Skip to content

AWG Tab

The AWG tab is available on all SHFQC Qubit Controller instruments.

Features

  • 4- or 8-channel arbitrary waveform generator
  • 98 kSa waveform memory per channel
  • Sequence branching
  • Digital modulation
  • Cross-domain trigger engine
  • Sequence Editor with code highlighting and auto completion
  • High-level programming language with waveform generation and editing toolset
  • Waveform viewer

Description

The AWG tab gives access to the arbitrary waveform generator functionality. Whenever the tab is closed or an additional one of the same type is needed, clicking the following icon will open a new instance of the tab.

Table 1: App icon and short description
Control/Tool Option/Range Description
AWG Generate arbitrary signals using sequencing and sample-by-sample definition of waveforms.

The AWG tab (see Figure 1) consists of a settings section on the right side and the Sequence and Waveform Viewer sub-tabs on the left side. The settings section is further divided into Control, Waveform, Trigger, and Advanced sub-tabs. The Sequence sub-tab is used for displaying, editing and compiling a LabOne sequence program. The sequence program defines which waveforms are played and in which order. The Sequence Editor is the main tool for operating the AWG.

Figure 1: LabOne UI: AWG tab

A number of sequence programming examples are available through a drop-down menu at the top of the Sequence Editor, and additional ones can be found in Tutorials . The LabOne sequence programming language is specified in detail in LabOne Sequence Programming. The language comes with a number of predefined waveforms, such as Gaussian, Blackman, sine, or square functions. By combining those predefined waveforms using the waveform editing tools (add, multiply, cut, concatenate, etc), signals with a high level of complexity can be generated directly from the Sequence Editor window. Sample-by-sample definition of the output signal is possible by using comma-separated value (CSV) files specified by the user .

The AWG features a compiler which translates the high-level sequence program into machine instructions and waveform data to be stored in the instrument memory as shown in Figure 2. The sequence program is written using high-level control structures and syntax that are inspired by human language, whereas machine instructions reflect exactly what happens on the hardware level. Writing the sequence program using a high-level language represents a more natural and efficient way of working in comparison to writing lists of machine instructions, which is the traditional way of programming AWGs. Concretely, the improvements rely on features such as:

  • combination of waveform generation, editing, and playback sequence in a single script
  • easily readable syntax and naming for run-time variables and constants
  • optimized waveform memory management, reduced transfers upon waveform changes
  • definition of user functions and procedures for advanced structuring
  • syntax validation

By design, there is no one-to-one link between the list of statements in the high-level language and the list of instructions executed by the Sequencer. In order to understand the execution timing, it’s helpful to consider the internal architecture of the AWG, consisting of the Sequencer itself, the Waveform Player, and the Waveform Memory.

Figure 2: AWG sequence program compilation process

The Sequence Editor provides the editing, compilation, and transfer functionality for sequence programs. A program typed into the Editor is compiled upon clicking . If the compilation is successful and Automatic Upload is enabled, the program including all necessary waveform data is transferred to the device. If the compilation fails, the Status field will display debug messages. Clicking on allows you to choose a new name for the program. The name of the program that is currently edited is displayed at the top of the editor. External program files as well as waveform data files can be transferred to the right location easily using the file drag-and-drop zone in the Config Tab so they become accessible from the user interface. The files can be managed in the File Manager Tab and their location in the directory structure is shown in Table 2. The program name is displayed in a drop-down box. The box allows quick access to all programs in the standard sequence program location. It is possible to quickly switch between programs using the box. Changes made in one program will be preserved when switching to a different program. The file name of a program will be postfixed by an asterisk in case there are unsaved changes in the source file. Note that switching programs in the editor is not sufficient to also update the program in the instrument. In order to send a newly selected program to the instrument, the button must be clicked.

Table 2: Sequence program and waveform file location
File type Location
Waveform files (Windows) C:\Users\<user name>\Documents\Zurich Instruments\LabOne\WebServer\awg\waves
Sequence programs (Windows) C:\Users\<user name>\Documents\Zurich Instruments\LabOne\WebServer\awg\src
Waveform files (Linux) ~/Zurich Instruments/LabOne/WebServer/awg/waves
Sequence programs (Linux) ~/Zurich Instruments/LabOne/WebServer/awg/src

In the Control sub-tab the user configures signal parameters and controls the execution of the AWG. The AWG can be started in by clicking on . When enabling the Rerun button, the Sequencer will be restarted automatically when its program completes. The continuous mode is a simple way to create an infinite loop, but it results in a considerable timing jitter. To avoid this jitter, it is recommended to specify infinite loops directly in the sequence program.

The Sampling Rate field is used to control the default playback sampling rate of the AWG. The sampling rate is dynamic, i.e., can be specified for each waveform by using an optional argument in the waveform playback instructions in the sequence program. This allows for considerably reducing waveform upload time for signals that contain both fast and slow components.

The Waveform sub-tab displays information about the waveforms that are used by the current sequence program, such as their length and channel number. Together with the Waveform viewer sub-tab, it is a useful tool to visualize the waveforms used in the sequence program.

On the Trigger sub-tab you can configure the trigger inputs of the AWG. Each AWG core has two internal trigger input channels which can be configured to probe any of the Trig inputs on the instrument front panel. The Advanced sub-tab displays the compiled list of sequencer instructions and the current state of the sequencer on the instrument. This can help an advanced user in debugging a sequence program and understanding its execution.

Sequence Editor Keyboard Shortcuts

The tables below list a number of helpful keyboard shortcuts that are applicable in the LabOne Sequence Editor.

Table 3: Line Operations
Shortcut Action
Ctrl+D Remove line
Alt+Shift+Down Copy lines down
Alt+Shift+Up Copy lines up
Alt+Down Move lines down
Alt+Up Move lines up
Alt+Del Remove to line end
Alt+Backspace Remove to line start
Ctrl+Backspace Remove word left
Ctrl+Del Remove word right
Table 4: Selection
Shortcut Action
Ctrl+A Select all
Shift+Left Select left
Shift+Right Select right
Ctrl+Shift+Left Select word left
Ctrl+Shift+Right Select word right
Shift+Home Select line start
Shift+End Select line end
Alt+Shift+Right Select to line end
Alt+Shift+Left Select to line start
Shift+Up Select up
Shift+Down Select down
Shift+Page Up Select page up
Shift+Page Down Select page down
Ctrl+Shift+Home Select to start
Ctrl+Shift+End Select to end
Ctrl+Shift+D Duplicate selection
Ctrl+Shift+P Select to matching bracket
Table 5: Go to
Shortcut Action
Left Go to left
Right Go to right
Ctrl+Left Go to word left
Ctrl+Right Go to word right
Up Go line up
Down Go line down
Alt+Left, Home Go to line start
Alt+Right, End Go to line end
Page Up Go to page up
Page Down Go to page down
Ctrl+Home Go to start
Ctrl+End Go to end
Ctrl+L Go to line
Ctrl+Down Scroll line down
Ctrl+Up Scroll line up
Ctrl+P Go to matching bracket
Table 6: Find/Replace
Shortcut Action
Ctrl+F Find
Ctrl+H Replace
Ctrl+K Find next
Ctrl+Shift+K Find previous
Table 7: Folding
Shortcut Action
Alt+L Fold selection
Alt+Shift+L Unfold
Table 8: Other
Shortcut Action
Tab Indent
Shift+Tab Outdent
Ctrl+Z Undo
Ctrl+Shift+Z, Ctrl+Y Redo
Ctrl+/ Toggle comment
Ctrl+Shift+U Change to lower case
Ctrl+U Change to upper case
Ins Overwrite
Ctrl+Shift+E Macros replay
Ctrl+Alt+E Macros recording
Del Delete

LabOne Sequence Programming

A Simple Example

