compilation#
Compiler for the quantify_scheduler.
Module Contents#
Functions#
Determine the absolute timing of a schedule based on the timing constraints. |
|
|
Check the schedulable references for circular references. |
|
Add nodes and edges to the graph containing schedulable references. |
|
|
|
|
|
|
|
Validate a configuration using a schema. |
Show the schedulable reference graph. |
Attributes#
- _determine_absolute_timing(schedule: quantify_scheduler.schedules.schedule.Schedule, time_unit: Literal['physical', 'ideal', None] = 'physical', config: quantify_scheduler.backends.graph_compilation.CompilationConfig | None = None) quantify_scheduler.schedules.schedule.Schedule [source]#
- _determine_absolute_timing(schedule: quantify_scheduler.operations.operation.Operation, time_unit: Literal['physical', 'ideal', None] = 'physical', config: quantify_scheduler.backends.graph_compilation.CompilationConfig | None = None) quantify_scheduler.operations.operation.Operation | quantify_scheduler.schedules.schedule.Schedule
Determine the absolute timing of a schedule based on the timing constraints.
This function determines absolute timings for every operation in the
schedulables
. It does this by:iterating over all and elements in the
schedulables
.determining the absolute time of the reference operation - reference point
"ref_pt"
of the reference operation defaults to"end"
in case it is not set (i.e., isNone
).determining the start of the operation based on the
rel_time
andduration
of operations - reference point"ref_pt_new"
of the added operation defaults to"start"
in case it is not set.
- Parameters:
schedule – The schedule for which to determine timings.
config – Compilation config for
QuantifyCompiler
.time_unit – Whether to use physical units to determine the absolute time or ideal time. When
time_unit == "physical"
the duration attribute is used. Whentime_unit == "ideal"
the duration attribute is ignored and treated as if it is1
. Whentime_unit == None
it will revert to"physical"
.
- Returns:
: The modified
schedule
where the absolute time for each operation has been determined.- Raises:
NotImplementedError – If the scheduling strategy is not SchedulingStrategy.ASAP
- _determine_absolute_timing_schedule(schedule: quantify_scheduler.schedules.schedule.Schedule, time_unit: Literal['physical', 'ideal', None], config: quantify_scheduler.backends.graph_compilation.CompilationConfig | None) quantify_scheduler.schedules.schedule.Schedule [source]#
- _determine_scheduling_strategy(config: quantify_scheduler.backends.graph_compilation.CompilationConfig | None = None) quantify_scheduler.enums.SchedulingStrategy [source]#
- _validate_schedulable_references(schedule: quantify_scheduler.schedules.schedule.Schedule, references_graph: networkx.DiGraph) None [source]#
Check the schedulable references for circular references.
- _populate_references_graph(schedule: quantify_scheduler.schedules.schedule.Schedule) networkx.DiGraph [source]#
Add nodes and edges to the graph containing schedulable references.
- _make_timing_constraints_explicit(schedule: quantify_scheduler.schedules.schedule.Schedule, strategy: quantify_scheduler.enums.SchedulingStrategy) None [source]#
- _make_timing_constraints_explicit_for_schedulable(schedule: quantify_scheduler.schedules.schedule.Schedule, schedulable_name: str, default_reference_schedulable_name: str | None, strategy: quantify_scheduler.enums.SchedulingStrategy) None [source]#
- _determine_default_ref_pt(strategy: quantify_scheduler.enums.SchedulingStrategy) Literal['start', 'end'] [source]#
- _determine_default_ref_pt_new(strategy: quantify_scheduler.enums.SchedulingStrategy) Literal['start', 'end'] [source]#
- _determine_default_ref_schedulables_by_schedulable(schedule: quantify_scheduler.schedules.schedule.Schedule, strategy: quantify_scheduler.enums.SchedulingStrategy) list[tuple[str, str | None]] [source]#
- _get_start_time(schedule: quantify_scheduler.schedules.schedule.Schedule, t_constr: quantify_scheduler.schedules.schedule.TimingConstraint, curr_op: quantify_scheduler.operations.operation.Operation | quantify_scheduler.schedules.schedule.Schedule, time_unit: Literal['physical', 'ideal', None]) float [source]#
- _normalize_absolute_timing(schedule: quantify_scheduler.schedules.schedule.Schedule, config: quantify_scheduler.backends.graph_compilation.CompilationConfig | None = None) quantify_scheduler.schedules.schedule.Schedule [source]#
- validate_config(config: dict, scheme_fn: str) bool [source]#
Validate a configuration using a schema.
- Parameters:
config – The configuration to validate
scheme_fn – The name of a json schema in the quantify_scheduler.schemas folder.
- Returns:
: True if valid
- plot_schedulable_references_graph(schedule: quantify_scheduler.schedules.schedule.Schedule) None [source]#
Show the schedulable reference graph.
Can be used as a debugging tool to spot any circular references.