Skip to main contentIBM Quantum Documentation

AI transpiler passes

​ The AI-powered transpiler passes are experimental passes that work as a drop-in replacement of "traditional" Qiskit® passes for some transpiling tasks. They often produce better results than existing heuristic algorithms (such as lower depth and CNOT count), but are also much faster than optimization algorithms such as Boolean satisfiability solvers. The AI transpiler passes run on the cloud and are available to IBM Quantum™ Premium Plan users.


This is an experimental feature available only to the IBM Quantum Premium Plan. The AI-powered transpiler passes are in alpha release status, subject to change.

The following passes are currently available:

Routing passes

  • AIRouting: Layout selection and circuit routing

The following passes will be available in Q1 2024.

Circuit synthesis passes

  • AICliffordSynthesis: Clifford circuit synthesis
  • AILinearFunctionSynthesis: Linear function circuit synthesis
  • AIPermutationSynthesis: Permutation circuit synthesis

To use the AI transpiler passes through our cloud services, install the qiskit-transpiler-service package (see instructions here).

AI routing pass

The AIRouting pass acts both as a layout stage and a routing stage. It can be used within a PassManager as follows:

from qiskit.transpiler import PassManager
from import AIRouting
from qiskit.circuit.library import EfficientSU2
ai_passmanager = PassManager([
  AIRouting(target="ibm_sherbrooke", optimization_level=2, layout_mode="optimize")
circuit = EfficientSU2(120, entanglement="circular", reps=1).decompose()
transpiled_circuit =

Here, the target determines which system to route for, the optimization_level (1, 2, or 3) determines the computational effort to spend in the process (higher usually gives better results but takes longer), and the layout_mode specifies how to handle the layout selection. The layout_mode includes the following options:

  • keep: This respects the layout set by the previous transpiler passes (or uses the trivial layout if not set). It is typically only used when the circuit must be run on specific qubits of the device. It often produces worse results because it has less room for optimization.
  • improve: This uses the layout set by the previous transpiler passes as a starting point. It is useful when you have a good initial guess for the layout; for example, for circuits that are built in a way that approximately follows the device's coupling map. It is also useful if you want to try other specific layout passes combined with the AIRouting pass.
  • optimize: This is the default mode. It works best for general circuits where you might not have good layout guesses. This mode ignores previous layout selections.
Was this page helpful?