mqt.ionshuttler.linear.dd.schemes¶
Reusable pulse sequences for dynamical decoupling.
Module Contents¶
- ARBITRARY_X_SCHEME_FAMILY = 'arbitrary_x'¶
- class GateSpec[source]¶
Describe the rotation of one decoupling pulse.
gate_namenames the rotation class, such as"Rx". A pulse applied to one ion becomes that gate; a global pulse becomes aGlobalGatewith the same rotation.
- class DDScheme[source]¶
Define pulse axes and their relative positions in an idle window.
- __post_init__() None[source]¶
Validate that every pulse has exactly one relative time.
- Raises:
ValueError – If pulse times and specifications are empty or inconsistent.
- gate_timesteps(window: tuple[int, int]) tuple[int, ...][source]¶
Map relative pulse times to the nearest schedule boundaries.
Offsets are rounded to nearest with ties-to-even before adding the window start. A pulse at boundary
tacts before phase accumulates over[t, t + 1).- Returns:
The schedule boundary for every pulse.
- resolved_gate_timesteps(window: tuple[int, int]) tuple[int, ...] | None[source]¶
Return distinct integral pulse boundaries, or
Noneif infeasible.With
allow_roundingunset, a pulse time must already coincide with a schedule boundary within tolerance. Withallow_roundingset, a pulse time is rounded to the nearest boundary and rejected only if that falls outside the window.
- clamped_pulses(window: tuple[int, int]) tuple[tuple[int, GateSpec], ...][source]¶
Return rounded, window-clamped, deduplicated pulse boundaries with their gate specs.
Unlike
resolved_gate_timesteps(), a pulse time outside the window is clamped to the nearer boundary instead of making the sequence infeasible.- Returns:
The ordered, deduplicated
(timestep, gate_spec)pairs to insert.
- make_cpmg_scheme(num_pulses: int) DDScheme[source]¶
Construct an evenly spaced Carr-Purcell-Meiboom-Gill sequence.
- Returns:
The requested CPMG sequence.
- Raises:
ValueError – If
num_pulsesis not an even integer of at least two.
- make_arbitrary_x_scheme(num_pulses: int) DDScheme[source]¶
Construct an evenly spaced sequence of X pulses.
- Returns:
The requested X-pulse sequence.
- Raises:
ValueError – If
num_pulsesis less than one.
- make_xy4_scheme(k: int = 1) DDScheme[source]¶
Construct an XY4 sequence repeated
ktimes.- Returns:
The requested XY4 sequence.
- make_xy8_scheme(k: int = 1) DDScheme[source]¶
Construct an XY8 sequence repeated
ktimes.- Returns:
The requested XY8 sequence.
- make_xy16_scheme(k: int = 1) DDScheme[source]¶
Construct an XY16 sequence repeated
ktimes.- Returns:
The requested XY16 sequence.
- make_cdd_scheme(level: int) DDScheme[source]¶
Construct a recursively concatenated sequence up to level three.
- Returns:
The requested concatenated sequence.
- Raises:
ValueError – If
levellies outside the supported range.
- HAHN_ECHO¶
- MIDPOINT_ONLY_HAHN¶
- CPMG_2¶
- CPMG_4¶
- CPMG_6¶
- CPMG_8¶
- XY4¶
- XY8¶
- XY16¶
- CDD_1¶
- CDD_2¶
- CDD_3¶
- dd_scheme(name: str) DDScheme[source]¶
Resolve a registered scheme by name.
- Returns:
The registered scheme.
- Raises:
ValueError – If
nameis not registered.