Generic native interface functions#

The native interface generic_func module contains the bulk of the functional code for the native interfaces of the Cluster so that this code can be reused between instruments. The functions can be parametrized using the FuncRefs class that contains references to functions of the native interfaces parent class.

class qblox_instruments.native.generic_func.StateEnum(value)[source]#

Bases: Enum

State enum base class that arranges child enum string representations.

class qblox_instruments.native.generic_func.DeprecatedStateEnum(value)[source]#

Bases: StateEnum

State enum class that throws deprecation warning.

__init__(_warning_message)[source]#
class qblox_instruments.native.generic_func.StateTuple(_warning_message)[source]#

Bases: object

State tuple base class that arranges child tuple string representations.

__init__(_warning_message)[source]#
class qblox_instruments.native.generic_func.SystemStatusTuple[source]#

Bases: object

System Status tuple base class that arranges child tuple string representations.

class qblox_instruments.native.generic_func.StatusTuple[source]#

Bases: object

Status tuple base class that arranges child tuple string representations.

class qblox_instruments.native.generic_func.SystemStatusOld(value)[source]#

Bases: DeprecatedStateEnum

System status enum.

BOOTING = 'System is booting.'#
OKAY = 'System is okay.'#
RESOLVED = 'An error indicated by the flags occured, but has been resolved.'#
ERROR = 'An error indicated by the flags is occuring.'#
CRIT_ERROR = 'A critical error indicated by the flags is occurring'#
__init__(*args)[source]#
class qblox_instruments.native.generic_func.SystemStatuses(value)[source]#

Bases: StateEnum

System status enum.

BOOTING = 'System is booting.'#
OKAY = 'System is okay.'#
RESOLVED = 'An error indicated by the flags occured, but has been resolved.'#
ERROR = 'An error indicated by the flags is occuring.'#
CRIT_ERROR = 'A critical error indicated by the flags is occurring'#
class qblox_instruments.native.generic_func.SystemStatusFlags(value)[source]#

Bases: StateEnum

System status flags enum.

PLL_UNLOCKED = 'PLL is unlocked.'#
TEMPERATURE_OUT_OF_RANGE = 'Temperature is out of range.'#
CRIT_TEMPERATURE_OUT_OF_RANGE = 'Temperature is critically out of range.'#
MODULE_NOT_CONNECTED = 'Module is not connected.'#
MODULE_FIRMWARE_INCOMPATIBLE = 'Module firmware is incompatible with the rest of the system.'#
MODULE_FF_CALIB_FAILED = 'The feedback network calibration failed.'#
HARDWARE_COMPONENT_FAILED = 'Hardware component failed'#
TRIGGER_NETWORK_MISSED_EXT_TRIGGER = 'Trigger Network Missed External Trigger.'#
class qblox_instruments.native.generic_func.SystemStatusSlotFlags(slot_flags: Dict = {})[source]#

Bases: SystemStatusSlotFlags

Tuple containing lists of Cluster slot status flag enums of type SystemStatusFlags. Each Cluster slot has its own status flag list attribute named slot<X>.

class qblox_instruments.native.generic_func.SystemState(status, flags, slot_flags)[source]#

Bases: SystemState, StateTuple

System status tuple returned by get_system_state(). The tuple contains a system status enum of type SystemStatusOld, a list of associated system status flag enums of type SystemStatusFlags and a tuple of type SystemStatusSlotFlags containing Cluster slot status flags.

__init__(*args)[source]#
class qblox_instruments.native.generic_func.SystemStatus(status, flags, slot_flags)[source]#

Bases: SystemStatus, SystemStatusTuple

System status tuple returned by get_system_status(). The tuple contains a system status enum of type SystemStatuses, a list of associated system status flag enums of type SystemStatusFlags and a tuple of type SystemStatusSlotFlags containing Cluster slot status flags.

class qblox_instruments.native.generic_func.SequencerStatusOld(value)[source]#

Bases: DeprecatedStateEnum

Sequencer status enum.

IDLE = 'Sequencer waiting to be armed and started.'#
ARMED = 'Sequencer is armed and ready to start.'#
RUNNING = 'Sequencer is running.'#
Q1_STOPPED = 'Classical part of the sequencer has stopped; waiting for real-time part to stop.'#
STOPPED = 'Sequencer has completely stopped.'#
__init__(*args)[source]#
class qblox_instruments.native.generic_func.SequencerStates(value)[source]#

Bases: StateEnum

Sequencer state enum.

IDLE = 'Sequencer waiting to be armed and started.'#
ARMED = 'Sequencer is armed and ready to start.'#
RUNNING = 'Sequencer is running.'#
Q1_STOPPED = 'Classical part of the sequencer has stopped; waiting for real-time part to stop.'#
STOPPED = 'Sequencer has completely stopped.'#
class qblox_instruments.native.generic_func.SequencerStatuses(value)[source]#

Bases: StateEnum

Sequencer status enum.

OKAY = 'OKAY'#
WARNING = 'WARNING'#
ERROR = 'ERROR'#
class qblox_instruments.native.generic_func.SequencerStatusFlags(value)[source]#

Bases: StateEnum

Sequencer status flags enum.

