TranspileLayout
class qiskit.transpiler.TranspileLayout(initial_layout, input_qubit_mapping, final_layout=None)
Bases: object
Layout attributes from output circuit from transpiler.
The transpiler in general is unitary-perserving up to permutations caused by setting and applying initial layout during the Layout Stage and SwapGate
insertion during the Routing Stage. To provide an interface to reason about these permutations caused by the transpiler
.
There are three attributes associated with the class:
initial_layout
- This attribute is used to model the permutation caused by the Layout Stage it contains aLayout
object that maps the inputQuantumCircuit
sQubit
objects to the position in the outputQuantumCircuit.qubits
list.input_qubit_mapping
- This attribute is used to retain input ordering of the originalQuantumCircuit
object. It maps the virtualQubit
object from the original circuit (andinitial_layout
) to its corresponding position inQuantumCircuit.qubits
in the original circuit. This is needed when computing the permutation of theOperator
of the circuit (and used byOperator.from_circuit()
).final_layout
- This is aLayout
object used to model the output permutation caused ny anySwapGate
s inserted into the :class:~.QuantumCircuit` during the Routing Stage. It maps the output circuit’s qubits fromQuantumCircuit.qubits
to the final position after routing.
Attributes
final_layout
Type: Layout | None
Default value: None
initial_layout
Type: Layout
input_qubit_mapping
Type: dict[Qubit, int]
Was this page helpful?
Report a bug or request content on GitHub.