quantify_scheduler.instrument_coordinator.components.qblox

Module containing Qblox InstrumentCoordinator Components.

Module Contents

Classes

_SequencerStateInfo

_StaticHardwareProperties

Dataclass that holds all the static differences between the different Qblox

QbloxInstrumentCoordinatorComponentBase

Qblox InstrumentCoordinator component base class.

QCMComponent

QCM specific InstrumentCoordinator component.

QRMComponent

QRM specific InstrumentCoordinator component.

QbloxRFComponent

Mix-in for RF-module-specific InstrumentCoordinatorComponent behaviour.

QCMRFComponent

QCM-RF specific InstrumentCoordinator component.

QRMRFComponent

QRM-RF specific InstrumentCoordinator component.

PulsarQCMComponent

A component for a baseband Pulsar QCM.

PulsarQRMComponent

A component for a baseband Pulsar QRM.

_QRMAcquisitionManager

Utility class that handles the acquisitions performed with the QRM.

ClusterComponent

Class that represents an instrument coordinator component for a Qblox cluster.

Attributes

logger

_SEQUENCER_STATE_FLAG_INFO

Used to link all flags returned by the hardware to logging message and

_QCM_BASEBAND_PROPERTIES

_QRM_BASEBAND_PROPERTIES

_QCM_RF_PROPERTIES

_QRM_RF_PROPERTIES

ClusterModule

Type that combines all the possible modules for a cluster.

logger[source]
class _SequencerStateInfo[source]
message: str[source]

The text to pass as the logging message.

logging_level: int[source]

The logging level to use.

static get_logging_level(flag: qblox_instruments.SequencerStatusFlags) int[source]

Define the logging level per SequencerStatusFlags flag.

_SEQUENCER_STATE_FLAG_INFO: Dict[qblox_instruments.SequencerStatusFlags, _SequencerStateInfo][source]

Used to link all flags returned by the hardware to logging message and logging level.

class _StaticHardwareProperties[source]

Dataclass that holds all the static differences between the different Qblox devices that are relevant for configuring them correctly.

settings_type: Type[quantify_scheduler.backends.types.qblox.BaseModuleSettings][source]

The settings dataclass to use that the hardware needs to configure to.

has_internal_lo: bool[source]

Specifies if an internal lo source is available.

number_of_sequencers: int[source]

The number of sequencers the hardware has available.

number_of_output_paths: int[source]

The number of output paths that can be used.

number_of_input_paths: int[source]

“The number of input paths that can be used.

_QCM_BASEBAND_PROPERTIES[source]
_QRM_BASEBAND_PROPERTIES[source]
_QCM_RF_PROPERTIES[source]
_QRM_RF_PROPERTIES[source]
class QbloxInstrumentCoordinatorComponentBase(instrument: Union[qcodes.instrument.Instrument, qcodes.instrument.InstrumentModule], **kwargs)[source]

Bases: quantify_scheduler.instrument_coordinator.components.base.InstrumentCoordinatorComponentBase

Qblox InstrumentCoordinator component base class.

Create a new instance of QbloxInstrumentCoordinatorComponentBase base class.

property instrument: Union[qcodes.instrument.Instrument, qcodes.instrument.InstrumentModule][source]

If the instrument behind this instance of QbloxInstrumentCoordinatorComponentBase is an InstrumentModule (e.g. the module within the qblox_instrument.Cluster), it is returned. Otherwise, the reference to the instrument is returned (e.g. for a stand-alone qblox_instruments.Pulsar).

property is_running: bool[source]

Finds if any of the sequencers is currently running.

Returns

True if any of the sequencers reports the SequencerStatus.RUNNING status.

abstract property _hardware_properties: _StaticHardwareProperties[source]

Holds all the differences between the different modules.

Returns

A dataclass with all the hardware properties for this specific module.

_set_parameter(instrument: Union[qcodes.instrument.Instrument, qcodes.instrument.InstrumentModule], parameter_name: str, val: Any) None[source]

Sets the parameter directly or using the lazy set, depending on the value of force_set_parameters.