DISARMED = 'Sequencer was disarmed.'#
FORCED_STOP = 'Sequencer was stopped while still running.'#
SEQUENCE_PROCESSOR_Q1_ILLEGAL_INSTRUCTION = 'Classical sequencer part executed an unknown instruction.'#
SEQUENCE_PROCESSOR_RT_EXEC_ILLEGAL_INSTRUCTION = 'Real-time sequencer part executed an unknown instruction.'#
SEQUENCE_PROCESSOR_RT_EXEC_COMMAND_UNDERFLOW = 'Real-time sequencer part command queue underflow.'#
AWG_WAVE_PLAYBACK_INDEX_INVALID_PATH_0 = 'AWG path 0 tried to play an unknown waveform.'#
AWG_WAVE_PLAYBACK_INDEX_INVALID_PATH_1 = 'AWG path 1 tried to play an unknown waveform.'#
ACQ_WEIGHT_PLAYBACK_INDEX_INVALID_PATH_0 = 'Acquisition path 0 tried to play an unknown weight.'#
ACQ_WEIGHT_PLAYBACK_INDEX_INVALID_PATH_1 = 'Acquisition path 1 tried to play an unknown weight.'#
ACQ_SCOPE_DONE_PATH_0 = 'Scope acquisition for path 0 has finished.'#
ACQ_SCOPE_OUT_OF_RANGE_PATH_0 = 'Scope acquisition data for path 0 was out-of-range.'#
ACQ_SCOPE_OVERWRITTEN_PATH_0 = 'Scope acquisition data for path 0 was overwritten.'#
ACQ_SCOPE_DONE_PATH_1 = 'Scope acquisition for path 1 has finished.'#
ACQ_SCOPE_OUT_OF_RANGE_PATH_1 = 'Scope acquisition data for path 1 was out-of-range.'#
ACQ_SCOPE_OVERWRITTEN_PATH_1 = 'Scope acquisition data for path 1 was overwritten.'#
ACQ_BINNING_DONE = 'Acquisition binning completed.'#
ACQ_BINNING_FIFO_ERROR = 'Acqusition binning encountered internal FIFO error.'#
ACQ_BINNING_COMM_ERROR = 'Acqusition binning encountered internal communication error.'#
ACQ_BINNING_OUT_OF_RANGE = 'Acquisition binning data out-of-range.'#
ACQ_INDEX_INVALID = 'Acquisition tried to process an invalid acquisition.'#
ACQ_BIN_INDEX_INVALID = 'Acquisition tried to process an invalid bin.'#
TRIGGER_NETWORK_CONFLICT = 'Trigger network has encountered a conflict.'#
TRIGGER_NETWORK_MISSED_INTERNAL_TRIGGER = 'Trigger network missed an internal trigger.'#
OUTPUT_OVERFLOW = 'Output overflow.'#
CLOCK_INSTABILITY = 'Clock source instability occurred.'#
ACQ_INTEGRATOR_OUT_OF_RANGE_PATH_0 = 'Acquisition integration input data for path 0 was out-of-range.'#
ACQ_INTEGRATOR_OUT_OF_RANGE_PATH_1 = 'Acquisition integration input data for path 1 was out-of-range.'#
DIO_COMMAND_OVERFLOW = 'DIO_COMMAND_OVERFLOW'#
DIO_DELAY_OUT_OF_ORDER = 'DIO_DELAY_OUT_OF_ORDER'#
DIO_UNSUPPORTED_PULSE_WIDTH = 'DIO_UNSUPPORTED_PULSE_WIDTH'#
DIO_TIMETAG_DEADLINE_MISSED = 'DIO_TIMETAG_DEADLINE_MISSED'#
DIO_TIME_DELTA_INVALID = 'DIO_TIME_DELTA_INVALID'#
DIO_COUNT_INVALID = 'DIO_COUNT_INVALID'#
DIO_THRESHOLD_INVALID = 'DIO_THRESHOLD_INVALID'#
DIO_INTERNAL_ERROR = 'DIO_INTERNAL_ERROR'#
class qblox_instruments.native.generic_func.SequencerState(status, flags)[source]#

Bases: SequencerState, StateTuple

Sequencer state tuple returned by get_sequencer_state(). The tuple contains a sequencer state enum of type SequencerStatusOld and a list of associated sequencer status flag enums of type SequencerStatusFlags.

__init__(*args)[source]#
class qblox_instruments.native.generic_func.SequencerStatus(status, state, info_flags, warn_flags, err_flags, log)[source]#

Bases: SequencerStatus, StatusTuple

Sequencer status tuple returned by get_sequencer_status(). The tuple contains a sequencer status, state, flags and log. The tuple contains: a sequencer status enum of type SequencerStatuses, a sequencer state enum of type SequencerStates, a list of associated info flags enums of type SequencerStatusFlags, a list of associated warning flags enums of type SequencerStatusFlags, a list of associated error flags enums of type SequencerStatusFlags, a list of informative log message of type str.

class qblox_instruments.native.generic_func.FuncRefs(instrument: Any | None = None)[source]#

Bases: object

Function reference container intended to hold references to methods of the instrument’s SCPI and native interfaces that are called by methods in generic_func. In effect, this class enables passing parametrized methods to the generic_func functions so that those functions can be reused between different instruments.

__init__(instrument: Any | None = None)[source]#

Create function reference container.

Parameters:

instrument (Any) – Instrument parent object of the function references.

property instrument: Any#

