HDAWG

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

Bases: zhinst.qcodes.base.ZIBaseInstrument

QCoDeS driver for the Zurich Instruments HDAWG.

Inherits from ZIBaseInstrument. Initializes some submodules from the device’s nodetree and a ChannelList of device-specific AWGs for high-level control of the AWG Cores.

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)

awgs

A list of four HDAWG specific AWG Cores (zhinst.qcodes.hdawg.AWG).

Type

ChannelList

AWG Core for HDAWG

class zhinst.qcodes.hdawg.AWG(name: str, index: int, parent_instr, parent_contr)

Bases: qcodes.instrument.channel.InstrumentChannel

Device-specific AWG Core for the HDAWG.

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

State of the output 1, i.e. one of {‘on’, ‘off’}.

Type

Parameter

output2

State of the output 2, i.e. one of {‘on’, ‘off’}.

Type

Parameter

modulation_freq

Frequency of the modulation in Hz if IQ modulation is enabled.

Type

Parameter

modulation_phase_shift

Phase shift in degrees between I and Q quadratures if IQ modulation is enabled (default: 90).

Type

Parameter

gain1

Gain of the output channel 1 if IQ modulation is enabled. Must be between -1 and +1 (default: +1).

Type

Parameter

gain2

Gain of the output channel 2 if IQ modulation is enabled. 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 Sequence Program on the AWG Core.

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

  • ToolkitError – If the compilation has failed.

  • Warning – If the compilation has finished with a warning.

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.

disable_iq_modulation() → None

Disables IQ modulation on the AWG Core.

Resets the settings of the sine generators and the AWG modulation.

enable_iq_modulation() → None

Enables IQ Modulation by on the AWG Core.

This method applies the corresponding settings for IQ modulation using one of the internal oscillators and two sine generators. The sines are used to modulate the AWG output channels. The parameters modulation_freq, modulation_phase_shift and gain1, gain2 correspond to the settings of the oscillator and the sine generators.

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’ sequence type. 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.

Keyword Arguments

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)

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.

Keyword Arguments
  • 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)

reset_queue() → None

Resets the waveform queue to an empty list.

run() → None

Runs the AWG Core.

sequence_params() → Dict

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() → None

Stops the AWG Core.

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’ mode and has been compiled beforehand.

wait_done(timeout: float = 10) → None

Waits until the AWG Core is finished running.

Keyword Arguments

timeout (int) – A timeout in seconds after which the AWG is stopped (default: 100)