3
$\begingroup$

I have the following circuit, which is the implementation of a quantum oracle for a fuzzy inference engine: Oracle

As you can see this is composed of blocks, between barriers, which can be considered independent. Since the depth of the transpiled circuit is prohibitive (more than 1000), I am trying to reduce it at the expense of the width by executing the blocks in parallel, I mean leveraging the available 127 qubits available on IBM real backend. Do you know if there's a way in Qiskit to automatically do it?

EDIT: I managed to decompose my circuit in subcircuits and assemble them in parallel as in the following image. For doing that I defined a new quantum circuit and used the function quantum_circuit.append(subcircuit) specifying the correct qubits to use for each subcircuit. Sadly I found out that the result from this new circuit is even worse than the one from the original one. Is it because of the width?

parallel circuit

$\endgroup$

1 Answer 1

5
$\begingroup$

A simple and effective way to reduce the depth of this circuit is to use ancilla qubits.

First add ancilla register and add it to your circuit:

anc = QuantumRegister(2, 'anc')
circ = QuantumCircuit(theta, omega, anc, current, cr)

then, change the mode of every multi-controlled NOT gate to be 'v-chain' and pass the ancilla qubits. For example,

circ.mcx(theta[:] + omega[:], current[2], ancilla_qubits=anc, mode='v-chain')

When I transpiled the original circuit against FakeTorino I got

Depth: 1690, 2Q Depth: 558

and when I transpiled the circuit with ancillas I got

Depth: 882, 2Q Depth: 223

Note that: if the input state to omega register is actually the vector state $\left[{\begin{array}{*{20}{c}}1 & 0 & 0 & 0\end{array}}\right]$, you can replace the multi-controlled NOTs with Toffoli gates which will reduce the circuit depth dramatically.

$\endgroup$
1
  • $\begingroup$ Thank you @Egretta.Thula, actually I am already applying v-chain approach (although I put the image of the original circuit) but the circuit is yet too deep, that is why I want to split it in blocks. $\endgroup$
    – Davvvd
    Commented Oct 28 at 8:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.