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.

Returns:

:

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.

Returns:

:

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

Returns:

:

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

Sets an awg module setting.

Parameters:
  • awg_index

  • setting

Returns:

:

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

Adds the Instruments default settings.

Parameters:

defaults

Returns:

:

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

Returns:

:

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

Returns:

:

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

Returns:

:

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

Returns:

:

with_qas_delay(delay: int) ZISettingsBuilder[source]#

Adds the Instruments QAS delay.

Parameters:

delay

Returns:

:

with_qas_result_enable(enabled: bool) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor result enable setting.

Parameters:

enabled

Returns:

:

with_qas_result_length(n_samples: int) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor result length setting.

Parameters:

n_samples

Returns:

:

with_qas_result_averages(n_averages: int) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor result averages setting.

Parameters:

n_averages

Returns:

:

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

Adds the Instruments QAS Monitor result mode setting.

Parameters:

mode

Returns:

:

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

Adds the Instruments QAS Monitor result source setting.

Parameters:

mode

Returns:

:

with_qas_result_reset(value: int) ZISettingsBuilder[source]#

Adds the Instruments QAS Result reset setting.

Parameters:

value

Returns:

:

with_qas_integration_length(n_samples: int) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor integration length setting.

Parameters:

n_samples

Returns:

:

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

Adds the Instruments QAS Monitor integration mode setting.

Parameters:

mode

Returns:

:

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

Returns:

:

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

Returns:

:

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

Returns:

:

with_qas_monitor_length(n_samples: int) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor length setting.

Parameters:

n_samples

Returns:

:

with_qas_monitor_averages(n_averages: int) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor averages setting.

Parameters:

n_averages

Returns:

:

with_qas_monitor_reset(value: int) ZISettingsBuilder[source]#

Adds the Instruments QAS Monitor reset setting.

Parameters:

value

Returns:

:

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.

Returns:

:

with_system_channelgrouping(channelgrouping: int) ZISettingsBuilder[source]#

Adds the Instruments channelgrouping setting.

Parameters:

channelgrouping

Returns:

:

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

Returns:

:

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

Returns:

:

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.

Returns:

:

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

Returns:

:

build() ZISettings[source]#

Builds the ZISettings class.

Returns:

: