settings#
Settings builder for Zurich Instruments.
Module Contents#
Classes#
Serialization data container to decouple filenames from |
|
Zurich Instruments Settings record type. |
|
A collection of AWG and DAQ settings for a Zurich Instruments device. |
|
The Zurich Instruments Settings builder class. |
Attributes#
- class ZISerializeSettings[source]#
Serialization data container to decouple filenames from instrument names during the serialization.
- class ZISetting[source]#
Zurich Instruments Settings record type.
- apply_fn: Callable[[zhinst.qcodes.base.ZIBaseInstrument, str, Any], None][source]#
- 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]#
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.
- 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 usingZISettings.as_dict()
to see what settings will be configured.- _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.