UHFQA

class zhinst.qcodes.UHFQA(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 UHFQA.

Inherits from ZIBaseInstrument. Initializes some submodules from the device’s nodetree and a device-specific AWG Core. It also features a ChannelList of ten Readout Channels (Channel).

Parameters
  • name (str) – The internal QCoDeS name of the instrument.

  • serial (str) – The device serial number, e.g. ‘dev1234’.

Keyword Arguments
  • interface (str) – The interface used to connect to the device. (default: ‘1gbe’)

  • host (str) – Address of the data server. (default: ‘localhost’)

  • port (int) – Port used to connect to the data server. (default: 8004)

  • api (int) – Api level used for the data server. (default: 6)

awg

A UHFQA specific AWG Core.

Type

zhinst.qcodes.uhfqa.AWG

channels

A list of ten Readout Channels (zhinst.qcodes.uhfqa.Channel).

Type

ChannelList

arm(length=None, averages=None) → None

Prepare UHFQA for result acquisition.

This method enables the QA Results Acquisition and resets the acquired points. Optionally, the result length and result averages can be set when specified as keyword arguments. If they are not specified,they are not changed.

Parameters
  • length (int) – If specified, the length of the result vector will be set before arming the UHFQA readout (default: None).

  • averages (int) – If specified, the result averages will be set before arming the UHFQA readout (default: None).

disable_readout_channels(channels: List = range(0, 10)) → None

Disable weighted integration on the specified readout channels.

Parameters

channels (list) – A list of indices of channels to disable. (default: range(10))

Raises

ValueError – If the channel list contains an element outside the allowed range.

enable_manual_mode() → None

Disconnect from the PQSC.

This method sets the reference clock source and DIO settings to factory default states and the instrument is disconnected from the PQSC.

enable_qccs_mode() → None

Configure the instrument to work with PQSC.

This method sets the reference clock source and DIO settings correctly to connect the instrument to the PQSC.

enable_readout_channels(channels: List = range(0, 10)) → None
Enable weighted integration on the specified readout

channels.

Parameters

channels (list) – A list of indices of channels to enable. (default: range(10))

Raises

ValueError – If the channel list contains an element outside the allowed range.

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).

AWG Core for UHFQA

class zhinst.qcodes.uhfqa.AWG(name: str, parent_instr, parent_contr)

Bases: qcodes.instrument.channel.InstrumentChannel

Device-specific AWG Core for the UHFQA.

Inherits from InstrumentChannel and wraps around a AWGCore for HDAWG from zhinst-toolkit. This class adds Parameters from the zhinst-toolkit as QCoDeS Parameters and wraps all methods of the toolkit’s AWGCore.

Parameters
  • name (str) – The name of the AWG submodule.

  • parent_instr (qcodes.instrument.base.Instrument) – The QCoDeS parent instrument of the InstrumentChannel.

  • parent_contr (zhinst.toolkit.BaseInstrument) – The _controller of the parent instrument that is used for getting and setting parameters.

output1

The state of the output of channel 1. Can be one of {‘on’, ‘off’}.

Type

Parameter

output2

The state of the output of channel 2. Can be one of {‘on’, ‘off’}.

Type

Parameter

gain1

Gain of the output channel 1. The value must be between -1 and +1 (default: +1).

Type

Parameter

gain2

Gain of the output channel 2. The value must be between -1 and +1 (default: +1).

Type

Parameter

waveforms

A list of Waveforms that respresent the queue of waveforms to upload to the device when the sequence type is ‘Simple’.

Type

list

is_running

A flag that shows if the AWG Core is currently running or not.

Type

bool

index

The index of the AWG Core in the list of awgs.

Type

int

compile() → None

Compiles the current SequenceProgram on the AWG Core.

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.

outputs(value=None)

Sets both signal outputs simultaneously.

Parameters

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

Returns

A tuple with the states {‘on’, ‘off’} for the two output channels if the keyword argument is not given.

Raises

ValueError – If the value argument is not a list or tuple of length 2.

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

Queues up a waveform to the AWG Core.