Parameters
  • instrument – The instrument or instrument channel that holds the parameter to set, e.g. self.instrument or self.instrument[f”sequencer{idx}”].

  • parameter_name – The name of the parameter to set.

  • val – The new value of the parameter.

wait_done(timeout_sec: int = 10) None[source]

Blocks the instrument until all the sequencers are done running.

Parameters

timeout_sec – The timeout in seconds. N.B. the instrument takes the timeout in minutes (int), therefore it is rounded down to whole minutes with a minimum of 1.

start() None[source]

Starts execution of the schedule.

stop() None[source]

Stops all execution.

abstract _configure_global_settings(settings: quantify_scheduler.backends.types.qblox.BaseModuleSettings) None[source]

Configures all settings that are set globally for the whole instrument.

Parameters

settings – The settings to configure it to.

_configure_sequencer_settings(seq_idx: int, settings: quantify_scheduler.backends.types.qblox.SequencerSettings) None[source]

Configures all sequencer-specific settings.

Parameters
  • seq_idx – Index of the sequencer to configure.

  • settings – The settings to configure it to.

static _get_channel_map_parameter_name(output_index: int) str[source]
_arm_all_sequencers_in_program(program: Dict[str, Any])[source]

Arms all the sequencers that are part of the program.

class QCMComponent(instrument: qcodes.instrument.Instrument, **kwargs)[source]

Bases: QbloxInstrumentCoordinatorComponentBase

QCM specific InstrumentCoordinator component.

Create a new instance of QCMComponent.

_hardware_properties[source]
retrieve_acquisition() None[source]

Retrieves the previous acquisition.

Returns

QCM returns None since the QCM has no acquisition.

prepare(program: Dict[str, dict]) None[source]

Uploads the waveforms and programs to the sequencers and configures all the settings required. Keep in mind that values set directly through the driver may be overridden (e.g. the offsets will be set according to the specified mixer calibration parameters).

Parameters

program – Program to upload to the sequencers. Under the key "sequencer" you specify the sequencer specific options for each sequencer, e.g. "seq0". For global settings, the options are under different keys, e.g. "settings".

_configure_global_settings(settings: quantify_scheduler.backends.types.qblox.BaseModuleSettings)[source]

Configures all settings that are set globally for the whole instrument.

Parameters

settings – The settings to configure it to.

class QRMComponent(instrument: qcodes.instrument.Instrument, **kwargs)[source]

Bases: QbloxInstrumentCoordinatorComponentBase

QRM specific InstrumentCoordinator component.

Create a new instance of QRMComponent.

_hardware_properties[source]
_acquisition_manager: Optional[_QRMAcquisitionManager][source]

Holds all the acquisition related logic.

retrieve_acquisition() Optional[xarray.Dataset][source]

Retrieves the latest acquisition results.

Returns

The acquired data.

prepare(program: Dict[str, dict]) None[source]

Uploads the waveforms and programs to the sequencers and configures all the settings required. Keep in mind that values set directly through the driver may be overridden (e.g. the offsets will be set according to the specified mixer calibration parameters).

Parameters

program – Program to upload to the sequencers. Under the key "sequencer" you specify the sequencer specific options for each sequencer, e.g. "seq0". For global settings, the options are under different keys, e.g. "settings".

_clear_sequencer_acquisition_data()[source]

Clear all acquisition data.

_configure_global_settings(settings: quantify_scheduler.backends.types.qblox.BaseModuleSettings)[source]

Configures all settings that are set globally for the whole instrument.

Parameters

settings – The settings to configure it to.

_configure_sequencer_settings(seq_idx: int, settings: quantify_scheduler.backends.types.qblox.SequencerSettings) None[source]

Configures all sequencer-specific settings.

Parameters
  • seq_idx – Index of the sequencer to configure.

  • settings – The settings to configure it to.

_determine_scope_mode_acquisition_sequencer_and_channel(acquisition_metadata: Dict[str, quantify_scheduler.schedules.schedule.AcquisitionMetadata]) Optional[Tuple[int, int]][source]

