When I draw my circuits some qubits are drawn multiple times (see 'circuit 1'). Does this mean that 1) the circuit itself is the same as 'circuit 2' below or 2) do I have some bug in my code that causes this and my circuit is not equivalent to 'circuit 2'?

Circuit 1:

0: ──X───RZ(0.00)──SX──RZ(3.14)──SX──RZ(9.42)───────────╭X────┤ ╭<Z@Z@Z@Z>
1: ──SX──RZ(3.14)──SX──RZ(9.42)─╭X──────────────────────│─────┤ ├<Z@Z@Z@Z>
2: ──SX──RZ(3.14)──SX──RZ(9.42)─│───────────────────────│─────┤ ├<Z@Z@Z@Z>
3: ──X───RZ(0.00)──SX──RZ(3.14)─│────SX────────RZ(9.42)─│──╭X─┤ ╰<Z@Z@Z@Z>
2: ─────────────────────────────╰●──────────────────────│──╰●─┤           
1: ─────────────────────────────────────────────────────╰●────┤ 

Circuit 2:

0: ──X───RZ(0.00)──SX──RZ(3.14)──SX──RZ(9.42)───────────╭X───-─┤ ╭<Z@Z@Z@Z>
1: ──SX──RZ(3.14)──SX──RZ(9.42)─╭X──────────────────────╰●─────┤ ├<Z@Z@Z@Z>
2: ──SX──RZ(3.14)──SX──RZ(9.42)─╰●───────────────────────╭●────┤ ├<Z@Z@Z@Z>
3: ──X───RZ(0.00)──SX──RZ(3.14)─────SX────────RZ(9.42)───╰X─---┤ ╰<Z@Z@Z@Z>
  • $\begingroup$ Hi @qcabepsilon, are you able to share (a minimal non-working example of) your code? It looks like a bug, but would need to see code to verify what's happened $\endgroup$
    – co9olguy
    Commented Jun 9, 2023 at 16:33
  • $\begingroup$ It was indeed a bug, which I did not recognize as one at first because no errors hinted at it. $\endgroup$ Commented Jun 12, 2023 at 9:27

1 Answer 1


The two circuits are not equivalent and the reason for this behavior is a bug in my code, as co9olguy suggested. I found that 1and 2 of the name of the second set of qubits were strings in contrast to the first set, that was named by integers.


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.