quantify_scheduler.helpers.schedule
Schedule helper functions.
Module Contents
Functions
|
Returns an unique identifier for a pulse. |
|
Returns an unique identifier for a acquisition protocol. |
|
Returns the total schedule duration in seconds. |
|
Returns the start of an operation in seconds. |
|
Returns the end of an operation in seconds. |
|
Returns a new dictionary containing the timeline of |
|
Returns the start time in seconds of the first pulse |
|
Returns a lookup dictionary of pulses with its |
|
Returns a lookup dictionary of unique identifiers |
Extracts acquisition metadata from a schedule. |
|
|
Private function containing the logic of extract_acquisition_metadata_from_schedule. |
- 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
isAPPEND
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.