zhinst ====== .. py:module:: quantify_scheduler.backends.types.zhinst .. autoapi-nested-parse:: Python dataclasses for quantify-scheduler json-schemas. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: quantify_scheduler.backends.types.zhinst.DeviceType quantify_scheduler.backends.types.zhinst.ModulationModeType quantify_scheduler.backends.types.zhinst.SignalModeType quantify_scheduler.backends.types.zhinst.ReferenceSourceType quantify_scheduler.backends.types.zhinst.InstrumentOperationMode quantify_scheduler.backends.types.zhinst.Modulation quantify_scheduler.backends.types.zhinst.LocalOscillator quantify_scheduler.backends.types.zhinst.Output quantify_scheduler.backends.types.zhinst.Device quantify_scheduler.backends.types.zhinst.CommandTableHeader quantify_scheduler.backends.types.zhinst.CommandTableEntryValue quantify_scheduler.backends.types.zhinst.CommandTableWaveform quantify_scheduler.backends.types.zhinst.CommandTableEntry quantify_scheduler.backends.types.zhinst.CommandTable quantify_scheduler.backends.types.zhinst.QasIntegrationMode quantify_scheduler.backends.types.zhinst.QasResultMode quantify_scheduler.backends.types.zhinst.QasResultSource quantify_scheduler.backends.types.zhinst.WaveformDestination quantify_scheduler.backends.types.zhinst.InstrumentInfo quantify_scheduler.backends.types.zhinst.Instruction quantify_scheduler.backends.types.zhinst.Acquisition quantify_scheduler.backends.types.zhinst.Wave quantify_scheduler.backends.types.zhinst.ZIChannelDescription quantify_scheduler.backends.types.zhinst.ZIBaseDescription quantify_scheduler.backends.types.zhinst.ZIHDAWG4Description quantify_scheduler.backends.types.zhinst.ZIHDAWG8Description quantify_scheduler.backends.types.zhinst.ZIUHFQADescription quantify_scheduler.backends.types.zhinst.OutputGain quantify_scheduler.backends.types.zhinst.ZIHardwareOptions Attributes ~~~~~~~~~~ .. autoapisummary:: quantify_scheduler.backends.types.zhinst.ZIHardwareDescription .. py:class:: DeviceType Bases: :py:obj:`str`, :py:obj:`enum.Enum` Enum of device types. .. py:attribute:: HDAWG :value: 'HDAWG' .. py:attribute:: UHFQA :value: 'UHFQA' .. py:attribute:: UHFLI :value: 'UHFLI' .. py:attribute:: MFLI :value: 'MFLI' .. py:attribute:: PQSC :value: 'PQSC' .. py:attribute:: NONE :value: 'none' .. py:class:: ModulationModeType Bases: :py:obj:`str`, :py:obj:`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 :class:`~quantify_scheduler.backends.types.zhinst.Modulation` for the use. .. py:attribute:: NONE :value: 'none' .. py:attribute:: PREMODULATE :value: 'premod' .. py:attribute:: MODULATE :value: 'modulate' .. py:class:: SignalModeType Bases: :py:obj:`str`, :py:obj:`enum.Enum` The signal output enum type. Used to set the output signal type to a modulated or real respectively. .. py:attribute:: COMPLEX :value: 'complex' .. py:attribute:: REAL :value: 'real' .. py:class:: ReferenceSourceType Bases: :py:obj:`str`, :py:obj:`enum.Enum` The reference source enum type. Used to set the source trigger type to internal or external respectively. .. py:attribute:: NONE :value: 'none' .. py:attribute:: INTERNAL :value: 'int' .. py:attribute:: EXTERNAL :value: 'ext' .. py:class:: InstrumentOperationMode Bases: :py:obj:`str`, :py:obj:`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. .. py:attribute:: OPERATING :value: 'operate' .. py:attribute:: CALIBRATING :value: 'calibrate' .. py:class:: Modulation(/, **data: Any) Bases: :py:obj:`quantify_scheduler.structure.model.DataStructure` The backend Modulation record type. .. py:attribute:: type :type: ModulationModeType 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') .. py:attribute:: interm_freq :type: float :value: 0.0 The inter-modulation frequency (IF) in Hz. (default = 0.0). .. py:attribute:: phase_shift :type: float :value: 0.0 The IQ modulation phase shift in Degrees. (default = 0.0). .. py:class:: LocalOscillator(/, **data: Any) Bases: :py:obj:`quantify_scheduler.structure.model.DataStructure` The backend LocalOscillator record type. .. py:attribute:: unique_name :type: str The unique name identifying the combination of instrument and channel/parameters. .. py:attribute:: instrument_name :type: str The QCodes name of the LocalOscillator. .. py:attribute:: generic_icc_name :type: Optional[str] :value: None The name of the GenericInstrumentCoordinatorComponent attached to this device. .. py:attribute:: frequency :type: Optional[dict] :value: None A dict which tells the generic icc what parameter maps to the local oscillator (LO) frequency in Hz. .. py:attribute:: frequency_param :type: Optional[str] :value: None The parameter on the LO instrument used to control the frequency. .. py:attribute:: power :type: Optional[dict] :value: None A dict which tells the generic icc what parameter maps to the local oscillator (LO) power in dBm. .. py:attribute:: phase :type: Optional[dict] :value: None A dict which tells the generic icc what parameter maps to the local oscillator (LO) phase in radians. .. py:attribute:: parameters :type: Optional[dict] :value: None A dict which allows setting of channel specific parameters of the device. Cannot be used together with frequency and power. .. py:class:: Output(/, **data: Any) Bases: :py:obj:`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. .. py:attribute:: port :type: str The port resource. .. py:attribute:: clock :type: str The Clock resource. .. py:attribute:: mode :type: SignalModeType The output mode type. .. py:attribute:: modulation :type: Modulation The modulation settings. .. py:attribute:: local_oscillator :type: Optional[str] :value: None The LocalOscillator name. .. py:attribute:: clock_frequency :type: Optional[float] :value: None The frequency for the clock resource (AKA RF/signal frequency). .. py:attribute:: gain1 :type: int :value: 0 The output1 IQ modulation gain. Accepted value between -1 and + 1. (default = 1.0) .. py:attribute:: gain2 :type: int :value: 0 The output2 IQ modulation gain. Accepted value between -1 and + 1. (default = 1.0) .. py:attribute:: trigger :type: Optional[int] :value: None The ZI Instrument input trigger. (default = None) Setting this will declare the device secondary. .. py:attribute:: markers :type: List[Union[str, int]] :value: [] The ZI Instrument output triggers. (default = []) .. py:attribute:: mixer_corrections :type: Optional[quantify_scheduler.backends.types.common.MixerCorrections] :value: None The output mixer corrections. .. py:method:: decapitalize_dc_mixer_offsets(v) 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. .. py:class:: Device(/, **data: Any) Bases: :py:obj:`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. .. py:attribute:: name :type: str The QCodes Instrument name. .. py:attribute:: type :type: str The instrument model type. For example, 'UHFQA', 'HDAWG4', 'HDAWG8'. .. py:attribute:: ref :type: ReferenceSourceType The reference source type. .. py:attribute:: channel_0 :type: Output The first physical channel properties. .. py:attribute:: channel_1 :type: Optional[Output] :value: None The second physical channel properties. .. py:attribute:: channel_2 :type: Optional[Output] :value: None The third physical channel properties. .. py:attribute:: channel_3 :type: Optional[Output] :value: None The fourth physical channel properties. .. py:attribute:: channels :type: List[Output] The list of channels. (auto generated) .. py:attribute:: clock_select :type: Optional[int] :value: 0 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) .. py:attribute:: channelgrouping :type: int :value: 0 The HDAWG channelgrouping property. (default = 0) corresponding to a single sequencer controlling a pair (2) awg outputs. .. py:attribute:: mode :type: InstrumentOperationMode The Instruments operation mode. (default = zhinst.InstrumentOperationMode.OPERATING) .. py:attribute:: device_type :type: DeviceType The Zurich Instruments hardware type. (default = DeviceType.NONE) This field is automatically populated. .. py:attribute:: sample_rate :type: Optional[int] :value: None The Instruments sampling clock rate. This field is automatically populated. .. py:attribute:: n_channels :type: Optional[int] The number of physical channels of this ZI Instrument. This field is automatically populated. .. py:method:: generate_channel_list(v, info) Generate the channel list. .. py:method:: calculate_n_channels(v, info) Calculate the number of channels. .. py:method:: determine_device_type(v, info) Determine the device type. .. py:class:: CommandTableHeader(/, **data: Any) Bases: :py:obj:`quantify_scheduler.structure.model.DataStructure` The CommandTable header definition. .. py:attribute:: version :type: str :value: '0.2' .. py:attribute:: partial :type: bool :value: False .. py:class:: CommandTableEntryValue(/, **data: Any) Bases: :py:obj:`quantify_scheduler.structure.model.DataStructure` A CommandTable entry definition with a value. .. py:attribute:: value :type: int .. py:class:: CommandTableWaveform(/, **data: Any) Bases: :py:obj:`quantify_scheduler.structure.model.DataStructure` The command table waveform properties. .. py:attribute:: index :type: int .. py:attribute:: length :type: int .. py:class:: CommandTableEntry(/, **data: Any) Bases: :py:obj:`quantify_scheduler.structure.model.DataStructure` The definition of a single CommandTable entry. .. py:attribute:: index :type: int .. py:attribute:: waveform :type: CommandTableWaveform .. py:class:: CommandTable(/, **data: Any) Bases: :py:obj:`quantify_scheduler.structure.model.DataStructure` The CommandTable definition for ZI HDAWG. .. py:attribute:: header :type: Optional[CommandTableHeader] .. py:attribute:: table :type: List[CommandTableEntry] .. py:method:: generate_command_table_header(v, values) Generates command table header. .. py:class:: QasIntegrationMode Bases: :py:obj:`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. .. py:attribute:: NORMAL :value: 0 .. py:attribute:: SPECTROSCOPY :value: 1 .. py:class:: QasResultMode Bases: :py:obj:`enum.Enum` UHFQA QAS result mode. .. py:attribute:: CYCLIC :value: 0 .. py:attribute:: SEQUENTIAL :value: 1 .. py:class:: QasResultSource Bases: :py:obj:`enum.Enum` UHFQA QAS result source. .. py:attribute:: CROSSTALK :value: 0 .. py:attribute:: THRESHOLD :value: 1 .. py:attribute:: ROTATION :value: 3 .. py:attribute:: CROSSTALK_CORRELATION :value: 4 .. py:attribute:: THRESHOLD_CORRELATION :value: 5 .. py:attribute:: INTEGRATION :value: 7 .. py:class:: WaveformDestination Bases: :py:obj:`enum.Enum` The waveform destination enum type. .. py:attribute:: CSV :value: 0 .. py:attribute:: WAVEFORM_TABLE :value: 1 .. py:class:: InstrumentInfo Instrument information record type. .. py:attribute:: sample_rate :type: int .. py:attribute:: num_samples_per_clock :type: int .. py:attribute:: granularity :type: int .. py:attribute:: mode :type: InstrumentOperationMode .. py:attribute:: sequencer_rate :type: float .. py:class:: Instruction Sequence base instruction record type. .. py:attribute:: waveform_id :type: str .. py:attribute:: abs_time :type: float .. py:attribute:: clock_cycle_start :type: int .. py:attribute:: duration :type: float .. py:method:: default() :staticmethod: Returns a default Instruction instance. :rtype: Instruction .. py:class:: Acquisition Bases: :py:obj:`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. .. py:class:: Wave Bases: :py:obj:`Instruction` This instruction indicates that a waveform should be played. .. py:class:: ZIChannelDescription(/, **data: Any) Bases: :py:obj:`quantify_scheduler.structure.model.DataStructure` Information needed to specify a ZI Channel in the :class:`~.quantify_scheduler.backends.zhinst_backend.ZIHardwareCompilationConfig`. A single 'channel' represents a complex output, consisting of two physical I/O channels on the Instrument. .. py:attribute:: mode :type: Union[Literal['real'], Literal['complex']] The output mode type. .. py:attribute:: markers :type: List[str] :value: [] Property that specifies which markers to trigger on each sequencer iteration. The values are used as input for the ``setTrigger`` sequencer instruction. .. py:attribute:: trigger :type: Optional[int] :value: None 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. .. py:class:: ZIBaseDescription(/, **data: Any) Bases: :py:obj:`quantify_scheduler.backends.types.common.HardwareDescription` Base class for a Zurich Instrument hardware description. .. py:attribute:: ref :type: Union[Literal['int'], Literal['ext'], Literal['none']] Property that describes if the instrument uses Markers or Triggers. - ``int`` Enables sending Marker - ``ext`` Enables waiting for Marker - ``none`` Ignores waiting for Marker .. py:class:: ZIHDAWG4Description(/, **data: Any) Bases: :py:obj:`ZIBaseDescription` Information needed to specify a HDAWG4 in the :class:`~.quantify_scheduler.backends.zhinst_backend.ZIHardwareCompilationConfig`. .. py:attribute:: instrument_type :type: Literal['HDAWG4'] The instrument type, used to select this datastructure when parsing a :class:`~.quantify_scheduler.backends.zhinst_backend.ZIHardwareCompilationConfig`. .. py:attribute:: channelgrouping :type: int 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. .. py:attribute:: clock_select :type: int 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) .. py:attribute:: channel_0 :type: Optional[ZIChannelDescription] :value: None Description of the first channel on this HDAWG (corresponding to 1 or 2 physical output ports). .. py:attribute:: channel_1 :type: Optional[ZIChannelDescription] :value: None Description of the second channel on this HDAWG (corresponding to 1 or 2 physical output ports). .. py:class:: ZIHDAWG8Description(/, **data: Any) Bases: :py:obj:`ZIHDAWG4Description` Information needed to specify a HDAWG8 in the :class:`~.quantify_scheduler.backends.zhinst_backend.ZIHardwareCompilationConfig`. .. py:attribute:: instrument_type :type: Literal['HDAWG8'] The instrument type, used to select this datastructure when parsing a :class:`~.quantify_scheduler.backends.zhinst_backend.ZIHardwareCompilationConfig`. .. py:attribute:: channel_2 :type: Optional[ZIChannelDescription] :value: None Description of the third channel on this HDAWG (corresponding to 1 or 2 physical output ports). .. py:attribute:: channel_3 :type: Optional[ZIChannelDescription] :value: None Description of the fourth channel on this HDAWG (corresponding to 1 or 2 physical output ports). .. py:class:: ZIUHFQADescription(/, **data: Any) Bases: :py:obj:`ZIBaseDescription` Information needed to specify a UHFQA in the :class:`~.quantify_scheduler.backends.zhinst_backend.ZIHardwareCompilationConfig`. .. py:attribute:: instrument_type :type: Literal['UHFQA'] The instrument type, used to select this datastructure when parsing a :class:`~.quantify_scheduler.backends.zhinst_backend.ZIHardwareCompilationConfig`. .. py:attribute:: channel_0 :type: Optional[ZIChannelDescription] :value: None Description of the readout channel on this UHFQA. .. py:data:: ZIHardwareDescription Specifies a piece of Zurich Instruments hardware and its instrument-specific settings. Currently, the supported instrument types are: :class:`~.ZIHDAWG4Description`, :class:`~.ZIHDAWG8Description`, :class:`~.ZIUHFQADescription` .. py:class:: OutputGain(/, **data: Any) Bases: :py:obj:`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. .. admonition:: Example :class: dropdown .. code-block:: python hardware_compilation_config.hardware_options.gain = { "q0:res-q0.ro": Gain( output_1 = 1, output_2 = 1 ), } .. py:attribute:: gain_I :type: float :value: 0 The output 1 IQ modulation gain. Accepted value between -1 and + 1. (default = 1.0). .. py:attribute:: gain_Q :type: float :value: 0 The output 2 IQ modulation gain. Accepted value between -1 and + 1. (default = 1.0). .. py:class:: ZIHardwareOptions(/, **data: Any) Bases: :py:obj:`quantify_scheduler.backends.types.common.HardwareOptions` Datastructure containing the hardware options for each port-clock combination. .. admonition:: Example :class: dropdown Here, the HardwareOptions datastructure is created by parsing a dictionary containing the relevant information. .. jupyter-execute:: import pprint from quantify_scheduler.schemas.examples.utils import ( load_json_example_scheme ) .. jupyter-execute:: from quantify_scheduler.backends.types.zhinst import ( ZIHardwareOptions ) zi_hw_options_dict = load_json_example_scheme( "zhinst_hardware_compilation_config.json")["hardware_options"] pprint.pprint(zi_hw_options_dict) zi_hw_options = ZIHardwareOptions.model_validate(zi_hw_options_dict) zi_hw_options .. py:attribute:: output_gain :type: Optional[Dict[str, OutputGain]] :value: None Dictionary containing the gain settings (values) that should be applied to the outputs that are connected to a certain port-clock combination (keys).