zhinst#

Python dataclasses for quantify-scheduler json-schemas.

Module Contents#

Classes#

DeviceType

Enum of device types.

ModulationModeType

The modulation mode enum type.

SignalModeType

The signal output enum type.

ReferenceSourceType

The reference source enum type.

InstrumentOperationMode

The InstrumentOperationMode enum defines in what operational mode an instrument is

Modulation

The backend Modulation record type.

LocalOscillator

The backend LocalOscillator record type.

Output

The definition class for zhinst channel properties.

Device

The device definition class for zhinst devices.

CommandTableHeader

The CommandTable header definition.

CommandTableEntryValue

A CommandTable entry definition with a value.

CommandTableWaveform

The command table waveform properties.

CommandTableEntry

The definition of a single CommandTable entry.

CommandTable

The CommandTable definition for ZI HDAWG.

QasIntegrationMode

Operation mode of all weighted integration units.

QasResultMode

UHFQA QAS result mode.

QasResultSource

UHFQA QAS result source.

WaveformDestination

The waveform destination enum type.

InstrumentInfo

Instrument information record type.

Instruction

Sequence base instruction record type.

Acquisition

This instruction indicates that an acquisition is to be triggered in the UHFQA.

Wave

This instruction indicates that a waveform should be played.

ZIChannelDescription

Information needed to specify a ZI Channel in the ZIHardwareCompilationConfig.

ZIBaseDescription

Base class for a Zurich Instrument hardware description.

ZIHDAWG4Description

Information needed to specify a HDAWG4 in the ZIHardwareCompilationConfig.

ZIHDAWG8Description

Information needed to specify a HDAWG8 in the ZIHardwareCompilationConfig.

ZIUHFQADescription

Information needed to specify a UHFQA in the ZIHardwareCompilationConfig.

OutputGain

Gain settings for a port-clock combination.

ZIHardwareOptions

Datastructure containing the hardware options for each port-clock combination.

Attributes#

ZIHardwareDescription

Specifies a piece of Zurich Instruments hardware and its instrument-specific settings.

class DeviceType[source]#

Bases: str, enum.Enum

Enum of device types.

HDAWG = 'HDAWG'[source]#
UHFQA = 'UHFQA'[source]#
UHFLI = 'UHFLI'[source]#
MFLI = 'MFLI'[source]#
PQSC = 'PQSC'[source]#
NONE = 'none'[source]#
class ModulationModeType[source]#

Bases: str, enum.Enum

The modulation mode enum type.

Used to set the modulation type to

  1. no modulation. (‘none’)

  2. Software premodulation applied in the numerical waveforms. (‘premod’)

  3. Hardware real-time modulation. (‘modulate’)

See also Modulation for the use.

NONE = 'none'[source]#
PREMODULATE = 'premod'[source]#
MODULATE = 'modulate'[source]#
class SignalModeType[source]#

Bases: str, enum.Enum

The signal output enum type.

Used to set the output signal type to a modulated or real respectively.

COMPLEX = 'complex'[source]#
REAL = 'real'[source]#
class ReferenceSourceType[source]#

Bases: str, enum.Enum

The reference source enum type.

Used to set the source trigger type to internal or external respectively.

NONE = 'none'[source]#
INTERNAL = 'int'[source]#
EXTERNAL = 'ext'[source]#
class InstrumentOperationMode[source]#

Bases: str, enum.Enum

The InstrumentOperationMode enum defines in what operational mode an instrument is in.

OPERATING mode sets the Instrument in its default operation mode. CALIBRATING mode sets the Instrument in calibration mode in which for example the numeric pulses generated by a backend for an AWG are set to np.ones.

OPERATING = 'operate'[source]#
CALIBRATING = 'calibrate'[source]#
class Modulation(/, **data: Any)[source]#

Bases: quantify_scheduler.structure.model.DataStructure

The backend Modulation record type.

type: ModulationModeType[source]#

