mqt.ionshuttler.partitioning¶
Shared circuit partitioning algorithms and data models.
Submodules¶
Package Contents¶
- class GatePartitionResult[source]¶
Partitioning and optimization metadata produced by the tabu search.
- gate_partition_by_pz¶
Gate ids grouped by processing zone in execution order.
- gate_assignment¶
Direct gate-id to processing-zone mapping used by the runtime code.
- time_slices¶
Relaxed gate slices used by the optimizer.
- qubit_assignments_by_slice¶
Per-slice qubit-to-cluster assignments.
- cost_before¶
Objective value before tabu refinement.
- cost_after¶
Best objective value reached by tabu refinement.
- move_distance_total¶
Aggregate move distance between adjacent slices.
- optimization_time¶
Wall-clock time spent in the tabu loop in seconds.
- compute_fine_grained_gate_partition(sequence: Sequence[int], gate_info: dict[int, GateInfo], pz_names: Sequence[str], pz_distance_matrix: Sequence[Sequence[float]] | None, *, processing_zone_capacities: Mapping[str, int] | None = None, config: FineGrainedTabuConfig | None = None) GatePartitionResult[source]¶
Compute a fine-grained gate-to-processing-zone assignment.
The algorithm first groups gates into relaxed time slices, contracts qubits that must move together inside each slice (to allow for 2q-gates), and then refines all slice assignments jointly with a tabu search. The result is expressed in terms of gate ids and processing-zone names so later runtime code can consume it without depending on this module’s internal optimization state.
- Parameters:
sequence – Ordered gate ids to partition.
gate_info – Gate metadata keyed by gate id.
pz_names – Processing-zone names in cluster index order.
pz_distance_matrix – Square distance matrix indexed by processing-zone order.
processing_zone_capacities – Optional soft qubit capacity of each processing zone. The mapping must contain exactly the names in
pz_names. When omitted, every zone usesceil(num_qubits / num_pzs).config – Optional configuration settings (see defaults in FineGrainedTabuConfig class).
- Returns:
A gate partition result object including GatePartitionResult.gate_assignment, which is the main output mapping gate ids to PZs.
- Raises:
TypeError – If the capacity mapping or one of its values has the wrong type.
ValueError – If the inputs are inconsistent or incomplete.