The syntax of the LabOne AWG Sequencer programming language is based on C, but with a few simplifications. Each statement is concluded with a semicolon, several statements can be grouped with curly brackets, and comment lines are identified with a double slash. The following example shows some of the fundamental functionalities: waveform generation, repeated playback, triggering, and single/dual-channel waveform playback. See Tutorials for a step-by-step introduction with more examples.

// Define an integer constant
const N = 4096;
// Create two Gaussian pulses with length N points,
// amplitude +1.0 (-1.0), center at N/2, and a width of N/8
wave gauss_pos = 1.0*gauss(N, N/2, N/8);
wave gauss_neg = -1.0*gauss(N, N/2, N/8);
// execute playback sequence 100 times
repeat (100) {
  // Play pulse on AWG channel 1
  playWave(gauss_pos);
  // Play pulses simultaneously on both AWG channels
  playWave(gauss_pos, gauss_neg);
}

Keywords and Comments

The following table lists the keywords used in the LabOne AWG Sequencer language.

Table 9: Programming keywords
Keyword Description
const Constant declaration
var Integer variable declaration
cvar Compile-time variable declaration
string Constant string declaration
true Boolean true constant
false Boolean false constant
for For-loop declaration
while While-loop declaration
repeat Repeat-loop declaration
if If-statement
else Else-part of an if-statement
switch Switch-statement
case Case-statement within a switch
default Default-statement within a switch
return Return from function or procedure, optionally with a return value

The following code example shows how to use comments.

const a = 10; // This is a line comment. Everything between the double
              // slash and the end of the line will be ignored.

/* This is a block comment. Everything between the start-of-block-comment
and end-of-block-comment markers is ignored.

For example, the following statement will be ignored by the compiler.
const b = 100;
*/

Constants and Variables

Constants may be used to make the program more readable. They may be of integer or floating-point type. It must be possible for the compiler to compute the value of a constant at compile time, i.e., on the host computer. Constants are declared using the const keyword.

Compile-time variables may be used in computations and loop iterations during compile time, e.g. to create large numbers of waveforms in a loop. They may be of integer or floating-point type. They are used in a similar way as constants, except that they can change their value during compile time operations. Compile-time variables are declared using the cvar keyword.

Variables may be used for making simple computations during run time, i.e., on the instrument. The Sequencer supports integer variables, addition, and subtraction. Not supported are floating-point variables, multiplication, and division. Typical uses of variables are to step waiting times or to tag digital measurement data with a numerical identifier. Variables are declared using the var keyword.

The following code example shows how to use variables.

var b = 100; // Create and initialize a variable

// Repeat the following block of statements 100 times
repeat (100) {
  b = b + 1; // Increment b
  wait(b);   // Wait 'b' cycles
}

The following table shows the predefined constants. These constants are intended to be used as arguments in certain run-time evaluated functions that encode device parameters with integer numbers. For example, the AWG Sampling Rate is specified as an integer exponent n in the expression (baseSamplingClock)/2n. The AWG rates constants are specified for the sampling clock of 2.0 GHz of the SHFSG.

Table 10: Predefined Constants
Name Value Description
commandTableEntries {4096}
AWG_RATE_2000MHZ 0 Constant to set Sampling Rate to 2.0 GHz.
AWG_RATE_1000MHZ 1 Constant to set Sampling Rate to 1.0 GHz.
AWG_RATE_500MHZ 2 Constant to set Sampling Rate to 500 MHz.
AWG_RATE_250MHZ 3 Constant to set Sampling Rate to 250 MHz.
AWG_RATE_125MHZ 4 Constant to set Sampling Rate to 125 MHz.
AWG_RATE_62P5MHZ 5 Constant to set Sampling Rate to 62.5 MHz.
AWG_RATE_31P25MHZ 6 Constant to set Sampling Rate to 31.25 MHz.
AWG_RATE_15P63MHZ 7 Constant to set Sampling Rate to 15.63 MHz.
AWG_RATE_7P81MHZ 8 Constant to set Sampling Rate to 7.81 MHz.
AWG_RATE_3P9MHZ 9 Constant to set Sampling Rate to 3.9 MHz.
AWG_RATE_1P95MHZ 10 Constant to set Sampling Rate to 1.95 MHz.
AWG_RATE_976KHZ 11 Constant to set Sampling Rate to 976 kHz.
AWG_RATE_488KHZ 12 Constant to set Sampling Rate to 488 kHz.
AWG_RATE_244KHZ 13 Constant to set Sampling Rate to 244 kHz.
DEVICE_SAMPLE_RATE <actual device sample rate>
ZSYNC_DATA_RAW commandTableEntries + 0
Constant to use as argument to getZSyncData/getFeedback. Return the data received on the ZSync as-is without parsing.
ZSYNC_DATA_PQSC_REGISTER commandTableEntries + 1
Constant to use as argument to getZSyncData/getFeedback. Get last readout register forwarded by the PQSC.
ZSYNC_DATA_PQSC_DECODER commandTableEntries + 2
Constant to use as argument to getZSyncData/getFeedback. Get last output of the decoder received from the PQSC.
QA_DATA_RAW commandTableEntries + 3
Constant to use as argument to getFeedback. Return the data received from the QA channel as is
QA_DATA_PROCESSED commandTableEntries + 4
Constant to use as argument to getFeedback. Return the processed data received from the QA channel
AWG_CHAN1 1 Constant to select channel 1.
AWG_CHAN2 2 Constant to select channel 2.
AWG_MARKER1 1 Constant to select marker 1.
AWG_MARKER2 2 Constant to select marker 2.
AWG_OSC_PHASE_START 1 Constant to trigger the oscillator phase on the positive edge.
AWG_OSC_PHASE_MIDDLE 0 Constant to trigger the oscillator phase on the negative edge.
AWG_USERREG_SWEEP_COUNT0 35 Constant for the sweep count register 0.
AWG_USERREG_SWEEP_COUNT1 36 Constant for the sweep count register 1.

Numbers can be expressed using either of the following formatting.

const a = 10;            // Integer notation
const b = -10;           // Negative number
const h = 0xdeadbeef;    // Hexadecimal integer
const bin = 0b10101;     // Binary integer
const f = 0.1e-3;        // Floating point number.
const not_float = 10e3;  // Not a floating point number

Booleans are specified with the keywords true and false. Furthermore, all numbers that evaluate to a nonzero value are considered true. All numbers that evaluate to zero are considered false.

Strings are delimited using "" and are interpreted as constants. Strings may be concatenated using the + operator.

string AWG_PATH = "awgs/0/";
string AWG_GAIN_PATH = AWG_PATH + "gains/0";

Waveform Generation and Editing

The following table contains the definition of functions for waveform generation.

wave zeros(const samples)

Constant amplitude of 0 over the defined number of samples.

\[ \[ h(x) = 0 \] \]

Args:

  • samples: Number of samples in the waveform

Returns:

resulting waveform

wave ones(const samples)

Constant amplitude of 1 over the defined number of samples.

\[ \[ h(x) = 1 \] \]

Args:

  • samples: Number of samples in the waveform

Returns:

resulting waveform

wave sine(const samples, const amplitude=1.0, const phaseOffset, const nrOfPeriods)

Sine function with arbitrary amplitude (a), phase offset in radians (p), number of periods (f) and number of samples (N).

\[ \[ h(x) = a\cdot\sin(2\pi f \frac{x}{N}+p) \] \]

Args:

  • amplitude: Amplitude of the signal (optional)

  • nrOfPeriods: Number of Periods within the defined number of samples

  • phaseOffset: Phase offset of the signal in radians

  • samples: Number of samples in the waveform

Returns:

resulting waveform

wave cosine(const samples, const amplitude=1.0, const phaseOffset, const nrOfPeriods)

