qblox_acq_index_manager#

Utility class for dynamically allocating Qblox acquisition indices and bins and for Qblox sequencers.

Module Contents#

Classes#

QbloxAcquisitionIndexBin

Qblox acquisition index and QBlox acquisition bin.

QbloxAcquisitionIndexManager

Utility class that keeps track of all the reserved indices, bins for a sequencer.

Attributes#

QbloxAcquisitionIndex

QbloxAcquisitionBinMapping

Binned type acquisition hardware mapping.

QbloxAcquisitionHardwareMapping

Type for all type acquisition hardware mapping.

QbloxAcquisitionIndex[source]#
class QbloxAcquisitionIndexBin[source]#

Qblox acquisition index and QBlox acquisition bin.

index: QbloxAcquisitionIndex[source]#

Qblox acquisition index.

bin: int[source]#

Qblox acquisition bin. For average bin mode, this is the bin where the data is stored. 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.

thresholded_trigger_count_metadata: quantify_scheduler.backends.types.common.ThresholdedTriggerCountMetadata | None[source]#

Thresholded trigger count metadata. Only applicable for ThresholdedTriggerCount, and only on QRM, QRM-RF, QRC. On QTM, this is unused, threshold calculations are on the hardware.

QbloxAcquisitionBinMapping[source]#

Binned type acquisition hardware mapping.

Each value maps the acquisition index to a hardware bin, which is specified by the Qblox acquisition index, and the Qblox acquisition bin.

QbloxAcquisitionHardwareMapping[source]#

Type for all type acquisition hardware mapping.

This is a union of types, because the exact mapping type depends on the protocol.

class QbloxAcquisitionIndexManager[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_declaration_dict: dict[str, Any][source]#

Acquisition declaration dictionary.

This data is used in qblox_instruments.qcodes_drivers.Sequencer sequence parameter’s “acquisitions”.

_acq_hardware_mapping_binned: dict[collections.abc.Hashable, QbloxAcquisitionBinMapping][source]#

Acquisition hardware mapping for binned acquisitions.

_acq_hardware_mapping_not_binned: dict[collections.abc.Hashable, QbloxAcquisitionIndex][source]#

Acquisition hardware mapping for not binned acquisitions.

_next_free_qblox_acq_bin: list[int] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0][source]#

Maps each Qblox acquisition index to the next free (unreserved) bin.

_acq_channel_to_qblox_acq_index: dict[collections.abc.Hashable, int][source]#

Maps each acquisition channel to the Qblox acquisition index it uses.

_trace_allocated: bool = False[source]#

Specifying whether a Trace or TimetagTrace have already been allocated.

_number_of_free_qblox_bins(qblox_acq_index: int) int[source]#
_next_qblox_acq_index_with_all_free_bins() int | None[source]#
_reserve_qblox_acq_bins(number_of_indices: int, qblox_acq_index: int, acq_channel: collections.abc.Hashable, acq_indices: list[int] | None, thresholded_trigger_count_metadata: quantify_scheduler.backends.types.common.ThresholdedTriggerCountMetadata | None, repetitions: int) int[source]#

Reserves the Qblox acquisition bin with the parameters. This function already assumes that the bin is free, not yet used.

Note, number_of_indices must be equal to the length of acq_indices if not None.

Parameters:
  • number_of_indices – Number of indices to reserve.

  • qblox_acq_index – Qblox acquisition index to be used.

  • acq_channel – Acquisition channel.

  • acq_indices – Acquisition index. If None, it has no corresponding acquisition index (for example Trace acquisition).

  • thresholded_trigger_count_metadata – Thresholded trigger count metadata. If not applicable, None.

  • repetitions – Repetitions of the schedule for append bin mode; otherwise 1.

Returns:

The starting Qblox acquisition bin.

allocate_bins(acq_channel: collections.abc.Hashable, acq_indices: list[int] | int, sequencer_name: str, thresholded_trigger_count_metadata: quantify_scheduler.backends.types.common.ThresholdedTriggerCountMetadata | None, repetitions: int | None) tuple[int, int][source]#

Allocates len(acq_indices) number of Qblox acquisition bins.

Parameters:
  • acq_channel – Acquisition channel.

  • acq_indices – Acquisition index. If None, it has no corresponding acquisition index (for example Trace acquisition).

  • sequencer_name – Sequencer name.

  • thresholded_trigger_count_metadata – Thresholded trigger count metadata. If not applicable, None.

  • repetitions – Repetitions of the schedule when using append bin mode.

Returns:

The Qblox acquisition index, and the Qblox acquisition bin offset as integers.

Raises:

IndexError – When the QbloxAcquisitionBinManager runs out of bins to allocate.

allocate_qblox_index(acq_channel: collections.abc.Hashable, sequencer_name: str) int[source]#

Allocates a whole Qblox acquisition index for ttl, other acquisition for the given acquisition channel.

Parameters:
  • acq_channel – Acquisition channel.

  • sequencer_name – Sequencer name.

Returns:

The Qblox acquisition index.

Raises:

IndexError – When the QbloxAcquisitionBinManager runs out of acquisition indices to allocate.

allocate_trace(acq_channel: collections.abc.Hashable, sequencer_name: str) tuple[int, int][source]#

Allocates a whole Qblox acquisition index for trace for the given acquisition channel.

Parameters:
  • acq_channel – Acquisition channel.

  • sequencer_name – Sequencer name.

Returns:

The Qblox acquisition index, and the Qblox acquisition bin offset as integers.

Raises:

IndexError – When the QbloxAcquisitionBinManager runs out of acquisition indices to allocate.

allocate_timetagtrace(acq_channel: collections.abc.Hashable, acq_indices: list[int], sequencer_name: str, 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.

  • sequencer_name – Sequencer name.

  • repetitions – Repetitions of the schedule.

Returns:

The Qblox acquisition index, and the Qblox acquisition bin offset as integers.

Raises:
  • IndexError – When the QbloxAcquisitionBinManager runs out of acquisition indices to allocate.

  • RuntimeError – 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.Sequencer sequence parameter’s “acquisitions”.

Returns:

The acquisition declaration dict.

acq_hardware_mapping() dict[collections.abc.Hashable, QbloxAcquisitionHardwareMapping][source]#

Returns the acquisition hardware mapping, which is needed for quantify instrument coordinator to figure out which hardware index, bin needs to be mapped to which output acquisition data.

Returns:

The acquisition hardware mapping.