The modulation mode type select. Allows to choose between. (default = ModulationModeType.NONE)

  1. no modulation. (‘none’)

  2. Software premodulation applied in the numerical waveforms. (‘premod’)

  3. Hardware real-time modulation. (‘modulate’)

interm_freq: float = 0.0[source]#

The inter-modulation frequency (IF) in Hz. (default = 0.0).

phase_shift: float = 0.0[source]#

The IQ modulation phase shift in Degrees. (default = 0.0).

class LocalOscillator(/, **data: Any)[source]#

Bases: quantify_scheduler.structure.model.DataStructure

The backend LocalOscillator record type.

unique_name: str[source]#

The unique name identifying the combination of instrument and channel/parameters.

instrument_name: str[source]#

The QCodes name of the LocalOscillator.

generic_icc_name: str | None[source]#

The name of the GenericInstrumentCoordinatorComponent attached to this device.

frequency: dict | None[source]#

A dict which tells the generic icc what parameter maps to the local oscillator (LO) frequency in Hz.

frequency_param: str | None[source]#

The parameter on the LO instrument used to control the frequency.

power: dict | None[source]#

A dict which tells the generic icc what parameter maps to the local oscillator (LO) power in dBm.

phase: dict | None[source]#

A dict which tells the generic icc what parameter maps to the local oscillator (LO) phase in radians.

parameters: dict | None[source]#

A dict which allows setting of channel specific parameters of the device. Cannot be used together with frequency and power.

class Output(/, **data: Any)[source]#

Bases: quantify_scheduler.structure.model.DataStructure

The definition class for zhinst channel properties.

This class maps to the zhinst backend JSON “channel” properties defined in the hardware mapping.

port: str[source]#

The port resource.

clock: str[source]#

The Clock resource.

mode: SignalModeType[source]#

The output mode type.

modulation: Modulation[source]#

The modulation settings.

local_oscillator: str | None[source]#

The LocalOscillator name.

clock_frequency: float | None[source]#

The frequency for the clock resource (AKA RF/signal frequency).

gain1: int = 0[source]#

The output1 IQ modulation gain. Accepted value between -1 and + 1. (default = 1.0)

gain2: int = 0[source]#

The output2 IQ modulation gain. Accepted value between -1 and + 1. (default = 1.0)

trigger: int | None[source]#

The ZI Instrument input trigger. (default = None) Setting this will declare the device secondary.

markers: List[str | int] = [][source]#

The ZI Instrument output triggers. (default = [])

mixer_corrections: quantify_scheduler.backends.types.common.MixerCorrections | None[source]#

The output mixer corrections.

decapitalize_dc_mixer_offsets(v)[source]#

Decapitalize the DC mixer offsets.

This is required because the old-style hardare config used capitalized keys for the DC mixer offsets, while the new-style hardware config uses lower-case keys.

class Device(/, **data: Any)[source]#

Bases: quantify_scheduler.structure.model.DataStructure

The device definition class for zhinst devices.

This class maps to the zhinst backend JSON “devices” properties defined in the hardware mapping.

name: str[source]#

The QCodes Instrument name.

type: str[source]#

The instrument model type. For example, ‘UHFQA’, ‘HDAWG4’, ‘HDAWG8’.

ref: ReferenceSourceType[source]#

The reference source type.

channel_0: Output[source]#

The first physical channel properties.

channel_1: Output | None[source]#

The second physical channel properties.

channel_2: Output | None[source]#

The third physical channel properties.

channel_3: Output | None[source]#

The fourth physical channel properties.

channels: List[Output][source]#

The list of channels. (auto generated)

clock_select: int | None = 0[source]#

The clock rate divisor which will be used to get the instruments clock rate from the lookup dictionary in quantify_scheduler.backends.zhinst_backend.DEVICE_CLOCK_RATES.

For information see zhinst User manuals, section /DEV…./AWGS/n/TIME Examples: base sampling rate (1.8 GHz) divided by 2^clock_select. (default = 0)

channelgrouping: int = 0[source]#

The HDAWG channelgrouping property. (default = 0) corresponding to a single sequencer controlling a pair (2) awg outputs.

