Sequence Programs

Base Sequence

class zhinst.toolkit.helpers.sequences.Sequence(target=<DeviceTypes.HDAWG: 'hdawg'>, clock_rate=2400000000.0, period=0.0001, trigger_mode=<TriggerMode.SEND_TRIGGER: 'Send Trigger'>, trigger_samples=32, repetitions=1, alignment=<Alignment.END_WITH_TRIGGER: 'End with Trigger'>, n_HW_loop=1, dead_time=5e-06, trigger_delay=0, latency=1.6e-07, latency_cycles=27, latency_adjustment=0, trigger_cmd_1='//', trigger_cmd_2='//', trigger_cmd_define='//\n', trigger_cmd_send='//\n', trigger_cmd_wait='//\n', trigger_cmd_latency='//\n', readout_cmd_trigger='//\n', osc_cmd_reset='//\n', wait_cycles=28500, dead_cycles=1500, wait_samples=228000, dead_samples=12000, reset_phase=False)

Base class for an AWG sequence to be programmed on a AWGCore .

period

Period in seconds at which the experiment is repeated.

Type

double

trigger_mode

The trigger mode of the sequence, i.e if the AWG Core is used to send out the triger signal (‘Send Triger’ or TriggerMode.SEND_TRIGGER), to wait for an external trigger signal (‘Receive Triger’ or TriggerMode.RECEIVE_TRIGGER) or to wait for an external signal to send out the triger signal (‘Send and Receive Triger’ or TriggerMode.SEND_AND_RECEIVE_TRIGGER). (default: TriggerMode.NONE)

Type

str or TriggerMode enum

trigger_samples

The duration of the trigger signal sent out by the AWG Core. It is given in number of samples. (default: 32)

Type

int

repetitions

The number of repetitions of the experiment.

Type

int

alignment

The alignment of the played waveform with the trigger signal, i.e. if the waveform should start with the trigger (or the time origin t=0 of the sequence). Waveforms can either ‘Start with Trigger’ (Alignment.START_WITH_TRIGGER) or ‘End with Trigger’ (Alignment.END_WITH_TRIGGER).

Type

str

dead_time

The dead time of a sequence is the time in seconds after the time origin of the sequence before the next trigger signal is sent / expected. This time defines the maximum length of a waveform played after the time origin, otherwise triggers can be missed. (default: 5 us)

Type

double

trigger_delay

The trigger delay is an addittional delay in seconds that shifts the time origin t=0 with respect to the trigger signal. (default: 0)

Type

double

latency

The latency is a time in seconds that compensated for different trigger latencies of different instruments. It works as a constant trigger_delay.

Type

double

latency_adjustment

In order to compensate for different trigger latencies of different instrument types, it is necessary for some instruments to wait for certain number of sequencer cycles after receiving the trigger. This way, it is possible to align the waveforms sent out from different instruments. The attribute latency_adjustment is an additional latency given as number of sequencer cycles that is used to increase the time an instrument waits after receiving the trigger signal. (default: 0)

Type

int

reset_phase

A flag that specifies if the phase of the modulation oscillator should be reset to 0 for every repetition of the experiment before the waveform is played.

Type

bool

Simple Sequence

class zhinst.toolkit.helpers.sequences.SimpleSequence(target=<DeviceTypes.HDAWG: 'hdawg'>, clock_rate=2400000000.0, period=0.0001, trigger_mode=<TriggerMode.SEND_TRIGGER: 'Send Trigger'>, trigger_samples=32, repetitions=1, alignment=<Alignment.END_WITH_TRIGGER: 'End with Trigger'>, n_HW_loop=1, dead_time=5e-06, trigger_delay=0, latency=1.6e-07, latency_cycles=27, latency_adjustment=0, trigger_cmd_1='//', trigger_cmd_2='//', trigger_cmd_define='//\n', trigger_cmd_send='//\n', trigger_cmd_wait='//\n', trigger_cmd_latency='//\n', readout_cmd_trigger='//\n', osc_cmd_reset='//\n', wait_cycles=28500, dead_cycles=1500, wait_samples=228000, dead_samples=12000, reset_phase=False, buffer_lengths=[800], delay_times=[0], wait_samples_updated=[0], dead_samples_updated=[0])

Bases: zhinst.toolkit.helpers.sequences.Sequence

Sequence for simple playback of waveform arrays.

Initializes placeholders (placeholder(…)) of the correct length for the waveforms in the queue of the AWG Core. The data of the waveform placeholders is then replaced in memory when uploading the waveform using upload_waveforms(). The waveforms are played sequentially within the main loop of the sequence program.