Cosine function with arbitrary amplitude (a), phase offset in radians (p), number of periods (f) and number of samples (N).

\[ \[ h(x) = a\cdot\cos(2\pi f \frac{x}{N}+p) \] \]

Args:

  • amplitude: Amplitude of the signal (optional)

  • nrOfPeriods: Number of Periods within the defined number of samples

  • phaseOffset: Phase offset of the signal in radians

  • samples: Number of samples in the waveform

Returns:

resulting waveform

wave sinc(const samples, const amplitude=1.0, const position, const beta)

Normalized sinc function with control of peak position (p), amplitude (a), width (\beta) and number of samples (N).

\[ \[ h(x) = \begin{cases} a & \quad \text{if } x = p \\ a \cdot \frac{\sin(2\pi\cdot beta\cdot \frac{x-p}{N})}{2\pi\cdot beta\cdot \frac{x-p}{N}} & \quad \text{else} \\ \end{cases} \] \]

Args:

  • amplitude: Amplitude of the signal (optional)

  • beta: Width of the function

  • position: Peak position of the function

  • samples: Number of samples in the waveform

Returns:

resulting waveform

wave ramp(const samples, const startLevel, const endLevel)

Linear ramp from the start (s) to the end level (e) over the number of samples (N).

\[ \[ h(x) = s + \frac{x(e-s)}{N-1} \] \]

Args:

  • endLevel: level at the last sample of the waveform

  • samples: Number of samples in the waveform

  • startLevel: level at the first sample of the waveform

Returns:

resulting waveform

wave sawtooth(const samples, const amplitude=1.0, const phaseOffset, const nrOfPeriods)

Sawtooth function with arbitrary amplitude, phase in radians and number of periods.

Args:

  • amplitude: Amplitude of the signal

  • nrOfPeriods: Number of Periods within the defined number of samples

  • phaseOffset: Phase offset of the signal in radians

  • samples: Number of samples in the waveform

Returns:

resulting waveform

wave triangle(const samples, const amplitude=1.0, const phaseOffset, const nrOfPeriods)

Triangle function with arbitrary amplitude, phase in radians and number of periods.

Args:

  • amplitude: Amplitude of the signal

  • nrOfPeriods: Number of Periods within the defined number of samples

  • phaseOffset: Phase offset of the signal in radians

  • samples: Number of samples in the waveform

Returns:

resulting waveform

wave gauss(const samples, const amplitude=1.0, const position, const width)

Gaussian pulse with arbitrary amplitude (a), position (p), width (w) and number of samples (N).

\[ \[ h(x) = a \cdot e^{-\frac{(x-p)^2}{2 \cdot w^2}} \] \]

Args:

  • amplitude: Amplitude of the signal (optional)

  • position: Peak position of the pulse

  • samples: Number of samples in the waveform

  • width: Width of the pulse

Returns:

resulting waveform

wave drag(const samples, const amplitude=1.0, const position, const width)

Derivative of Gaussian pulse with arbitrary amplitude (a), position (p), width (w) and number of samples (N) normalized to a maximum amplitude of 1.

\[ \[ h(x) = a \cdot \frac{\sqrt{e}(p-x)}{w} \cdot e^{-\frac{(x-p)^2}{2 \cdot w^2}} \] \]

Args:

  • amplitude: Amplitude of the signal (optional)

  • position: Center point position of the pulse

  • samples: Number of samples in the waveform

  • width: Width of the pulse

Returns:

resulting waveform

wave blackman(const samples, const amplitude=1.0, const alpha)

Blackman window function with arbitrary amplitude (a), alpha parameter and number of samples (N).

\[ \begin{align} h(x) =& a \cdot (\alpha_0 - \alpha_1 \cos(\frac{2\pi x}{N-1}) \\ &+ \alpha_2\cos(\frac{4\pi x}{N-1})) \\ \alpha_0 =& \frac{1-\alpha}{2}; \quad \alpha_1 = \frac{1}{2}; \quad \alpha_2 = \frac{\alpha}{2}; \end{align} \]

Args:

  • alpha: Width of the function

  • amplitude: Amplitude of the signal (optional)

  • samples: Number of samples in the waveform

Returns:

resulting waveform

wave hamming(const samples, const amplitude=1.0)

Hamming window function with arbitrary amplitude (a) and number of samples (N).

\[ \begin{align} h(x) = a \cdot (\alpha - \beta \cos(\frac{2\pi x}{N-1})) \\ \text{with }\alpha = 0.54 \text{ and } \beta = 0.46 \end{align} \]

Args:

  • amplitude: Amplitude of the signal (optional)

  • samples: Number of samples in the waveform

Returns:

resulting waveform

wave hann(const samples, const amplitude=1.0)

Hann window function with arbitrary amplitude (a) and number of samples (N).

\[ \[ h(x) = a \cdot 0.5 \cdot (1 - \cos(\frac{2\pi x}{N-1})) \] \]

Args:

  • amplitude: Amplitude of the signal

  • samples: Number of samples in the waveform

Returns:

resulting waveform

wave rect(const samples, const amplitude)

Rectangle function, constants amplitude (a) over the defined number of samples.

\[ \[ h(x) = \text{a} \] \]

Args:

  • amplitude: Amplitude of the signal

  • samples: Number of samples in the waveform

Returns:

resulting waveform

wave marker(const samples, const markerValue)

Generate a waveform with marker bits set to the specified value. The analog part of the waveform is zero.

Args:

  • markerValue: Value of the marker bits

  • samples: Number of samples in the waveform

Returns:

resulting waveform

wave rand(const samples, const amplitude=1.0, const mean, const stdDev)

White noise with arbitrary amplitude, power and standard deviation.

Args:

  • amplitude: Amplitude of the signal

  • mean: Average signal level

  • samples: Number of samples in the waveform

  • stdDev: Standard deviation of the noise signal

Returns:

resulting waveform

wave randomGauss(const samples, const amplitude=1.0, const mean, const stdDev)

White noise with arbitrary amplitude, power and standard deviation.

Args:

  • amplitude: Amplitude of the signal

  • mean: Average signal level

  • samples: Number of samples in the waveform

  • stdDev: Standard deviation of the noise signal

Returns:

resulting waveform

wave randomUniform(const samples, const amplitude=1.0)

Random waveform with uniform distribution.

Args:

  • amplitude: Amplitude of the signal

  • samples: Number of samples in the waveform

Returns:

resulting waveform

wave lfsrGaloisMarker(const samples, const markerBit, const polynomial, const initial)

Generate a waveform with specified marker bit set to the Galois LFSR (linear-feedback shift register) generated sequence. The analog part of the waveform is zero. The LFSR characteristic polynomial is a member of the Galois Field of two elements and represented in binary form. See wikipedia entries for "Finite field arithmetic" and "Linear-feedback shift register (Galois LFSR)".

Args:

  • initial: LFSR initial state, any nonzero value will work, usually 0x1

  • markerBit: Marker bit to set (1 or 2)

  • polynomial: LFSR characteristic polynomial in binary representation (max shift length 32), use 0x90000 for QRSS / PRBS-20

  • samples: Number of samples in the waveform

Returns:

resulting waveform

wave chirp(const samples, const amplitude=1.0, const startFreq, const stopFreq, const phase=0)

Frequency chirp function with arbitrary amplitude, start and stop frequency, initial phase in radians and number of samples. Start and stop frequency are expressed in units of the AWG Sampling Rate. The amplitude can only be defined if the initial phase is defined as well.

Args:

  • amplitude: Amplitude of the signal (optional)

  • phase: Initial phase of the signal (optional)

  • samples: Number of samples in the waveform

  • startFreq: Start frequency of the signal

  • stopFreq: Stop Frequency of the signal

Returns:

resulting waveform

wave rrc(const samples, const amplitude=1.0, const position, const beta, const width)