Finds which sequencer, channel has to perform raw trace acquisitions. Raises an error if multiple scope mode acquisitions are present per sequencer. Note, that compiler ensures there is at most one scope mode acquisition, however the user is able to freely modify the compiler program, so we make sure this requirement is still satisfied. See _ensure_single_scope_mode_acquisition_sequencer().

Parameters

acquisition_metadata – The acquisition metadata for each sequencer.

Returns

The sequencer and channel for the trace acquisition, if there is any, otherwise None, None.

class QbloxRFComponent(instrument: Union[qcodes.instrument.Instrument, qcodes.instrument.InstrumentModule], **kwargs)[source]

Bases: QbloxInstrumentCoordinatorComponentBase

Mix-in for RF-module-specific InstrumentCoordinatorComponent behaviour.

Create a new instance of QbloxInstrumentCoordinatorComponentBase base class.

_configure_sequencer_settings(seq_idx: int, settings: quantify_scheduler.backends.types.qblox.SequencerSettings) None[source]

Configures all sequencer-specific settings.

Parameters
  • seq_idx – Index of the sequencer to configure.

  • settings – The settings to configure it to.

class QCMRFComponent(instrument: Union[qcodes.instrument.Instrument, qcodes.instrument.InstrumentModule], **kwargs)[source]

Bases: QbloxRFComponent, QCMComponent

QCM-RF specific InstrumentCoordinator component.

Create a new instance of QbloxInstrumentCoordinatorComponentBase base class.

_hardware_properties[source]
_configure_global_settings(settings: quantify_scheduler.backends.types.qblox.RFModuleSettings)[source]

Configures all settings that are set globally for the whole instrument.

Parameters

settings – The settings to configure it to.

class QRMRFComponent(instrument: Union[qcodes.instrument.Instrument, qcodes.instrument.InstrumentModule], **kwargs)[source]

Bases: QbloxRFComponent, QRMComponent

QRM-RF specific InstrumentCoordinator component.

Create a new instance of QbloxInstrumentCoordinatorComponentBase base class.

_hardware_properties[source]
_configure_global_settings(settings: quantify_scheduler.backends.types.qblox.RFModuleSettings)[source]

Configures all settings that are set globally for the whole instrument.

Parameters

settings – The settings to configure it to.

class PulsarQCMComponent(instrument: qcodes.instrument.Instrument, **kwargs)[source]

Bases: QCMComponent

A component for a baseband Pulsar QCM.

Create a new instance of QCMComponent.

prepare(options: Dict[str, dict]) None[source]

Uploads the waveforms and programs to the sequencers and configures all the settings required. Keep in mind that values set directly through the driver may be overridden (e.g. the offsets will be set according to the specified mixer calibration parameters).

Parameters

program – Program to upload to the sequencers. Under the key "sequencer" you specify the sequencer specific options for each sequencer, e.g. "seq0". For global settings, the options are under different keys, e.g. "settings".

class PulsarQRMComponent(instrument: qcodes.instrument.Instrument, **kwargs)[source]

Bases: QRMComponent

A component for a baseband Pulsar QRM.

Create a new instance of QRMComponent.

prepare(options: Dict[str, dict]) None[source]

Uploads the waveforms and programs to the sequencers and configures all the settings required. Keep in mind that values set directly through the driver may be overridden (e.g. the offsets will be set according to the specified mixer calibration parameters).

Parameters

program – Program to upload to the sequencers. Under the key "sequencer" you specify the sequencer specific options for each sequencer, e.g. "seq0". For global settings, the options are under different keys, e.g. "settings".

class _QRMAcquisitionManager(parent: QRMComponent, acquisition_metadata: Dict[str, quantify_scheduler.schedules.schedule.AcquisitionMetadata], scope_mode_sequencer_and_channel: Optional[Tuple[int, int]], acquisition_duration: Dict[int, int], seq_name_to_idx_map: Dict[str, int])[source]

Utility class that handles the acquisitions performed with the QRM.

