mqt.ionshuttler.linear.schedule

Linear machine state, explicit schedules, and schedule persistence.

Module Contents

class LinearMachineState[source]

Describes a Linear hardware state independent of compiler progress.

positions: tuple[tuple[int, int], ...]
ions_busy_until: tuple[tuple[int, int], ...]
pzs_busy_until: tuple[tuple[str, int], ...]
time: int = 0
__post_init__() → None[source]

Normalize and validate machine-state values.

Raises:
  • TypeError – If the machine clock has the wrong type.

  • ValueError – If mappings, occupancy, or timestamps are inconsistent.

classmethod from_compiler_state(state: State) → LinearMachineState[source]

Copy hardware fields from a Linear compiler state.

Returns:

The canonical machine state.

to_replay_state() → State[source]

Return a Linear state with empty circuit progress.

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

Return this machine state using JSON-compatible values.

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

Restore a Linear machine state.

Returns:

The restored state.

schedule_from_path(path: Sequence[SearchTransition], initial_state: State | LinearMachineState, architecture: LinearArchitecture) → Schedule[Action, LinearMachineState][source]

Convert a Linear search path to the shared explicit timeline.

Each AdvanceTime transition moves the clock forward and does not appear in the schedule. The architecture supplies every action’s duration and processing zone.

Returns:

A schedule with explicit action start times.

schedule_from_dict(data: object) → Schedule[Action, LinearMachineState][source]

Restore a Linear schedule from its versioned JSON representation.

Returns:

The restored schedule.

schedule_from_json(raw: str) → Schedule[Action, LinearMachineState][source]

Restore a Linear schedule from JSON text.

Returns:

The restored schedule.

load_schedule(filename: str | Path) → Schedule[Action, LinearMachineState][source]

Load a Linear schedule from a UTF-8 JSON file.

Returns:

The restored schedule.