SHFQA

class zhinst.qcodes.SHFQA(name: str, serial: str, interface: str = '1gbe', host: str = 'localhost', port: int = 8004, api: int = 6, **kwargs)

Bases: zhinst.qcodes.control.drivers.base.base.ZIBaseInstrument

QCoDeS driver for the Zurich Instruments SHFQA

check_ref_clock(blocking: bool = True, timeout: int = 30, sleep_time: int = 1) → None

Check if reference clock is locked successfully.

Parameters
  • blocking (bool) – A flag that specifies if the program should be blocked until the reference clock is ‘locked’. (default: True)

  • timeout (int) – Maximum time in seconds the program waits when blocking is set to True (default: 30).

  • sleep_time (int) – Time in seconds to wait between requesting the reference clock status (default: 1)

Raises

ToolkitError – If the device fails to lock on the reference clock.

clear_trigger_loopback()

Stop the the internal loopback trigger pulse.

factory_reset(sync=True) → None

Load the factory default settings.

Parameters

sync (bool) – A flag that specifies if a synchronisation should be performed between the device and the data server after loading the factory preset (default: True).

set_trigger_loopback()

Start a trigger pulse using the internal loopback.

A 1kHz continuous trigger pulse from marker 1 A using the internal loopback to trigger in 1 A.

QAChannel Module for SHFQA

class zhinst.qcodes.shfqa.QAChannel(name: str, index: int, parent_instr, parent_contr)

Bases: qcodes.instrument.channel.InstrumentChannel

Device-specific QAChannel for the SHFQA.

Generator Module for SHFQA

class zhinst.qcodes.shfqa.Generator(name: str, parent_instr, parent_contr)

Bases: qcodes.instrument.channel.InstrumentChannel

Device-specific Generator for the SHFQA.

compile() → None

Compile the current SequenceProgram and load it to sequencer.

Raises
  • ToolkitConnectionError – If the AWG Core has not been set up yet

  • ToolkitError – if the compilation has failed or the ELF upload is not successful.

  • TimeoutError – if the program upload is not completed before timeout.

compile_and_upload_waveforms() → None

Compiles the Sequence Program and uploads the queued waveforms.

Simply combines the two methods to make sure the sequence is compiled before the waveform queue is uplaoded.

property name

Name of the instrument

queue_waveform(wave: Union[List, numpy.array], delay: float = 0) → None

Add a new waveform to the queue.

Parameters
  • wave (array) – The waveform to be queued as a 1D numpy array.

  • delay (int) – An individual delay in seconds for this waveform w.r.t. the time origin of the sequence. (default: 0)

Raises

ToolkitError – If the sequence is not of type ‘Custom’.

replace_waveform(wave: Union[List, numpy.array], i: int = 0, delay: float = 0) → None

Replace a waveform in the queue at a given index.

Parameters
  • wave (array) – Waveform to replace current wave

  • i (int) – The index of the waveform in the queue to be replaced.

  • delay (int) – An individual delay in seconds for this waveform w.r.t. the time origin of the sequence. (default: 0)

Raises

ValueError – If the given index is out of range.

reset_queue() → None

Resets the waveform queue to an empty list.

run(sync=True) → None

Run the generator.

Parameters

sync (bool) – A flag that specifies if a synchronisation should be performed between the device and the data server after enabling the generator (default: True).

set_sequence_params(**kwargs) → None

Sets the parameters of the Sequence Program.

Passes all the keyword arguments to the set_param(…) method of the Sequence Program. The available sequence parameters may vary between different sequences. For a list of all current sequence parameters see the property sequence_params.

They include ‘sequence_type’, ‘period’, ‘repetitions’, ‘trigger_mode’, ‘trigger_delay’, …

>>> shfqa.qachannels[0].generator.set_sequence_params(
>>>     sequence_type="Custom",
>>>     program = seqc_program_string,
>>>     custom_params = [param1, param2],
>>> )
stop(sync=True) → None

Stop the generator.

Parameters

sync (bool) – A flag that specifies if a synchronisation should be performed between the device and the data server after disabling the generator (default: True).

upload_waveforms() → None

Upload all waveforms in the queue to the Generator.

This method only works as expected if the Sequence Program has been compiled beforehand. See compile_and_upload_waveforms(...)().

wait_done(timeout: float = 10, sleep_time: float = 0.005) → None

Wait until the generator is finished.

Parameters
  • timeout (float) – The maximum waiting time in seconds for the generator (default: 10).

  • sleep_time (float) – Time in seconds to wait between requesting generator state

Raises
  • ToolkitError – If the generator is running in continuous mode.

  • TimeoutError – If the generator is not finished before the timeout.

Integration Module for SHFQA

class zhinst.qcodes.shfqa.Integration(name: str, index: int, parent_instr, parent_contr)

Bases: qcodes.instrument.channel.InstrumentChannel

Device-specific Integration for the SHFQA.

Sweeper Module for SHFQA

class zhinst.qcodes.shfqa.Sweeper(name: str, parent_instr, parent_contr)

Bases: qcodes.instrument.channel.InstrumentChannel

Device-specific Sweeper for the SHFQA.