An instance of this class is meant to exist only for a single prepare-start- retrieve_acquisition cycle to prevent stateful behavior.

Constructor for _QRMAcquisitionManager.

Parameters
  • parent – Reference to the parent QRM IC component.

  • acquisition_metadata – Provides a summary of the used acquisition protocol, bin mode, acquisition channels, acquisition indices per channel, and repetitions, for each sequencer.

  • scope_mode_sequencer_and_channel – The sequencer and channel of the scope mode acquisition if there’s any.

  • acquisition_duration – The duration of each acquisition for each sequencer.

  • seq_name_to_idx_map – All available sequencer names to their ids in a dict.

property instrument[source]

Returns the QRM driver from the parent IC component.

retrieve_acquisition() xarray.Dataset[source]

Retrieves all the acquisition data in the correct format.

Returns

The acquisitions with the protocols specified in the acquisition_metadata. Each xarray.DataArray in the xarray.Dataset corresponds to one acq_channel. The acq_channel is the name of each xarray.DataArray in the xarray.Dataset. Each xarray.DataArray is a two-dimensional array, with acq_index and repetition as dimensions.

classmethod _format_acquisitions_data_array_for_scope_and_integration(acquisition_metadata: quantify_scheduler.schedules.schedule.AcquisitionMetadata, acq_indices: Iterable, acquisitions_data: Iterable) xarray.DataArray[source]

Formats the scope and integration type acquisition data to a xarray.DataArray. acquisitions_data is expected to be in the following order for the binned acquisitions: [index0_rep0, index1_rep0, index2_rep0, index0_rep1, index1_rep1, index2_rep1, ...]. The data is converted into the following order for the xarray.DataArray: [[index0_rep0, index1_rep0, index2_rep0], [index0_rep1, index1_rep1, index2_rep1], ...].

Parameters
  • acquisition_metadata – Acquisition metadata.

  • acq_indices – Indices for the acquisition channel.

  • acquisitions_data – Data of the acquisitions.

Returns

Formatted xarray.DataArray of the acquisition data by cutting the raw data retrieved from the hardware into repetitions, and giving them appropriate coordinates in the xarray.DataArray.

static _format_acquisitions_data_array(acquisitions_data, coords_repetition, coords_acq_index) xarray.DataArray[source]

Formats acquisitions_data to an xarray.DataArray by giving them the appropriate coordinates: coords_repetition as repetition coordinates and coords_acq_index as acquisition indices. It’s just a simple wrapper, so that each xarray.DataArray creation is consistent among protocols.

_store_scope_acquisition()[source]

Calls store_scope_acquisition function on the Qblox instrument. This will ensure that the correct sequencer will store the scope acquisition data on the hardware, so it will be filled out when we call get_acquisitions on the Qblox instrument’s sequencer corresponding to the scope acquisition.

_get_scope_data(acq_indices: list, acquisitions: dict, acquisition_metadata: quantify_scheduler.schedules.schedule.AcquisitionMetadata, acq_duration: int, acq_channel: int = 0) xarray.DataArray[source]

Retrieves the scope mode acquisition associated with an acq_channel.

Parameters
  • acq_indices – Acquisition indices.

  • acquisitions – The acquisitions dict as returned by the sequencer.

  • acquisition_metadata – Acquisition metadata.

  • acq_duration – Desired maximum number of samples for the scope acquisition.

  • acq_channel – The acq_channel from which to get the data.

Returns

The scope mode data.

_get_integration_data(acq_indices: list, acquisitions: dict, acquisition_metadata: quantify_scheduler.schedules.schedule.AcquisitionMetadata, acq_duration: int, acq_channel: int = 0) xarray.DataArray[source]

Retrieves the integrated acquisition data associated with an acq_channel.

Parameters
  • acq_indices – Acquisition indices.

  • acquisitions – The acquisitions dict as returned by the sequencer.

  • acquisition_metadata – Acquisition metadata.

  • acq_duration – Not used in this function.

  • acq_channel – The acq_channel from which to get the data.

