mqt.ionshuttler.multi_shuttler.gate_partitioning_tabu

Module Contents

class FineGrainedTabuConfig[source]

Configuration for the fine-grained tabu gate partitioner.

balance_penalty: float = 1.0
capacity_weight: float = 0.5
distance_weight_factor: float = 1.0
max_iterations: int | None = None
max_iterations_factor: float | None = 20.0
tabu_list_length: int = 200
candidate_list_length: int | None = 200
per_slice_quota: int | None = None
slack_dropoff: float | None = 1.0
refresh_every: int | None = None
randomize_initial: bool = False
seed: int | None = 0
max_layer_depth: int | None = None
__post_init__() None[source]

Validate configuration values at construction time.

resolve_max_iterations(num_qubits: int) int[source]

Resolve max_iterations_factor, which scales the iteration budget with the number of qubits.

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.

gate_partition_by_pz: dict[str, list[int]]
gate_assignment: dict[int, str]
time_slices: list[list[int]]
qubit_assignments_by_slice: list[list[int]]
cost_before: float
cost_after: float
move_distance_total: float
optimization_time: float
compute_fine_grained_gate_partition(sequence: Sequence[int], gate_info: dict[int, GateInfo], pz_names: Sequence[str], pz_distance_matrix: Sequence[Sequence[float]] | None, *, capacity: 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.

  • capacity – Optional soft per-zone qubit capacity, which informs the congestion penalty in the partitioning cost function. When omitted, defaults to ceil(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:

ValueError – If the inputs are inconsistent or incomplete.