Root raised cosine function with arbitrary amplitude (a), position (p), roll-off factor (\beta) and width (w) and number of samples (N).

\[ \begin{align} h(y) = a \frac{\sin(y \pi(1-\beta)) + 4 y \beta\cos(y \pi(1+\beta))}{y \pi(1-(4 y \beta)^2)} \\ \text{with } y(x) = 2 w \frac{x - p}{N} \end{align} \]

Args:

  • amplitude: Amplitude of the signal

  • beta: Roll-off factor

  • position: Center point position of the pulse

  • samples: Number of samples in the waveform

  • width: Width of the pulse

Returns:

Resulting waveform

wave vect(const value,...)

Specify a waveform sample by sample. Each sample is defined by one of an arbitrary number of input arguments. Only recommended for short waveforms that consist of less than 100 samples. Larger waveforms may be defined in a CSV file.

Args:

  • value: Waveform amplitude at the respective sample

Returns:

resulting waveform

wave placeholder(const samples, const marker0=false, const marker1=false)

Creates space for a single-channel waveform, optionally with markers, without actually generating any waveform data when compiling the sequence program. Actual waveform data needs to be uploaded separately via the "<dev>/AWGS/<n>/WAVEFORM/WAVES/<index>" API nodes after the sequence compilation and upload. The waveform index can be explicitly assigned to the generated placeholder wave using the assignWaveIndex instruction.

Args:

  • marker0: true if marker bit 0 must be used (default false)

  • marker1: true if marker bit 1 must be used (default false)

  • samples: Number of samples in the waveform

Returns:

waveform object

The following table contains the definition of functions for waveform editing.

wave join(wave wave1, wave wave2, const interpolLength=0)

Connect two or more waveforms with optional linear interpolation between the waveforms.

Args:

  • interpolLength: Number of samples to interpolate between waveforms (optional, default 0)

  • wave1: Input waveform

  • wave2: Input waveform

Returns:

joined waveform

wave join(wave wave1, wave wave2,...)

Connect two or more waveforms.

Args:

  • wave1: Input waveform

  • wave2: Input waveform

Returns:

joined waveform

wave interleave(wave wave1, wave wave2,...)

Interleave two or more waveforms sample by sample.

Args:

  • wave1: Input waveform

  • wave2: Input waveform

Returns:

interleaved waveform

wave add(wave wave1, wave wave2,...)

Add two or more waveforms sample by sample. Alternatively, the "+" operator may be used for waveform addition.

Args:

  • wave1: Input waveform

  • wave2: Input waveform

Returns:

sum waveform

wave multiply(wave wave1, wave wave2,...)

Multiply two or more waveforms sample by sample. Alternatively, the "*" operator may be used for waveform multiplication.

Args:

  • wave1: Input waveform

  • wave2: Input waveform

Returns:

product waveform

wave scale(wave waveform, const factor)

Scale the input waveform with the factor and return the scaled waveform. The input waveform remains unchanged.

Args:

  • factor: Scaling factor

  • waveform: Input waveform

Returns:

scaled waveform

wave flip(wave waveform)

Flip the input waveform back to front and return the flipped waveform. The input waveform remains unchanged.

Args:

  • waveform: Input waveform

Returns:

flipped waveform

wave cut(wave waveform, const from, const to)

Cuts a segment out of the input waveform and returns it. The input waveform remains unchanged. The segment is flipped in case that "from" is larger than "to".

Args:

  • from: First sample of the cut waveform

  • to: Last sample of the cut waveform

  • waveform: Input waveform

Returns:

cut waveform

wave filter(wave b, wave a, wave x)

Filter generates a rational transfer function with the waveforms a and b as numerator and denominator coefficients. The transfer function is normalized by the first element of a, which has to be non-zero. The filter is applied to the input waveform x and returns the filtered waveform.

\[ \begin{align} y(n) = \frac{1}{a_0}\left(\!\sum_{i=0}^{M}b_i x_{n-i} - \sum_{i=1}^{N}a_i y_{n-i}\!\right) \\ \text{with } M = \text{length}(b)-1 \\ \text{ and } N = \text{length}(a)-1 \end{align} \]

Args:

  • a: Denominator coefficients

  • b: Numerator coefficients

  • x: Input waveform

Returns:

filtered waveform

wave circshift(wave a, const n)

Circularly shifts a 1D waveform and returns it.

Args:

  • n: Number of elements to shift

  • waveform: Input waveform

Returns:

circularly shifted waveform

Waveform Playback and Predefined Functions

The following table contains the definition of functions for waveform playback and other purposes.

void setDIO(var value)

Writes the value as a 32-bit value to the DIO bus.

The value can be either a const or a var value. Configure the Mode setting in the DIO tab when using this command. The DIO interface speed of 50 MHz limits the rate at which the DIO output value is updated.

Args:

  • value: The value to write to the DIO (const or var)
var getDIO()

Reads a 32-bit value from the DIO bus.

Returns:

var containing the read value

var getDIOTriggered()

Reads a 32-bit value from the DIO bus as recorded at the last DIO trigger position.

Returns:

var containing the read value

void setTrigger(var value)

Sets the AWG Trigger output signals.

The state of all four AWG Trigger output signals is represented by the bits in the binary representation of the integer value. Binary notation of the form 0b0000 is recommended for readability.

Args:

  • value: to be written to the trigger output lines
void wait(var cycles)

Waits for the given number of Sequencer clock cycles (4 ns per cycle). The execution of the instruction adds an offset of 2 clock cycles, i.e., the statement wait(3) leads to a waiting time of 5 * 4 ns = 20 ns.

Note: the minimum waiting time amounts to 3 cycles, which means that wait(0) and wait(1) will both result in a waiting time of 3 * 4 ns = 12 ns.

Args:

  • cycles: number of cycles to wait
void waitTrigger(const mask, const value)

Waits until the masked trigger input is equal to the given value.

Args:

  • mask: mask to be applied to the input signal

  • value: value to be compared with the trigger input

void waitDIOTrigger()

Waits until the DIO interface trigger is active. The trigger is specified by the Strobe Index and Strobe Slope settings in the AWG Sequencer tab.

var getDigTrigger(const index)

Gets the state of the indexed Digital Trigger input (1 or 2).

The physical signal connected to the AWG Digital Trigger input is to be configured in the Trigger sub-tab of the AWG tab.

Args:

  • index: index of the Digital Trigger input to be read; can be either 1 or 2

Returns:

trigger state, either 0 or 1

void error(string msg,...)

Throws the given error message when reached.

Args:

  • msg: Message to be displayed
void info(string msg,...)

Returns the specified message when reached.

Args:

  • msg: Message to be displayed
void waitWave()

Waits until the AWG is done playing the current waveform.

void setRate(const rate)

Overwrites the default Sampling Rate for the following playWave commands.

Args:

  • rate: New default sampling rate
void randomSeed()

Generate a new seed for the subsequent random vector commands.

void assignWaveIndex(const output, wave waveform, const index)
void assignWaveIndex(wave waveform, const index)
void playWave(const output, wave waveform, const rate=AWG_RATE_DEFAULT)

Starts to play the given waveforms on the defined output channels. The playback begins as soon as the previous waveform playback is finished.

Args:

  • output: defines on which output the following waveform is played

  • rate: sample rate with which the AWG plays the waveforms (default set in the user interface).

  • waveform: waveform to be played

void playWave(const output, wave waveform,...)

Starts to play the given waveforms on the defined output channels. It can contain multiple waveforms with an output definition. The playback begins as soon as the previous waveform playback is finished.

Args:

  • output: defines on which output the following waveform is played

  • waveform: waveform to be played

void playWave(wave waveform, const rate=AWG_RATE_DEFAULT)

Starts to play the given waveforms, output channels are assigned automatically depending on the number of input waveforms. The playback begins as soon as the previous waveform playback is finished.

