qblox_scheduler.backends.qblox.qblox_acq_index_manager#
Utility class for dynamically allocating Qblox acquisition indices and bins and for Qblox sequencers.
Attributes#
Acquisition hardware mapping for timetag trace acquisitions. |
Exceptions#
Raised when there is an error in allocating acquisition memory. |
Classes#
Qblox acquisition index and QBlox acquisition bin. |
|
Acquisition info for binned acquisition. |
|
Node to represent all acquisitions which are within the same loop tree structure. |
|
Acquisition hardware mapping for binned acquisitions. |
|
Acquisition hardware mapping for all acquisitions. |
|
Utility class that keeps track of all the reserved acquisition resources for a module. |
|
Utility class that keeps track of all the reserved indices, bins for a sequencer. |
Module Contents#
- class QbloxAcquisitionTimetagTraceIndexBin[source]#
Qblox acquisition index and QBlox acquisition bin. Only used for timetag trace acquisitions.
- bin: int[source]#
Qblox acquisition bin. For append bin mode, this is first bin where data is stored, for each loop and repetition cycle, the data is consecutively stored.
- stride: int[source]#
Stride. Only used for acquisitions within a loop (not schedule repetitions). Defines what’s the stride between each repetitions of the schedule for the data.
The assumption is that for an append bin mode operation with loops and schedule repetitions there is only one register; the register’s inner iteration first goes through the loop, and then the schedule repetitions.
- QbloxAcquisitionBinMappingTimetagTrace[source]#
Acquisition hardware mapping for timetag trace acquisitions.
Each value maps the acquisition index to a hardware bin, which is specified by the Qblox acquisition index, and the Qblox acquisition bin.
- class BinnedAcqInfo[source]#
Acquisition info for binned acquisition.
- acq_channel: collections.abc.Hashable[source]#
- thresholded_trigger_count_metadata: qblox_scheduler.backends.types.common.ThresholdedTriggerCountMetadata | None[source]#
- class BinnedAcqControlFlowNode[source]#
Node to represent all acquisitions which are within the same loop tree structure. If and only if repetitions and bin_modes are not None, then it is a loop node.
- parent: BinnedAcqControlFlowNode | None[source]#
- children: list[BinnedAcqControlFlowNode | BinnedAcqInfo][source]#
- bin_mode: qblox_scheduler.enums.BinMode | None[source]#
- add_control_flow_child(child_repetitions: int | None, bin_mode: qblox_scheduler.enums.BinMode | None) BinnedAcqControlFlowNode[source]#
Adds a new control flow as a child to the current node, and returns it.
- return_control_flow_child() BinnedAcqControlFlowNode[source]#
Returns the parent, and if the current node is empty, it will remove it from the tree. Only call this function after any add_control_flow_child was called.
- static get_nearest_loop_node(node: BinnedAcqControlFlowNode) BinnedAcqControlFlowNode[source]#
Returns argument if it’s a loop node, otherwise returns the parent’s nearest loop node or argument if there’s no parent (root node).
- class QbloxAcquisitionHardwareMappingBinned[source]#
Acquisition hardware mapping for binned acquisitions.
- qblox_acq_index: QbloxAcquisitionIndex[source]#
- qblox_acq_bin_offset: int[source]#
The starting bin where all acquisition data is stored for this mapping.
- tree: BinnedAcqControlFlowNode[source]#
Root node for the whole tree of the loop and acquisition tree.
- class QbloxAcquisitionHardwareMapping[source]#
Bases:
qblox_scheduler.json_utils.JSONSerializableAcquisition hardware mapping for all acquisitions.
- non_binned: dict[collections.abc.Hashable, QbloxAcquisitionIndex][source]#
- timetagtrace: tuple[collections.abc.Hashable, int, QbloxAcquisitionBinMappingTimetagTrace] | None[source]#
- exception AcquisitionMemoryError[source]#
Bases:
ValueErrorRaised when there is an error in allocating acquisition memory.
- class QbloxAcquisitionModuleResourceManager(maximum_bins: int)[source]#
Utility class that keeps track of all the reserved acquisition resources for a module.
- class _SequencerAcquisitionModel(module_resource_manager: QbloxAcquisitionModuleResourceManager)[source]#
- class QbloxAcquisitionIndexManager(module_resource_manager: QbloxAcquisitionModuleResourceManager)[source]#
Utility class that keeps track of all the reserved indices, bins for a sequencer.
Each acquisition channel is mapped to a unique Qblox acquisition index. For binned acquisitions, each new allocation request reserves the Qblox acquisition bins in order (incrementing the bin index by one). For trace and ttl and other acquisitions, the whole Qblox acquisition index is reserved, there, the bin index has no relevance.
- _acq_hardware_mapping_not_binned: dict[collections.abc.Hashable, QbloxAcquisitionIndex][source]#
Acquisition hardware mapping for not binned acquisitions.
- _sequencer_acquisition_model[source]#
Data model of sequencer acquisition memory, which keeps track of the allocated amount of bins for each Qblox acquisition index.
- _binned_qblox_acq_index: int | None = None[source]#
Qblox acquisition index used by the binned acquisitions.
- _trace_allocated: bool = False[source]#
Specifying whether a Trace or TimetagTrace have already been allocated.
- _acq_hardware_mapping_binned: list[QbloxAcquisitionHardwareMappingBinned] = [][source]#
- _acq_hardware_mapping_timetagtrace: tuple[collections.abc.Hashable, int, QbloxAcquisitionBinMappingTimetagTrace] | None = None[source]#
Acquisition hardware mapping for time tag trace.
- allocate_bins_binned(number_of_acq_indices: int, tree: BinnedAcqControlFlowNode, repetitions: int | None) tuple[int, int][source]#
Allocates Qblox acquisition bins for binned acquisitions.
- Parameters:
number_of_acq_indices – Number of acquisition indices to allocate.
tree – The loop tree structure for all of the acquisitions.
repetitions – Repetitions of the schedule when using append bin mode.
- Returns:
The Qblox acquisition index, and the Qblox acquisition bin offset as integers.
- Raises:
AcquisitionMemoryError – When the QbloxAcquisitionBinManager runs out of bins to allocate.
- allocate_qblox_index(acq_channel: collections.abc.Hashable) int[source]#
Allocates a whole Qblox acquisition index for ttl, other acquisition for the given acquisition channel.
- Parameters:
acq_channel – Acquisition channel.
- Returns:
The Qblox acquisition index.
- Raises:
AcquisitionMemoryError – When the QbloxAcquisitionBinManager runs out of acquisition indices to allocate.
- allocate_trace(acq_channel: collections.abc.Hashable) tuple[int, int][source]#
Allocates a whole Qblox acquisition index for trace for the given acquisition channel.
- Parameters:
acq_channel – Acquisition channel.
- Returns:
The Qblox acquisition index, and the Qblox acquisition bin offset as integers.
- Raises:
AcquisitionMemoryError – When the QbloxAcquisitionBinManager runs out of acquisition indices to allocate.
- allocate_timetagtrace(acq_channel: collections.abc.Hashable, acq_indices: list[int], repetitions: int) tuple[int, int][source]#
Allocates a whole Qblox acquisition index for TimetagTrace for the given acquisition channel.
- Parameters:
acq_channel – Acquisition channel.
acq_indices – Acquisition index.
repetitions – Repetitions of the schedule.
- Returns:
The Qblox acquisition index, and the Qblox acquisition bin offset as integers.
- Raises:
AcquisitionMemoryError – When the QbloxAcquisitionBinManager runs out of acquisition indices to allocate.
AcquisitionMemoryError – When there have already been an other trace acquisition allocated.
- acq_declaration_dict() dict[str, Any][source]#
Returns the acquisition declaration dict, which is needed for the qblox-instruments. This data is used in
qblox_instruments.qcodes_drivers.Sequencersequence parameter’s “acquisitions”.- Returns:
The acquisition declaration dict.
- acq_hardware_mapping() QbloxAcquisitionHardwareMapping[source]#
Returns the acquisition hardware mapping, which is needed for qblox-scheduler instrument coordinator to figure out which hardware index, bin needs to be mapped to which output acquisition data.
- Returns:
The acquisition hardware mapping.