mode: InstrumentOperationMode[source]#

The Instruments operation mode. (default = zhinst.InstrumentOperationMode.OPERATING)

device_type: DeviceType[source]#

The Zurich Instruments hardware type. (default = DeviceType.NONE) This field is automatically populated.

sample_rate: int | None[source]#

The Instruments sampling clock rate. This field is automatically populated.

n_channels: int | None[source]#

The number of physical channels of this ZI Instrument. This field is automatically populated.

generate_channel_list(v, info)[source]#

Generate the channel list.

calculate_n_channels(v, info)[source]#

Calculate the number of channels.

determine_device_type(v, info)[source]#

Determine the device type.

class CommandTableHeader(/, **data: Any)[source]#

Bases: quantify_scheduler.structure.model.DataStructure

The CommandTable header definition.

version: str = '0.2'[source]#
partial: bool = False[source]#
class CommandTableEntryValue(/, **data: Any)[source]#

Bases: quantify_scheduler.structure.model.DataStructure

A CommandTable entry definition with a value.

value: int[source]#
class CommandTableWaveform(/, **data: Any)[source]#

Bases: quantify_scheduler.structure.model.DataStructure

The command table waveform properties.

index: int[source]#
length: int[source]#
class CommandTableEntry(/, **data: Any)[source]#

Bases: quantify_scheduler.structure.model.DataStructure

The definition of a single CommandTable entry.

index: int[source]#
waveform: CommandTableWaveform[source]#
class CommandTable(/, **data: Any)[source]#

Bases: quantify_scheduler.structure.model.DataStructure

The CommandTable definition for ZI HDAWG.

header: CommandTableHeader | None[source]#
table: List[CommandTableEntry][source]#
generate_command_table_header(v, values)[source]#

Generates command table header.

class QasIntegrationMode[source]#

Bases: enum.Enum

Operation mode of all weighted integration units.

NORMAL: Normal mode. The integration weights are given by the user-programmed filter memory.

SPECTROSCOPY: Spectroscopy mode. The integration weights are generated by a digital oscillator. This mode offers enhanced frequency resolution.

NORMAL = 0[source]#
SPECTROSCOPY = 1[source]#
class QasResultMode[source]#

Bases: enum.Enum

UHFQA QAS result mode.

CYCLIC = 0[source]#
SEQUENTIAL = 1[source]#
class QasResultSource[source]#

Bases: enum.Enum

UHFQA QAS result source.

CROSSTALK = 0[source]#
THRESHOLD = 1[source]#
ROTATION = 3[source]#
CROSSTALK_CORRELATION = 4[source]#
THRESHOLD_CORRELATION = 5[source]#
INTEGRATION = 7[source]#
class WaveformDestination[source]#

Bases: enum.Enum

The waveform destination enum type.

CSV = 0[source]#
WAVEFORM_TABLE = 1[source]#
class InstrumentInfo[source]#

Instrument information record type.

sample_rate: int[source]#
num_samples_per_clock: int[source]#
granularity: int[source]#
mode: InstrumentOperationMode[source]#
sequencer_rate: float[source]#
class Instruction[source]#

Sequence base instruction record type.

waveform_id: str[source]#
abs_time: float[source]#
clock_cycle_start: int[source]#
duration: float[source]#
static default()[source]#

Returns a default Instruction instance.

Return type:

Instruction

class Acquisition[source]#

Bases: Instruction

This instruction indicates that an acquisition is to be triggered in the UHFQA. If a waveform_id is specified, this waveform will be used as the integration weight.

class Wave[source]#

Bases: Instruction

This instruction indicates that a waveform should be played.

class ZIChannelDescription(/, **data: Any)[source]#

Bases: quantify_scheduler.structure.model.DataStructure

Information needed to specify a ZI Channel in the ZIHardwareCompilationConfig.

A single ‘channel’ represents a complex output, consisting of two physical I/O channels on the Instrument.

mode: Literal[real] | Literal[complex][source]#

The output mode type.

