Skip to content

Commit

Permalink
Fix idle qubit detection to ignore barriers
Browse files Browse the repository at this point in the history
  • Loading branch information
raunakkumarsingh committed Jul 16, 2024
1 parent 14acf91 commit fee9569
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions circuit_knitting/utils/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ def _partition_labels_from_circuit(
# Determine which qubit wires are idle/unused
idle_wires = set(range(circuit.num_qubits))
for instruction in circuit.data:
if instruction.operation.name == 'barrier':
continue
for q1 in instruction.qubits:
q1_id = circuit.find_bit(q1).index
idle_wires.discard(q1_id)
Expand Down

0 comments on commit fee9569

Please sign in to comment.