Return function references parent object.

Returns:

Instrument parent object of the function references.

Return type:

Any

property funcs: Dict#

Return dictionary of instrument function names and their associate references, referenced in this module’s functions so that the referenced functions can be registered to this object using the register method.

Returns:

Dictionary of required instrument function names and associated references.

Return type:

dict

register(ref: Callable[[Any], Any], attr_name: str | None = None) None[source]#

Register function reference as attribute to object.

Parameters:
  • ref (Callable[[Any], Any]) – Function reference to register.

  • attr_name (Optional[str]) – Attribute name to register function to. If attribute name is not provided. The function is registered to the name of the reference argument.

Raises:
  • AttributeError – Could not get name of reference.

  • KeyError – Attribute name is not found in function name list.

qblox_instruments.native.generic_func.check_sequencer_index(sequencer: int) None[source]#

Check if sequencer index is within range. We just check if the index is a positive integer here, because sending a negative number breaks the underlying SCPI command. The upperbound is checked by the instrument.

Parameters:

sequencer (int) – Sequencer index.

Raises:

ValueError – Sequencer index is out-of-range (i.e. < 1).

qblox_instruments.native.generic_func.check_io_channel_index(io_channel: int) None[source]#

Check if I/O channel index is within range. We just check if the index is a positive integer here, because sending a negative number breaks the underlying SCPI command. The upperbound is checked by the instrument.

Parameters:

io_channel (int) – I/O channel index.

Raises:

ValueError – I/O channel index is out-of-range (i.e. < 1).

qblox_instruments.native.generic_func.check_qrm_type(is_qrm_type: bool) None[source]#

Check if module is of type QRM. If not throw a NotImplemented exception. This helper function can be used to catch execution of QRM functionality on non-QRM type modules.

Parameters:

is_qrm_type (bool) – Is QRM module type.

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.check_qcm_type(is_qcm_type: bool) None[source]#

Check if module is of type QCM. If not throw a NotImplemented exception. This helper function can be used to catch execution of QCM functionality on non-QCM type modules.

Parameters:

is_qcm_type (bool) – Is QCM module type.

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.check_qtm_type(is_qtm_type: bool) None[source]#

Check if module is of type QTM. If not throw a NotImplemented exception. This helper function can be used to catch execution of QTM functionality on non-QTM type modules.

Parameters:

is_qtm_type (bool) – Is QTM module type.

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.check_qdm_type(is_qdm_type: bool) None[source]#

Check if module is of type QDM. If not throw a NotImplemented exception. This helper function can be used to catch execution of QDM functionality on non-QDM type modules.

Parameters:

is_qdm_type (bool) – Is QDM module type.

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.check_is_valid_type(is_type: bool) None[source]#

Check if module type is valid. If not throw a NotImplemented exception. This helper function can be used to catch execution of QXM functionality that is not implemented.

Parameters:

is_type (bool) – Is module type.

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.create_read_bin(read_bin_func: Callable[[str, bool], bytes], cmd: str) Callable[[int | None, str | None], bytes][source]#

Create binary read function that can provide a binary read with a preconfigured command. This is usefull for functions like _get_awg_waveforms, that need a specific binary read command to kick off a stream of binary blocks.

Parameters:
  • read_bin_func (Callable[[str, bool], bytes]) – SCPI layer binary read method.

  • cmd (str) – Unformated command string.

Returns:

Binary read function with preconfigured command that takes the optional sequencer index and optional name string as arguments.

Return type:

Callable[[Optional[int], Optional[str]], bytes]

qblox_instruments.native.generic_func.get_scpi_commands(funcs: FuncRefs) Dict[source]#

Get SCPI commands and convert to dictionary.

Returns:

Dictionary containing all available SCPI commands, corresponding parameters, arguments and Python methods and finally a descriptive comment.

Return type:

dict

qblox_instruments.native.generic_func.get_idn(funcs: FuncRefs) Dict[source]#

Get device identity and build information and convert them to a dictionary.

Returns:

Dictionary containing manufacturer, model, serial number and build information. The build information is subdivided into FPGA firmware, kernel module software, application software and driver software build information. Each of those consist of the version, build date, build Git hash and Git build dirty indication.

Return type:

dict

qblox_instruments.native.generic_func.get_system_state(funcs: FuncRefs) SystemState[source]#

Get general system state and convert it to a SystemState.

Returns:

Tuple containing general system status and corresponding flags.

Return type:

SystemStatus

qblox_instruments.native.generic_func.get_system_status(funcs: FuncRefs) SystemStatus[source]#

Get general system status and convert it to a SystemStatus.

Returns:

Tuple containing general system status and corresponding flags.

Return type:

SystemStatus

qblox_instruments.native.generic_func.set_acq_scope_config(funcs: FuncRefs, config: Dict) None[source]#

Set configuration of the scope acquisition. The configuration consists of multiple parameters in a C struct format. If an invalid sequencer index is given or the configation struct does not have the correct format, an error is set in system error.

Parameters:

config (dict) – Configuration dictionary.

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.get_acq_scope_config(funcs: FuncRefs) Dict[source]#

Get configuration of the scope acquisition. The configuration consists of multiple parameters in a C struct format. If an invalid sequencer index is given, an error is set in system error.

Returns:

Configuration dictionary.

Return type:

