Transpiler Passes (qiskit.transpiler.passes
)¶
Layout Selection (Placement)¶
|
Set the |
|
Choose a Layout by assigning |
|
Choose a Layout by finding the most connected subset of qubits. |
|
Choose a noise-adaptive Layout based on current calibration data for the backend. |
|
If possible, chooses a Layout as a CSP, using backtracking. |
|
Transform a circuit with virtual qubits into a circuit with physical qubits. |
|
Evaluate how good the layout selection was. |
|
Extend the dag with virtual qubits that are in layout but not in the circuit yet. |
|
Allocate all idle nodes from the coupling map as ancilla on the layout. |
Routing¶
|
Map (with minimum effort) a DAGCircuit onto a coupling_map adding swap gates. |
|
Map input circuit onto a backend topology via insertion of SWAPs. |
|
Map a DAGCircuit onto a coupling_map adding swap gates. |
Basis Change¶
|
Unroll a circuit to a given basis. |
|
Recursively expands 3q+ gates until the circuit only contains 2q or 1q gates. |
|
Expand a gate in a circuit using its decomposition rules. |
Optimizations¶
|
Optimize chains of single-qubit u1, u2, u3 gates by combining them into a single gate. |
|
Collect sequences of uninterrupted gates acting on 2 qubits. |
|
Replace each block of consecutive gates by a single Unitary node. |
|
Cancel back-to-back cx gates in dag. |
|
Analysis pass to find commutation relations between DAG nodes. |
|
Cancel the redundant (self-adjoint) gates through commutation relations. |
|
Remove diagonal gates (including diagonal 2Q gates) before a measurement. |
|
Remove reset gate when the qubit is in zero state. |
|
Crosstalk mitigation through adaptive instruction scheduling. |
Circuit Analysis¶
|
Calculate the width of a DAG circuit. |
|
Calculate the depth of a DAG circuit. |
|
Calculate the size of a DAG circuit. |
|
Count the operations in a DAG circuit. |
|
Count the operations on the longest path in a DAGcircuit. |
|
Calculate the number of tensor factors of a DAG circuit. |
|
Return the longest path in a DAGcircuit as a list of DAGNodes. |
Additional Passes¶
|
Check if a DAG circuit is already mapped to a coupling map. |
|
Check if the CNOTs follow the right direction with respect to the coupling map. |
|
Rearrange the direction of the cx nodes to match the directed coupling map. |
|
Return a circuit with any adjacent barriers merged together. |
|
Add a barrier before final measurements. |
|
Remove final measurements and barriers at the end of a circuit. |
|
Check if the DAG has reached a fixed point. |
|
Check if a property reached a fixed point. |