averaging_mode(mode=None)

Set or get the averaging mode for the sweeper.

Parameters

mode (str) –

Averaging mode for the sweeper. Can be either “sequential” or “cyclic” (default: None).

”sequential”: A frequency point is measured the number of times specified by the number of averages setting. In other words, the same frequency point is measured repeatedly until the number of averages is reached and the sweeper then moves to the next frequency point.

”cyclic”: All frequency points are measured once from start frequency to stop frequency. The sweeper then moves back to start frequency and repeats the sweep the number of times specified by the number of averages setting.

mapping(map=None)

Set or get the mapping configuration for the sweeper.

Parameters

map (str) – Mapping that specifies the distances between frequency points of the sweeper. Can be either “linear” or “log” (default: None).

num_averages(num=None)

Set or get the number of averages for the sweeper.

Number of averages specifies how many times a frequency point will be measured and averaged.

Parameters

num (int) – Number of times the sweeper measures one frequency point (default: None).

num_points(num=None)

Set or get the number of points for the sweeper.

Parameters

num (int) – Number of frequency points to sweep between start and stop frequency values (default: None).

output_freq()

Get the output frequency.

Returns

The carrier frequency in Hz of the microwave signal at the Out connector. This frequency corresponds to the sum of the Center Frequency and the Offset Frequency.

plot()

Plot power over frequency for last sweep.

This method eventually wraps around the plot method of zhinst.utils.shf_sweeper

read()

Get the measurement data of the last sweep.

This method eventually wraps around the get_result method of zhinst.utils.shf_sweeper

Returns

A dictionary with measurement data of the last sweep

run()

Perform a sweep with the specified settings.

This method eventually wraps around the run method of zhinst.utils.shf_sweeper

start_frequency(freq=None)

Set or get the start frequency for the sweeper.

Parameters

freq (float) – Start frequency in Hz of the sweeper (default: None).

stop_frequency(freq=None)

Set or get the stop frequency for the sweeper.

Parameters

freq (float) – Stop frequency in Hz of the sweeper (default: None).

trigger_imp50(imp50=None)

Set or get the trigger input impedance setting for the sweeper.

Parameters

imp50 (bool) – Trigger input impedance selection for the sweeper. When set to True, the trigger input impedance is 50 Ohm. When set to False, it is 1 kOhm (default: None).

trigger_level(level=None)

Set or get the trigger level for the sweeper.

Parameters

level (float) – Trigger level of the sweeper (default: None).

Scope Module for SHFQA

class zhinst.qcodes.shfqa.Scope(name: str, parent_instr, parent_contr)

Bases: qcodes.instrument.channel.InstrumentChannel

Device-specific Scope for the SHFQA.

averaging(enable=None, count=None)

Configure averaging options of Scope measurements.

Keyword Arguments
  • enable (bool) – a flag that specifies whether averaging of Scope measurements is enabled (default: None).

  • count (int) – number of Scope measurements to average (default: None)

Returns

A dictionary showing the enable state and averaging count

channels(value=None)

Set all Scope channels simultaneously.

Parameters

value (tuple) – Tuple of values {‘on’, ‘off’} for channel 1, 2, 3 and 4 (default: None).

Returns

A tuple with the states {‘on’, ‘off’} for all input channels.

input_select(value=None)

Set all Scope input signals simultaneously.

Keyword Arguments

value (tuple) – Tuple of values for input signal 1, 2, 3 and 4. The accepted values can be found in SHFQA user manual (default: None).

Returns

A tuple with the selected input signal sources for all input channels.

read(channel=None, blocking: bool = True, timeout: float = 10, sleep_time: float = 0.005)

Read out the recorded data from the specified channel of the scope.

Parameters
  • channel (int) – The scope channel to read the data from. If no channel is specified, the method will return the data for all channels.

  • blocking (bool) – A flag that specifies if the program should be blocked until the scope has finished recording (default: True).

  • timeout (float) – The maximum waiting time in seconds for the Scope (default: 10).

  • sleep_time (float) – Time in seconds to wait between requesting the progress and records values

Returns

A dictionary showing the recorded data and scope time.

Raises

TimeoutError – if the scope recording is not completed before timeout.

run(sync=True) → None

Run the scope recording.

Parameters

sync (bool) – A flag that specifies if a synchronisation should be performed between the device and the data server after starting the scope recording (default: True).

segments(enable=None, count=None)

Configure segmented Scope recording options.

Keyword Arguments
  • enable (bool) – a flag that specifies whether segmented Scope recording is enabled (default: None).

  • count (int) – number of segments in device memory (default: None)

Returns

A dictionary showing the enable state and segment count

stop(sync=True) → None

Stop the scope recording.

Parameters

sync (bool) – A flag that specifies if a synchronisation should be performed between the device and the data server after stopping scope recording (default: True).

wait_done(timeout: float = 10, sleep_time: float = 0.005) → None

Wait until the Scope recording is finished.

Parameters
  • timeout (int) – The maximum waiting time in seconds for the Scope (default: 10).

  • sleep_time (float) – Time in seconds to wait between requesting the progress and records values

Raises

ToolkitError – If the Scope recording is not done before the timeout.