create_iqm_pass_manager#
Module: iqm.qrisp_iqm.passes
- iqm.qrisp_iqm.passes.create_iqm_pass_manager(connectivity: list[tuple[int, int]], effort: int = 100, depth_weight: float = 0.0, ignore_nodes: list[int] | None = None, ignore_edges: list[tuple[int, int]] | None = None) PassManager#
Create a
PassManagerpre-configured for IQM transpilation.This pass applies the full transpilation pipeline including: - Layout and routing (SABRE-based) - SWAP optimization - Gate conversions (to CZ + PRX) - Gate cancellation and optimization
- Parameters:
connectivity (list[tuple[int, int]]) – The connectivity describing the device topology.
effort (int, optional) – Effort level for layout and routing. Default is 100.
depth_weight (float, optional) –
Tradeoff between gate count and circuit depth (-1.0 to 1.0).
-1: Circuit optimized purely for swap count.0(default): Balanced.+1: Circuit optimized purely for circuit depth.
ignore_nodes (list[int], optional) – Qubit indices to ignore (e.g., faulty qubits). Ignored nodes are removed from the effective connectivity via
shift_graph_edges()so that layout and routing never place logical qubits on them.ignore_edges (list[tuple[int, int]], optional) – Edges to ignore in the connectivity. Like ignore_nodes, these are stripped from the effective topology before the passes are configured.
- Returns:
A configured PassManager with all IQM transpilation passes. Call
pm.run(qc)to apply all passes to a circuit.- Return type:
PassManager
Examples
>>> from qrisp import QuantumCircuit >>> from iqm.qrisp_iqm import create_iqm_pass_manager >>> qc = QuantumCircuit(2); qc.h(0); qc.cx(0, 1); qc.measure(qc.qubits) >>> connectivity = [(0, 1), (1, 2), (2, 3)] >>> pm = create_iqm_pass_manager(connectivity) >>> transpiled_qc = pm.run(qc)
Excluding a faulty qubit:
>>> pm = create_iqm_pass_manager( ... connectivity, ignore_nodes=[2] ... ) >>> transpiled_qc = pm.run(circuit)