1

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>
qcabepsilon
  • 195
  • 9
  • 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 – co9olguy Jun 09 '23 at 16:33
  • It was indeed a bug, which I did not recognize as one at first because no errors hinted at it. – qcabepsilon Jun 12 '23 at 09:27

1 Answers1

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.

qcabepsilon
  • 195
  • 9