>>> awg.set_sequence_params(sequence_type="Simple")
>>> awg.queue_waveform(np.ones(800), np.oenes(800))
>>> awg.compile_and_upload_waveforms()
>>> ...
buffer_lengths

A list of integers with the required lengths of the waveform buffers. These values will be taken from the waveforms in the queue of the AWG Core.

Type

list

delay_times

A list of delay times for each fo the individual waveform w.r.t. the time origin of the period. These values will be taken from the waveform queue of the AWG Core.

Type

list

Rabi Sequence

class zhinst.toolkit.helpers.sequences.RabiSequence(target=<DeviceTypes.HDAWG: 'hdawg'>, clock_rate=2400000000.0, period=0.0001, trigger_mode=<TriggerMode.SEND_TRIGGER: 'Send Trigger'>, trigger_samples=32, repetitions=1, alignment=<Alignment.END_WITH_TRIGGER: 'End with Trigger'>, n_HW_loop=1, dead_time=5e-06, trigger_delay=0, latency=1.6e-07, latency_cycles=27, latency_adjustment=0, trigger_cmd_1='//', trigger_cmd_2='//', trigger_cmd_define='//\n', trigger_cmd_send='//\n', trigger_cmd_wait='//\n', trigger_cmd_latency='//\n', readout_cmd_trigger='//\n', osc_cmd_reset='//\n', wait_cycles=28500, dead_cycles=1500, wait_samples=228000, dead_samples=12000, reset_phase=False, pulse_amplitudes=[1.0], pulse_width=5e-08, pulse_truncation=3)

Bases: zhinst.toolkit.helpers.sequences.Sequence

Predefined Rabi Sequence.

This sequence plays a Gaussian pulse with width pulse_width and varies its amplitude. The values for the amplitude sweep are defined in the array parameter pulse_amplitudes. For each value in the array, one pulse of that amplitude is played in the main loop of the sequence program in the same order as in the array.

>>> awg.set_sequence_params(
>>>     sequence_type="Rabi",
>>>     pulse_width=50e-9,
>>>     pulse_amplitudes=np.linspace(0, 1.0, 101),
>>> )
pulse_amplitudes

A list of pulse amplitudes for each point in the Rabi sequence. The pulse amplitudes have to be within -1.0 and 1.0.

Type

list

pulse_width

The width of the gaussian pulse (sigma) in seconds.

Type

double

pulse_truncation

The truncation of the gaussian pulse as multiples of the width.

Type

double

T1 Sequence

class zhinst.toolkit.helpers.sequences.T1Sequence(target=<DeviceTypes.HDAWG: 'hdawg'>, clock_rate=2400000000.0, period=0.0001, trigger_mode=<TriggerMode.SEND_TRIGGER: 'Send Trigger'>, trigger_samples=32, repetitions=1, alignment=<Alignment.END_WITH_TRIGGER: 'End with Trigger'>, n_HW_loop=1, dead_time=5e-06, trigger_delay=0, latency=1.6e-07, latency_cycles=27, latency_adjustment=0, trigger_cmd_1='//', trigger_cmd_2='//', trigger_cmd_define='//\n', trigger_cmd_send='//\n', trigger_cmd_wait='//\n', trigger_cmd_latency='//\n', readout_cmd_trigger='//\n', osc_cmd_reset='//\n', wait_cycles=28500, dead_cycles=1500, wait_samples=228000, dead_samples=12000, reset_phase=False, pulse_amplitude=1, pulse_width=5e-08, pulse_truncation=3, delay_times=[1e-06])

Bases: zhinst.toolkit.helpers.sequences.Sequence

Predefined T1 Sequence.

This sequence plays a Gaussian pulse with width pulse_width and amplitude pulse_amplitude. The shift of the waveform with respect to the period’s time origin t=0 is defined in the array parameter time_delays. For each value in the array, one pulse is shifted by the given value (in seconds) forward in time is played in the main loop of the seuence program.

>>> awg.set_sequence_params(
>>>     sequence_type="T1",
>>>     pulse_amplitude=0.876,
>>>     pulse_width=50e-9,
>>>     delay_times=np.linspace(0.1e-6, 10e-6, 100),
>>> )
pulse_amplitude

The amplitude of the Gaussian pulse (pi-pulse). Must be between -1.0 and 1.0.

Type

double

pulse_width

The width of the gaussian pulse (sigma) in seconds.

Type

double

pulse_truncation

The truncation of the gaussian pulse as multiples of the width.

Type

double

delay_times

The time shifts in seconds of the waveforms forward in time with respect to the period’s time origin t=0.

