When using with_layout=True
as argument in qc.draw()
where qc is a QuantumCircuit
object the resulting text includes the mapping from the qubits in the circuit to the physical qubits like this:
ancilla_0 -> 0 ----
q_3 -> 1 ----
q_2 -> 2 ---- ...
q_0 -> 3 ----
meas: 3/====
Which one (q_3 or 1 eg.) is the qubit in the circuit and which one the physical qubit?
Note:
I assume the answer can be found at wire_names()
of TextDrawing
(qiskit/visualization/text.py lines 782 to 789 in version 0.36.2), but I'm not sure if I understand it correctly.
for reg in self.qubits:
register = self.bit_locations[reg]["register"]
index = self.bit_locations[reg]["index"]
qubit_label = get_bit_label("text", register, index, qubit=True, layout=self.layout)
qubit_label += ": " if self.layout is None else " "
qubit_labels.append(qubit_label + initial_qubit_value)```