dict

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.set_acq_scope_config_val(funcs: FuncRefs, keys: Any, val: Any) None[source]#

Set value of specific scope acquisition parameter.

Parameters:
  • keys (Union[List[str], str]) – Configuration key to access, or hierarchical list thereof

  • val (Any) – Value to set parameter to.

qblox_instruments.native.generic_func.get_acq_scope_config_val(funcs: FuncRefs, keys: Any) Any[source]#

Get value of specific scope acquisition parameter.

Parameters:

keys (Union[List[str], str]) – Configuration key to access, or hierarchical list thereof

Returns:

Parameter value.

Return type:

Any

qblox_instruments.native.generic_func.set_io_channel_config(funcs: FuncRefs, channel: int, config: Dict) None[source]#

Set IO channel configuration. The configuration consists of multiple parameters in a JSON format. If the configation struct does not have the correct format, an error is set in system error.

Parameters:
  • channel (int) – I/O channel index.

  • config (dict) – Configuration dictionary.

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.get_io_channel_config(funcs: FuncRefs, channel: int) Dict[source]#

Get IO channel configuration. The configuration consists of multiple parameters in a JSON format.

Parameters:

channel (int) – I/O channel index.

Returns:

Configuration dictionary.

Return type:

dict

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.set_io_channel_config_val(funcs: FuncRefs, channel: int, keys: Any, val: Any) None[source]#

Set value of specific IO channel configuration parameter.

Parameters:
  • keys (Union[List[str], str]) – Configuration key to access, or hierarchical list thereof.

  • channel (int) – I/O channel index.

  • val (Any) – Value to set parameter to.

qblox_instruments.native.generic_func.get_io_channel_config_val(funcs: FuncRefs, channel: int, keys: Any) Any[source]#

Get value of specific IO channel configuration parameter.

Parameters:
  • channel (int) – I/O channel index.

  • keys (Union[List[str], str]) – Configuration key to access, or hierarchical list thereof

Returns:

Parameter value.

Return type:

Any

qblox_instruments.native.generic_func.get_io_channel_status(funcs: FuncRefs, channel: int) Dict[source]#

Get IO channel status. The status consists of multiple values in a JSON format.

Parameters:

channel (int) – I/O channel index.

Returns:

Status dictionary.

Return type:

dict

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.get_io_channel_status_val(funcs: FuncRefs, channel: int, keys: Any) Any[source]#

Get value of specific IO channel status parameter.

Parameters:
  • channel (int) – I/O channel index.

  • keys (Union[List[str], str]) – Status key to access, or hierarchical list thereof

Returns:

Parameter value.

Return type:

Any

qblox_instruments.native.generic_func.set_quad_config(funcs: FuncRefs, quad: int, config: Dict) None[source]#

Set quad configuration. The configuration consists of multiple parameters in a JSON format. If the configation struct does not have the correct format, an error is set in system error.

Parameters:
  • quad (int) – I/O quad index.

  • config (dict) – Configuration dictionary.

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.get_quad_config(funcs: FuncRefs, quad: int) Dict[source]#

Get quad configuration. The configuration consists of multiple parameters in a JSON format.

Parameters:

quad (int) – I/O quad index.

Returns:

Configuration dictionary.

Return type:

dict

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.set_quad_config_val(funcs: FuncRefs, quad: int, keys: Any, val: Any) None[source]#

Set value of specific quad configuration parameter.

Parameters:
  • quad (int) – I/O quad index.

  • keys (Union[List[str], str]) – Configuration key to access, or hierarchical list thereof

  • val (Any) – Value to set parameter to.

qblox_instruments.native.generic_func.get_quad_config_val(funcs: FuncRefs, quad: int, keys: Any) Any[source]#

Get value of specific quad configuration parameter.

Parameters:
  • quad (int) – I/O quad index.

  • keys (Union[List[str], str]) – Configuration key to access, or hierarchical list thereof

Returns:

Parameter value.

Return type:

Any

qblox_instruments.native.generic_func.set_sequencer_program(funcs: FuncRefs, sequencer: int, program: str) None[source]#

Assemble and set Q1ASM program for the indexed sequencer. If assembling failes, an RuntimeError is thrown with the assembler log attached.

Parameters:
  • sequencer (int) – Sequencer index.

  • program (str) – Q1ASM program.

Raises:

RuntimeError – Assembly failed.

qblox_instruments.native.generic_func.set_sequencer_config(funcs: FuncRefs, sequencer: int, config: Dict) None[source]#

Set configuration of the indexed sequencer. The configuration consists dictionary containing multiple parameters that will be converted into a JSON object supported by the device.

Parameters:
  • sequencer (int) – Sequencer index.

  • config (dict) – Configuration dictionary.

qblox_instruments.native.generic_func.get_sequencer_config(funcs: FuncRefs, sequencer: int) Dict[source]#

Get configuration of the indexed sequencer. The configuration consists dictionary containing multiple parameters that will be converted from a JSON object provided by the device.

Parameters:

sequencer (int) – Sequencer index.

Returns:

Configuration dictionary.

Return type:

dict

qblox_instruments.native.generic_func.set_sequencer_config_val(funcs: FuncRefs, sequencer: int, keys: Any, val: Any) None[source]#

Set value of specific sequencer parameter.

