mqt.ionshuttler.linear.dd.critical_segments

Replay logic-aware normalized phase over ion-local critical segments.

Module Contents

SegmentationMode
class CriticalSegment[source]

Describe one interval over which longitudinal phase remains comparable.

ion: int
index: int
start: int
end: int
positions: tuple[int, ...]
toggling_signs: tuple[int, ...]
sensitivities: tuple[float, ...]
phase: float
boundary_gate: str | None = None
property squared_phase: float

This segment’s normalized squared-phase objective.

class CriticalSegmentResult[source]

Contain logic-aware normalized-phase replay over critical segments.

phase_cost is a schedule-ranking surrogate: the sum of squared normalized segment phases. It is not a joint-coherence decay exponent or a complete circuit-error model.

segments: tuple[CriticalSegment, ...]
phase_per_ion: Mapping[int, float]
squared_phase_per_ion: Mapping[int, float]
phase_cost: float = 0.0
sensitivity_profile: tuple[float, ...] = ()
dt: float = 1.0
__post_init__() → None[source]

Freeze nested per-ion results.

normalized_sensitivity_values(architecture: Architecture, profile: FieldProfile | None = None) → tuple[float, ...][source]

Return a nonnegative dimensionless sensitivity envelope with unit RMS.

Raises:

ValueError – If the profile does not match the architecture or cannot be normalized.

gate_z_effect(action: Action, ion: int) → int | None[source]

Return a preserving gate’s Z sign, or None for a mixing gate.

Raises:

TypeError – If action is not a supported algorithmic gate.

compute_critical_segments(schedule: ActionSchedule, architecture: Architecture, *, sensitivity_profile: FieldProfile | None = None, dt: float = 1.0, segmentation: SegmentationMode = 'critical', local_pulse_action_ids: frozenset[int] = frozenset()) → CriticalSegmentResult[source]

Replay ion-local segments and their normalized squared-phase proxy.

Returns:

The reconstructed critical segments and their phase objective.

Raises:

ValueError – If the analysis parameters or architecture metadata are invalid.