schedule#

Schedule helper functions.

Module Contents#

Functions#

get_pulse_uuid(→ int)

Return an unique identifier for a pulse.

get_acq_uuid(→ int)

Return an unique identifier for a acquisition protocol.

get_total_duration(→ float)

Return the total schedule duration in seconds.

get_operation_start(→ float)

Return the start of an operation in seconds.

get_operation_end(→ float)

Return the end of an operation in seconds.

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

Return a new dictionary containing the port timeline.

get_schedule_time_offset(→ float)

Return the start time in seconds of the first pulse in the CompiledSchedule.

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

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

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

Return a lookup dictionary of unique identifiers of acquisition information.

extract_acquisition_metadata_from_schedule(...)

Extract acquisition metadata from a schedule.

extract_acquisition_metadata_from_acquisition_protocols(...)

Private function containing the logic of extract_acquisition_metadata_from_schedule.

_extract_port_clocks_used(→ set[tuple])

Extracts which port-clock combinations are used in an operation or schedule.

get_pulse_uuid(pulse_info: dict[str, Any], excludes: list[str] = None) int[source]#

Return an unique identifier for a pulse.

Parameters:
  • pulse_info – The pulse information dictionary.

  • excludes – A list of keys to exclude.

Returns:

The uuid hash.

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

Return 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.ScheduleBase) float[source]#

Return 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]#

Return the start of an operation in seconds.

Parameters:
  • schedule – The schedule

  • timeslot_index – The index of the operation in the schedule.

Returns:

The Operation start time in Seconds.

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

Return the end of an operation in seconds.

Parameters:
  • schedule – The schedule

  • timeslot_index – The index of the operation in the schedule.

Returns:

The Operation end time in Seconds.

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

Return a new dictionary containing the port timeline.

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]#

Return the start time in seconds of the first pulse in the CompiledSchedule.

The “None” port containing the Reset Operation will be ignored.

Parameters:
  • schedule – The schedule.

  • port_timeline_dict – Dictionary containing port timelines.

Returns:

The operation t0 in seconds.

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

Return 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]#

Return a lookup dictionary of unique identifiers of acquisition information.

Parameters:

schedule – The schedule.

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

Extract 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]], repetitions: int) 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.

  • repetitions – How many times the acquisition was repeated.

_extract_port_clocks_used(operation: quantify_scheduler.operations.operation.Operation | quantify_scheduler.schedules.schedule.Schedule) set[tuple][source]#

Extracts which port-clock combinations are used in an operation or schedule.