Parameters:
  • sequencer (int) – Sequencer index.

  • keys (Union[List[str], str]) – Configuration key to access, or hierarchical list thereof

  • val (Any) – Value to set parameter to.

qblox_instruments.native.generic_func.get_sequencer_config_val(funcs: FuncRefs, sequencer: int, keys: Any) Any[source]#

Get value of specific sequencer parameter.

Parameters:
  • sequencer (int) – Sequencer index.

  • keys (Union[List[str], str]) – Configuration key to access, or hierarchical list thereof

Returns:

Parameter value.

Return type:

Any

qblox_instruments.native.generic_func.get_output_latency(funcs: FuncRefs, output: int) float[source]#

Get the latency in output path. The output path can change depending on ” “the filter configuration of the output.”

Parameters:

output (int) – The output for which the latency should be returned.

Returns:

latency – Latency of the output path.

Return type:

float

qblox_instruments.native.generic_func.set_pre_distortion_config(funcs: FuncRefs, config: Dict) None[source]#

Set pre distortion configuration. The configuration consists dictionary containing multiple parameters that will be converted into a JSON object.

Parameters:
  • sequencer (int) – Sequencer index.

  • config (dict) – Configuration dictionary.

qblox_instruments.native.generic_func.get_pre_distortion_config(funcs: FuncRefs) Dict[source]#

Get pre-distortion configuration. The configuration consists dictionary containing multiple parameters that will be converted from a JSON object.

Returns:

Configuration dictionary.

Return type:

dict

qblox_instruments.native.generic_func.set_pre_distortion_config_val(funcs: FuncRefs, keys: Any, val: Any) None[source]#

Set value of specific pre-distortion filtering parameter.

Parameters:
  • keys (Union[List[str], str]) – Configuration key to access, or hierarchical list thereof

  • val (Any) – Value to set parameter to.

qblox_instruments.native.generic_func.get_pre_distortion_config_val(funcs: FuncRefs, keys: Any) Any[source]#

Get value of specific pre-distortion filtering parameter.

Parameters:

keys (Union[List[str], str]) – Configuration key to access, or hierarchical list thereof

Returns:

Parameter value.

Return type:

Any

qblox_instruments.native.generic_func.set_sequencer_config_rotation_matrix(funcs: FuncRefs, sequencer: int, phase_incr: float) None[source]#

Sets the integration result phase rotation matrix in the acquisition path.

Parameters:
  • sequencer (int) – Sequencer index.

  • phase_incr (float) – Phase increment in degrees.

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.get_sequencer_config_rotation_matrix(funcs: FuncRefs, sequencer: int) float[source]#

Gets the integration result phase rotation matrix in the acquisition path.

Parameters:

sequencer (int) – Sequencer index.

Returns:

Phase increment in degrees.

Return type:

float

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.set_sequencer_connect_out(funcs: FuncRefs, sequencer: int, output: int, state: str | bool) None[source]#

Set whether the output of the indexed sequencer is connected to the given output and if so with which path.

Parameters:
  • sequencer (int) – Sequencer index.

  • output (int) – Zero-based output index.

  • state (str | bool) –

    • For baseband modules, one of:
      • ”off”: the output is not connected.

      • ”I”: the output is connected to path0/I.

      • ”Q”: the output is connected to path1/Q.

    • For RF modules, one of:
      • ”off” or False: the RF output is not connected.

      • ”IQ” or True: the RF output is connected.

qblox_instruments.native.generic_func.get_sequencer_connect_out(funcs: FuncRefs, sequencer: int, output: int) str[source]#

Returns whether the output of the indexed sequencer is connected to the given output and if so with which path.

Parameters:
  • sequencer (int) – Sequencer index.

  • output (int) – Zero-based output index.

Returns:

  • For baseband modules, one of:
    • ”off”: the output is not connected.

    • ”I”: the output is connected to path0/I.

    • ”Q”: the output is connected to path1/Q.

  • For RF modules, one of:
    • ”off”: the RF output is not connected.

    • ”IQ”: the RF output is connected.

Return type:

str

qblox_instruments.native.generic_func.set_sequencer_connect_acq(funcs: FuncRefs, sequencer: int, path: int, state: str | bool) None[source]#

Set whether the input of the indexed sequencer’s acquisition path is connected to an external input and if so which.

Parameters:
  • sequencer (int) – Sequencer index.

  • path (int) – Path index: 0 for baseband path0/I, 1 for baseband path1/Q, ignored for RF.

  • state (str | bool) –

    • One of:
      • ”off” or False: connection disabled.

      • ”in#”: the acquisition input path is connected to external input #, where # is a zero-based input index.

      • True: if there is only one option other than off, True is allowed as alias.

qblox_instruments.native.generic_func.get_sequencer_connect_acq(funcs: FuncRefs, sequencer: int, path: int) str[source]#

Get whether the input of the indexed sequencer’s acquisition path is connected to an external input and if so which.

Parameters:
  • sequencer (int) – Sequencer index.

  • path (int) – Path index: 0 for baseband path0/I, 1 for baseband path1/Q, ignored for RF.

Returns:

-One of:
  • ”off”: connection disabled.

  • ”in#”: the acquisition input path is connected to external input #, where # is a zero-based input index.

Return type:

str

qblox_instruments.native.generic_func.disconnect_outputs(funcs: FuncRefs) None[source]#

