qblox_backend#

Compiler backend for Qblox hardware.

Module Contents#

Classes#

QbloxHardwareCompilationConfig

Datastructure containing the information needed to compile to the Qblox backend.

Functions#

_get_square_pulses_to_replace(→ dict[str, list[int]])

Generate a dict referring to long square pulses to replace in the schedule.

_replace_long_square_pulses(...)

Replace any square pulses indicated by pulse_idx_map by a long_square_pulse.

compile_long_square_pulses_to_awg_offsets(...)

Replace square pulses in the schedule with long square pulses.

hardware_compile(...)

Generate qblox hardware instructions for executing the schedule.

find_qblox_instruments(→ Dict[str, Any])

Find all inner dictionaries representing a qblox instrument of the given type.

validate_non_overlapping_stitched_pulse(→ None)

Raise an error when pulses overlap, if at least one contains a voltage offset.

_exists_pulse_starting_before_current_end(...)

_raise_if_pulses_overlap_on_same_port_clock(→ None)

Raise an error if any pulse operations overlap on the same port-clock.

_get_pulse_start_ends(→ dict[str, tuple[float, float]])

_has_voltage_offset(→ bool)

_has_pulse(→ bool)

_operation_end(→ float)

_get_square_pulses_to_replace(schedule: quantify_scheduler.schedules.schedule.Schedule) dict[str, list[int]][source]#

Generate a dict referring to long square pulses to replace in the schedule.

This function generates a mapping (dict) from the keys in the operations() dict to a list of indices, which refer to entries in the “pulse_info” list that describe a square pulse.

Parameters:

schedule (Schedule) – A Schedule, possibly containing long square pulses.

Returns:

square_pulse_idx_map – The mapping from operation_id to "pulse_info" indices to be replaced.

Return type:

dict[str, list[int]]

_replace_long_square_pulses(schedule: quantify_scheduler.schedules.schedule.Schedule, pulse_idx_map: dict[str, list[int]]) quantify_scheduler.schedules.schedule.Schedule[source]#

Replace any square pulses indicated by pulse_idx_map by a long_square_pulse.

Parameters:
  • schedule (Schedule) – A Schedule, possibly containing long square pulses.

  • pulse_idx_map (dict[str, list[int]]) – A mapping from the keys in the operations() dict to a list of indices, which refer to entries in the “pulse_info” list that describe a square pulse.

Returns:

The schedule with square pulses longer than PULSE_STITCHING_DURATION replaced by long_square_pulse(). If no replacements were done, this is the original unmodified schedule.

Return type:

Schedule

compile_long_square_pulses_to_awg_offsets(schedule: quantify_scheduler.schedules.schedule.Schedule, **_: Any) quantify_scheduler.schedules.schedule.Schedule[source]#

Replace square pulses in the schedule with long square pulses.

Introspects operations in the schedule to find square pulses with a duration longer than PULSE_STITCHING_DURATION. Any of these square pulses are converted to long_square_pulse(), which consist of AWG voltage offsets.

If any operations are to be replaced, a deepcopy will be made of the schedule, which is returned by this function. Otherwise the original unmodified schedule will be returned.

Parameters:

schedule (Schedule) – A Schedule, possibly containing long square pulses.

Returns:

schedule – The schedule with square pulses longer than PULSE_STITCHING_DURATION replaced by long_square_pulse(). If no replacements were done, this is the original unmodified schedule.

Return type:

Schedule

hardware_compile(schedule: quantify_scheduler.schedules.schedule.Schedule, config: quantify_scheduler.backends.graph_compilation.CompilationConfig | dict[str, Any] | None = None, *, hardware_cfg: dict[str, Any] | None = None) quantify_scheduler.schedules.schedule.CompiledSchedule[source]#

Generate qblox hardware instructions for executing the schedule.

The principle behind the overall compilation is as follows:

For every instrument in the hardware configuration, we instantiate a compiler object. Then we assign all the pulses/acquisitions that need to be played by that instrument to the compiler, which then compiles for each instrument individually.

This function then returns all the compiled programs bundled together in a dictionary with the QCoDeS name of the instrument as key.

