settings#

Settings builder for Zurich Instruments.

Module Contents#

Classes#

ZISerializeSettings

Serialization data container to decouple filenames from

ZISetting

Zurich Instruments Settings record type.

ZISettings

A collection of AWG and DAQ settings for a Zurich Instruments device.

ZISettingsBuilder

The Zurich Instruments Settings builder class.

Attributes#

NUM_UHFQA_READOUT_CHANNELS = 10[source]#
class ZISerializeSettings[source]#

Serialization data container to decouple filenames from instrument names during the serialization.

name: str[source]#
_serial: str[source]#
_type: str[source]#
class ZISetting[source]#

Zurich Instruments Settings record type.

node: str[source]#
value: Any[source]#
apply_fn: Callable[[zhinst.qcodes.base.ZIBaseInstrument, str, Any], None][source]#
as_dict() dict[str, Any][source]#

Returns the key-value pair as a dictionary.

apply(instrument: zhinst.qcodes.base.ZIBaseInstrument) None[source]#

Applies settings to the Instrument.

Parameters:

instrument

class ZISettings(daq_settings: list[ZISetting], awg_settings: dict[int, ZISetting])[source]#

A collection of AWG and DAQ settings for a Zurich Instruments device.

Parameters:
  • daq_settings – The data acquisition node settings.

  • awg_settings – The AWG(s) node settings.

_daq_settings: list[ZISetting][source]#
_awg_settings: dict[int, ZISetting][source]#
_awg_indexes[source]#
property awg_indexes: list[int][source]#

Returns a list of enabled AWG indexes.

as_dict() dict[str, Any][source]#

Returns the ZISettings as a dictionary.

apply(instrument: zhinst.qcodes.base.ZIBaseInstrument) None[source]#

Apply all settings to the instrument.

serialize(root: pathlib.Path, options: ZISerializeSettings) pathlib.Path[source]#

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.

Parameters:
  • root – The root path to serialized files.

  • options – The serialization options to associate these settings.

Returns:

The path to the parent JSON file.

classmethod deserialize(settings_path: pathlib.Path) ZISettingsBuilder[source]#

Deserializes the JSON settings for Zurich Instruments in to the ZISettingsBuilder.

Parameters:

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’.

class ZISettingsBuilder[source]#

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 build() and then view them as a dictionary using ZISettings.as_dict() to see what settings will be configured.

_daq_settings: list[ZISetting][source]#
_awg_settings: list[tuple[str, tuple[int, ZISetting]]][source]#
_set_daq(setting: ZISetting) ZISettingsBuilder[source]#

Sets an daq module setting.

Parameters:

setting

_set_awg(awg_index: int, setting: ZISetting) ZISettingsBuilder[source]#

Sets an awg module setting.

Parameters:
  • awg_index

  • setting

with_defaults(defaults: list[tuple[str, str | int]]) ZISettingsBuilder[source]#

Adds the Instruments default settings.

Parameters:

defaults

with_wave_vector(awg_index: int, wave_index: int, vector: list | str) ZISettingsBuilder[source]#

Adds the Instruments waveform vector setting by index for an awg by index.

Parameters:
  • awg_index

  • wave_index

  • vector

with_csv_wave_vector(awg_index: int, wave_index: int, vector: list | str) ZISettingsBuilder[source]#

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.

Parameters:
  • awg_index

  • wave_index

  • vector

with_commandtable_data(awg_index: int, json_data: dict[str, Any] | str) ZISettingsBuilder[source]#

Adds the Instruments CommandTable json vector setting to the awg by index.

Parameters:
  • awg_index

  • json_data

with_awg_time(awg_index: int, clock_rate_index: int) ZISettingsBuilder[source]#

Adds the Instruments clock rate frequency setting.

See ZI instrument user manual

/DEV…./AWGS/n/TIME

Parameters:
  • awg_index

  • clock_rate_index

with_qas_delay(delay: int) ZISettingsBuilder[source]#

Adds the Instruments QAS delay.

Parameters:

delay

with_qas_result_enable(enabled: bool) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor result enable setting.

Parameters:

enabled

with_qas_result_length(n_samples: int) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor result length setting.

Parameters:

n_samples

with_qas_result_averages(n_averages: int) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor result averages setting.

Parameters:

n_averages

with_qas_result_mode(mode: quantify_scheduler.backends.types.zhinst.QasResultMode) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor result mode setting.

Parameters:

mode

with_qas_result_source(mode: quantify_scheduler.backends.types.zhinst.QasResultSource) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor result source setting.

Parameters:

mode

with_qas_result_reset(value: int) ZISettingsBuilder[source]#

Adds the Instruments QAS Result reset setting.

Parameters:

value

with_qas_integration_length(n_samples: int) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor integration length setting.

Parameters:

n_samples

with_qas_integration_mode(mode: quantify_scheduler.backends.types.zhinst.QasIntegrationMode) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor integration mode setting.

Parameters:

mode

with_qas_integration_weights_real(channels: int | list[int], real: list[int] | numpy.ndarray) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor integration real weights setting.

Parameters:
  • channels

  • real

Raises:

ValueError – If a channel used is larger than 9.

with_qas_integration_weights_imag(channels: int | list[int], imag: list[int] | numpy.ndarray) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor integration imaginary weights setting.

Parameters:
  • channels

  • imag

Raises:

ValueError – If a channel used is larger than 9.

with_qas_monitor_enable(enabled: bool) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor enable setting.

Parameters:

enabled

with_qas_monitor_length(n_samples: int) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor length setting.

Parameters:

n_samples

with_qas_monitor_averages(n_averages: int) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor averages setting.

Parameters:

n_averages

with_qas_monitor_reset(value: int) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor reset setting.

Parameters:

value

with_qas_rotations(channels: int | list[int], value: int | complex) ZISettingsBuilder[source]#

Adds the Instruments QAS rotation setting.

Parameters:
  • channels

  • value – Number of degrees or a complex value.

with_system_channelgrouping(channelgrouping: int) ZISettingsBuilder[source]#

Adds the Instruments channelgrouping setting.

Parameters:

channelgrouping

with_sigouts(awg_index: int, outputs: tuple[int, int]) ZISettingsBuilder[source]#

Adds the channel sigouts setting for the Instruments awg by index.

Parameters:
  • awg_index

  • outputs

with_sigout_offset(channel_index: int, offset_in_millivolts: float) ZISettingsBuilder[source]#

Adds the channel sigout offset setting in volts.

Parameters:
  • channel_index

  • offset_in_millivolts

with_gain(awg_index: int, gain: tuple[float, float]) ZISettingsBuilder[source]#

Adds the gain settings for the Instruments awg by index.

Parameters:
  • awg_index

  • gain – The gain values for output 1 and 2.

with_compiler_sourcestring(awg_index: int, seqc: str) ZISettingsBuilder[source]#

Adds the sequencer compiler sourcestring setting for the Instruments awg by index.

Parameters:
  • awg_index

  • seqc

  • waveforms_dict

build() ZISettings[source]#

Builds the ZISettings class.