Args:

  • rate: sample rate with which the AWG plays the waveforms (default set in the user interface).

  • waveform: waveform to be played

void playWave(wave waveform,...)

Starts to play the given waveforms, output channels are assigned automatically depending on the number of input waveforms. The playback begins as soon as the previous waveform playback is finished.

Args:

  • waveform: waveform to be played
void setUserReg(const register, var value)

Writes a value to one of the User Registers (indexed 0 to 15).

The User Registers may be used for communicating information to the LabOne User Interface or a running API program.

Args:

  • register: The register index (0 to 15) to be written to

  • value: The integer value to be written

var getUserReg(const register)

Reads the value from one of the User Registers (indexed 0 to 15). The User Registers may be used for communicating information to the LabOne User Interface or a running API program.

Args:

  • register: The register to be read (0 to 15)

Returns:

current register value

void playZero(var samples)

Starts to play zeros on all channels for the specified number of samples. Behaves as if same length all-zeros waveform is played using playWave, but without consuming waveform memory.

Args:

  • samples: Number of samples to be played. The same min length and granularity applies as for regular waveforms.
void playZero(var samples, const rate)

Starts to play zeros on all channels for the specified number of samples. Behaves as if same length all-zeros waveform is played using playWave, but without consuming waveform memory.

Args:

  • rate: Sample rate with which the AWG plays zeros (default set in the user interface).

  • samples: Number of samples to be played. The same min length and granularity applies as for regular waveforms.

void waitDigTrigger(const index)

Waits for the reception of a trigger signal on the indexed Digital Trigger (index 1 or 2). The physical signals connected to the two AWG Digital Triggers are to be configured in the Trigger sub-tab of the AWG Sequencer tab. The Digital Triggers are configured separately for each AWG Core.

Args:

  • index: Index of the digital trigger input; can be either 1 or 2.
void executeTableEntry(var index)

Execute the entry of the AWG command/waveform table with the given index. An entry of the command/waveform table contains a waveform playback instruction as well as additional space for instructions for real-time setting of Sine Generator phases and AWG amplitude. The entries of the command/waveform table can be specified by direct upload of a JSON string to the "<dev>/SGCHANNELS/<n>/AWG/COMMANDTABLE/DATA" API node.

Args:

  • data_type: ZSYNC_DATA_RAW: The raw ZSYNC data is the table entry to execute ZSYNC_DATA_PQSC_REGISTER: The last readout register forwarded by the PQSC is the table entry to execute ZSYNC_DATA_PQSC_DECODER: The last output of the decoder received from the PQSC is the table entry to execute QA_DATA_PROCESSED: The last internal feedback data received from the QA channel is the table entry to execute

  • index: table entry that shall be executed

  • wait_cycles: Wait for the specified number of cycles after the most recent waitZSyncTrigger() or waitDigTrigger() instruction

void setPRNGSeed(var value)

Sets the seed for the linear-shift feedback register lsfr of the pseudo random number generator (PRNG).

The seed is a 16 bit int32_t value. Zero is invalid as seed.

Args:

  • value: seed value to be configured
var getPRNGValue()

Returns a random value from the pseudo-random number generator (PRNG). The PRNG is implemented as a Galois linear-shift feedback register according to the pseudo code below. The feedback register lsfr is initialized to a seed value using the function setPRNGSeed. The values lower and upper are set using the function setPRNGRange. The feedback register lsfr is stored from one call of the function getPRNGValue to the next, which renders the pseudo code recursive. In the pseudo code, XOR and AND are bitwise logical operators, and >> is the right bit shift operator. Pseudo code: lsb = lsfr AND 1; lsfr = lsfr >> 1; if (lsb == 1) then: lsfr = 0xb400 XOR lsfr; rand = ((lsfr * (upper-lower+1) >> 16) + lower) AND 0xffff;.

Returns:

Random value rand

void setPRNGRange(var lower, var upper)

Configures the range of the pseudo random number generator (PRNG) to generate output in range [lower, upper].

Args:

  • lower: lower bound of range, 0 ... 2**16-1

  • upper: upper bound of range, 0 ... 2**16-1

void setSinePhase(const phase)

Set the phase in units of degree of the sine generator of the AWG core in use. The phase is reset to 0 after execution of the sequence program.

Args:

  • phase: Phase value [degree]
void incrementSinePhase(const phase)

Increment the phase in units of degree of the sine generator of the AWG core in use.

Args:

  • phase: Phase value [degree]
void resetOscPhase(const mask)

Reset the phase of the oscillators specified by the binary mask argument. Each AWG core can access the oscillators of its SGCHANNEL.

Args:

  • mask: one-hot encoding to reset phase of individual oscillators
void resetOscPhase()

Reset the phase of all oscillators controllable by the AWG core.

void playHold(var samples)

Hold the last played value for the specified number of samples samples. Behaves as if same length constant waveform is played using playWave, but without consuming waveform memory.

Args:

  • samples: Number of samples to be played. The same min length and granularity applies as for regular waveforms.
void playHold(var samples, const rate)

Hold the last played value for the specified number of samples samples. Behaves as if same length constant waveform is played using playWave, but without consuming waveform memory.

Args:

  • rate: Sample rate with which the AWG plays zeros (default set in the user interface).

  • samples: Number of samples to be played. The same min length and granularity applies as for regular waveforms.

void playWaveDIO()

Starts to play a waveform from the table defined by the setWaveDIO instruction. The waveform is selected according to the integer codeword currently read on the DIO interface. The codeword is specified by the Codeword Mask and Codeword Shift settings in the AWG Sequencer tab.

void waitSineOscPhase()

Waits until the oscillator phase of the sine generator reaches a zero crossing (negative -> positive, start of sine period) of I component.

void configFreqSweep(const oscillator_index, const freq_start, const freq_increment)

Configures a frequency sweep.

Args:

  • freq_increment: Specify how much to increment the frequency for each step of the sweep [Hz]

  • freq_start: Specify the start frequency value for the sweep [Hz]

  • oscillator_index: Index of the oscillator that will be used for the sweep

void setSweepStep(const oscillator_index, var sweep_index)

Executes a step within a frequency sweep.

Args:

  • oscillator_index: Index of the oscillator that will be used for the sweep

  • sweep_index: Sets the step index, from which the frequency is set

void setOscFreq(const oscillator_index, const freq)

Configures the frequency of an oscillator.

Args:

  • freq: Frequency to be set [Hz]

  • oscillator_index: Index of oscillator

var getFeedback(const data_type)

Read the last received feedback message. The argument specify which data the function should return.

Args:

  • data_type: Specifies which data the function should return: ZSYNC_DATA_RAW: Return the data received on the ZSync as-is without parsing. The structure of the message can change across different LabOne releases. ZSYNC_DATA_PQSC_REGISTER: Get last readout register forwarded by the PQSC ZSYNC_DATA_PQSC_DECODER: Get last output of the decoder received from the PQSC. QA_DATA_RAW: Return the last readout data received from the QA as-is QA_DATA_PROCESSED: Return the last readout data received from the QA, after processing

Returns:

var containing the read value

var getFeedback(const data_type, var wait_cycles)

Read the last received feedback message. The argument specify which data the function should return.

Args:

  • data_type: Specifies which data the function should return: ZSYNC_DATA_RAW: Return the data received on the ZSync as-is without parsing. The structure of the message can change across different LabOne releases. ZSYNC_DATA_PQSC_REGISTER: Get last readout register forwarded by the PQSC ZSYNC_DATA_PQSC_DECODER: Get last output of the decoder received from the PQSC. QA_DATA_RAW: Return the last readout data received from the QA as-is QA_DATA_PROCESSED: Return the last readout data received from the QA, after processing

  • wait_cycles: Wait for the specified number of cycles after the most recent waitZSyncTrigger() or waitDigTrigger() instruction

