mqt.ionshuttler.linear.dd.frame_replay

Replay Pauli frames induced by local and global decoupling pulses.

Module Contents

class PauliFrameOperation[source]

Represent one Pauli operation applied to a tracked frame.

label: str
__post_init__() → None[source]

Validate and normalize the Pauli label.

class PauliFrame[source]

Represent a Pauli frame while ignoring physically irrelevant phase.

label: str = 'I'
__post_init__() → None[source]

Validate and normalize the Pauli label.

compose(other: PauliFrame | PauliFrameOperation) → PauliFrame[source]

Return the frame after applying another Pauli operation.

anticommutes_with(axis: str) → bool[source]

Return whether this frame anticommutes with a Pauli axis.

phase_sign(axis: str = 'Z') → int[source]

Return the sign induced on evolution around a Pauli axis.

class FrameHistory[source]

Store global and ion-local Pauli frames at every schedule boundary.

global_frames_by_time: tuple[PauliFrame, ...]
local_frame_overrides: Mapping[int, tuple[PauliFrame, ...]]
__post_init__() → None[source]

Copy nested frame sequences into an immutable mapping.

Raises:

ValueError – If a local override does not cover every schedule boundary.

frame_for_ion(ion: int, timestep: int) → PauliFrame[source]

Return the combined global and local frame for an ion.

Raises:

ValueError – If timestep lies outside the tracked schedule.

phase_sign_for_ion(ion: int, timestep: int, axis: str = 'Z') → int[source]

Return the frame-induced evolution sign for an ion and axis.

class FramedActionEvent[source]

Describe one scheduled action together with its effective ion frames.

timestep: int
action: Action
kind: FrameActionKind
ion_frames: tuple[tuple[int, PauliFrame], ...]
build_frame_history(timeline: CompiledTimeline, local_pulse_action_ids: frozenset[int] = frozenset()) → FrameHistory[source]

Replay Pauli frames through every schedule boundary.

Entry t is the frame after decoupling pulses at boundary t. For t < makespan, it applies to phase accumulation on [t, t + 1). The final entry represents the frame after terminal pulses.

Returns:

The global and ion-local frame at every schedule boundary.

framed_action_events(schedule: ActionSchedule, architecture: Architecture, timeline: CompiledTimeline | None = None, local_pulse_action_ids: frozenset[int] = frozenset()) → tuple[FramedActionEvent, ...][source]

Return ordered schedule actions annotated with their effective frames.

global_pulse_timesteps(timeline: CompiledTimeline) → tuple[int, ...][source]

Return boundaries containing at least one global pulse.

frame_operation_for_action(action: Action) → PauliFrameOperation | None[source]

Return the frame operation induced by a global pulse, if applicable.

frame_operation_for_gate_spec(spec: GateSpec) → PauliFrameOperation[source]

Translate an odd-pi single-axis rotation into a Pauli operation.

Returns:

The corresponding Pauli-frame operation.

Raises:

ValueError – If the gate is not a supported odd-pi rotation.

effective_gate_spec(spec: GateSpec, frame: PauliFrame) → GateSpec[source]

Return a gate specification transformed through a Pauli frame.

effective_action(action: Action, frame: PauliFrame) → Action[source]

Return a single-ion rotation transformed through a Pauli frame.

accumulated_frame_phase(timeline: CompiledTimeline, ion: int, t_start: int, t_end: int, field_profile: FieldProfile | None, frame_history: FrameHistory | None = None, local_pulse_action_ids: frozenset[int] = frozenset()) → float[source]

Return signed field exposure after applying tracked Pauli frames.

Raises:

ValueError – If the requested interval lies outside the schedule.