settings ======== .. py:module:: quantify_scheduler.backends.zhinst.settings .. autoapi-nested-parse:: Settings builder for Zurich Instruments. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: quantify_scheduler.backends.zhinst.settings.ZISerializeSettings quantify_scheduler.backends.zhinst.settings.ZISetting quantify_scheduler.backends.zhinst.settings.ZISettings quantify_scheduler.backends.zhinst.settings.ZISettingsBuilder Attributes ~~~~~~~~~~ .. autoapisummary:: quantify_scheduler.backends.zhinst.settings.NUM_UHFQA_READOUT_CHANNELS .. py:data:: NUM_UHFQA_READOUT_CHANNELS :value: 10 .. py:class:: ZISerializeSettings Serialization data container to decouple filenames from instrument names during the serialization. .. py:attribute:: name :type: str .. py:attribute:: _serial :type: str .. py:attribute:: _type :type: str .. py:class:: ZISetting Zurich Instruments Settings record type. .. py:attribute:: node :type: str .. py:attribute:: value :type: Any .. py:attribute:: apply_fn :type: Callable[[zhinst.qcodes.base.ZIBaseInstrument, str, Any], None] .. py:method:: as_dict() -> Dict[str, Any] Returns the key-value pair as a dictionary. .. py:method:: apply(instrument: zhinst.qcodes.base.ZIBaseInstrument) Applies settings to the Instrument. :param instrument: .. py:class:: ZISettings(daq_settings: List[ZISetting], awg_settings: Dict[int, ZISetting]) A collection of AWG and DAQ settings for a Zurich Instruments device. :param daq_settings: The data acquisition node settings. :param awg_settings: The AWG(s) node settings. .. py:attribute:: _daq_settings :type: List[ZISetting] .. py:attribute:: _awg_settings :type: Dict[int, ZISetting] .. py:attribute:: _awg_indexes .. py:property:: awg_indexes :type: List[int] Returns a list of enabled AWG indexes. .. py:method:: as_dict() -> Dict[str, Any] Returns the ZISettings as a dictionary. .. py:method:: apply(instrument: zhinst.qcodes.base.ZIBaseInstrument) -> None Apply all settings to the instrument. .. py:method:: serialize(root: pathlib.Path, options: ZISerializeSettings) -> pathlib.Path Serializes the ZISerializeSettings to file storage. The parent '{options.name}_settings.json' file contains references to all child files. While settings are stored in JSON the waveforms are stored in CSV. :param root: The root path to serialized files. :param options: The serialization options to associate these settings. :returns: The path to the parent JSON file. .. py:method:: deserialize(settings_path: pathlib.Path) -> ZISettingsBuilder :classmethod: Deserializes the JSON settings for Zurich Instruments in to the :class:`.ZISettingsBuilder`. :param settings_path: The path to the parent JSON file. :returns: The ZISettingsBuilder containing all the deserialized settings. :raises ValueError: If the settings_path does not end with '_settings.json'. .. py:class:: ZISettingsBuilder The Zurich Instruments Settings builder class. This class provides an API for settings that are configured in the zhinst backend. The ZISettings class is the resulting set that holds settings. This class exist because configuring these settings requires logic in how the settings are configured using the zurich instruments API. .. tip:: Build the settings using :meth:`~.build` and then view them as a dictionary using :meth:`ZISettings.as_dict` to see what settings will be configured. .. py:attribute:: _daq_settings :type: List[ZISetting] .. py:attribute:: _awg_settings :type: List[Tuple[str, Tuple[int, ZISetting]]] .. py:method:: _set_daq(setting: ZISetting) -> ZISettingsBuilder Sets an daq module setting. :param setting: .. py:method:: _set_awg(awg_index: int, setting: ZISetting) -> ZISettingsBuilder Sets an awg module setting. :param awg_index: :param setting: .. py:method:: with_defaults(defaults: List[Tuple[str, Union[str, int]]]) -> ZISettingsBuilder Adds the Instruments default settings. :param defaults: .. py:method:: with_wave_vector(awg_index: int, wave_index: int, vector: Union[List, str]) -> ZISettingsBuilder Adds the Instruments waveform vector setting by index for an awg by index. :param awg_index: :param wave_index: :param vector: .. py:method:: with_csv_wave_vector(awg_index: int, wave_index: int, vector: Union[List, str]) -> ZISettingsBuilder Adds the Instruments waveform vector setting by index for an awg by index. This equivalent to ``with_wave_vector`` only it does not upload the setting to the node, because for loading waveforms using a CSV file this is not required. :param awg_index: :param wave_index: :param vector: .. py:method:: with_commandtable_data(awg_index: int, json_data: Union[Dict[str, Any], str]) -> ZISettingsBuilder Adds the Instruments CommandTable json vector setting to the awg by index. :param awg_index: :param json_data: .. py:method:: with_awg_time(awg_index: int, clock_rate_index: int) -> ZISettingsBuilder Adds the Instruments clock rate frequency setting. See ZI instrument user manual /DEV..../AWGS/n/TIME :param awg_index: :param clock_rate_index: .. py:method:: with_qas_delay(delay: int) -> ZISettingsBuilder Adds the Instruments QAS delay. :param delay: .. py:method:: with_qas_result_enable(enabled: bool) -> ZISettingsBuilder Adds the Instruments QAS Monitor result enable setting. :param enabled: .. py:method:: with_qas_result_length(n_samples: int) -> ZISettingsBuilder Adds the Instruments QAS Monitor result length setting. :param n_samples: .. py:method:: with_qas_result_averages(n_averages: int) -> ZISettingsBuilder Adds the Instruments QAS Monitor result averages setting. :param n_averages: .. py:method:: with_qas_result_mode(mode: quantify_scheduler.backends.types.zhinst.QasResultMode) -> ZISettingsBuilder Adds the Instruments QAS Monitor result mode setting. :param mode: .. py:method:: with_qas_result_source(mode: quantify_scheduler.backends.types.zhinst.QasResultSource) -> ZISettingsBuilder Adds the Instruments QAS Monitor result source setting. :param mode: .. py:method:: with_qas_result_reset(value: int) -> ZISettingsBuilder Adds the Instruments QAS Result reset setting. :param value: .. py:method:: with_qas_integration_length(n_samples: int) -> ZISettingsBuilder Adds the Instruments QAS Monitor integration length setting. :param n_samples: .. py:method:: with_qas_integration_mode(mode: quantify_scheduler.backends.types.zhinst.QasIntegrationMode) -> ZISettingsBuilder Adds the Instruments QAS Monitor integration mode setting. :param mode: .. py:method:: with_qas_integration_weights_real(channels: Union[int, List[int]], real: Union[List[int], numpy.ndarray]) -> ZISettingsBuilder Adds the Instruments QAS Monitor integration real weights setting. :param channels: :param real: :raises ValueError: If a channel used is larger than 9. .. py:method:: with_qas_integration_weights_imag(channels: Union[int, List[int]], imag: Union[List[int], numpy.ndarray]) -> ZISettingsBuilder Adds the Instruments QAS Monitor integration imaginary weights setting. :param channels: :param imag: :raises ValueError: If a channel used is larger than 9. .. py:method:: with_qas_monitor_enable(enabled: bool) -> ZISettingsBuilder Adds the Instruments QAS Monitor enable setting. :param enabled: .. py:method:: with_qas_monitor_length(n_samples: int) -> ZISettingsBuilder Adds the Instruments QAS Monitor length setting. :param n_samples: .. py:method:: with_qas_monitor_averages(n_averages: int) -> ZISettingsBuilder Adds the Instruments QAS Monitor averages setting. :param n_averages: .. py:method:: with_qas_monitor_reset(value: int) -> ZISettingsBuilder Adds the Instruments QAS Monitor reset setting. :param value: .. py:method:: with_qas_rotations(channels: Union[int, List[int]], value: Union[int, complex]) -> ZISettingsBuilder Adds the Instruments QAS rotation setting. :param channels: :param value: Number of degrees or a complex value. .. py:method:: with_system_channelgrouping(channelgrouping: int) -> ZISettingsBuilder Adds the Instruments channelgrouping setting. :param channelgrouping: .. py:method:: with_sigouts(awg_index: int, outputs: Tuple[int, int]) -> ZISettingsBuilder Adds the channel sigouts setting for the Instruments awg by index. :param awg_index: :param outputs: .. py:method:: with_sigout_offset(channel_index: int, offset_in_millivolts: float) -> ZISettingsBuilder Adds the channel sigout offset setting in volts. :param channel_index: :param offset_in_millivolts: .. py:method:: with_gain(awg_index: int, gain: Tuple[float, float]) -> ZISettingsBuilder Adds the gain settings for the Instruments awg by index. :param awg_index: :param gain: The gain values for output 1 and 2. .. py:method:: with_compiler_sourcestring(awg_index: int, seqc: str) -> ZISettingsBuilder Adds the sequencer compiler sourcestring setting for the Instruments awg by index. :param awg_index: :param seqc: :param waveforms_dict: .. py:method:: build() -> ZISettings Builds the ZISettings class.