Transpiler Passes (qiskit.transpiler.passes)

Layout Selection (Placement)

SetLayout(*args, **kwargs)

Set the layout property to the given layout.

TrivialLayout(*args, **kwargs)

Choose a Layout by assigning n circuit qubits to device qubits 0, .., n-1.

DenseLayout(*args, **kwargs)

Choose a Layout by finding the most connected subset of qubits.

NoiseAdaptiveLayout(*args, **kwargs)

Choose a noise-adaptive Layout based on current calibration data for the backend.

CSPLayout(*args, **kwargs)

If possible, chooses a Layout as a CSP, using backtracking.

ApplyLayout(*args, **kwargs)

Transform a circuit with virtual qubits into a circuit with physical qubits.

Layout2qDistance(*args, **kwargs)

Evaluate how good the layout selection was.

EnlargeWithAncilla(*args, **kwargs)

Extend the dag with virtual qubits that are in layout but not in the circuit yet.

FullAncillaAllocation(*args, **kwargs)

Allocate all idle nodes from the coupling map as ancilla on the layout.

Routing

BasicSwap(*args, **kwargs)

Map (with minimum effort) a DAGCircuit onto a coupling_map adding swap gates.

LookaheadSwap(*args, **kwargs)

Map input circuit onto a backend topology via insertion of SWAPs.

StochasticSwap(*args, **kwargs)

Map a DAGCircuit onto a coupling_map adding swap gates.

Basis Change

Unroller(*args, **kwargs)

Unroll a circuit to a given basis.

Unroll3qOrMore(*args, **kwargs)

Recursively expands 3q+ gates until the circuit only contains 2q or 1q gates.

Decompose([gate])

Expand a gate in a circuit using its decomposition rules.

Optimizations

Optimize1qGates(*args, **kwargs)

Optimize chains of single-qubit u1, u2, u3 gates by combining them into a single gate.

Collect2qBlocks(*args, **kwargs)

Collect sequences of uninterrupted gates acting on 2 qubits.

ConsolidateBlocks(*args, **kwargs)

Replace each block of consecutive gates by a single Unitary node.

CXCancellation(*args, **kwargs)

Cancel back-to-back cx gates in dag.

CommutationAnalysis(*args, **kwargs)

Analysis pass to find commutation relations between DAG nodes.

CommutativeCancellation(*args, **kwargs)

Cancel the redundant (self-adjoint) gates through commutation relations.

RemoveDiagonalGatesBeforeMeasure(*args, **kwargs)

Remove diagonal gates (including diagonal 2Q gates) before a measurement.

RemoveResetInZeroState(*args, **kwargs)

Remove reset gate when the qubit is in zero state.

CrosstalkAdaptiveSchedule(*args, **kwargs)

Crosstalk mitigation through adaptive instruction scheduling.

Circuit Analysis

Width(*args, **kwargs)

Calculate the width of a DAG circuit.

Depth(*args, **kwargs)

Calculate the depth of a DAG circuit.

Size(*args, **kwargs)

Calculate the size of a DAG circuit.

CountOps(*args, **kwargs)

Count the operations in a DAG circuit.

CountOpsLongestPath(*args, **kwargs)

Count the operations on the longest path in a DAGcircuit.

NumTensorFactors(*args, **kwargs)

Calculate the number of tensor factors of a DAG circuit.

DAGLongestPath(*args, **kwargs)

Return the longest path in a DAGcircuit as a list of DAGNodes.

Additional Passes

CheckMap(*args, **kwargs)

Check if a DAG circuit is already mapped to a coupling map.

CheckCXDirection(*args, **kwargs)

Check if the CNOTs follow the right direction with respect to the coupling map.

CXDirection(*args, **kwargs)

Rearrange the direction of the cx nodes to match the directed coupling map.

MergeAdjacentBarriers(*args, **kwargs)

Return a circuit with any adjacent barriers merged together.

BarrierBeforeFinalMeasurements(*args, **kwargs)

Add a barrier before final measurements.

RemoveFinalMeasurements(*args, **kwargs)

Remove final measurements and barriers at the end of a circuit.

DAGFixedPoint(*args, **kwargs)

Check if the DAG has reached a fixed point.

FixedPoint(*args, **kwargs)

Check if a property reached a fixed point.