Returns:

var containing the read value

void waitZSyncTrigger()

Waits for a trigger over ZSync.

void resetRTLoggerTimestamp()

Reset the timestamp counter of the Real-Time Logger.

Expressions

Expressions may be used for making computations based on mathematical functions and operators. There are two kinds of expressions: those evaluated at compile time (the moment of clicking "Save" or "Save as...​" in the user interface), and those evaluated at run time (after clicking "Run/Stop" or "Start"). Compile-time evaluated expressions only involve constants (const) or compile-time variables (cvar) and can be computed at compile time by the host computer. Such expressions can make use of standard mathematical functions and floating point arithmetic. Run-time evaluated expressions involve variables (var) and are evaluated by the Sequencer on the instrument. Due to the limited computational capabilities of the Sequencer, these expressions may only operate on integer numbers and there are less operators available than at compile time.

The following table contains the list of mathematical functions supported at compile time.

Table 11: Mathematical Functions
Function Description
const abs(const c) absolute value
const acos(const c) inverse cosine
const acosh(const c) hyperbolic inverse cosine
const asin(const c) inverse sine
const asinh(const c) hyperbolic inverse sine
const atan(const c) inverse tangent
const atanh(const c) hyperbolic inverse tangent
const cos(const c) cosine
const cosh(const c) hyperbolic cosine
const exp(const c) exponential function
const ln(const c) logarithm to base e (2.71828...)
const log(const c) logarithm to the base 10
const log2(const c) logarithm to the base 2
const log10(const c) logarithm to the base 10
const sign(const c) sign function -1 if x<0; 1 if x>0
const sin(const c) sine
const sinh(const c) hyperbolic sine
const sqrt(const c) square root
const tan(const c) tangent
const tanh(const c) hyperbolic tangent
const ceil(const c) smallest integer value not less than the argument
const round(const c) round to nearest integer
const floor(const c) largest integer value not greater than the argument
const avg(const c1, const c2,...) mean value of all arguments
const max(const c1, const c2,...) maximum of all arguments
const min(const c1, const c2,...) minimum of all arguments
const pow(const base, const exp) first argument raised to the power of second argument
const sum(const c1, const c2,...) sum of all arguments

The following table contains the list of predefined mathematical constants. These can be used for convenience in compile-time evaluated expressions.

Table 12: Predefined Constants
Name Value Description
M_E 2.71828182845904523536028747135266250 e
M_LOG2E 1.44269504088896340735992468100189214 log2(e)
M_LOG10E 0.434294481903251827651128918916605082 log10(e)
M_LN2 0.693147180559945309417232121458176568 loge(2)
M_LN10 2.30258509299404568401799145468436421 loge(10)
M_PI 3.14159265358979323846264338327950288 pi
M_PI_2 1.57079632679489661923132169163975144 pi/2
M_PI_4 0.785398163397448309615660845819875721 pi/4
M_1_PI 0.318309886183790671537767526745028724 1/pi
M_2_PI 0.636619772367581343075535053490057448 2/pi
M_2_SQRTPI 1.12837916709551257389615890312154517 2/sqrt(pi)
M_SQRT2 1.41421356237309504880168872420969808 sqrt(2)
M_SQRT1_2 0.707106781186547524400844362104849039 1/sqrt(2)
Table 13: Operators supported at compile time
Operator Description Priority
= assignment -1
+=, -=, *=, /=, %=, &=, |=, <<=, >>= assignment by sum, difference, product, quotient, remainder, AND, OR, left shift, and right shift -1
|| logical OR 1
&& logical AND 2
| bit-wise logical OR 3
& bit-wise logical AND 4
!= not equal 5
== equal 5
<= less or equal 6
>= greater or equal 6
> greater than 6
< less than 6
<< arithmetic left bit shift 7
>> arithmetic right bit shift 7
+ addition 8
- subtraction 8
* multiplication 9
/ division 9
~ bit-wise logical negation 10
Table 14: Operators supported at run time
Operator Description Priority
= assignment -1
+=, -=, *=, /=, %=, &=, |=, <<=, >>= assignment by sum, difference, product, quotient, remainder, AND, OR, left shift, and right shift -1
|| logical OR 1
&& logical AND 2
| bit-wise logical OR 3
& bit-wise logical AND 4
== equal 5
!= not equal 5
<= less or equal 6
>= greater or equal 6
> greater than 6
< less than 6
<< left bit shift 7
>> right bit shift 7
+ addition 8
- subtraction 8
~ bit-wise logical negation 9

Control Structures

Functions may be declared using the var keyword. Procedures may be declared using the void keyword. Functions must return a value, which should be specified using the return keyword. Procedures can not return values. Functions and procedures may be declared with an arbitrary number of arguments. The return keyword may also be used without arguments to return from an arbitrary point within the function or procedure. Functions and procedures may contain variable and constant declarations. These declarations are local to the scope of the function or procedure.

var function_name(argument1, argument2, ...) {
  // Statements to be executed as part of the function.
  return constant-or-variable;
}

void procedure_name(argument1, argument2, ...) {
  // Statements to be executed as part of the procedure.
  // Optional return statement
  return;
}

An if-then-else structure is used to create a conditional branching point in a sequencer program.

// If-then-else statement syntax
if (expression) {
  // Statements to execute if 'expression' evaluates to 'true'.
} else {
  // Statements to execute if 'expression' evaluates to 'false'.
}

// If-then-else statement short syntax
(expression)?(statement if true):(statement if false)
// If-then-else statement example
const REQUEST_BIT     = 0x0001;
const ACKNOWLEDGE_BIT = 0x0002;
const IDLE_BIT        = 0x8000;
var dio = getDIO();
if (dio & REQUEST_BIT) {
  dio = dio | ACKNOWLEDGE_BIT;
  setDIO(dio);
} else {
  dio = dio | IDLE_BIT;
  setDIO(dio);
}

A switch-case structure serves to define a conditional branching point similarly to the if-then-else statement, but is used to split the sequencer thread into more than two branches. Unlike the if-then-else structure, the switch statement is synchronous, which means that the execution time is the same for all branches and determined by the execution time of the longest branch. If no default case is provided and no case matches the condition, all cases will be skipped. The case arguments need to be of type const.

// Switch-case statement syntax
switch (expression) {
  case const-expression:
    expression;
  ...
  default:
    expression;
}
// Switch-case statement example
switch (getDIO()) {
  case 0:
    playWave(gauss(1024,1.0,512,64));
  case 1:
    playWave(gauss(1024,1.0,512,128));
  case 2:
    playWave(drag(1024,1.0,512,64));
  default:
    playWave(drag(1024,1.0,512,128));
}

The for loop is used to iterate through a code block several times. The initialization statement is executed before the loop starts. The end-expression is evaluated at the start of each iteration and determines when the loop should stop. The loop is executed as long as this expression is true. The iteration-expression is executed at the end of each loop iteration.

Depending on how the for loop is set up, it can be either evaluated at compile time or at run time. Run-time evaluation is typically used to play series of waveforms. Compile-time evaluation is typically used for advanced waveform generation, e.g. to generate a series of waveforms with varying amplitude. For a run-time evaluated for loop, use the var data type as a loop index. To ensure that a loop is evaluated at compile time, use the cvar data type as a loop index. Furthermore, the compile-time for loop should only contain waveform generation/editing operations and it can’t contain any variables of type var. The following code example shows both versions of the loop.

// For loop syntax
for (initialization; end-expression; iteration-expression) {
  // Statements to execute while end-expression evaluates to true
}
// FOR loop example to assemble a train of pulses into
// a single waveform (compile-time execution)
cvar gain_factor; // CVAR: integer or float values allowed
wave w_pulse_series;
for (gain_factor = 0; gain_factor < 1.0; gain_factor = gain_factor + 0.1) {
  w_pulse_series = join(w_pulse_series, gain_factor*gauss(1008, 504, 100));
}

