memq_dqc.scheduler¶
scheduler
¶
Public scheduler interface for distributed circuit execution planning.
DESLinkCriticalPathScheduler
¶
DESLinkCriticalPathScheduler(
distributed_circuit: DistributedCircuit,
*,
profile: SchedulerHardwareProfile | None = None,
modality: SchedulerModality = DEFAULT_SCHEDULER_MODALITY,
entanglement_profile: SchedulerEntanglementProfile = DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE,
multiplex_entangle: bool = True,
seed: int | None = None,
)
Bases: DESLinkFIFOScheduler
DES scheduler that prefers requests with larger remaining path cost.
Source code in src/memq_dqc/scheduler/des_link_scheduler.py
DESLinkFIFOScheduler
¶
DESLinkFIFOScheduler(
distributed_circuit: DistributedCircuit,
*,
profile: SchedulerHardwareProfile | None = None,
modality: SchedulerModality = DEFAULT_SCHEDULER_MODALITY,
entanglement_profile: SchedulerEntanglementProfile = DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE,
multiplex_entangle: bool = True,
seed: int | None = None,
)
Bases: BaseDESLinkScheduler
DES scheduler that serves contended links in FIFO order.
Source code in src/memq_dqc/scheduler/des_link_scheduler.py
DESLinkShortestDurationScheduler
¶
DESLinkShortestDurationScheduler(
distributed_circuit: DistributedCircuit,
*,
profile: SchedulerHardwareProfile | None = None,
modality: SchedulerModality = DEFAULT_SCHEDULER_MODALITY,
entanglement_profile: SchedulerEntanglementProfile = DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE,
multiplex_entangle: bool = True,
seed: int | None = None,
)
Bases: DESLinkFIFOScheduler
DES scheduler that prefers the shortest blocked remote request.
Source code in src/memq_dqc/scheduler/des_link_scheduler.py
FIFOScheduler
¶
FIFOScheduler(
distributed_circuit: DistributedCircuit,
*,
profile: SchedulerHardwareProfile | None = None,
modality: SchedulerModality = DEFAULT_SCHEDULER_MODALITY,
entanglement_profile: SchedulerEntanglementProfile = DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE,
multiplex_entangle: bool = True,
)
Bases: BaseScheduler
Schedule operations by walking DAG layers in FIFO order.
Source code in src/memq_dqc/scheduler/schedule.py
run
¶
Build a FIFO schedule for the configured distributed circuit.
Source code in src/memq_dqc/scheduler/fifo.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |
EPRDemand
dataclass
¶
EPRDemand(
demand_id: str,
consumer_op_id: int,
num_pairs: int,
assigned: EPRLinkAssignment | None,
candidates: tuple[EPRLinkAssignment, ...],
nominal_start_time: float,
predecessor_op_ids: tuple[int, ...],
remaining_critical_path: float,
)
A request for newly generated entanglement by one operation.
An EPR demand is a scheduling resource request, not an EPR-generation event. The external simulator creates as many generation attempts as its policy requires.
Attributes:
| Name | Type | Description |
|---|---|---|
demand_id |
str
|
Stable identifier for the demand. |
consumer_op_id |
int
|
Operation that consumes the entanglement (a |
num_pairs |
int
|
Number of EPR pairs the consumer requires. |
assigned |
EPRLinkAssignment | None
|
The fixed link assignment, or |
candidates |
tuple[EPRLinkAssignment, ...]
|
Candidate link assignments when assignment is deferred; empty when a fixed assignment is present. |
nominal_start_time |
float
|
Consumer's nominal start time. |
predecessor_op_ids |
tuple[int, ...]
|
Operation ids that must complete before the consumer. |
remaining_critical_path |
float
|
Static remaining-critical-path duration from the consumer to a DAG sink. |
EPRLinkAssignment
dataclass
¶
One concrete or candidate link assignment for an EPR demand.
Attributes:
| Name | Type | Description |
|---|---|---|
link_ids |
tuple[str, ...]
|
Link resource ids, one per required EPR pair. |
comm_qubit_ids |
tuple[str, ...]
|
Communication-qubit resource ids occupied by this assignment. |
SchedulingCompileOptions
dataclass
¶
SchedulingCompileOptions(
partitioner: str = "interaction",
partitioner_kwargs: Mapping[str, Any] | None = None,
partition_seed: int | None = None,
ebit_assignment: bool = True,
group_gates: bool = False,
max_group_size: int | None = None,
hardware_profile: Any | None = None,
)
Options controlling how a scheduling instance is compiled.
For the initial RL corpus the MVP requires ebit_assignment=True and
group_gates=False; the remaining fields are kept general for later
experiments.
Attributes:
| Name | Type | Description |
|---|---|---|
partitioner |
str
|
Registry name of the partitioning algorithm. |
partitioner_kwargs |
Mapping[str, Any] | None
|
Extra keyword arguments forwarded to the
partitioning algorithm, or |
partition_seed |
int | None
|
Optional seed for partitioners with random components. |
ebit_assignment |
bool
|
Whether the compiler assigns concrete e-bit pairs
( |
group_gates |
bool
|
Whether compatible remote gates share a cat-entanglement region. |
max_group_size |
int | None
|
Optional maximum number of two-qubit gates per group. |
hardware_profile |
Any | None
|
Scheduler hardware profile whose timings set the
deterministic operation durations. |
SchedulingDependency
dataclass
¶
SchedulingDependency(
source_op_id: int,
target_op_id: int,
resources: tuple[str, ...],
classification: str | None = None,
)
One precedence edge in the distributed operation DAG.
Attributes:
| Name | Type | Description |
|---|---|---|
source_op_id |
int
|
Operation id the dependency originates from. |
target_op_id |
int
|
Operation id that depends on the source. |
resources |
tuple[str, ...]
|
Physical qubit resource ids that created the dependency. |
classification |
str | None
|
Optional dependency label, e.g. |
SchedulingInstance
dataclass
¶
SchedulingInstance(
schema_version: int,
instance_id: str,
compiler_version: str,
source_fingerprint: str,
time_unit: str,
operations: tuple[SchedulingOperation, ...],
dependencies: tuple[SchedulingDependency, ...],
resources: tuple[SchedulingResource, ...],
epr_demands: tuple[EPRDemand, ...],
nominal_makespan: float,
metadata: Mapping[str, JSONValue] = dict(),
)
A self-contained scheduling artifact for an external RL scheduler.
Attributes:
| Name | Type | Description |
|---|---|---|
schema_version |
int
|
Scheduling-instance schema version. |
instance_id |
str
|
Deterministic identifier derived from
|
compiler_version |
str
|
memq_dqc version that produced the instance. |
source_fingerprint |
str
|
Hash of the normalized inputs, options, hardware profile, and schema version. |
time_unit |
str
|
Unit for all durations and nominal times. |
operations |
tuple[SchedulingOperation, ...]
|
Distributed operations, ordered by |
dependencies |
tuple[SchedulingDependency, ...]
|
Precedence edges, ordered by |
resources |
tuple[SchedulingResource, ...]
|
Physical resources, ordered by |
epr_demands |
tuple[EPRDemand, ...]
|
Entanglement demands, ordered by |
nominal_makespan |
float
|
Maximum nominal operation end time. |
metadata |
Mapping[str, JSONValue]
|
Reproducibility metadata (partitioner, seed, profile, ...). |
SchedulingOperation
dataclass
¶
SchedulingOperation(
op_id: int,
statement_id: int,
name: str,
op_type: str,
is_remote: bool,
data_qubits: tuple[str, ...],
comm_qubits: tuple[str, ...],
duration: float,
group_id: int | None,
nominal_start: float,
nominal_end: float,
cat_proxy_x: bool = False,
)
One distributed operation with its nominal timing.
Attributes:
| Name | Type | Description |
|---|---|---|
op_id |
int
|
Operation identifier from the distributed DAG. |
statement_id |
int
|
Statement identifier from the distributed program. |
name |
str
|
Gate or instruction name. |
op_type |
str
|
Classification, e.g. |
is_remote |
bool
|
Whether the operation is a remote distributed operation. |
data_qubits |
tuple[str, ...]
|
Ordered physical data-qubit resource ids. |
comm_qubits |
tuple[str, ...]
|
Ordered physical communication-qubit resource ids. |
duration |
float
|
Deterministic operation duration in |
group_id |
int | None
|
Cat-entanglement group id, or |
nominal_start |
float
|
Start time in the zero-EPR-wait nominal schedule. |
nominal_end |
float
|
End time in the zero-EPR-wait nominal schedule. |
cat_proxy_x |
bool
|
Whether the selected cat group's remote proxy also receives X when the named data operation executes. |
SchedulingResource
dataclass
¶
SchedulingResource(
resource_id: str,
resource_type: ResourceType,
qpu_id: int | None = None,
local_index: int | None = None,
endpoints: tuple[str, str] | None = None,
parameters: Mapping[str, JSONValue] = dict(),
)
One physical resource: a qubit or an inter-QPU link.
Attributes:
| Name | Type | Description |
|---|---|---|
resource_id |
str
|
Stable identifier, e.g. |
resource_type |
ResourceType
|
Whether the resource is a computation qubit, a communication qubit, or an inter-QPU link. |
qpu_id |
int | None
|
Owning QPU id for qubit resources; |
local_index |
int | None
|
Local slot index for qubit resources; |
endpoints |
tuple[str, str] | None
|
The two communication-qubit resource ids a link connects;
|
parameters |
Mapping[str, JSONValue]
|
Reserved mapping for external hardware annotations (coherence times, link fidelities); empty by default. |
BaseScheduler
¶
BaseScheduler(
distributed_circuit: DistributedCircuit,
*,
profile: SchedulerHardwareProfile | None = None,
modality: SchedulerModality = DEFAULT_SCHEDULER_MODALITY,
entanglement_profile: SchedulerEntanglementProfile = DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE,
multiplex_entangle: bool = True,
)
Bases: ABC
Base class for distributed scheduling algorithm implementations.
Initialize the scheduler with a distributed circuit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
distributed_circuit
|
DistributedCircuit
|
Distributed circuit DAG to schedule. |
required |
profile
|
SchedulerHardwareProfile | None
|
Optional convenience object selecting both modality and
entanglement profile, and carrying any custom hardware
parameter overrides. When provided, |
None
|
modality
|
SchedulerModality
|
Hardware timing profile used for local 1Q/2Q gate
durations. Defaults to |
DEFAULT_SCHEDULER_MODALITY
|
entanglement_profile
|
SchedulerEntanglementProfile
|
Entanglement-generation profile used for
entanglement timing. Defaults to |
DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE
|
multiplex_entangle
|
bool
|
True if we can perform entanglement generation for comm qubits on same chip simultaneously |
True
|
Source code in src/memq_dqc/scheduler/schedule.py
EntanglementGeneration
dataclass
¶
EntanglementGeneration(
qubits: tuple[str, str],
start_time: float,
duration: float = _default_entanglement_duration(),
was_used: bool = True,
)
Schedule entanglement generation between two available qubits.
Attributes:
| Name | Type | Description |
|---|---|---|
qubits |
tuple[str, str]
|
Communication qubits used for entanglement generation. |
start_time |
float
|
Time at which generation begins. |
duration |
float
|
Total time the EPR pair occupies the link. |
was_used |
bool
|
Whether the generated pair was consumed before expiration. |
OperationSchedule
dataclass
¶
OperationSchedule(
operations: tuple[ScheduleEvent, ...],
timelines: tuple[ScheduledQubitTimeline, ...],
makespan: float,
)
Operation-level schedule with per-qubit execution timelines.
Attributes:
| Name | Type | Description |
|---|---|---|
operations |
tuple[ScheduleEvent, ...]
|
Scheduled operations in dispatch order. |
timelines |
tuple[ScheduledQubitTimeline, ...]
|
Per-qubit views derived from |
makespan |
float
|
Total execution time across all physical qubits. |
qubits
property
¶
Return the ordered physical qubits present in the schedule.
ScheduledOperation
dataclass
¶
ScheduledOperation(
op_id: int,
statement_id: int,
name: str,
qubits: tuple[str, ...],
start_time: float,
duration: float,
is_remote: bool,
cat_proxy_qubits: tuple[str, ...] = (),
)
One scheduled operation in physical-qubit coordinates.
Attributes:
| Name | Type | Description |
|---|---|---|
op_id |
int
|
Operation identifier from the distributed DAG. |
statement_id |
int
|
Statement identifier from the distributed program. |
name |
str
|
Gate or instruction name. |
qubits |
tuple[str, ...]
|
Physical qubit labels touched by the operation. |
start_time |
float
|
Earliest time the operation can begin. |
duration |
float
|
Operation duration in abstract scheduler time units. |
is_remote |
bool
|
Whether the operation is a remote distributed operation. |
cat_proxy_qubits |
tuple[str, ...]
|
Communication qubits receiving an additional X alongside the named data gate. Empty for ordinary operations. |
ScheduledQubitTimeline
dataclass
¶
Ordered operations scheduled on a single physical qubit.
Attributes:
| Name | Type | Description |
|---|---|---|
qubit |
str
|
Physical qubit label. |
operations |
tuple[ScheduleEvent, ...]
|
Operations that execute on this qubit in time order. |
Scheduler
¶
Scheduler(
source: Compiler | Partitioner | DistributedCircuit,
*,
algo: str | type[_Algorithm] | _Algorithm = "fifo",
profile: SchedulerHardwareProfile | None = None,
modality: SchedulerModality = DEFAULT_SCHEDULER_MODALITY,
entanglement_profile: SchedulerEntanglementProfile = DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE,
multiplex_entangle: bool = True,
algo_kwargs: dict[str, Any] | None = None,
)
Orchestrate a scheduling algorithm implementation.
Initialize the scheduler and select the algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Compiler | Partitioner | DistributedCircuit
|
What to schedule. A |
required |
algo
|
str | type[_Algorithm] | _Algorithm
|
Algorithm name, class, or preconfigured instance. |
'fifo'
|
profile
|
SchedulerHardwareProfile | None
|
Optional convenience object selecting both modality and
entanglement profile. When provided, |
None
|
modality
|
SchedulerModality
|
Hardware timing profile used for local 1Q/2Q gate
durations. Defaults to |
DEFAULT_SCHEDULER_MODALITY
|
entanglement_profile
|
SchedulerEntanglementProfile
|
Entanglement-generation profile used for
entanglement timing. Defaults to |
DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE
|
multiplex_entangle
|
bool
|
Whether entanglement generation may overlap across independent communication resources. |
True
|
algo_kwargs
|
dict[str, Any] | None
|
Keyword arguments forwarded to the algorithm. |
None
|
Source code in src/memq_dqc/scheduler/schedule.py
distributed_circuit
property
¶
distributed_circuit: DistributedCircuit
Return the distributed circuit used by the scheduler.
schedule
property
¶
schedule: OperationSchedule | None
Return the latest operation schedule, if available.
run
¶
Run the configured scheduling algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
verbosity
|
Literal['quiet', 'info', 'debug']
|
Logging verbosity for this workflow call. |
'quiet'
|
Source code in src/memq_dqc/scheduler/schedule.py
plot_gantt
¶
plot_gantt(
*,
ax: Axes | None = None,
title: str | None = None,
display: Literal["pretty", "legacy"] = "pretty",
explicit_ops: bool = False,
show: bool = False,
save_path: str | PathLike[str] | None = None,
dpi: int = 150,
) -> Axes
Render this scheduler's result as a Gantt chart.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ax
|
Axes | None
|
Existing axes to draw into. A new figure and axes are created when omitted. |
None
|
title
|
str | None
|
Optional chart title (ignored in |
None
|
display
|
Literal['pretty', 'legacy']
|
Which rendering to produce. |
'pretty'
|
explicit_ops
|
bool
|
Whether to render one row per scheduled event instead of one row per physical qubit. |
False
|
show
|
bool
|
Whether to call |
False
|
save_path
|
str | PathLike[str] | None
|
Optional file path. When given, the rendered figure is saved there. |
None
|
dpi
|
int
|
Resolution used when saving to |
150
|
Returns:
| Type | Description |
|---|---|
Axes
|
The Matplotlib axes containing the rendered schedule. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the scheduler has not produced a schedule yet. |
Source code in src/memq_dqc/scheduler/schedule.py
to_json
¶
Serialize this scheduler's result to a JSON document.
Opt-in export; scheduling never serializes automatically. See memq_dqc.scheduler.serialize.schedule_to_json for the document layout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | PathLike[str] | None
|
Optional destination file. When given, the JSON document is written there in addition to being returned. |
None
|
indent
|
int | None
|
Indentation forwarded to the underlying serializer. Pass
|
2
|
Returns:
| Type | Description |
|---|---|
str
|
The JSON document as a string. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the scheduler has not produced a schedule yet. |
Source code in src/memq_dqc/scheduler/schedule.py
SchedulerHardwareProfile
dataclass
¶
SchedulerHardwareProfile(
modality: SchedulerModality = DEFAULT_SCHEDULER_MODALITY,
entanglement_profile: SchedulerEntanglementProfile = DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE,
one_qubit_gate_time: float | None = None,
two_qubit_gate_time: float | None = None,
measurement_time: float | None = None,
entanglement_rate: float | None = None,
epr_lifetime: float | None = None,
)
User-facing hardware selection for scheduler timing.
The two selector fields pick a named profile from settings.toml. The
remaining fields are optional per-instance overrides of the individual
hardware parameters that profile resolves to: None keeps the profile's
value, and any other value replaces it. Derived timings (cat-entangling,
cat-disentangling, state teleport, entanglement duration, DES success
probability) always recompute from the effective values, so they cannot
contradict the parameters they are built from.
Example
A Sr+ trapped-ion device with a faster two-qubit gate and a longer EPR lifetime than the packaged profile assumes:
Attributes:
| Name | Type | Description |
|---|---|---|
modality |
SchedulerModality
|
Modality profile used for local gate times. |
entanglement_profile |
SchedulerEntanglementProfile
|
Entanglement-generation profile used for entanglement timing. |
one_qubit_gate_time |
float | None
|
Optional override for the local single-qubit gate duration. |
two_qubit_gate_time |
float | None
|
Optional override for the local two-qubit gate duration. |
measurement_time |
float | None
|
Optional override for the measurement duration. |
entanglement_rate |
float | None
|
Optional override for the entanglement-generation rate. |
epr_lifetime |
float | None
|
Optional override for the maximum EPR-pair lifetime. |
overrides
property
¶
Return the supplied overrides, keyed by field name.
ba_trapped_ion
classmethod
¶
ba_trapped_ion(
*,
entanglement_profile: SchedulerEntanglementProfile = DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE,
one_qubit_gate_time: float | None = None,
two_qubit_gate_time: float | None = None,
measurement_time: float | None = None,
entanglement_rate: float | None = None,
epr_lifetime: float | None = None,
) -> SchedulerHardwareProfile
Return the Ba+ trapped-ion hardware selection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entanglement_profile
|
SchedulerEntanglementProfile
|
Entanglement-generation profile to pair with the modality. |
DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE
|
one_qubit_gate_time
|
float | None
|
Optional single-qubit gate duration override. |
None
|
two_qubit_gate_time
|
float | None
|
Optional two-qubit gate duration override. |
None
|
measurement_time
|
float | None
|
Optional measurement duration override. |
None
|
entanglement_rate
|
float | None
|
Optional entanglement-generation rate override. |
None
|
epr_lifetime
|
float | None
|
Optional EPR-pair lifetime override. |
None
|
Returns:
| Type | Description |
|---|---|
SchedulerHardwareProfile
|
The hardware profile. |
Source code in src/memq_dqc/scheduler/schedule.py
sr_trapped_ion
classmethod
¶
sr_trapped_ion(
*,
entanglement_profile: SchedulerEntanglementProfile = DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE,
one_qubit_gate_time: float | None = None,
two_qubit_gate_time: float | None = None,
measurement_time: float | None = None,
entanglement_rate: float | None = None,
epr_lifetime: float | None = None,
) -> SchedulerHardwareProfile
Return the Sr+ trapped-ion hardware selection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entanglement_profile
|
SchedulerEntanglementProfile
|
Entanglement-generation profile to pair with the modality. |
DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE
|
one_qubit_gate_time
|
float | None
|
Optional single-qubit gate duration override. |
None
|
two_qubit_gate_time
|
float | None
|
Optional two-qubit gate duration override. |
None
|
measurement_time
|
float | None
|
Optional measurement duration override. |
None
|
entanglement_rate
|
float | None
|
Optional entanglement-generation rate override. |
None
|
epr_lifetime
|
float | None
|
Optional EPR-pair lifetime override. |
None
|
Returns:
| Type | Description |
|---|---|
SchedulerHardwareProfile
|
The hardware profile. |
Source code in src/memq_dqc/scheduler/schedule.py
forte_trapped_ion
classmethod
¶
forte_trapped_ion(
*,
entanglement_profile: SchedulerEntanglementProfile = DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE,
one_qubit_gate_time: float | None = None,
two_qubit_gate_time: float | None = None,
measurement_time: float | None = None,
entanglement_rate: float | None = None,
epr_lifetime: float | None = None,
) -> SchedulerHardwareProfile
Return the IonQ Forte Enterprise 1 trapped-ion hardware selection.
Timings come from the vendor-published calibration record; unlike the other packaged modalities, this profile also supplies its own measurement time rather than falling back to the package default.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entanglement_profile
|
SchedulerEntanglementProfile
|
Entanglement-generation profile to pair with the modality. |
DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE
|
one_qubit_gate_time
|
float | None
|
Optional single-qubit gate duration override. |
None
|
two_qubit_gate_time
|
float | None
|
Optional two-qubit gate duration override. |
None
|
measurement_time
|
float | None
|
Optional measurement duration override. |
None
|
entanglement_rate
|
float | None
|
Optional entanglement-generation rate override. |
None
|
epr_lifetime
|
float | None
|
Optional EPR-pair lifetime override. |
None
|
Returns:
| Type | Description |
|---|---|
SchedulerHardwareProfile
|
The hardware profile. |
Source code in src/memq_dqc/scheduler/schedule.py
neutral_atom
classmethod
¶
neutral_atom(
*,
entanglement_profile: SchedulerEntanglementProfile = DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE,
one_qubit_gate_time: float | None = None,
two_qubit_gate_time: float | None = None,
measurement_time: float | None = None,
entanglement_rate: float | None = None,
epr_lifetime: float | None = None,
) -> SchedulerHardwareProfile
Return the neutral-atom hardware selection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entanglement_profile
|
SchedulerEntanglementProfile
|
Entanglement-generation profile to pair with the modality. |
DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE
|
one_qubit_gate_time
|
float | None
|
Optional single-qubit gate duration override. |
None
|
two_qubit_gate_time
|
float | None
|
Optional two-qubit gate duration override. |
None
|
measurement_time
|
float | None
|
Optional measurement duration override. |
None
|
entanglement_rate
|
float | None
|
Optional entanglement-generation rate override. |
None
|
epr_lifetime
|
float | None
|
Optional EPR-pair lifetime override. |
None
|
Returns:
| Type | Description |
|---|---|
SchedulerHardwareProfile
|
The hardware profile. |
Source code in src/memq_dqc/scheduler/schedule.py
des_link_critical_path_schedule
¶
des_link_critical_path_schedule(
distributed_circuit: DistributedCircuit,
*,
profile: SchedulerHardwareProfile | None = None,
modality: SchedulerModality = DEFAULT_SCHEDULER_MODALITY,
entanglement_profile: SchedulerEntanglementProfile = DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE,
multiplex_entangle: bool = True,
seed: int | None = None,
) -> OperationSchedule
Build a critical-path-first DES schedule.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
distributed_circuit
|
DistributedCircuit
|
Distributed circuit to schedule. |
required |
profile
|
SchedulerHardwareProfile | None
|
Optional convenience object selecting both modality and
entanglement profile. When provided, |
None
|
modality
|
SchedulerModality
|
Hardware timing profile used for local 1Q/2Q gate
durations. Defaults to |
DEFAULT_SCHEDULER_MODALITY
|
entanglement_profile
|
SchedulerEntanglementProfile
|
Entanglement-generation profile used for
entanglement timing. Defaults to |
DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE
|
multiplex_entangle
|
bool
|
Whether entanglement generation for multi-pair remote requests may overlap. The current DES link model still enforces one active entanglement process per link. |
True
|
seed
|
int | None
|
Optional random seed for deterministic simulations. |
None
|
Returns:
| Type | Description |
|---|---|
OperationSchedule
|
An operation-level schedule with stochastic entanglement timing and |
OperationSchedule
|
critical-path-first link arbitration. |
Source code in src/memq_dqc/scheduler/des_link_critical_path.py
des_link_fifo_schedule
¶
des_link_fifo_schedule(
distributed_circuit: DistributedCircuit,
*,
profile: SchedulerHardwareProfile | None = None,
modality: SchedulerModality = DEFAULT_SCHEDULER_MODALITY,
entanglement_profile: SchedulerEntanglementProfile = DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE,
multiplex_entangle: bool = True,
seed: int | None = None,
) -> OperationSchedule
Build a FIFO-arbitrated DES schedule for a distributed circuit DAG.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
distributed_circuit
|
DistributedCircuit
|
Distributed circuit to schedule. |
required |
profile
|
SchedulerHardwareProfile | None
|
Optional convenience object selecting both modality and
entanglement profile. When provided, |
None
|
modality
|
SchedulerModality
|
Hardware timing profile used for local 1Q/2Q gate
durations. Defaults to |
DEFAULT_SCHEDULER_MODALITY
|
entanglement_profile
|
SchedulerEntanglementProfile
|
Entanglement-generation profile used for
entanglement timing. Defaults to |
DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE
|
multiplex_entangle
|
bool
|
Whether entanglement generation for multi-pair remote requests may overlap. The current DES link model still enforces one active entanglement process per link. |
True
|
seed
|
int | None
|
Optional random seed for deterministic simulations. |
None
|
Returns:
| Type | Description |
|---|---|
OperationSchedule
|
An operation-level schedule with stochastic entanglement timing and |
OperationSchedule
|
FIFO link arbitration. |
Source code in src/memq_dqc/scheduler/des_link_fifo.py
des_link_shortest_duration_schedule
¶
des_link_shortest_duration_schedule(
distributed_circuit: DistributedCircuit,
*,
profile: SchedulerHardwareProfile | None = None,
modality: SchedulerModality = DEFAULT_SCHEDULER_MODALITY,
entanglement_profile: SchedulerEntanglementProfile = DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE,
multiplex_entangle: bool = True,
seed: int | None = None,
) -> OperationSchedule
Build a shortest-duration-first DES schedule.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
distributed_circuit
|
DistributedCircuit
|
Distributed circuit to schedule. |
required |
profile
|
SchedulerHardwareProfile | None
|
Optional convenience object selecting both modality and
entanglement profile. When provided, |
None
|
modality
|
SchedulerModality
|
Hardware timing profile used for local 1Q/2Q gate
durations. Defaults to |
DEFAULT_SCHEDULER_MODALITY
|
entanglement_profile
|
SchedulerEntanglementProfile
|
Entanglement-generation profile used for
entanglement timing. Defaults to |
DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE
|
multiplex_entangle
|
bool
|
Whether entanglement generation for multi-pair remote requests may overlap. The current DES link model still enforces one active entanglement process per link. |
True
|
seed
|
int | None
|
Optional random seed for deterministic simulations. |
None
|
Returns:
| Type | Description |
|---|---|
OperationSchedule
|
An operation-level schedule with stochastic entanglement timing and |
OperationSchedule
|
shortest-duration link arbitration. |
Source code in src/memq_dqc/scheduler/des_link_shortest_duration.py
fifo_schedule
¶
fifo_schedule(
distributed_circuit: DistributedCircuit,
*,
profile: SchedulerHardwareProfile | None = None,
modality: SchedulerModality = DEFAULT_SCHEDULER_MODALITY,
entanglement_profile: SchedulerEntanglementProfile = DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE,
multiplex_entangle: bool = True,
) -> OperationSchedule
Build a FIFO schedule for a distributed circuit DAG.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
distributed_circuit
|
DistributedCircuit
|
Distributed circuit to schedule. |
required |
profile
|
SchedulerHardwareProfile | None
|
Optional convenience object selecting both modality and
entanglement profile. When provided, |
None
|
modality
|
SchedulerModality
|
Hardware timing profile used for local 1Q/2Q gate
durations. Defaults to |
DEFAULT_SCHEDULER_MODALITY
|
entanglement_profile
|
SchedulerEntanglementProfile
|
Entanglement-generation profile used for
entanglement timing. Defaults to |
DEFAULT_SCHEDULER_ENTANGLEMENT_PROFILE
|
multiplex_entangle
|
bool
|
Reserved for future entanglement multiplexing behavior.(# TODO) |
True
|
Returns:
| Type | Description |
|---|---|
OperationSchedule
|
An operation-level schedule with per-qubit timelines. |
Source code in src/memq_dqc/scheduler/fifo.py
validate_scheduling_instance
¶
validate_scheduling_instance(
instance: SchedulingInstance,
) -> None
Validate the structural and nominal-schedule invariants of an instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance
|
SchedulingInstance
|
The scheduling instance to validate. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If any invariant is violated. The message names the offending id(s) and the invariant. |
Source code in src/memq_dqc/scheduler/instance.py
scheduling_instance_from_json
¶
scheduling_instance_from_json(
source: str | PathLike[str] | Mapping[str, Any],
) -> SchedulingInstance
Load and validate a scheduling instance from JSON.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str | PathLike[str] | Mapping[str, Any]
|
A parsed mapping, a JSON document string, or a path to a JSON
file (as |
required |
Returns:
| Type | Description |
|---|---|
SchedulingInstance
|
The reconstructed, validated SchedulingInstance. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the document type or schema version is unsupported, a number is non-finite, or the reconstructed instance is invalid. |
Source code in src/memq_dqc/scheduler/instance_serialize.py
scheduling_instance_to_json
¶
scheduling_instance_to_json(
instance: SchedulingInstance,
path: str | PathLike[str] | None = None,
*,
indent: int | None = 2,
) -> str
Serialize a scheduling instance to a JSON document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance
|
SchedulingInstance
|
The scheduling instance to serialize. |
required |
path
|
str | PathLike[str] | None
|
Optional destination file. When given, the document is written there as UTF-8 text in addition to being returned. |
None
|
indent
|
int | None
|
Indentation forwarded to |
2
|
Returns:
| Type | Description |
|---|---|
str
|
The JSON document as a string. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the instance contains a non-finite number. |
Source code in src/memq_dqc/scheduler/instance_serialize.py
build_scheduling_instance
¶
build_scheduling_instance(
distributed: DistributedCircuit,
network: NetworkGraph,
*,
options: SchedulingCompileOptions,
compiler_version: str,
source_fingerprint: str,
) -> SchedulingInstance
Assemble a validated scheduling instance for a compiled circuit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
distributed
|
DistributedCircuit
|
The compiled distributed circuit to describe. |
required |
network
|
NetworkGraph
|
The network graph the circuit was compiled for. |
required |
options
|
SchedulingCompileOptions
|
Compilation options recorded for reproducibility; its
|
required |
compiler_version
|
str
|
memq_dqc version producing the instance. |
required |
source_fingerprint
|
str
|
Precomputed fingerprint of the normalized inputs
and options; also used to derive |
required |
Returns:
| Type | Description |
|---|---|
SchedulingInstance
|
A validated SchedulingInstance. |
Source code in src/memq_dqc/scheduler/nominal.py
plot_schedule_gantt
¶
plot_schedule_gantt(
schedule: OperationSchedule,
*,
ax: Axes | None = None,
title: str | None = None,
show: bool = False,
explicit_ops: bool = False,
display: Literal["pretty", "legacy"] = "pretty",
) -> Axes
Render a scheduler-produced operation timeline as a Gantt chart.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
schedule
|
OperationSchedule
|
Scheduler output to render. |
required |
ax
|
Axes | None
|
Existing axes to draw into. A new figure and axes are created when omitted. |
None
|
title
|
str | None
|
Optional chart title (ignored in |
None
|
show
|
bool
|
Whether to call |
False
|
explicit_ops
|
bool
|
Whether to render one row per scheduled event instead of one row per physical qubit. |
False
|
display
|
Literal['pretty', 'legacy']
|
Which rendering to produce. |
'pretty'
|
Returns:
| Type | Description |
|---|---|
Axes
|
The Matplotlib axes containing the rendered schedule. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/memq_dqc/scheduler/schedule_visualizer.py
schedule_to_json
¶
schedule_to_json(
schedule: OperationSchedule,
path: str | PathLike[str] | None = None,
*,
indent: int | None = 2,
) -> str
Serialize an operation schedule to a JSON document.
This is an opt-in helper; scheduling never serializes automatically. The
document has a makespan field and a flat, time-ordered operations
list. Each operation carries a type discriminator ("operation" or
"entanglement"), its stored fields, and the derived end_time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
schedule
|
OperationSchedule
|
The operation schedule to serialize. |
required |
path
|
str | PathLike[str] | None
|
Optional destination file. When given, the JSON document is written there as UTF-8 text in addition to being returned. |
None
|
indent
|
int | None
|
Indentation forwarded to |
2
|
Returns:
| Type | Description |
|---|---|
str
|
The JSON document as a string. |