Type

array

T2 Ramsey Sequence

class zhinst.toolkit.helpers.sequences.T2Sequence(target=<DeviceTypes.HDAWG: 'hdawg'>, clock_rate=2400000000.0, period=0.0001, trigger_mode=<TriggerMode.SEND_TRIGGER: 'Send Trigger'>, trigger_samples=32, repetitions=1, alignment=<Alignment.END_WITH_TRIGGER: 'End with Trigger'>, n_HW_loop=1, dead_time=5e-06, trigger_delay=0, latency=1.6e-07, latency_cycles=27, latency_adjustment=0, trigger_cmd_1='//', trigger_cmd_2='//', trigger_cmd_define='//\n', trigger_cmd_send='//\n', trigger_cmd_wait='//\n', trigger_cmd_latency='//\n', readout_cmd_trigger='//\n', osc_cmd_reset='//\n', wait_cycles=28500, dead_cycles=1500, wait_samples=228000, dead_samples=12000, reset_phase=False, pulse_amplitude=1, pulse_width=5e-08, pulse_truncation=3, delay_times=[1e-06])

Bases: zhinst.toolkit.helpers.sequences.T1Sequence

Predefined T2 Ramsey sequence.

This sequence plays two Gaussian pulses with width pulse_width and amplitude 1/2 * pulse_amplitude. The shift between the waveforms is defined in the array parameter time_delays. For each value in the array, the first pulse is shifted forward in time by the given value (in seconds) before the second pulse is played.

>>> awg.set_sequence_params(
>>>     sequence_type="T2*",
>>>     pulse_amplitude=0.876,
>>>     pulse_width=50e-9,
>>>     delay_times=np.linspace(0.1e-6, 10e-6, 100),
>>> )
pulse_amplitude

Twice the amplitude of the Gaussian pulse (pi-half pulse). Must be between -1.0 and 1.0.

Type

double

pulse_width

The width of the gaussian pulse (sigma) in seconds.

Type

double

pulse_truncation

The truncation of the gaussian pulse as multiples of the width.

Type

double

delay_times

The time shifts in seconds of the waveforms forward in time with respect to the period’s time origin t=0.

Type

array

Readout Sequence

class zhinst.toolkit.helpers.sequences.ReadoutSequence(target=<DeviceTypes.HDAWG: 'hdawg'>, clock_rate=2400000000.0, period=0.0001, trigger_mode=<TriggerMode.SEND_TRIGGER: 'Send Trigger'>, trigger_samples=32, repetitions=1, alignment=<Alignment.END_WITH_TRIGGER: 'End with Trigger'>, n_HW_loop=1, dead_time=5e-06, trigger_delay=0, latency=1.6e-07, latency_cycles=27, latency_adjustment=0, trigger_cmd_1='//', trigger_cmd_2='//', trigger_cmd_define='//\n', trigger_cmd_send='//\n', trigger_cmd_wait='//\n', trigger_cmd_latency='//\n', readout_cmd_trigger='//\n', osc_cmd_reset='//\n', wait_cycles=28500, dead_cycles=1500, wait_samples=228000, dead_samples=12000, reset_phase=False, readout_length=2e-06, readout_amplitudes=[1], readout_frequencies=[100000000.0], phase_shifts=[0])

Bases: zhinst.toolkit.helpers.sequences.Sequence

Predefined sequence for Multiplexed Qubit Readout.

The Readout sequence is designed for multiplexed qubit readout. It is made to work together with the Readout Channels of the UHFQA. The sequence generates a readout pulse as the sum of readout tones at different readout frequencies. The readout frequencies are given in the list parameter readout_frequencies, their amplitudes in readout_amplitudes. If the Readout sequence is configured, the integration mode is automatically set to Standard (weighted integration).

For the UHFQA the values for readout frequencies and readout amplitudes can be taken from the respective Readout Channel. If the AWG Core is configured to use the Readout sequence, upon compilation the sequence takes the values from all enabled channels. This ensures that for all channels for which a readout tone is generated, the weighted integration is also a demodulation at that readout frequency. The transfer of the corresponding values from channels to the sequence program is done before compilation or manually using update_readout_params().

