mqt.ionshuttler.linear.dd.sadd

Public types for the shuttling-aware dynamical decoupling (SADD) pass.

Module Contents

class SADDMethod[source]

Bases: enum.StrEnum

Select a shuttling-aware dynamical decoupling (SADD) method.

PULSE_ONLY = 'pulse_only_sadd'
FULL = 'full_sadd'
property allow_transport: bool

Whether this method permits transport synthesis.

class OperationDurations[source]

Define durations of operations that SADD may synthesize.

shuttle: int = 1
swap: int = 3
one_qubit_gate: int = 1
__post_init__() → None[source]

Validate that every synthesized operation occupies positive time.

Raises:
class SADDConfig[source]

Configure the shared pulse-only and transport-enabled SADD backend.

SADD denotes shuttling-aware dynamical decoupling.

timeout_s bounds each control window’s solve. The unchanged schedule is always an admissible solution and is supplied to the solver as a hint, so a window that runs out of time yields a weaker improvement or none at all rather than an invalid or missing result. Raise it for long windows or many participating ions, where proving optimality takes longer.

When operation_durations is None, SADD infers uniform transport durations already present in the schedule and uses the standard operation defaults for transport kinds that are absent.

min_window_length: int = 2
max_window_length: int = 16
max_participating_ions: int = 5
timeout_s: float = 1.0
ion_preselection: Literal['phase', 'distance'] = 'phase'
opportunity_order: Literal['chronological', 'reverse_chronological'] = 'chronological'
max_accepted_windows: int | None = None
improvement_tolerance: float = 1e-12
allow_pulses: bool = True
scale: int = 1000
num_search_workers: int = 8
operation_durations: OperationDurations | None = None
__post_init__() → None[source]

Validate optimization and problem parameters.

Raises:
  • TypeError – If a parameter has the wrong type.

  • ValueError – If a parameter is outside its supported range.

class SADDOpportunityRecord[source]

Describe one ordered SADD optimization opportunity and its outcome.

transport_delta records the signed change in scheduled transport actions by concrete action type between the opportunity input and proposed result.

target_pz: str
window: tuple[int, int]
participating_ions: tuple[int, ...]
status: str
validation_status: str
phase_cost_before: float
phase_cost_after: float | None
accepted: bool
pulse_count: int
transport_delta: Mapping[str, int]
runtime_s: float
message: str | None = None
eligible_ions: tuple[int, ...] = ()
busy_ions: tuple[int, ...] = ()
rejected_no_active_segment_ions: tuple[int, ...] = ()
rejected_unreachable_ions: tuple[int, ...] = ()
selection_scores: tuple[tuple[int, float, int], ...] = ()
phase_before_by_ion: IonFloatMapping | None = None
phase_after_by_ion: IonFloatMapping | None = None
pulse_timesteps: IonTimestepsMapping | None = None
pulse_action_ids: IonTimestepsMapping | None = None
transport_actions: tuple[str, ...] = ()
trajectories: IonTimestepsMapping | None = None
model_num_variables: int = 0
model_num_constraints: int = 0
__post_init__() → None[source]

Validate and freeze nested opportunity diagnostics.

Raises:
  • TypeError – If a field has the wrong type.

  • ValueError – If a field contains an invalid value.

class SADDReport[source]

Collect ordered opportunity records produced by one SADD pass.

report_type: ClassVar[str] = 'sadd'
method: SADDMethod
opportunities: tuple[SADDOpportunityRecord, ...] = ()
__post_init__() → None[source]

Normalize opportunity records to an immutable tuple.

Raises:

TypeError – If the method or an opportunity has the wrong type.

property sequences: tuple[LocalDDSequence, ...]

Accepted ion-local pulse sequences in opportunity order.

to_dict() → dict[str, object][source]

Return this report using JSON-compatible values.

classmethod from_dict(data: object) → SADDReport[source]

Restore a SADD report from JSON-compatible values.

Returns:

The restored SADD report.

Raises:

ValueError – If the serialized report is malformed.

run_sadd(schedule: ActionSchedule, architecture: Architecture, method: SADDMethod, config: SADDConfig | None = None) → DDPassResult[SADDReport][source]

Apply shuttling-aware dynamical decoupling to a compiled schedule.

Pulse-only and transport-enabled SADD use the same optimization backend; method controls whether the solver may synthesize transport.

Returns:

The transformed schedule and an ordered SADD report.

Raises:
  • TypeError – If method is not a SADDMethod.

  • ValueError – If the schedule and architecture are incompatible or the architecture lacks actions required by the selected method.