Disconnects all outputs from the sequencers.

qblox_instruments.native.generic_func.disconnect_inputs(funcs: FuncRefs) None[source]#

Disconnects all inputs from the sequencers.

qblox_instruments.native.generic_func.iter_connections(funcs: FuncRefs) Iterator[Tuple[int, str, str]][source]#

Iterates over all enabled connections between ADCs, DACs, and sequencers.

Returns:

An iterator of connections. The four components of each connection are:

  • the index of the sequencer for the connection;

  • the connection point of the sequencer being connected to, being one of I, Q, acq_I, or acq_Q;

  • the external connection, being either adc# or dac#, where # is the zero-based ADC or DAC index.

Note that these are ADC and DAC indices. For baseband modules, these indices map one-to-one to the external SMA ports, but for RF modules they don’t: each pair of DACs or ADCs maps to a single RF port, the I component being generated by ADC/DAC index 0/2/… and the Q component being generated by ADC/DAC index 1/3/…

Return type:

Iterator[tuple[int, str, str]]

qblox_instruments.native.generic_func.sequencer_connect(funcs: FuncRefs, sequencer: int, *connections: str) None[source]#

Makes new connections between the indexed sequencer and some inputs and/or outputs. This will fail if a requested connection already existed, or if the connection could not be made due to a conflict with an existing connection (hardware constraints). In such a case, the channel map will not be affected.

Parameters:
  • sequencer (int) – Sequencer index.

  • *connections (str) – Zero or more connections to make, each specified using a string. The string should have the format <direction><channel> or <direction><I-channel>_<Q-channel>. <direction> must be in to make a connection between an input and the acquisition path, out to make a connection from the waveform generator to an output, or io to do both. The channels must be integer channel indices. If only one channel is specified, the sequencer operates in real mode; if two channels are specified, it operates in complex mode.

Raises:
  • RuntimeError – If the connection command could not be completed due to a conflict.

  • ValueError – If parsing of a connection fails.

qblox_instruments.native.generic_func.arm_sequencer(funcs: FuncRefs, scpi_cmd_prefix: str) None[source]#

Prepare the indexed sequencer to start by putting it in the armed state. If no sequencer index is given, all sequencers are armed. Any sequencer that was already running is stopped and rearmed. If an invalid sequencer index is given, an error is set in system error.

Parameters:

sequencer (Optional[int]) – Sequencer index.

Raises:

RuntimeError – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.

qblox_instruments.native.generic_func.start_sequencer(funcs: FuncRefs, scpi_cmd_prefix: str) None[source]#

Start the indexed sequencer, thereby putting it in the running state. If an invalid sequencer index is given or the indexed sequencer was not yet armed, an error is set in system error. If no sequencer index is given, all armed sequencers are started and any sequencer not in the armed state is ignored. However, if no sequencer index is given and no sequencers are armed, and error is set in system error.

Parameters:

sequencer (Optional[int]) – Sequencer index.

Raises:

RuntimeError – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.

qblox_instruments.native.generic_func.stop_sequencer(funcs: FuncRefs, scpi_cmd_prefix: str) None[source]#

Stop the indexed sequencer, thereby putting it in the stopped state. If an invalid sequencer index is given, an error is set in system error. If no sequencer index is given, all sequencers are stopped.

Parameters:

sequencer (Optional[int]) – Sequencer index.

Raises:

RuntimeError – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.

qblox_instruments.native.generic_func.clear_sequencer_flags(funcs: FuncRefs, scpi_cmd_prefix: str) None[source]#

Clear flags

Parameters:

sequencer (int) – Sequencer index.

qblox_instruments.native.generic_func.get_sequencer_state(funcs: FuncRefs, sequencer: int, timeout: int = 0, timeout_poll_res: float = 0.02) SequencerState[source]#

Get the sequencer state. If an invalid sequencer index is given, an error is set in system error. If the timeout is set to zero, the function returns the state immediately. If a positive non-zero timeout is set, the function blocks until the sequencer completes. If the sequencer hasn’t stopped before the timeout expires, a TimeoutError is thrown.

Parameters:
  • sequencer (int) – Sequencer index.

  • timeout (int) – Timeout in minutes.

  • timeout_poll_res (float) – Timeout polling resolution in seconds.

Returns:

Tuple containing sequencer status and corresponding flags.

Return type:

SequencerState

Raises:

TimeoutError – Timeout

qblox_instruments.native.generic_func.get_sequencer_status(funcs: FuncRefs, sequencer: int, timeout: int = 0, timeout_poll_res: float = 0.02) SequencerStatus[source]#

Get the sequencer status. If an invalid sequencer index is given, an error is set in system error. If the timeout is set to zero, the function returns the state immediately. If a positive non-zero timeout is set, the function blocks until the sequencer completes. If the sequencer hasn’t stopped before the timeout expires, a TimeoutError is thrown.

Parameters:
  • sequencer (int) – Sequencer index.

  • timeout (int) – Timeout in minutes.

  • timeout_poll_res (float) – Timeout polling resolution in seconds.

Returns:

Tuple containing sequencer status and corresponding flags.

Return type:

SequencerState

Raises:

TimeoutError – Timeout

qblox_instruments.native.generic_func.arm_scope_trigger(funcs: FuncRefs) None[source]#