>>> frequencies = [34e6, 56e6, 78e6, 90e6]
>>> amplitudes = [0.4, 0.5, 0.6, 0.7]
>>> for i, ch in enumerate(uhfqa.channels[:4]):
>>>     ch.enable()
>>>     ch.readout_frequency(frequencies[i])
>>>     ch.readout_amplitude(amplitudes[i])
>>>
>>> uhfqa.awg.set_sequence_params(
>>>     sequence_type="Readout",
>>>     readout_length=1e-6,
>>> )
>>> uhfqa.awg.update_readout_params()
>>> uhfqa.awg
qa: <zhinst.toolkit.control.drivers.uhfqa.AWG object at 0x000001BA34D978D0>
    parent  : <zhinst.toolkit.control.drivers.uhfqa.UHFQA object at 0x000001BA34D97B38>
    index   : 0
    sequence:
        type: Readout
            ('target', <DeviceTypes.UHFQA: 'uhfqa'>)
            ('clock_rate', 1800000000.0)
            ('period', 0.0001)
            ('trigger_mode', 'None')
            ('repetitions', 1)
            ('alignment', 'End with Trigger')
            ...
            ('readout_length', 2e-06)
            ('readout_amplitudes', [0.4, 0.5, 0.6, 0.7])
            ('readout_frequencies', [34000000.0, 56000000.0, 78000000.0, 90000000.0])
            ('phase_shifts', [0, 0, 0, 0])
readout_length

The duration in seconds of the readout pulse. Note that the maximum integration time for weighted integration is 4096 samples or roughly 2.3 us. (default: 2 us)

Type

double

readout_freqencies

A list of readout frequencies in Hz. These values are typically taken from the Readout Channels of the UHFQA.

Type

list

readout_amplitudes

A list of readout amplitudes (-1.0 to 1.0). These values are typically taken from the Readout Channels of the UHFQA. Note that the amplitude of each tone is always divided by the number of tones.

Type

list

phase_shifts

A list of additional phase shifts (in degrees) between the generated I and Q quadratures of each individual readout tone.

Type

list

Pulsed Spectroscopy Sequence

class zhinst.toolkit.helpers.sequences.PulsedSpectroscopySequence(target=<DeviceTypes.HDAWG: 'hdawg'>, clock_rate=2400000000.0, period=0.0001, trigger_mode=<TriggerMode.SEND_TRIGGER: 'Send Trigger'>, trigger_samples=32, repetitions=1, alignment=<Alignment.END_WITH_TRIGGER: 'End with Trigger'>, n_HW_loop=1, dead_time=5e-06, trigger_delay=0, latency=1.6e-07, latency_cycles=27, latency_adjustment=0, trigger_cmd_1='//', trigger_cmd_2='//', trigger_cmd_define='//\n', trigger_cmd_send='//\n', trigger_cmd_wait='//\n', trigger_cmd_latency='//\n', readout_cmd_trigger='//\n', osc_cmd_reset='//\n', wait_cycles=28500, dead_cycles=1500, wait_samples=228000, dead_samples=12000, reset_phase=False, pulse_length=2e-06, pulse_amplitude=1, pulse_samples=3600, wait_samples_updated=0, dead_samples_updated=0)

Bases: zhinst.toolkit.helpers.sequences.Sequence

Predefined Sequence for Pulsed Spectroscopy.

This sequence plays a rectangular pulse of duration pulse_length (in seconds). When this sequence is configured, the AWG output modulation of the UHFQA is enabled and the two output channels are modulated with the sine and cosine of the internal oscillator. The oscillators frequency can be set with the Parameter uhfqa.nodetree.osc.freq.

In this sequence the sine generators are enabled, so the oscillator runs continouosly. Therefore, it is required that the oscillator phase is set to zero with the resetOscPhase instruction before playing the pulse. Therefore, reset_phase parameter is set to True.

Similarly, the integration mode of the UHFQA is set to Spectroscopy to demodulate the input signals with the sine and cosine of the same internal oscillator. Note that when modulating the AWG output, the value for integration time has to be set to at least as long as the pulse duration of the modulated pulse.

>>> awg.set_sequence_params(
>>>     sequence_type="Pulsed Spectroscopy",
>>>     trigger_mode="Receive Trigger",
>>>     pulse_length=5e-6,
>>>     pulse_amplitude=0.567,
>>> )
pulse_length

The duration of the spectroscopy pulse in seconds.

Type

double

pulse_amplitude

The amplitude of the generated rectangular pulse.

Type

double

CW Spectroscopy Sequence