// Playback of waveform defined using compile-time FOR loop
playWave(w_pulse_series);

// FOR loop example to vary waiting time between
// waveform playbacks (run-time execution)
var i; // VAR: integer values allowed
for (i = 0; i < 1000; i = i + 100) {
  playWave(gauss(1008, 504, 100));
  waitWave();
  wait(i);
}

The while loop is a simplified version of the for loop. The end-expression is evaluated at the start of each loop iteration. The contents of the loop are executed as long as this expression is true. Like the for loop, this loop comes in a compile-time version (if the end-expression involves only cvar and const) and in a run-time version (if the end-expression involves also var data types).

// While loop syntax
while (end-expression) {
 // Statements to execute while end-expression evaluates to true
}
// While loop example
const STOP_BIT = 0x8000;
var run = 1;
var i = 0;
var dio = 0;
while (run) {
  dio = getDIO();
  run = dio & STOP_BIT;

  dio = dio | (i & 0xff);
  setDIO(dio);
  i = i + 1;
}

The repeat loop is a simplified version of the for loop. It repeats the contents of the loop a fixed number of times. In contrast to the for loop, the repetition number of the repeat loop must be known at compile time, i.e., const-expression can only depend on constants and not on variables. Unlike the for and the while loop, this loop comes only in a run-time version. Thus, no cvar data types may be modified in the loop body.

// Repeat loop syntax
repeat (constant-expression) {
  // Statements to execute
}
// Repeat loop example
repeat (100) {
  setDIO(0x1);
  wait(10);
  setDIO(0x0);
  wait(10);
}

Usage of playZero and playHold commands

The functionalities of playHold and playZero are both available either through sequencer commands or through the command table. To use within a sequence, only the length in samples must be specified, as in playHold(32) or playZero(128). The sequencer commands also accept a sampling rate as a second optional argument, which reduces the sampling rate only for the duration of the command. For example, playZero(128, AWG_RATE_1000MHZ) will play 128 samples of zeros at a sampling rate of 1.0 GSa/s, corresponding to 128 ns.

To use playZero or playHold within the command table, a command table entry must be made. See Pulse-level Sequencing with the Command Table for more information on using playZero within the command table. Similar syntax applies for using playHold within the command table. The table entries can be used within a sequence by adding the appropriate executeTableEntry command to the sequencer code.

Depending on the experiment being performed, it can make sense to use the playZero sequencer command in some cases and the command table version in other cases (and similarly for playHold). Generally speaking, the sequencer commands should be used when the length is variable, when the length is 2^20 - 1 or fewer samples, or when the optional sampling rate argument is used. When using a variable argument, such as when performing a sweep of the evolution time between two pulses with playZero or of the length of a pulse with playHold, the sequencer command must be used, as the playZero and playHold functionality within the command table cannot support variable arguments. A similar restriction applies to the optional sampling rate argument.

When the length is 2^20 - 1 or fewer samples, the sequencer commands map to a single assembly instruction. Once the length is more than or equal to 2^20 samples, however, the sequencer commands map to at least two assembly instructions instead. Additionally, when using the optional sampling rate divider argument of the sequencer commands, playZero and playHold always map to at least three assembly instructions, regardless of the length in samples. When using the command table to perform playZero or playHold functionality, the corresponding executeTableEntry command always maps to a single assembly instruction, regardless of the length of the playZero or playHold, at the cost of using a command table entry.

Using Qubit Feedback Data in a Sequence

The AWG can make decisions depending on the feedback data received over ZSync or internal feedback. There are two primary ways to use the feedback data received: by using the command getFeedback and storing the result in a variable, or by using the feedback data directly as the argument of executeTableEntry. To directly make decisions about which pulse to play, it is recommended to use the feedback arguments of the executeTableEntry. For example, active reset in which the qubit data is passed to an SG Channel over a ZSync connection to a PQSC could involve a snippet of code like the following:

waitZSyncTrigger();
executeTableEntry(ZSYNC_DATA_PQSC_REGISTER, feedback_time);

The first argument determines which command table entry should be played, and the second argument accounts for the time between when the ZSync trigger is received and when the updated qubit readout data is available for use. The exact value of feedback_time (specified in number of sequencer clock cycles) depends on the combination of equipment being used as well as the experiment being performed and must be characterized by the user. For this example, the command table has been defined to play no pulse if the appropriate bit of ZSYNC_DATA_PQSC_REGISTER is 0 or to play a pi-pulse if the appropriate bit of ZSYNC_DATA_RAW is 1:

## Qubit was in state 0
table[0].waveform.playZero = True
table[0].waveform.length = PI_PULSE_LENGTH

## Qubit was in state 1
table[1].waveform.index = 0
table[1].amplitude00.value = PI_AMPLITUDE
table[1].amplitude01.value = -PI_AMPLITUDE
table[1].amplitude10.value = PI_AMPLITUDE
table[1].amplitude11.value = PI_AMPLITUDE

To use ZSYNC_DATA_PQSC_REGISTER, it is additionally necessary to configure the appropriate shift, mask, and offset values of the corresponding SG Channel sequencer.

In other cases, storing the results of getFeedback in a variable is the recommended route. For example, repeat until success requires repeated checking of the qubit readout data, but does not require a pulse to be played until the success criterion is met. Such an experiment might include sequencer code snippet like the following:

waitZSyncTrigger();

do {
  // preceding code
  failure = getFeedback(ZSYNC_DATA_PQSC_DECODER, feedback_time); // check for failure
  // following code
} while (failure)

// Success pulse
playWave(1, 2, w_success);

The success pulse is played only once the success condition has been met, and the type of pulse played does not directly depend on the feedback data received.

When testing a new sequence, it can also be useful to store the , as the value of the variable can be monitored by writing to a user register:

waitZSyncTrigger();
feedback_data = getFeedback(ZSYNC_DATA_PQSC_REGISTER, feedback_time);
setUserReg(0, feedback_data);

The above code will write the feedback data available at feedback_time sequencer clock cycles after the ZSync trigger is received. The data is written to user register 0.

To use internal feedback data from the QA channel of the {dev_class_abbrev}, the terms QA_DATA_RAW and QA_DATA_PROCESSED can be used as arguments of the getFeedback. Alternatively, QA_DATA_PROCESSED can be used as an argument of the executeTableEntry commands. This functionality is analogous to the corresponding terms for qubit readout data received over ZSync (ZSYNC_DATA_PQSC_RAW and ZSYNC_DATA_PQSC_REGISTER).

Synchronizing Multiple AWG Cores

In many cases, using a common start trigger at an appropriate point in the sequence is enough to ensure that the start of the output signals of the AWG cores are aligned in time. In some cases, however, actions with non-deterministic timing can cause the AWG cores to become out of sync with each other. To ensure that the AWG cores start their waveform playback in sync, even in the presence of actions with non-deterministic timing, it is possible to enable a synchronization check between the different AWG cores. Each SG channel has its own synchronization node (/device/sgchannels/[SG_CHAN_INDEX]/synchronization/enable, see Node Documentation). If the synchronization node of a channel is enabled (i.e. set to 1), the AWG core of that channel will participate in a synchronization check, which can be useful when executing actions with a non-deterministic timing such as loading of new sequences. This check is performed after the prefetch step of a sequence (i.e. after the sequencer instruction data, command table data, and waveform data have been transferred from the external to the internal memory of the AWG module but before the first sequencer instruction is executed), and each participating AWG core will wait until all of the participants in the synchronization check have returned a “ready” status. It is possible to even synchronize an entire QCCS setup in this way by setting the node /device/system/synchronization/source to external (numerical value of 1). When the source is external, the instrument will report its ready status to the PQSC to which the instrument is connected, and the PQSC will wait for all instruments connected to it to report a ready status. If the source is set to internal (i.e. a numerical value of 0), then only the AWG cores on the instrument that have synchronization enabled participate in the synchronization check. Also note that if the source of the SHFSG is set to internal, the PQSC will not consider the instrument as participating in the synchronization check and will ignore the ready status of that instrument. Finally, to ensure that trigger generation is coordinated with the synchronization check of the AWG cores, it is possible to have the internal trigger unit participate in the synchronization check by setting the node /device/system/internaltrigger/synchronization/enable to True (i.e. to 1). A similar node is available on the PQSC. When the trigger synchronization is enabled, the same number of trigger events with the same holdoff time will be generated between subsequent synchronization checks.

