iqm.qrisp_iqm.passes.routing.core.sabre_meta_functions.sectionized_sabre

iqm.qrisp_iqm.passes.routing.core.sabre_meta_functions.sectionized_sabre#

iqm.qrisp_iqm.passes.routing.core.sabre_meta_functions.sectionized_sabre(topology: QPUTopology, instruction_dag: CircuitDAG, greediness: int, threads: int, section_lengths: ndarray, tempering_range: int = 3, congestion_penalty: float = 0.0, selection_exponent: float = 0.0, seed: int = 0) → tuple[list[tuple[int16, int16, int16]], ndarray]#

Execute the SABRE algorithm with “sectionizing” strategy.

Sectionizing means dividing the QuantumCircuit into several sections, which are sequentially compiled. Each section is compiled multiple times with different seeds. The best seed is picked and the algorithm proceeds to the next section.

Section boundaries are placed at semantically meaningful positions (e.g. after TerminatorNodes in the PermeabilityGraph) rather than at uniform intervals. The section_lengths array specifies how many DAG nodes belong to each section.

The depth_array is carried forward between sections so that per-physical-qubit depth tracking remains continuous, enabling the congestion penalty to account for congestion accumulated in earlier sections.

Parameters:
  • topology (QPUTopology) – QPU topology.

  • instruction_dag (CircuitDAG) – Instruction DAG.

  • greediness (int) – Controls swap selection randomness.

  • threads (int) – The amount of instances that should be executed in parallel.

  • section_lengths (ndarray) – 1-D int32 array where each entry is the number of DAG nodes in that section. The last entry is treated as “compile everything remaining” (i.e. max_instruction=inf). The sum should equal the total DAG size but the last section will consume whatever is left regardless.

  • tempering_range (int) – Controls parallel tempering.

  • congestion_penalty (float) – Strength of the per-physical-qubit congestion penalty.

  • selection_exponent (float) – Blending weight for the geometric-mean selection metric (0.0–1.0). Forwarded to sabre_gen_swaps_parallel.

  • seed (int) – Base seed for reproducibility. Each section derives its own seed offset so that different sections use non-overlapping seed ranges.

Returns:

  • Instructions in the compiled QuantumCircuit.

  • Final logical to physical qubit index permutation.

Return type:

tuple[list[tuple[int16, int16, int16]], ndarray]