Returns

The integrated data.

_get_integration_amplitude_data(acq_indices: list, acquisitions: dict, acquisition_metadata: quantify_scheduler.schedules.schedule.AcquisitionMetadata, acq_duration: int, acq_channel: int = 0) xarray.DataArray[source]

Gets the integration data but normalized to the integration time (number of samples summed). The return value is thus the amplitude of the demodulated signal directly and has volt units (i.e. same units as a single sample of the integrated signal).

Parameters
  • acq_indices – Acquisition indices.

  • acquisitions – The acquisitions dict as returned by the sequencer.

  • acquisition_metadata – Acquisition metadata.

  • acq_duration – Duration of the acquisition. This needs to be specified.

  • acq_channel – The acq_channel from which to get the data.

Returns

Array containing binned, normalized acquisition data.

_get_threshold_data(acquisitions: dict, acquisition_metadata: quantify_scheduler.schedules.schedule.AcquisitionMetadata, acq_duration: int, acq_channel: int = 0, acq_index: int = 0) float[source]

Retrieves the thresholded acquisition data associated with acq_channel and acq_index.

Parameters
  • acquisitions – The acquisitions dict as returned by the sequencer.

  • acquisition_metadata – Not used in this function.

  • acq_duration – Not used in this function.

  • acq_channel – The acq_channel from which to get the data.

  • acq_index – The acquisition index.

Returns

The value of the thresholded acquisition for acq_channel and acq_index. Should always be 0.0 <= val <= 1.0.

_get_trigger_count_data(acq_indices: list, acquisitions: dict, acquisition_metadata: quantify_scheduler.schedules.schedule.AcquisitionMetadata, acq_duration: int, acq_channel: int = 0) xarray.DataArray[source]

Retrieves the trigger count acquisition data associated with acq_channel.

Parameters
  • acq_indices – Acquisition indices.

  • acquisitions – The acquisitions dict as returned by the sequencer.

  • acquisition_metadata – Acquisition metadata.

  • acq_duration – Not used in this function.

  • acq_channel – The acq_channel from which to get the data.

Returns

  • count – A list of integers indicating the amount of triggers counted.

  • occurence – For BinMode.AVERAGE a list of integers with the occurence of each trigger count, for BinMode.APPEND a list of 1’s.

static _channel_index_to_channel_name(acq_channel: int) str[source]

Returns the name of the acquisition from the acq_channel.

classmethod _get_bin_data(acquisitions: dict, acq_channel: int = 0) dict[source]

Returns the bin entry of the acquisition data dict.

ClusterModule[source]

Type that combines all the possible modules for a cluster.

class ClusterComponent(instrument: qblox_instruments.Cluster, **kwargs)[source]

Bases: quantify_scheduler.instrument_coordinator.components.base.InstrumentCoordinatorComponentBase

Class that represents an instrument coordinator component for a Qblox cluster.

Create a new instance of the ClusterComponent. Automatically adds installed modules using name “<cluster_name>_module<slot>”.

Parameters
  • instrument – Reference to the cluster driver object.

  • **kwargs – Keyword arguments passed to the parent class.

property is_running: bool[source]

Returns true if any of the modules are currently running.

start() None[source]

Starts all the modules in the cluster.

stop() None[source]

Stops all the modules in the cluster.

_configure_cmm_settings(settings: Dict[str, Any])[source]

Sets all the settings of the CMM (Cluster Management Module) that have been provided by the backend.

Parameters

settings – A dictionary containing all the settings to set.

prepare(options: Dict[str, dict]) None[source]

Prepares the cluster component for execution of a schedule.

Parameters

options – The compiled instructions to configure the cluster to.

retrieve_acquisition() Optional[Dict[Tuple[int, int], Any]][source]

Retrieves all the data from the instruments.

Returns

The acquired data or None if no acquisitions have been performed.

wait_done(timeout_sec: int = 10) None[source]

Blocks until all the components are done executing their programs.

Parameters

timeout_sec – The time in seconds until the instrument is considered to have timed out.