markers: List[str] = [][source]#

Property that specifies which markers to trigger on each sequencer iteration. The values are used as input for the setTrigger sequencer instruction.

trigger: int | None[source]#

The trigger property specifies for a sequencer which digital trigger to wait for. This value is used as the input parameter for the waitDigTrigger sequencer instruction. Setting this will declare the device secondary.

class ZIBaseDescription(/, **data: Any)[source]#

Bases: quantify_scheduler.backends.types.common.HardwareDescription

Base class for a Zurich Instrument hardware description.

ref: Literal[int] | Literal[ext] | Literal[none][source]#

Property that describes if the instrument uses Markers or Triggers. - int Enables sending Marker - ext Enables waiting for Marker - none Ignores waiting for Marker

class ZIHDAWG4Description(/, **data: Any)[source]#

Bases: ZIBaseDescription

Information needed to specify a HDAWG4 in the ZIHardwareCompilationConfig.

instrument_type: Literal[HDAWG4][source]#

The instrument type, used to select this datastructure when parsing a ZIHardwareCompilationConfig.

channelgrouping: int[source]#

The HDAWG channelgrouping property impacting the amount of HDAWG channels per AWG that must be used.. (default = 0) corresponding to a single sequencer controlling a pair (2) awg outputs.

clock_select: int[source]#

The clock rate divisor which will be used to get the instruments clock rate from the lookup dictionary in quantify_scheduler.backends.zhinst_backend.DEVICE_CLOCK_RATES.

For information see zhinst User manuals, section /DEV…./AWGS/n/TIME Examples: base sampling rate (1.8 GHz) divided by 2^clock_select. (default = 0)

channel_0: ZIChannelDescription | None[source]#

Description of the first channel on this HDAWG (corresponding to 1 or 2 physical output ports).

channel_1: ZIChannelDescription | None[source]#

Description of the second channel on this HDAWG (corresponding to 1 or 2 physical output ports).

class ZIHDAWG8Description(/, **data: Any)[source]#

Bases: ZIHDAWG4Description

Information needed to specify a HDAWG8 in the ZIHardwareCompilationConfig.

instrument_type: Literal[HDAWG8][source]#

The instrument type, used to select this datastructure when parsing a ZIHardwareCompilationConfig.

channel_2: ZIChannelDescription | None[source]#

Description of the third channel on this HDAWG (corresponding to 1 or 2 physical output ports).

channel_3: ZIChannelDescription | None[source]#

Description of the fourth channel on this HDAWG (corresponding to 1 or 2 physical output ports).

class ZIUHFQADescription(/, **data: Any)[source]#

Bases: ZIBaseDescription

Information needed to specify a UHFQA in the ZIHardwareCompilationConfig.

instrument_type: Literal[UHFQA][source]#

The instrument type, used to select this datastructure when parsing a ZIHardwareCompilationConfig.

channel_0: ZIChannelDescription | None[source]#

Description of the readout channel on this UHFQA.

ZIHardwareDescription[source]#

Specifies a piece of Zurich Instruments hardware and its instrument-specific settings.

Currently, the supported instrument types are: ZIHDAWG4Description, ZIHDAWG8Description, ZIUHFQADescription

class OutputGain(/, **data: Any)[source]#

Bases: quantify_scheduler.structure.model.DataStructure

Gain settings for a port-clock combination.

These gain values will be set on each control-hardware output port that is used for this port-clock combination.

gain_I: float = 0[source]#

The output 1 IQ modulation gain. Accepted value between -1 and + 1. (default = 1.0).

gain_Q: float = 0[source]#

The output 2 IQ modulation gain. Accepted value between -1 and + 1. (default = 1.0).

class ZIHardwareOptions(/, **data: Any)[source]#

Bases: quantify_scheduler.backends.types.common.HardwareOptions

Datastructure containing the hardware options for each port-clock combination.

output_gain: Dict[str, OutputGain] | None[source]#

Dictionary containing the gain settings (values) that should be applied to the outputs that are connected to a certain port-clock combination (keys).