quantify_scheduler.helpers.schedule

Schedule helper functions.

Module Contents

Functions

get_pulse_uuid(→ int)

Returns an unique identifier for a pulse.

get_acq_uuid(→ int)

Returns an unique identifier for a acquisition protocol.

get_total_duration(→ float)

Returns the total schedule duration in seconds.

get_operation_start(→ float)

Returns the start of an operation in seconds.

get_operation_end(→ float)

Returns the end of an operation in seconds.

get_port_timeline(→ Dict[str, Dict[int, List[int]]])

Returns a new dictionary containing the timeline of

get_schedule_time_offset(→ float)

Returns the start time in seconds of the first pulse

get_pulse_info_by_uuid(→ Dict[int, Dict[str, Any]])

Returns a lookup dictionary of pulses with its

get_acq_info_by_uuid(→ Dict[int, Dict[str, Any]])

Returns a lookup dictionary of unique identifiers

extract_acquisition_metadata_from_schedule(...)

Extracts acquisition metadata from a schedule.

_extract_acquisition_metadata_from_acquisition_protocols(...)

Private function containing the logic of extract_acquisition_metadata_from_schedule.

_extract_acquisition_metadata_from_acquisitions(...)

Private variant of extract_acquisition_metadata_from_schedule explicitly for use

get_pulse_uuid(pulse_info: Dict[str, Any], excludes: List[str] = None) int[source]

Returns an unique identifier for a pulse.

Parameters:

pulse_info – The pulse information dictionary.

Returns:

The uuid hash.

get_acq_uuid(acq_info: Dict[str, Any]) int[source]

Returns an unique identifier for a acquisition protocol.

Parameters:

acq_info – The acquisition information dictionary.

Returns:

The uuid hash.

get_total_duration(schedule: quantify_scheduler.schedules.schedule.CompiledSchedule) float[source]

Returns the total schedule duration in seconds.

Parameters:

schedule – The schedule.

Returns:

Duration in seconds.

get_operation_start(schedule: quantify_scheduler.schedules.schedule.CompiledSchedule, timeslot_index: int) float[source]

Returns the start of an operation in seconds.

Parameters:
  • schedule

  • timeslot_index

Returns:

The Operation start time in Seconds.

get_operation_end(schedule: quantify_scheduler.schedules.schedule.CompiledSchedule, timeslot_index: int) float[source]

Returns the end of an operation in seconds.

Parameters:
  • schedule

  • timeslot_index

Returns:

The Operation end time in Seconds.

get_port_timeline(schedule: quantify_scheduler.schedules.schedule.CompiledSchedule) Dict[str, Dict[int, List[int]]][source]

Returns a new dictionary containing the timeline of pulses, readout- and acquisition pulses of a port.

Using iterators on this collection enables sorting.

print(port_timeline_dict)
# { {'q0:mw', {0, [123456789]}},
# ... }

# Sorted items.
print(port_timeline_dict.items())
Parameters:

schedule – The schedule.

get_schedule_time_offset(schedule: quantify_scheduler.schedules.schedule.CompiledSchedule, port_timeline_dict: Dict[str, Dict[int, List[int]]]) float[source]

Returns the start time in seconds of the first pulse in the CompiledSchedule. The “None” port containing the Reset Operation will be ignored.

Parameters:
  • schedule

  • port_timeline_dict

Returns:

The operation t0 in seconds.

get_pulse_info_by_uuid(schedule: quantify_scheduler.schedules.schedule.CompiledSchedule) Dict[int, Dict[str, Any]][source]

Returns a lookup dictionary of pulses with its hash as unique identifiers.

Parameters:

schedule – The schedule.

get_acq_info_by_uuid(schedule: quantify_scheduler.schedules.schedule.CompiledSchedule) Dict[int, Dict[str, Any]][source]

Returns a lookup dictionary of unique identifiers of acquisition information.

Parameters:

schedule – The schedule.

extract_acquisition_metadata_from_schedule(schedule: quantify_scheduler.schedules.schedule.ScheduleBase) quantify_scheduler.schedules.schedule.AcquisitionMetadata[source]

Extracts acquisition metadata from a schedule.

This function operates under certain assumptions with respect to the schedule.

  • The acquisition_metadata should be sufficient to initialize the xarray dataset (described in quantify-core !212) that executing the schedule will result in.

  • All measurements in the schedule use the same acquisition protocol.

  • The used acquisition index channel combinations for each measurement are unique.

  • The used acquisition indices for each channel are the same.

  • When BinMode is APPEND The number of data points per acquisition index assumed to be given by the schedule’s repetition property. This implies no support for feedback (conditional measurements).

Parameters:

schedule – schedule containing measurements from which acquisition metadata can be extracted.

Returns:

The acquisition metadata provides a summary of the acquisition protocol, bin-mode, return-type and acquisition indices of the acquisitions in the schedule.

Raises:

AssertionError – If not all acquisition protocols in a schedule are the same. If not all acquisitions use the same bin_mode. If the return type of the acquisitions is different.

_extract_acquisition_metadata_from_acquisition_protocols(acquisition_protocols: List[Dict[str, Any]]) quantify_scheduler.schedules.schedule.AcquisitionMetadata[source]

Private function containing the logic of extract_acquisition_metadata_from_schedule. The logic is factored out as to work around limitations of the different interfaces required.

Parameters:

acquisition_protocols – A list of acquisition protocols.

_extract_acquisition_metadata_from_acquisitions(acquisitions: List[quantify_scheduler.backends.types.qblox.OpInfo]) quantify_scheduler.schedules.schedule.AcquisitionMetadata[source]

Private variant of extract_acquisition_metadata_from_schedule explicitly for use with the qblox assembler backend.