class zhinst.toolkit.helpers.sequences.CWSpectroscopySequence(target=<DeviceTypes.HDAWG: 'hdawg'>, clock_rate=2400000000.0, period=0.0001, trigger_mode=<TriggerMode.SEND_TRIGGER: 'Send Trigger'>, trigger_samples=32, repetitions=1, alignment=<Alignment.END_WITH_TRIGGER: 'End with Trigger'>, n_HW_loop=1, dead_time=5e-06, trigger_delay=0, latency=1.6e-07, latency_cycles=27, latency_adjustment=0, trigger_cmd_1='//', trigger_cmd_2='//', trigger_cmd_define='//\n', trigger_cmd_send='//\n', trigger_cmd_wait='//\n', trigger_cmd_latency='//\n', readout_cmd_trigger='//\n', osc_cmd_reset='//\n', wait_cycles=28500, dead_cycles=1500, wait_samples=228000, dead_samples=12000, reset_phase=False)

Bases: zhinst.toolkit.helpers.sequences.Sequence

Predefined sequence for Continuous-Wave Spectroscopy.

The sequence configures the direct output of the oscillator signal. There are no actual waveforms payed within the seuqence program, however, the data acquisition of the QA Results is triggered.

Trigger Sequence

class zhinst.toolkit.helpers.sequences.TriggerSequence(target=<DeviceTypes.HDAWG: 'hdawg'>, clock_rate=2400000000.0, period=0.0001, trigger_mode=<TriggerMode.SEND_TRIGGER: 'Send Trigger'>, trigger_samples=32, repetitions=1, alignment=<Alignment.END_WITH_TRIGGER: 'End with Trigger'>, n_HW_loop=1, dead_time=5e-06, trigger_delay=0, latency=1.6e-07, latency_cycles=27, latency_adjustment=0, trigger_cmd_1='//', trigger_cmd_2='//', trigger_cmd_define='//\n', trigger_cmd_send='//\n', trigger_cmd_wait='//\n', trigger_cmd_latency='//\n', readout_cmd_trigger='//\n', osc_cmd_reset='//\n', wait_cycles=28500, dead_cycles=1500, wait_samples=228000, dead_samples=12000, reset_phase=False)

Bases: zhinst.toolkit.helpers.sequences.Sequence

Predefined sequence for Master Trigger.

This sequence does not play any waveforms but only sends out the trigger signal once at the start of the sequence program. The trigger_mode parameter must be chosen as ‘Send Trigger’ or ‘Send and Receive Trigger’. Otherwise, it will automatically be overwritten to be ‘Send Trigger’. The trigger signal will be played on the AWG core output 1. However, this signal should still be manually assigned to the desired Mark output in DIO settings by selecting Output 1 Marker 1.

>>> awg.set_sequence_params(
>>>     sequence_type="Trigger",
>>>     period=50e-6,
>>>     repetitions=1e3,
>>> )

Custom Sequence

class zhinst.toolkit.helpers.sequences.CustomSequence(target=<DeviceTypes.HDAWG: 'hdawg'>, clock_rate=2400000000.0, period=0.0001, trigger_mode=<TriggerMode.SEND_TRIGGER: 'Send Trigger'>, trigger_samples=32, repetitions=1, alignment=<Alignment.END_WITH_TRIGGER: 'End with Trigger'>, n_HW_loop=1, dead_time=5e-06, trigger_delay=0, latency=1.6e-07, latency_cycles=27, latency_adjustment=0, trigger_cmd_1='//', trigger_cmd_2='//', trigger_cmd_define='//\n', trigger_cmd_send='//\n', trigger_cmd_wait='//\n', trigger_cmd_latency='//\n', readout_cmd_trigger='//\n', osc_cmd_reset='//\n', wait_cycles=28500, dead_cycles=1500, wait_samples=228000, dead_samples=12000, reset_phase=False, path='', program='', custom_params=[], ct_path='')

Bases: zhinst.toolkit.helpers.sequences.Sequence

A Custom Sequence for compiling an existing .seqC program.

The Custom Sequence allows the user to specify the file path to an existing .seqC program. It needs to be located in the folder “…/Zurich Instruments/LabOne/WebServer/awg/src”.

Additionally, the Custom Sequence gives the user the ability to define variable placeholders in their .seqC program. So parameter custom_params expects a list of values that replace placeholders in the program. The placeholders are specified as special in the format “$param{i}$” where i is the index of the value in the custom_params list.

>>> awg.set_sequence_params(
>>>    sequence_type="Custom",
>>>    path="...\Zurich Instruments\LabOne\WebServerwg\src\myProgram.seqC",
>>>    custom_params=[1000, 99, 1],
>>>    ct_path="Path    o
alidct.json
>>> )

If the specified ‘myProgram.seqC’ sequence program has placeholders “$param0$”, “$param1$”, “$param2$”, they will be replaced by “1000”, “99”, “1”.

Attributes:

path (str): The file path to a preexisting .seqC program. custom_params (list): A list of parameter values to replace placeholders

in the program.