Uploading custom waveforms is only possible when using the ‘Simple’ or ‘Custom’ sequence types. The waveform is specified with two numpy arrays for the two channels of the AWG Core. The waveform will then automatically align them to the correct minimum waveform length, sample granularity and scaling. An individual delay can be specified to shift the individual waveform with respect to the time origin of the period.

Parameters
  • wave1 (array like) – A list or array of samples in the waveform to be queued for channel 1. An empty list ‘[]’ will upload zeros of the minimum waveform length.

  • wave2 (array like) – A list or array of samples in the waveform to be queued for channel 2. An empty list ‘[]’ will upload zeros of the minimum waveform length.

  • delay (float) – An individual delay for the queued sequence with respect to the time origin. Positive values shift the start of the waveform forwards in time. (default: 0)

Raises

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

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

Replaces the data in a waveform in the queue.

The new data must have the same length as the previous data s.t. the waveform data can be replaced without recompilation of the sequence program.

Parameters
  • wave1 (array) – Waveform to replace current wave for Channel 1.

  • wave2 (array) – Waveform to replace current wave for Channel 2.

  • 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 AWG Core.

Parameters

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

sequence_params() → None

Returns the current seuence parameters.

Returns

A dictionary with the current sequence parameters.

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 method sequence_params().

They include:

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

>>> hdawg.awgs[0].set_sequence_params(
>>>     sequence_type="Simple",
>>>     trigger_mode="Send Trigger",
>>>     repetitions=1e6,
>>>     alignemnt="Start with Trigger"
>>> )
stop(sync=True) → None

Stop the AWG Core.

Parameters

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

upload_waveforms() → None

Uploads all waveforms in the queue to the AWG Core.

This method only works as expected if the Sequence Program is in ‘Simple’ or ‘Custom’ modes and has been compiled beforehand. See compile_and_upload_waveforms(...)().

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

Wait until the AWG Core is finished.

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

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

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

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

Readout Channel for UHFQA

class zhinst.qcodes.uhfqa.Channel(name: str, index: int, parent_instr, parent_contr)

Bases: qcodes.instrument.channel.InstrumentChannel

Implements a Readout Channel for the UHFQA.

Inherits from InstrumentChannel and wraps around a ReadoutChannel for UHFQA from zhinst-toolkit. This class adds Parameters from the zhinst-toolkit as QCoDeS Parameters and wraps all methods of the toolkit’s ReadoutChannel.

This class represents the signal processing chain for one of the ten ReadoutChannels of a UHFQA. One channel is typically used for dispersive resonator readout of a superconducting Qubit.

>>> ch = uhfqa.channels[0]
>>> uhfqa.result_source("Threshold")
>>> ...
>>> ch.enable()
>>> ch.readout_frequency(85.6e6)
>>> ch.rotation(123.4)
>>> ch.threshold(-56.78)
>>> ...
>>> ch.result()
array([0.0, 1.0, 1.0, 1.0, 0.0, ...])

The readout channel can be enabled with enable() which means that the weighted integration mode is activated and integration weights are set to demodulate the signal at the given readout frequency. If the channel is enabled, the readout parameters are also used for signal generation in the AWGCore if the sequence type is set to “Readout”.

Parameters
  • name (str) – The name of the Channel submodule.

  • parent_instr (qcodes.instrument.base.Instrument) – The QCoDeS parent instrument of the InstrumentChannel.

  • parent_contr (zhinst.toolkit.BaseInstrument) – The _controller of the parent instrument that is used for getting and setting parameters.

index

The index of the Readout Channel from 1 - 10.

Type

int

rotation

The rotation applied to the signal in IQ plane. The angle is specified in degrees.

Type

Parameter

threshold

The signal threshold used for state discrimination in the thresholding unit.

Type

Parameter

result

This read-only Parameter holds the result vector for the given readout channel as a 1D numpy array.

Type

Parameter

disable() → None

Disable weighted integration for this channel.

This method also resets the corresponding integration weights.

enable() → None

Enable weighted integration for this channel.

This method also sets the corresponding integration weights to demodulate at the given readout frequency.

enabled() → None

Returns if weighted integration is enabled.