Prepare the scope trigger to start by putting it in the armed state. If it was already running, it is stopped and rearmed.

Raises:

RuntimeError – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.

qblox_instruments.native.generic_func.get_acq_acquisition_data(instrument: Any, funcs: FuncRefs, sequencer: int, name: str) Dict[source]#

Get acquisition data of acquisition in acquisition list of indexed sequencer’s acquisition path. The acquisition scope and bin data is normalized to a range of -1.0 to 1.0 taking both the bit widths of the processing path and average count into considaration. For the binned integration results, the integration length is not handled during normalization and therefore these values have to be divided by their respective integration lenghts. If an invalid sequencer index is given or if a non-existing acquisition name is given, an error is set in system error.

Parameters:
  • sequencer (int) – Sequencer index.

  • name (str) – Acquisition name.

Returns:

Dictionary with data of single acquisition.

Return type:

dict

Raises:

RuntimeError – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.

qblox_instruments.native.generic_func.add_waveforms(funcs: FuncRefs, sequencer: int, waveforms: Dict) None[source]#

Add all waveforms in JSON compatible dictionary to the AWG waveform list of indexed sequencer. The dictionary must be structured as follows:

  • name: waveform name.

    • data: waveform samples in a range of 1.0 to -1.0.

    • index: optional waveform index used by the sequencer Q1ASM program to refer to the waveform.

Parameters:
  • sequencer (int) – Sequencer index.

  • waveforms (dict) – JSON compatible dictionary with one or more waveforms and weigths.

Raises:

KeyError – Missing waveform data of waveform in dictionary.

qblox_instruments.native.generic_func.delete_waveform(funcs: FuncRefs, sequencer: int, name: str = '', all: bool = False) None[source]#

Delete a waveform specified by name in the AWG waveform list of indexed sequencer or delete all waveforms if all is True.

Parameters:
  • sequencer (int) – Sequencer index.

  • name (str) – Waveform name

  • all (bool) – All waveforms

qblox_instruments.native.generic_func.get_waveforms(funcs: FuncRefs, sequencer: int) Dict[source]#

Get all waveforms and weigths in the AWG waveform list of indexed sequencer. The returned dictionary is structured as follows:

  • name: waveform name.

    • data: waveform samples in a range of 1.0 to -1.0.

    • index: waveform index used by the sequencer Q1ASM program to refer

      to the waveform.

Parameters:

sequencer (int) – Sequencer index.

Returns:

Dictionary with waveforms.

Return type:

dict

qblox_instruments.native.generic_func.add_weights(funcs: FuncRefs, sequencer: int, weights: Dict) None[source]#

Add all weights in JSON compatible dictionary to the aquisition weight list of indexed sequencer. The dictionary must be structured as follows:

  • name : weight name.

    • data: weight samples in a range of 1.0 to -1.0.

    • index: optional waveweightform index used by the sequencer Q1ASM program to refer to the weight.

Parameters:
  • sequencer (int) – Sequencer index.

  • weights (dict) – JSON compatible dictionary with one or more weigths.

Raises:
qblox_instruments.native.generic_func.delete_weight(funcs: FuncRefs, sequencer: int, name: str = '', all: bool = False) None[source]#

Delete a weight specified by name in the acquisition weight list of indexed sequencer or delete all weights if all is True.

Parameters:
  • sequencer (int) – Sequencer index.

  • name (str) – Weight name

  • all (bool) – All weights

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.get_weights(funcs: FuncRefs, sequencer: int) Dict[source]#

Get all weigths in the acquisition weight lists of indexed sequencer. The returned dictionary is structured as follows:

-name : weight name.

  • data: weight samples in a range of 1.0 to -1.0.

  • index: weight index used by the sequencer Q1ASM program to refer

    to the weight.

Parameters:

sequencer (int) – Sequencer index.

Returns:

Dictionary with weights.

Return type:

dict

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.get_acquisition_state(funcs: FuncRefs, sequencer: int, timeout: int = 0, timeout_poll_res: float = 0.02, check_seq_state: bool = True) bool[source]#

Return acquisition binning completion state of the indexed sequencer. If an invalid sequencer is given, an error is set in system error. If the timeout is set to zero, the function returns the state immediately. If a positive non-zero timeout is set, the function blocks until the acquisition binning completes. If the acquisition hasn’t completed before the timeout expires, a TimeoutError is thrown. Note that when sequencer state checking is enabled, the sequencer state is checked using get_sequencer_state with the selected timeout period first and then the acquisition state is checked with the same timeout period. This means that the total timeout period is two times the set timeout period.

Parameters:
  • sequencer (int) – Sequencer index.

  • timeout (int) – Timeout in minutes.

  • timeout_poll_res (float) – Timeout polling resolution in seconds.

  • check_seq_state (bool) – Check if sequencer is done before checking acquisition state.

Returns:

Indicates the acquisition binning completion state (False = uncompleted, True = completed).

Return type:

bool

Raises:
qblox_instruments.native.generic_func.get_acquisition_status(funcs: FuncRefs, sequencer: int, timeout: int = 0, timeout_poll_res: float = 0.02, check_seq_state: bool = True) bool[source]#