Parameters:
  • schedule – The schedule to compile. It is assumed the pulse and acquisition info is already added to the operation. Otherwise an exception is raised.

  • config – Compilation config for QuantifyCompiler.

  • hardware_cfg – (deprecated) The hardware configuration of the setup. Pass a full compilation config instead using config argument.

Returns:

The compiled schedule.

Raises:

ValueError – When both config and hardware_cfg are supplied.

find_qblox_instruments(hardware_config: Dict[str, Any], instrument_type: str) Dict[str, Any][source]#

Find all inner dictionaries representing a qblox instrument of the given type.

class QbloxHardwareCompilationConfig(/, **data: Any)[source]#

Bases: quantify_scheduler.backends.types.common.HardwareCompilationConfig

Datastructure containing the information needed to compile to the Qblox backend.

This information is structured in the same way as in the generic HardwareCompilationConfig, but contains fields for hardware-specific settings.

config_type: Type[QbloxHardwareCompilationConfig][source]#

A reference to the HardwareCompilationConfig DataStructure for the Qblox backend.

hardware_description: Dict[str, quantify_scheduler.backends.types.qblox.QbloxHardwareDescription | quantify_scheduler.backends.types.common.HardwareDescription][source]#

Description of the instruments in the physical setup.

hardware_options: quantify_scheduler.backends.types.qblox.QbloxHardwareOptions[source]#

Options that are used in compiling the instructions for the hardware, such as LatencyCorrection or SequencerOptions.

compilation_passes: List[quantify_scheduler.backends.graph_compilation.SimpleNodeConfig][source]#

The list of compilation nodes that should be called in succession to compile a schedule to instructions for the Qblox hardware.

_validate_connectivity_channel_names() QbloxHardwareCompilationConfig[source]#
classmethod from_old_style_hardware_config(data: Any) Any[source]#

Convert old style hardware config dict to new style before validation.

validate_non_overlapping_stitched_pulse(schedule: quantify_scheduler.schedules.schedule.Schedule, **_: Any) None[source]#

Raise an error when pulses overlap, if at least one contains a voltage offset.

Since voltage offsets are sometimes used to construct pulses (see e.g. long_square_pulse()), overlapping these with regular pulses in time on the same port-clock can lead to undefined behaviour.

Note that for each schedulable, all pulse info entries with the same port and clock count as one pulse for that port and clock. This is because schedulables, starting before another schedulable has finished, could affect the waveforms or offsets in the remaining time of that other schedulable.

Parameters:

schedule (Schedule) – A Schedule, possibly containing long square pulses.

Returns:

schedule – A Schedule, possibly containing long square pulses.

Return type:

Schedule

Raises:

RuntimeError – If the schedule contains overlapping pulses (containing voltage offsets) on the same port and clock.

_exists_pulse_starting_before_current_end(sorted_schedulables: list[quantify_scheduler.schedules.schedule.Schedulable], current_idx: int, schedule: quantify_scheduler.schedules.schedule.Schedule) quantify_scheduler.schedules.schedule.Schedulable | Literal[False][source]#
_raise_if_pulses_overlap_on_same_port_clock(schble_a: quantify_scheduler.schedules.schedule.Schedulable, schble_b: quantify_scheduler.schedules.schedule.Schedulable, schedule: quantify_scheduler.schedules.schedule.Schedule) None[source]#

Raise an error if any pulse operations overlap on the same port-clock.

A pulse here means a waveform or a voltage offset.

_get_pulse_start_ends(schedulable: quantify_scheduler.schedules.schedule.Schedulable, schedule: quantify_scheduler.schedules.schedule.Schedule) dict[str, tuple[float, float]][source]#
_has_voltage_offset(schedulable: quantify_scheduler.schedules.schedule.Schedulable, schedule: quantify_scheduler.schedules.schedule.Schedule) bool[source]#
_has_pulse(schedulable: quantify_scheduler.schedules.schedule.Schedulable, schedule: quantify_scheduler.schedules.schedule.Schedule) bool[source]#
_operation_end(schedulable: quantify_scheduler.schedules.schedule.Schedulable, schedule: quantify_scheduler.schedules.schedule.Schedule) float[source]#