qblox_scheduler.compilation#

Compiler for the qblox_scheduler.

Attributes#

Functions#

_determine_absolute_timing(…)

Determine the absolute timing of a schedule based on the timing constraints.

_determine_absolute_timing_schedule(...)

_determine_scheduling_strategy(...)

_validate_schedulable_references(→ None)

Check the schedulable references for circular references.

_populate_references_graph(→ networkx.DiGraph)

Add nodes and edges to the graph containing schedulable references.

_make_timing_constraints_explicit(→ None)

_make_timing_constraints_explicit_for_schedulable(→ None)

_determine_default_ref_pt(→ Literal[, ])

_determine_default_ref_pt_new(→ Literal[, ])

_determine_default_ref_schedulables_by_schedulable(...)

_get_start_time(→ float)

_normalize_absolute_timing(...)

_unroll_loops(…)

_unroll_single_loop(...)

validate_config(→ bool)

Validate a configuration using a schema.

plot_schedulable_references_graph(→ None)

Show the schedulable reference graph.

Module Contents#

logger[source]#
_determine_absolute_timing(schedule: qblox_scheduler.schedules.schedule.TimeableSchedule, time_unit: Literal['physical', 'ideal', None] = 'physical', config: qblox_scheduler.backends.graph_compilation.CompilationConfig | None = None) qblox_scheduler.schedules.schedule.TimeableSchedule[source]#
_determine_absolute_timing(schedule: qblox_scheduler.operations.operation.Operation, time_unit: Literal['physical', 'ideal', None] = 'physical', config: qblox_scheduler.backends.graph_compilation.CompilationConfig | None = None) qblox_scheduler.operations.operation.Operation | qblox_scheduler.schedules.schedule.TimeableSchedule

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:

  1. iterating over all and elements in the schedulables.

  2. 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., is None).

  3. determining the start of the operation based on the rel_time and duration 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 ScheduleCompiler.

  • time_unit – Whether to use physical units to determine the absolute time or ideal time. When time_unit == "physical" the duration attribute is used. When time_unit == "ideal" the duration attribute is ignored and treated as if it is 1. When time_unit == None it will revert to "physical".

Returns:

: The modified .TimeableSchedule` 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: qblox_scheduler.schedules.schedule.TimeableSchedule, time_unit: Literal['physical', 'ideal', None], config: qblox_scheduler.backends.graph_compilation.CompilationConfig | None) qblox_scheduler.schedules.schedule.TimeableSchedule[source]#
_determine_scheduling_strategy(config: qblox_scheduler.backends.graph_compilation.CompilationConfig | None = None) qblox_scheduler.enums.SchedulingStrategy[source]#
_validate_schedulable_references(schedule: qblox_scheduler.schedules.schedule.TimeableSchedule, references_graph: networkx.DiGraph) None[source]#

Check the schedulable references for circular references.

_populate_references_graph(schedule: qblox_scheduler.schedules.schedule.TimeableSchedule) networkx.DiGraph[source]#

Add nodes and edges to the graph containing schedulable references.

_make_timing_constraints_explicit(schedule: qblox_scheduler.schedules.schedule.TimeableSchedule, strategy: qblox_scheduler.enums.SchedulingStrategy) None[source]#
_make_timing_constraints_explicit_for_schedulable(schedule: qblox_scheduler.schedules.schedule.TimeableSchedule, schedulable_name: str, default_reference_schedulable_name: str | None, strategy: qblox_scheduler.enums.SchedulingStrategy) None[source]#
_determine_default_ref_pt(strategy: qblox_scheduler.enums.SchedulingStrategy) Literal['start', 'end'][source]#
_determine_default_ref_pt_new(strategy: qblox_scheduler.enums.SchedulingStrategy) Literal['start', 'end'][source]#
_determine_default_ref_schedulables_by_schedulable(schedule: qblox_scheduler.schedules.schedule.TimeableSchedule, strategy: qblox_scheduler.enums.SchedulingStrategy) list[tuple[str, str | None]][source]#
_get_start_time(schedule: qblox_scheduler.schedules.schedule.TimeableSchedule, t_constr: qblox_scheduler.schedules.schedule.TimingConstraint, curr_op: qblox_scheduler.operations.operation.Operation | qblox_scheduler.schedules.schedule.TimeableSchedule, time_unit: Literal['physical', 'ideal', None]) float[source]#
_normalize_absolute_timing(schedule: qblox_scheduler.schedules.schedule.TimeableSchedule, config: qblox_scheduler.backends.graph_compilation.CompilationConfig | None = None) qblox_scheduler.schedules.schedule.TimeableSchedule[source]#
_unroll_loops(schedule: qblox_scheduler.schedules.schedule.TimeableSchedule, config: qblox_scheduler.backends.graph_compilation.CompilationConfig | None = None) qblox_scheduler.schedules.schedule.TimeableSchedule[source]#
_unroll_loops(schedule: qblox_scheduler.operations.operation.Operation, config: qblox_scheduler.backends.graph_compilation.CompilationConfig | None = None) qblox_scheduler.operations.operation.Operation | qblox_scheduler.schedules.schedule.TimeableSchedule
_unroll_single_loop(op: qblox_scheduler.operations.control_flow_library.LoopOperation) qblox_scheduler.schedules.schedule.TimeableSchedule[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 qblox_scheduler.schemas folder.

Returns:

: True if valid

plot_schedulable_references_graph(schedule: qblox_scheduler.schedules.schedule.TimeableSchedule) None[source]#

Show the schedulable reference graph.

Can be used as a debugging tool to spot any circular references.