Skip to content

Python Utils SHFSG

zhinst.utils.shfsg

Zurich Instruments LabOne Python API Utility functions for SHFSG.

SHFSG_MAX_SIGNAL_GENERATOR_WAVEFORM_LENGTH = 98304 module-attribute

SHFSG_SAMPLING_FREQUENCY = 2000000000.0 module-attribute

configure_marker_and_trigger = configure_maker(get_marker_and_trigger_settings, partial(build_docstring_configure, new_first_line='Configures the trigger inputs and marker outputs of a specified AWG core.')) module-attribute

configure_pulse_modulation = configure_maker(get_pulse_modulation_settings, partial(build_docstring_configure, new_first_line='Configure the pulse modulation.\n\n Configures the sine generator to digitally modulate the AWG output, for\n generating single sideband AWG signals.')) module-attribute

configure_sine_generation = configure_maker(get_sine_generation_settings, partial(build_docstring_configure, new_first_line='Configures the sine generator output of a specified channel.\n\n Configures the sine generator output of a specified channel for generating\n continuous wave signals without the AWG.')) module-attribute

configure_channel(daq, device_id, channel_index, *, enable, output_range, center_frequency, rflf_path)

Configures the RF input and output of a specified channel.

Parameters:

Name Type Description Default
daq ziDAQServer

Instance of a Zurich Instruments API session connected to a Data Server. The device with identifier device_id is assumed to already be connected to this instance.

required
device_id str

SHFSG device identifier, e.g. dev12004 or 'shf-dev12004'.

required
channel_index int

Index of the used SG channel.

required
enable int

Whether or not to enable the channel.

required
output_range int

Maximal range of the signal output power in dbM.

required
center_frequency float

Center Frequency before modulation.

required
rflf_path int

Switch between RF and LF paths.

required

enable_sequencer(daq, device_id, channel_index, *, single=True)

Starts the sequencer of a specific channel.

Parameters:

Name Type Description Default
daq ziDAQServer

Instance of a Zurich Instruments API session connected to a Data Server. The device with identifier device_id is assumed to already be connected to this instance.

required
device_id str

SHFSG device identifier, e.g. dev12004 or 'shf-dev12004'.

required
channel_index int

Index specifying which sequencer to enable - there is one sequencer per channel.

required
single Union[bool, int]

Flag if the sequencer should run in single mode.

True

get_marker_and_trigger_settings(device_id, channel_index, *, trigger_in_source, trigger_in_slope, marker_out_source)

Provides settings for the trigger inputs and marker outputs of an AWG core.

This function only gathers all node settings and does not apply the values on the device. It is intended to be used by higher-level APIs for simpler integrations. Instead of using this function directly, consider calling 'configure_marker_and_trigger', which will also apply the settings on the device.

Parameters:

Name Type Description Default
device_id str

SHFSG device identifier, e.g. dev12004 or 'shf-dev12004'

required
channel_index int

Index of the used SG channel.

required
trigger_in_source str

Alias for the trigger input used by the sequencer. For a list of available values use: daq.help(f"/{dev_id}/sgchannels/{channel_index}/awg/auxtriggers/0/channel")

required
trigger_in_slope str

Alias for the slope of the input trigger used by sequencer. For a list of available values use daq.help(f"/{dev_id}/sgchannels/{channel_index}/awg/auxtriggers/0/slope") or available_trigger_inputs in zhinst.toolkit

required
marker_out_source str

Alias for the marker output source used by the sequencer. For a list of available values use daq.help(f"/{dev_id}/sgchannels/{channel_index}/marker/source") or available_trigger_slopes in zhinst.toolkit

required

get_pulse_modulation_settings(device_id, channel_index, *, enable, osc_index=0, osc_frequency=100000000.0, phase=0.0, global_amp=0.5, gains=(1.0, -1.0, 1.0, 1.0), sine_generator_index=0)

Provides a list of settings for the pulse modulation.

This function only gathers all node settings and does not apply the values on the device. It is intended to be used by higher-level APIs for simpler integrations. Instead of using this function directly, consider calling 'configure_pulse_modulation', which will also apply the settings on the device.

Provides settings which would configure the sine generator to digitally modulate the AWG output, for generating single sideband AWG signals.

Parameters:

Name Type Description Default
device_id str

SHFSG device identifier, e.g. dev12004 or 'shf-dev12004'

required
channel_index int

Index of the used SG channel.

required
enable int

Enables modulation.

required
osc_index int

Selects which oscillator to use.

0
osc_frequency float

Oscillator frequency used to modulate the AWG outputs. (default = 100e6)

100000000.0
phase float

Sets the oscillator phase. (default = 0.0)

0.0
global_amp float

Global scale factor for the AWG outputs. (default = 0.5)

0.5
gains tuple

Sets the four amplitudes used for single sideband generation. default values correspond to upper sideband with a positive oscillator frequency. (default = (1.0, -1.0, 1.0, 1.0))

(1.0, -1.0, 1.0, 1.0)
sine_generator_index int

Selects which sine generator to use on a given channel.

0

get_sine_generation_settings(device_id, channel_index, *, enable, osc_index=0, osc_frequency=100000000.0, phase=0.0, gains=(0.0, 1.0, 1.0, 0.0), sine_generator_index=0)

Provides a list of settings for the sine generator output of a specified channel.

This function only gathers all node settings and does not apply the values on the device. It is intended to be used by higher-level APIs for simpler integrations. Instead of using this function directly, consider calling 'configure_sine_generation', which will also apply the settings on the device.

Provides settings which would configure the sine generator output of a specified channel for generating continuous wave signals without the AWG.

Parameters:

Name Type Description Default
device_id str

SHFSG device identifier, e.g. dev12004 or 'shf-dev12004'.

required
channel_index int

Index of the used SG channel.

required
enable int

Enables the sine generator output.

required
osc_index int

Selects which oscillator to use.

0
osc_frequency float

Oscillator frequency used by the sine generator. (default = 100e6)

100000000.0
phase float

Sets the oscillator phase. (default = 0.0)

0.0
gains tuple

Sets the four amplitudes used for single sideband. generation. default values correspond to upper sideband with a positive oscillator frequency. gains are set in this order: I/sin, I/cos, Q/sin, Q/cos (default = (0.0, 1.0, 1.0, 0.0))

(0.0, 1.0, 1.0, 0.0)
sine_generator_index int

Selects which sine generator to use on a given channel.

0

load_sequencer_program(daq, device_id, channel_index, sequencer_program, **_)

Compiles and loads a program to a specified AWG core.

This function is composed of 4 steps
  1. Reset the awg core to ensure a clean state.
  2. Compile the sequencer program with the offline compiler.
  3. Upload the compiled binary elf file.
  4. Validate that the upload was successful and the awg core is ready again.

Parameters:

Name Type Description Default
daq ziDAQServer

Instance of a Zurich Instruments API session connected to a Data Server. The device with identifier device_id is assumed to already be connected to this instance.

required
device_id str

SHFSG device identifier, e.g. dev12004 or 'shf-dev12004'.

required
channel_index int

Index specifying which sequencer to upload - there is one sequencer per channel.

required
sequencer_program str

Sequencer program to be uploaded.

required

Raises:

Type Description
RuntimeError

If the Upload was not successfully or the device could not process the sequencer program.

upload_commandtable(daq, device_id, channel_index, command_table)

Uploads a command table in the form of a string to the appropriate channel.

Parameters:

Name Type Description Default
daq ziDAQServer

Instance of a Zurich Instruments API session connected to a Data Server. The device with identifier device_id is assumed to already be connected to this instance.

required
device_id str

SHFSG device identifier, e.g. dev12004 or 'shf-dev12004'.

required
channel_index int

Index specifying which channel to upload the command table to.

required
command_table str

The command table to be uploaded.

required

write_to_waveform_memory(daq, device_id, channel_index, waveforms)

Writes waveforms to the waveform memory of a specified sequencer.

Parameters:

Name Type Description Default
daq ziDAQServer

Instance of a Zurich Instruments API session connected to a Data Server. The device with identifier device_id is assumed to already be connected to this instance.

required
device_id str

SHFSG device identifier, e.g. dev12004 or 'shf-dev12004'.

required
channel_index int

Index specifying which sequencer the waveforms below are written to - there is one generator per channel.

required
waveforms dict

Dictionary of waveforms, the key specifies the waveform index to which to write the waveforms.

required