Return acquisition binning completion status of the indexed sequencer. If an invalid sequencer is given, an error is set in system error. If the timeout is set to zero, the function returns the status immediately. If a positive non-zero timeout is set, the function blocks until the acquisition binning completes. If the acquisition hasn’t completed before the timeout expires, a TimeoutError is thrown. Note that when sequencer state checking is enabled, the sequencer state is checked using get_sequencer_status with the selected timeout period first and then the acquisition status is checked with the same timeout period. This means that the total timeout period is two times the set timeout period.

Parameters:
  • sequencer (int) – Sequencer index.

  • timeout (int) – Timeout in minutes.

  • timeout_poll_res (float) – Timeout polling resolution in seconds.

  • check_seq_state (bool) – Check if sequencer is done before checking acquisition status.

Returns:

Indicates the acquisition binning completion status (False = uncompleted, True = completed).

Return type:

bool

Raises:
qblox_instruments.native.generic_func.add_acquisitions(funcs: FuncRefs, sequencer: int, acquisitions: Dict) None[source]#

Add all waveforms and weights in JSON compatible dictionary to AWG waveform and aquisition weight lists of indexed sequencer. The dictionary must be structured as follows:

  • name: acquisition name.
    • num_bins: number of bins in acquisition.

    • index: optional acquisition index used by the sequencer Q1ASM program to refer to the acquition.

Parameters:
  • sequencer (int) – Sequencer index.

  • acquisitions (dict) – JSON compatible dictionary with one or more acquisitions.

Raises:
qblox_instruments.native.generic_func.delete_acquisition(funcs: FuncRefs, sequencer: int, name: str = '', all: bool = False) None[source]#

Delete an acquisition specified by name in the acquisition list of indexed sequencer or delete all acquisitions if all is True.

Parameters:
  • sequencer (int) – Sequencer index.

  • name (str) – Weight name

  • all (bool) – All weights

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.delete_acquisition_data(funcs: FuncRefs, sequencer: int, name: str = '', all: bool = False) None[source]#

Delete data from an acquisition specified by name in the acquisition list of indexed sequencer or delete data in all acquisitions if all is True.

Parameters:
  • sequencer (int) – Sequencer index.

  • name (str) – Weight name

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.store_scope_acquisition(funcs: FuncRefs, sequencer: int, name: str) None[source]#

After an acquisition has completed, store the scope acquisition results in the acquisition specified by name of the indexed sequencers. If an invalid sequencer index is given an error is set in system error. To get access to the acquisition results, the sequencer will be stopped when calling this function.

Parameters:
  • sequencer (int) – Sequencer index.

  • name (str) – Acquisition name.

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.get_acquisitions(funcs: FuncRefs, sequencer: int) Dict[source]#

Get all acquisitions in acquisition lists of indexed sequencer. The acquisition scope and bin data is normalized to a range of -1.0 to 1.0 taking both the bit widths of the processing path and average count into considaration. For the binned integration results, the integration length is not handled during normalization and therefore these values have to be divided by their respective integration lenghts. The returned dictionary is structured as follows:

  • name: acquisition name

    • index: acquisition index used by the sequencer Q1ASM program to refer to the acquisition.

    • acquisition: acquisition dictionary

      • scope: Scope data

        • path0: input path 0

          • data: acquisition samples in a range of 1.0 to -1.0.

          • out-of-range: out-of-range indication for the entire acquisition (False = in-range, True = out-of-range).

          • avg_cnt: number of averages.

        • path1: input path 1

          • data: acquisition samples in a range of 1.0 to -1.0.

          • out-of-range: out-of-range indication for the entire acquisition (False = in-range, True = out-of-range).

          • avg_cnt: number of averages.

      • bins: bin data

        • integration: integration data

          • path_0: input path 0 integration result bin list

          • path_1: input path 1 integration result bin list

        • threshold: threshold result bin list

        • valid: list of valid indications per bin

        • avg_cnt: list of number of averages per bin

Parameters:

sequencer (int) – Sequencer index.

Returns:

Dictionary with acquisitions.

Return type:

dict

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.scope_trigger_arm(funcs: FuncRefs) Dict[source]#

Arms the external scope trigger logic on a QTM, such that it will send a trigger to scope acquisition blocks in the I/O channels when the trigger condition is satisfied.

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.get_scope_data(funcs: FuncRefs, io_channel: int) Dict[source]#

Returns the QTM I/O channel scope data for the given slot and channel acquired since the previous call.

Parameters:

io_channel (int) – I/O channel you want to get the data for.

Returns:

The acquired data. Empty if no data acquired since last call.

Return type:

list

Raises:

NotImplementedError – Functionality not available on this module.

qblox_instruments.native.generic_func.set_sequence(funcs: FuncRefs, sequencer: int, sequence: str | Dict[str, Any], validation_enable: bool = True) None[source]#

Set sequencer program, AWG waveforms, acquisition weights and acquisitions from a JSON file or from a dictionary directly. The JSON file or dictionary need to apply the schema specified by QCM_SEQUENCE_JSON_SCHEMA, QRM_SEQUENCE_JSON_SCHEMA, WAVE_JSON_SCHEMA and ACQ_JSON_SCHEMA.

Parameters:
  • sequencer (int) – Sequencer index.

  • sequence (Union[str, Dict[str, Any]]) – Path to sequence file or dictionary.

  • validation_enable (bool) – Enable JSON schema validation on sequence.

Raises:

JsonSchemaValueException – Invalid JSON object.