Skip to content

Commit 2400b16

Browse files
committed
🚨 implement ruff suggestion
Signed-off-by: burgholzer <burgholzer@me.com>
1 parent 91ebcc6 commit 2400b16

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/mqt/core/plugins/qiskit.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -370,12 +370,10 @@ def _import_layouts(qc: QuantumComputation, circ: QuantumCircuit) -> None:
370370
# `get_registers()` method does not guarantee this as it returns a set that
371371
# reorders the qubits.
372372
qubit_to_idx: dict[Qubit, int] = {}
373-
idx = 0
374-
for qubit in initial_layout.get_virtual_bits():
373+
for idx, qubit in enumerate(initial_layout.get_virtual_bits()):
375374
qubit_to_idx[qubit] = idx
376375
if isinstance(qubit, AncillaQubit):
377376
qc.set_circuit_qubit_ancillary(idx)
378-
idx += 1
379377

380378
for register in initial_layout.get_registers():
381379
is_ancilla = register.name == "ancilla" or isinstance(register, AncillaRegister)

0 commit comments

Comments
 (0)