mqt.ionshuttler.linear.dd.sadd_solver

Optional OR-Tools integration for shuttling-aware dynamical decoupling (SADD).

Module Contents

class SADDProblem[source]

Contain one bounded control-window CP-SAT problem.

schedule: Schedule
architecture: LinearArchitecture
target_pz: str
t_start: int
t_end: int
participating_ions: tuple[int, ...]
start_positions: dict[int, int]
fixed_positions: dict[tuple[int, int], int]
fixed_transport_timesteps: frozenset[tuple[int, int]]
fixed_transport_starts: frozenset[tuple[int, int]]
phase_segments: tuple[CriticalSegment, ...]
sensitivity_profile: tuple[float, ...]
objective_before: float
scale: int = 1000
shuttle_duration: int = 1
swap_duration: int = 1
pulse_duration: int = 1
num_search_workers: int = 8
local_pulse_action_ids: frozenset[int]
property duration: int

Number of discrete intervals in the opportunity.

class SADDSolution[source]

Contain a decoded CP-SAT solution and materialization diagnostics.

status: str
objective_before: float
objective_after: float | None
trajectories: dict[int, tuple[int, ...]]
pulse_timesteps: dict[int, tuple[int, ...]]
pulse_action_ids: dict[int, tuple[int, ...]]
transport_actions: tuple[tuple[int, Action], ...]
schedule: Schedule | None
validation_status: str
validation_error: str | None
runtime_s: float
solver_objective: int | None = None
model_num_variables: int = 0
model_num_constraints: int = 0
property materialized: bool

Whether the solution produced a replay-valid schedule.

build_sadd_problem(schedule: Schedule, architecture: LinearArchitecture, *, target_pz: str, t_start: int, t_end: int, participating_ions: tuple[int, ...], scale: int = 1000, num_search_workers: int = 8, local_pulse_action_ids: frozenset[int] = frozenset()) → SADDProblem[source]

Build one shuttling-aware dynamical decoupling optimization problem.

Synthesized shuttles, swaps, and local pulses take the durations defined by the architecture.

Returns:

The bounded optimization problem.

Raises:

ValueError – If schedule metadata, problem bounds, or the local pulse duration are invalid.

solve_sadd_problem(problem: SADDProblem, *, timeout_s: float = 10.0, allow_transport: bool = True, allow_pulses: bool = True) → SADDSolution[source]

Solve and materialize one SADD control-window problem.

Returns:

The decoded solver outcome and validation diagnostics.