as mentioned in the title, i have a problem with the qiskit decompose function.
AND=Operator([
[1,0,0,0,0,0,0,0],
[0,1,0,0,0,0,0,0],
[0,0,1,0,0,0,0,0],
[0,0,0,1,0,0,0,0],
[0,0,0,0,1,0,0,0],
[0,0,0,0,0,1,0,0],
[0,0,0,0,0,0,0,1],
[0,0,0,0,0,0,1,0],
])
In my code i defined an AND gate like this.
An AND Operator is actually just a CCX Gate, but i defined the matrix and then applied the unitary function with the Operator and the qubit list as parameters.
circ.unitary(AND,[0,1,2],label="AND")
After transpiling on the qasm_simulator, i get the result added in the picture below
In this example i tried to calculate q_2 AND q_1. After Measuring the result is measured at q_0. It works just fine. My question is what are these circuit mean in the picture, i found nothing about circuit-140 for example.
What i think should be expected is the decomposed toffoli gate or ccx gate.
decompose()
can be called multiple times if you want to get deeper into the circuit. You can also callgate.decompose(reps=5)
for example, to call decompose five times. Two or three times is usually sufficient. $\endgroup$