Skip to content

Python Utils SHFQA Sweeper

zhinst.utils.shf_sweeper

Class for frequency sweeps on SHFQA

Config = namedtuple('Config', ['sweep', 'avg', 'rf', 'trig']) module-attribute

AvgConfig dataclass

Averaging settings for a sweep

integration_delay: float = 2.24e-07 class-attribute instance-attribute

time delay after the trigger for the integrator to start

integration_time: float = 0.001 class-attribute instance-attribute

mode: str = 'cyclic' class-attribute instance-attribute

averaging mode, which can be "cyclic", to first scan the frequency and then repeat, or "sequential", to average each point before changing the frequency

num_averages: int = 1 class-attribute instance-attribute

EnvelopeConfig dataclass

Settings for defining a complex envelope for pulsed spectroscopy

delay: float = 0.0 class-attribute instance-attribute

waveform: np.complex128 = None class-attribute instance-attribute

RfConfig dataclass

RF in- and output settings for a sweep

center_freq: float = 5000000000.0 class-attribute instance-attribute

channel: int = 0 class-attribute instance-attribute

input_range: int = -5 class-attribute instance-attribute

output_range: int = 0 class-attribute instance-attribute

ShfSweeper(daq, dev)

Class to set up and run a sweep on an SHFQA

Parameters:

Name Type Description Default
daq ziDAQServer

ziDAQServer object to communicate with a Zurich Instruments data server

required
dev str

The ID of the device to run the sweeper with. For example, dev12004.

required

actual_hold_off_time: float property

Wait time after triggering the integration unit until the next cycle.

Note: the granularity of this time is 16 samples (8 ns).

actual_settling_time: float property

Wait time between setting new frequency and triggering of integration.

Note: the granularity of this time is 16 samples (8 ns).

predicted_cycle_time: float property

Predicted duration of each cycle of the spectroscopy loop.

Note: this property only applies in self-triggered mode, which is active when the trigger source is set to None and use_sequencer is True.

configure(sweep_config=None, avg_config=None, rf_config=None, trig_config=None, envelope_config=None)

Configure and check the settings

Parameters:

Name Type Description Default
sweep_config SweepConfig

@dataclass containing sweep configuration (None: default configuration applies)

None
avg_config AvgConfig

@dataclass with averaging configuration (None: default configuration applies)

None
rf_config RfConfig

@dataclass with RF configuration (None: default configuration applies)

None
trig_config TriggerConfig

@dataclass with trigger configuration (None: default configuration applies)

None
envelope_config EnvelopeConfig

(EnvelopeConfig, optional): @dataclass configuring the envelope for pulse spectroscopy (None: the multiplication with the envelope is disabled)

None

get_configuration()

Get the current configuration.

Returns:

Type Description
Config

The configuration of the sweeper class as

Config

Config(SweepConfig, AvgConfig, RfConfig, TriggerConfig)

get_offset_freq_vector()

Get vector of frequency points

get_result(data=None)

Get the result of the sweep.

Parameters:

Name Type Description Default
data dict

optional data. If not provided, the data is fetched from the device.

None

Returns:

Type Description
Dict[str, Any]

A dictionary with measurement data of the last sweep.

plot(input_impedance_ohm=50.0)

Plots power over frequency for last sweep

run()

Perform a sweep with the specified settings.

WARNING: During the sweep the following nodes are subscribed and the sync command is used to clear all buffers on the data server before the measurement:

/{dev}/qachannels/{rf.channel}/spectroscopy/result/acquired /{dev}/qachannels/{rf.channel}/spectroscopy/result/data/wave

Returns:

Type Description
Dict[str, Any]

A dictionary with measurement data of the sweep

set_to_device()

Transfer settings to device

SweepConfig dataclass

Frequency range settings for a sweep

mapping: str = 'linear' class-attribute instance-attribute

num_points: int = 100 class-attribute instance-attribute

oscillator_gain: float = 1 class-attribute instance-attribute

psd: bool = False class-attribute instance-attribute

specify whether to compute the Power Spectral Density (PSD)

settling_time: float = _MIN_SETTLING_TIME class-attribute instance-attribute

time to wait to ensure new frequency took effect in the device under test

start_freq: float = -300000000.0 class-attribute instance-attribute

stop_freq: float = 300000000.0 class-attribute instance-attribute

use_sequencer: bool = True class-attribute instance-attribute

specify whether to use the fast sequencer-based sweep (True) or the slower host-driven sweep (False)

wait_after_integration: float = 0.0 class-attribute instance-attribute

time to wait after the integration finished until the next frequency is set

TriggerConfig dataclass

Settings for the trigger

force_sw_trigger: bool = False class-attribute instance-attribute

if True, the sequencer program waits for the software trigger even in sequencer-based mode. Note, however, that the ShfSweeper python class will not generate the software trigger on its own. Thus this mode is only useful if a separate API session issues the software triggers!

imp50: bool = True class-attribute instance-attribute

level: float = 0.5 class-attribute instance-attribute

source: str = None class-attribute instance-attribute

trigger source. Please refer to the node documentation in the user manual under /DEV.../QACHANNELS/n/GENERATOR/AUXTRIGGERS/n/CHANNEL for a list of possible sources. The default source (None) means the repetition rate of the experiment will be determined by the sequencer using the integration time in AvgConfig and settling time in SweepConfig. Further note that the software trigger is not supported for the sequencer-based sweeps (exception see force_sw_trigger)!