Python Utils SHFQC¶
zhinst.utils.shfqc
¶
Zurich Instruments LabOne Python API Utility functions for SHFQC.
configure_marker_and_trigger(daq, device_id, channel_index, *, trigger_in_source, trigger_in_slope, marker_out_source)
¶
Configures the trigger inputs and marker outputs of a specified AWG core.
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
|
SHFQC device identifier, e.g. |
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") |
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") |
required |
configure_pulse_modulation(daq, 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)
¶
Configure the pulse modulation.
Configures the sine generator to digitally modulate the AWG output, for generating single sideband AWG signals.
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
|
SHFQC device identifier, e.g. |
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
|
configure_qa_channel(daq, device_id, *, input_range, output_range, center_frequency, mode)
¶
Configures the RF input and output of a specified QA 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
|
SHFQC device identifier, e.g. |
required |
input_range |
int
|
Maximal range of the signal input power in dbM. |
required |
output_range |
int
|
Maximal range of the signal output power in dbM. |
required |
center_frequency |
float
|
Center Frequency of the analysis band. |
required |
mode |
str
|
Select between "spectroscopy" and "readout" mode. |
required |
configure_qa_sequencer_triggering(daq, device_id, *, aux_trigger, play_pulse_delay=0.0)
¶
Configures the triggering 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
|
SHFQC device identifier, e.g. |
required |
aux_trigger |
str
|
Alias for the trigger used in the sequencer. For a list of available values use. daq.help(f"/{device_id}/qachannels/0/generator/auxtriggers/0/channel") |
required |
play_pulse_delay |
float
|
Delay in seconds before the start of waveform playback. |
0.0
|
configure_result_logger_for_readout(daq, device_id, *, result_source, result_length, num_averages=1, averaging_mode=0)
¶
Configures a specified result logger for readout mode.
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
|
SHFQC device identifier, e.g. |
required |
result_source |
str
|
String-based tag to select the result source in readout mode, e.g. "result_of_integration" or "result_of_discrimination". |
required |
result_length |
int
|
Number of results to be returned by the result logger. |
required |
num_averages |
int
|
Number of averages, will be rounded to 2^n. |
1
|
averaging_mode |
int
|
Select the averaging order of the result, with 0 = cyclic and 1 = sequential. |
0
|
configure_result_logger_for_spectroscopy(daq, device_id, *, result_length, num_averages=1, averaging_mode=0)
¶
Configures a specified result logger for spectroscopy mode.
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
|
SHFQC device identifier, e.g. |
required |
result_length |
int
|
Number of results to be returned by the result logger |
required |
num_averages |
int
|
Number of averages, will be rounded to 2^n. |
1
|
averaging_mode |
int
|
Select the averaging order of the result, with 0 = cyclic and 1 = sequential. |
0
|
configure_scope(daq, device_id, *, input_select, num_samples, trigger_input, num_segments=1, num_averages=1, trigger_delay=0.0)
¶
Configures the scope for a measurement.
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
|
SHFQC device identifier, e.g. |
required |
input_select |
dict
|
Keys (int) map a specific scope channel with a signal source (str), e.g. "channel0_signal_input". For a list of available values use daq.help(f"/{device_id}/scopes/0/channels/0/inputselect"). |
required |
num_samples |
int
|
Number of samples. |
required |
trigger_input |
str
|
Specifies the trigger source of the scope acquisition - if set to None, the self-triggering mode of the scope becomes active, which is useful e.g. for the GUI. For a list of available trigger values use daq.help(f"/{device_id}/scopes/0/trigger/channel"). |
required |
num_segments |
int
|
Number of distinct scope shots to be returned after ending the acquisition. |
1
|
num_averages |
int
|
Specifies how many times each segment should be averaged on hardware; to finish a scope acquisition, the number of issued triggers must be equal to num_segments * num_averages. |
1
|
trigger_delay |
float
|
Delay in samples specifying the time between the start of data acquisition and reception of a trigger. |
0.0
|
configure_sg_channel(daq, device_id, channel_index, *, enable, output_range, center_frequency, rflf_path)
¶
Configures the RF input and output of a specified SG 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
|
SHFQC device identifier, e.g. |
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 |
configure_sine_generation(daq, 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)
¶
Configures the sine generator output of a specified SG channel.
Configures the sine generator output of a specified channel for generating continuous wave signals without the AWG.
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
|
SHFQC device identifier, e.g. |
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
|
configure_weighted_integration(daq, device_id, *, weights, integration_delay=0.0, clear_existing=True)
¶
Configures the weighted integration on 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
|
SHFQC device identifier, e.g. |
required |
weights |
dict
|
Dictionary containing the complex weight vectors, where keys correspond to the indices of the integration units to be configured. |
required |
integration_delay |
float
|
Delay in seconds before starting readout. |
0.0
|
clear_existing |
bool
|
Specify whether to set all the integration weights to zero before proceeding with the present upload. |
True
|
enable_result_logger(daq, device_id, *, mode, acknowledge_timeout=1.0)
¶
Resets and enables a specified result logger.
Blocks until the host has received the enable acknowledgment from the device.
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
|
SHFQC device identifier, e.g. |
required |
mode |
str
|
Select between "spectroscopy" and "readout" mode. |
required |
acknowledge_timeout |
float
|
Maximum time to wait for diverse acknowledgments in the implementation. |
1.0
|
.. versionadded:: 0.1.1
enable_scope(daq, device_id, *, single, acknowledge_timeout=1.0)
¶
Resets and enables the scope.
Blocks until the host has received the enable acknowledgment from the device.
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
|
SHFQC device identifier, e.g. |
required |
single |
int
|
0 = continuous mode, 1 = single-shot. |
required |
acknowledge_timeout |
float
|
Maximum time to wait for diverse acknowledgments in the implementation. |
1.0
|
.. versionadded:: 0.1.1
enable_sequencer(daq, device_id, channel_index, *, single, channel_type)
¶
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
|
SHFQC device identifier, e.g. |
required |
channel_index |
int
|
Index specifying which sequencer to enable - there is one sequencer per channel. (Always 0 for the qa channel) |
required |
single |
int
|
1 - Disable sequencer after finishing execution. 0 - Restart sequencer after finishing execution. |
required |
channel_type |
str
|
Identifier specifying if the sequencer from the qa or sg channel should be used. ("qa" or "sg") |
required |
get_result_logger_data(daq, device_id, *, mode, timeout=1.0)
¶
Return the measured data of a specified result logger.
Blocks until the specified result logger is finished.
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
|
SHFQC device identifier, e.g. |
required |
mode |
str
|
Select between "spectroscopy" and "readout" mode. |
required |
timeout |
float
|
Maximum time to wait for data in seconds. |
1.0
|
Returns:
Type | Description |
---|---|
array
|
Array containing the result logger data. |
get_scope_data(daq, device_id, *, timeout=5.0)
¶
Queries the scope for data once it is finished.
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
|
SHFQC device identifier, e.g. |
required |
timeout |
float
|
Maximum time to wait for the scope data in seconds. |
5.0
|
Returns:
Type | Description |
---|---|
tuple
|
Three-element tuple with: * recorded_data (array): Contains an array per scope channel with the recorded data. * recorded_data_range (array): Full scale range of each scope channel. * scope_time (array): Relative acquisition time for each point in recorded_data in seconds starting from 0. |
load_sequencer_program(daq, device_id, channel_index, sequencer_program, *, channel_type, awg_module=None, timeout=10)
¶
Compiles and loads a program to 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
|
SHFQC device identifier, e.g. |
required |
channel_index |
int
|
Index specifying to which sequencer the program below is uploaded - there is one sequencer per channel. (Always 0 for the qa channel) |
required |
sequencer_program |
str
|
Sequencer program to be uploaded. |
required |
channel_type |
str
|
Identifier specifying if the sequencer from the qa or sg channel should be used. ("qa" or "sg") |
required |
awg_module |
AwgModule
|
The standalone AWG compiler is used instead. .. deprecated:: 22.08 |
None
|
timeout |
float
|
Maximum time to wait for the compilation on the device in seconds. |
10
|
max_qubits_per_qa_channel(daq, device_id)
¶
Returns the maximum number of supported qubits per 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
|
SHFQC device identifier, e.g. |
required |
start_continuous_sw_trigger(daq, device_id, *, num_triggers, wait_time)
¶
Start a continuous trigger.
Issues a specified number of software triggers with a certain wait time in between. The function guarantees reception and proper processing of all triggers by the device, but the time between triggers is non-deterministic by nature of software triggering.
Warning
Only use this function for prototyping and/or cases without strong timing requirements.
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
|
SHFQC device identifier, e.g. |
required |
num_triggers |
int
|
Number of triggers to be issued. |
required |
wait_time |
float
|
Time between triggers in seconds. |
required |
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
|
SHFQC device identifier, e.g. |
required |
channel_index |
int
|
Index specifying which SG 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, *, channel_type, clear_existing=True)
¶
Writes pulses to the waveform memory of a specified generator.
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
|
SHFQC device identifier, e.g. |
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 slot to which to write the value which is a complex array containing the waveform samples. |
required |
channel_type |
str
|
Identifier specifying if the waveforms should be uploaded to the qa or sg channel. ("qa" or "sg") |
required |
clear_existing |
bool
|
Specify whether to clear the waveform memory before the present upload. (Only used when channel_type is "qa"!) |
True
|