quantify_scheduler.backends.zhinst.settings

Settings builder for Zurich Instruments.

Module Contents

Classes

ZISerializeSettings

Serialization data container to decouple filenames from

ZISetting

Zurich Instruments Settings record type.

ZISettings

Zurich Instruments settings result class.

ZISettingsBuilder

The Zurich Instruments Settings builder class.

Attributes

NUM_UHFQA_READOUT_CHANNELS

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)[source]

Applies settings to the Instrument.

Parameters

instrument

class ZISettings(daq_settings: List[ZISetting], awg_settings: Dict[int, ZISetting])[source]

Zurich Instruments settings result class.

__eq__(other)[source]

Return self==value.

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, Union[str, int]]]) ZISettingsBuilder[source]

Adds the Instruments default settings.

Parameters

defaults

with_wave_vector(awg_index: int, wave_index: int, vector: Union[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: Union[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: Union[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: Union[int, List[int]], real: Union[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: Union[int, List[int]], imag: Union[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: Union[int, List[int]], value: Union[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.