Functional Elements

Table 15: AWG tab: Control sub-tab
Control/Tool Option/Range Description
Start Runs the AWG.
Sampling Rate AWG sampling rate. This value is used by default and can be overridden in the Sequence program. The numeric values are rounded for display purposes. The exact values are equal to the base sampling rate divided by 2^n, where n is an integer between 0 and 13.
Round oscillator frequencies. Round oscillator frequencies to nearest commensurable with 225 MHz.
Status Display compiler errors and warnings.
Compile Status grey/green/yellow/red Sequence program compilation status. Grey: No compilation started yet. Green: Compilation successful. Yellow: Compiler warnings (see status field). Red: Compilation failed (see status field).
Upload Progress 0% to 100% The percentage of the sequencer program already uploaded to the device.
Upload Status grey/yellow/green Indicates the upload status of the compiled AWG sequence. Grey: Nothing has been uploaded. Yellow: Upload in progress. Green: Compiled sequence has been uploaded.
Register selector Select the number of the user register value to be edited.
Register 0 to 2^32 Integer user register value. The sequencer has reading and writing access to the user register values during run time.
Input File External source code file to be compiled.
Example File Load pre-installed example sequence program.
New Create a new sequence program.
Revert Undo the changes made to the current program and go back to the contents of the original file.
Save (Ctrl+S) Compile and save the current program displayed in the Sequence Editor. Overwrites the original file.
Save as... (Ctrl+Shift+S) Compile and save the current program displayed in the Sequence Editor under a new name.
Automatic upload ON / OFF If enabled, the sequence program is automatically uploaded to the device after clicking Save and if the compilation was successful.
To Device Sequence program will be compiled and, if the compilation was successful, uploaded to the device.
Multi-Device ON / OFF Compile the program for use with multiple devices. If enabled, the program will be compiled for and uploaded to the devices currently synchronized in the Multi-Device Sync tab.
Sync Status grey/green/yellow Sequence program synchronization status. Grey: No program loaded on device. Green: Program in sync with device. Yellow: Sequence program in editor differs from the one running on the device.
Table 16: AWG tab: Waveform sub-tab
Control/Tool Option/Range Description
Wave Selection Select wave for display in the waveform viewer. If greyed out, the corresponding wave is too long for display.
Waveforms Lists all waveforms used by the current sequence program.
Mem Usage (%) 0 to 100 Amount of the used waveform data relative to the device cache memory. The cache memory provides space for 64 kSa of waveform data per AWG core.
Table 17: AWG tab: Trigger sub-tab
Control/Tool Option/Range Description
Trigger State grey/green State of the Trigger. Grey: No trigger detected. Green: Trigger detected.
Slope Select the signal edge that should activate the trigger. The trigger will be level sensitive when the Level option is selected.
Level (V) numeric value Defines the analog trigger level.
Auxiliary Trigger State grey/green State of the Auxiliary Trigger. Grey: No trigger detected. Green: Trigger detected.
Signal Selects the digital trigger source signal.
DIO/Zsync Trigger state grey/green Indicates that triggers are generated from the DIO or ZSync interface to the AWG.
Read DIO/ZSync Each AWG can be configured to either receive DIO data or ZSync data.
Valid Index 16 to 31 Selects the index n of the DIO interface bit (notation DIO[n] in the Specification chapter of the User Manual) to be used as a VALID signal input, i.e. a qualifier indicating that a valid codeword is available on the DIO interface.
Valid Polarity Polarity of the VALID bit that indicates that a codeword is available on the DIO interface.
None VALID bit is ignored.
Low VALID bit must be logical low.
High VALID bit must be logical high.
Both VALID bit may be logical high or logical low.
Codeword Mask 0 to 1023 10-bit value to select the bits of the DIO interface input state (notation DIO[n] in the Specification chapter of the User Manual) to be used as a codeword in connection with the playWaveDIO sequencer instruction. The Codeword Mask is combined with the DIO interface input state by a bitwise AND operation after applying the Codeword Shift.
Codeword Shift 0 to 31 Defines the integer bit shift to be applied to the input state of the DIO interface (notation DIO[n] in the Specification chapter of the User Manual) to be used as a codeword for waveform selection in connection with the playWaveDIO sequencer instruction.
High bits 32-bit value indicating which bits on the DIO interface are detected as logic high.
Low bits 32-bit value indicating which bits on the DIO interface are detected as logic low.
Timing Error grey/red Indicates a timing error. A timing error is defined as an event where either the VALID or any of the data bits on the DIO interface change value at the same time as the STROBE bit.
Synchronization Enable Enable multi-channel synchronization for this channel. The program will only execute once all channels with enabled synchronization are ready.
Display Format Select PQSC Register and Decoder view format.
Hexadecimal ZSync parameters view format is hexadecimal.
Decimal ZSync parameters view format is decimal.
Binary ZSync parameters view format is binary.
PQSC Register Shift The bit shift applied to the message received on ZSync interface coming from the PQSC readout registers.
PQSC Register Mask 4-bit value to select the bits of the message received on ZSync interface coming from the PQSC readout registers.
PQSC Register Offset The additive offset applied to the message received on ZSync interface coming from the PQSC readout registers.
PQSC Decoder Shift The bit shift applied to the message received on ZSync interface coming from the PQSC error decoder.
PQSC Decoder Mask 8-bit value to select the bits of the message received on ZSync interface coming from the PQSC error decoder.
PQSC Decoder Offset The additive offset applied to the message received on ZSync interface coming from the PQSC error decoder.
Display Format Select view format.
Hexadecimal Internal feedback parameters view format is hexadecimal.
Decimal Internal feedback parameters view format is decimal.
Binary Internal feedback parameters view format is binary.
Internal Feedback Shift The bit shift applied to the readout data received from the QA channel.
Internal Feedback Mask 16-bit value to select the bits of the shifted readout data received from the QA channel.
Internal Feedback Offset The additive offset applied to the shifted and masked readout data received from the QA channel.
Table 18: AWG tab: Advanced sub-tab
Control/Tool Option/Range Description
Sequence Editor Display and edit the sequence program.
Assembly Text display Displays the current sequence program in compiled form. Every line corresponds to one hardware instruction.
Counter Current position in the list of sequence instructions during execution.
Status Running, Idle, Waiting Displays the status of the sequencer on the instrument. Off: Ready, not running. Green: Running, not waiting for any trigger event. Yellow: Running, waiting for a trigger event. Red: Not ready (e.g., pending elf download, no elf downloaded)
Rerun ON / OFF Reruns the Sequencer program continuously. This way of looping a program results in timing jitter. For a jitter free signal implement a loop directly in the sequence program.
Mem Usage (%) 0 to 100 Size of the current sequence program relative to the device cache memory. The cache memory provides space for a maximum of 16384 instructions.
Clear Clears the command table description for the selected AWG Core.
Status grey/green/red Displays the status of the command table of the selected AWG Core. Grey: no table description uploaded, Green: table description successfully uploaded, Red: Error occurred during uploading of the table description.