AIRouting
class qiskit_ibm_transpiler.ai.AIRouting(backend_name: str | None = None, coupling_map: list[list[int]] | None = None, optimization_level: int = 2, layout_mode: str = 'OPTIMIZE')
Bases: TransformationPass
The AIRouting pass acts both as a layout stage and a routing stage.
Parameters
- backend_name (str, optional) – Name of the backend used for doing the transpilation.
- coupling_map (list[list[int]], optional) – A list of pairs that represents physical links between qubits.
- optimization_level (int) – With a range from 1 to 3, determines the computational effort to spend in the process (higher usually gives better results but takes longer), defaults to 2.
- layout_mode (str) – Specifies how to handle the layout selection. There are 3 layout modes: keep (respects the layout set by the previous transpiler passes), improve (uses the layout set by the previous transpiler passes as a starting point) and optimize (ignores previous layout selections), defaults to OPTIMIZE.
Methods
execute
execute(passmanager_ir, state, callback=None)
Execute optimization task for input Qiskit IR.
Parameters
- passmanager_ir (Any) – Qiskit IR to optimize.
- state (PassManagerState) – State associated with workflow execution by the pass manager itself.
- callback (Callable) – A callback function which is caller per execution of optimization task.
Returns
Optimized Qiskit IR and state of the workflow.
Return type
name
run
run(dag)
Run the AIRouting pass on dag.
Parameters
dag (DAGCircuit) – the directed acyclic graph to be mapped.
Returns
A dag mapped to be compatible with the coupling_map.
Return type
DAGCircuit
Raises
- TranspilerError – if the coupling map or the layout are not
- compatible with the DAG**, or **if the coupling_map=None –
update_status
update_status(state, run_state)
Update workflow status.
Parameters
- state (PassManagerState) – Pass manager state to update.
- run_state (RunState) – Completion status of current task.
Returns
Updated pass manager state.
Return type
Was this page helpful?
Report a bug or request content on GitHub.