schedule ======== .. py:module:: quantify_scheduler.helpers.schedule .. autoapi-nested-parse:: Schedule helper functions. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: quantify_scheduler.helpers.schedule.get_pulse_uuid quantify_scheduler.helpers.schedule.get_acq_uuid quantify_scheduler.helpers.schedule.get_total_duration quantify_scheduler.helpers.schedule.get_operation_start quantify_scheduler.helpers.schedule.get_operation_end quantify_scheduler.helpers.schedule.get_port_timeline quantify_scheduler.helpers.schedule.get_schedule_time_offset quantify_scheduler.helpers.schedule.get_pulse_info_by_uuid quantify_scheduler.helpers.schedule.get_acq_info_by_uuid quantify_scheduler.helpers.schedule.extract_acquisition_metadata_from_schedule quantify_scheduler.helpers.schedule.extract_acquisition_metadata_from_acquisition_protocols quantify_scheduler.helpers.schedule._extract_port_clocks_used .. py:function:: get_pulse_uuid(pulse_info: dict[str, Any], excludes: list[str] = None) -> int Return an unique identifier for a pulse. :param pulse_info: The pulse information dictionary. :param excludes: A list of keys to exclude. :returns: The uuid hash. .. py:function:: get_acq_uuid(acq_info: dict[str, Any]) -> int Return an unique identifier for a acquisition protocol. :param acq_info: The acquisition information dictionary. :returns: The uuid hash. .. py:function:: get_total_duration(schedule: quantify_scheduler.schedules.schedule.ScheduleBase) -> float Return the total schedule duration in seconds. :param schedule: The schedule. :returns: Duration in seconds. .. py:function:: get_operation_start(schedule: quantify_scheduler.schedules.schedule.CompiledSchedule, timeslot_index: int) -> float Return the start of an operation in seconds. :param schedule: The schedule :param timeslot_index: The index of the operation in the schedule. :returns: The Operation start time in Seconds. .. py:function:: get_operation_end(schedule: quantify_scheduler.schedules.schedule.ScheduleBase, timeslot_index: int) -> float Return the end of an operation in seconds. :param schedule: The schedule :param timeslot_index: The index of the operation in the schedule. :returns: The Operation end time in Seconds. .. py:function:: get_port_timeline(schedule: quantify_scheduler.schedules.schedule.CompiledSchedule) -> dict[str, dict[int, list[int]]] Return a new dictionary containing the port timeline. Using iterators on this collection enables sorting. .. code-block:: print(port_timeline_dict) # { {'q0:mw', {0, [123456789]}}, # ... } # Sorted items. print(port_timeline_dict.items()) :param schedule: The schedule. .. py:function:: get_schedule_time_offset(schedule: quantify_scheduler.schedules.schedule.CompiledSchedule, port_timeline_dict: dict[str, dict[int, list[int]]]) -> float Return the start time in seconds of the first pulse in the CompiledSchedule. The "None" port containing the Reset Operation will be ignored. :param schedule: The schedule. :param port_timeline_dict: Dictionary containing port timelines. :returns: The operation t0 in seconds. .. py:function:: get_pulse_info_by_uuid(schedule: quantify_scheduler.schedules.schedule.CompiledSchedule) -> dict[int, dict[str, Any]] Return a lookup dictionary of pulses with its hash as unique identifiers. :param schedule: The schedule. .. py:function:: get_acq_info_by_uuid(schedule: quantify_scheduler.schedules.schedule.CompiledSchedule) -> dict[int, dict[str, Any]] Return a lookup dictionary of unique identifiers of acquisition information. :param schedule: The schedule. .. py:function:: extract_acquisition_metadata_from_schedule(schedule: quantify_scheduler.schedules.schedule.Schedule) -> quantify_scheduler.schedules.schedule.AcquisitionMetadata 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 :class:`~quantify_scheduler.enums.BinMode` is :code:`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). :param 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. .. py:function:: extract_acquisition_metadata_from_acquisition_protocols(acquisition_protocols: list[dict[str, Any]], repetitions: int) -> quantify_scheduler.schedules.schedule.AcquisitionMetadata 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. :param acquisition_protocols: A list of acquisition protocols. :param repetitions: How many times the acquisition was repeated. .. py:function:: _extract_port_clocks_used(operation: quantify_scheduler.operations.operation.Operation | quantify_scheduler.schedules.schedule.Schedule) -> set[tuple] Extracts which port-clock combinations are used in an operation or schedule.