39 lines
3.5 KiB
Plaintext
39 lines
3.5 KiB
Plaintext
---
|
||
title: TranspileLayout
|
||
description: API reference for qiskit.transpiler.TranspileLayout
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.transpiler.TranspileLayout
|
||
---
|
||
|
||
# TranspileLayout
|
||
|
||
<Class id="qiskit.transpiler.TranspileLayout" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.25/qiskit/transpiler/layout.py" signature="qiskit.transpiler.TranspileLayout(initial_layout, input_qubit_mapping, final_layout=None)" modifiers="class">
|
||
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.12)")
|
||
|
||
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](transpiler#layout-stage) and [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate") insertion during the [Routing Stage](transpiler#routing-stage). To provide an interface to reason about these permutations caused by the [`transpiler`](transpiler#module-qiskit.transpiler "qiskit.transpiler").
|
||
|
||
There are three attributes associated with the class:
|
||
|
||
> * [`initial_layout`](#qiskit.transpiler.TranspileLayout.initial_layout "qiskit.transpiler.TranspileLayout.initial_layout") - This attribute is used to model the permutation caused by the [Layout Stage](transpiler#layout-stage) it contains a [`Layout`](qiskit.transpiler.Layout "qiskit.transpiler.Layout") object that maps the input [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")s [`Qubit`](qiskit.circuit.Qubit "qiskit.circuit.Qubit") objects to the position in the output `QuantumCircuit.qubits` list.
|
||
> * [`input_qubit_mapping`](#qiskit.transpiler.TranspileLayout.input_qubit_mapping "qiskit.transpiler.TranspileLayout.input_qubit_mapping") - This attribute is used to retain input ordering of the original [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object. It maps the virtual [`Qubit`](qiskit.circuit.Qubit "qiskit.circuit.Qubit") object from the original circuit (and [`initial_layout`](#qiskit.transpiler.TranspileLayout.initial_layout "qiskit.transpiler.TranspileLayout.initial_layout")) to its corresponding position in [`QuantumCircuit.qubits`](qiskit.circuit.QuantumCircuit#qubits "qiskit.circuit.QuantumCircuit.qubits") in the original circuit. This is needed when computing the permutation of the `Operator` of the circuit (and used by [`Operator.from_circuit()`](qiskit.quantum_info.Operator#from_circuit "qiskit.quantum_info.Operator.from_circuit")).
|
||
> * [`final_layout`](#qiskit.transpiler.TranspileLayout.final_layout "qiskit.transpiler.TranspileLayout.final_layout") - This is a [`Layout`](qiskit.transpiler.Layout "qiskit.transpiler.Layout") object used to model the output permutation caused ny any [`SwapGate`](qiskit.circuit.library.SwapGate "qiskit.circuit.library.SwapGate")s inserted into the :class:\~.QuantumCircuit\` during the [Routing Stage](transpiler#routing-stage). It maps the output circuit’s qubits from `QuantumCircuit.qubits` to the final position after routing.
|
||
|
||
## Attributes
|
||
|
||
### final\_layout
|
||
|
||
<Attribute id="qiskit.transpiler.TranspileLayout.final_layout" attributeTypeHint="Layout | None" attributeValue="None" />
|
||
|
||
### initial\_layout
|
||
|
||
<Attribute id="qiskit.transpiler.TranspileLayout.initial_layout" attributeTypeHint="Layout" />
|
||
|
||
### input\_qubit\_mapping
|
||
|
||
<Attribute id="qiskit.transpiler.TranspileLayout.input_qubit_mapping" attributeTypeHint="dict[Qubit, int]" />
|
||
</Class>
|
||
|