Background · Chapter 2
Classical control systems
Between the program and the qubit sits a rack of classical electronics: FPGAs, converters, oscillators made of arithmetic, clocks, cables and optics. This chapter explains each piece, what it does to a signal, and where it appears in the RISC-Q model that the simulator runs.
Read chapter 1 first if you have not met transmons, ions and atoms. The numbers here come from data sheets, papers and RISC-Q's own files, each named where it is used. Real products are named only where a public source describes them.
1Why a computer is not enough
Why not drive the qubits from an ordinary PC?
In this section: determinism, the division of labor between processors and FPGA logic, and four control systems with public descriptions.
A desktop processor is fast but not predictable. Caches, branch predictors, interrupts and the operating system make the time an instruction takes vary from run to run. A transmon gate lasts 35 ns on the ring this course uses, and a pulse that starts 2 ns late is wrong. What a quantum computer needs is determinism: every sample at the converter on its scheduled clock cycle, every time.
The standard answer is an FPGA (field-programmable gate array), a chip of configurable logic and memory that runs a fixed, clocked circuit. An FPGA pipeline takes exactly the same number of cycles every time, so its timing can be known to the cycle. Its weakness is flexibility: changing what it does means changing the circuit. Control systems therefore split the work. The datapath, which produces samples and digests incoming ones, is FPGA logic. The sequencing, which decides what to play next and reacts to measurements, is a small processor, either a custom sequencer or a soft CPU built inside the FPGA, whose job is to tell the datapath what to do ahead of time.
Four systems with public descriptions show the range:
| System | What it is | Source |
|---|---|---|
| QubiC | Open-source FPGA control and measurement for superconducting qubits from Lawrence Berkeley National Laboratory. The first version ran on a Xilinx VC707 board with 1.25 GS/s DACs and 1 GS/s ADCs, operated at 1 GS/s with a 250 MHz DSP clock. QubiC 2.0 runs on the AMD ZCU216 RFSoC with a 500 MHz DSP clock, 8 GS/s DACs and 2 GS/s ADCs, and supports mid-circuit measurement and feed-forward. | Xu et al., IEEE TQE 2, 6003811 (2021), arXiv:2101.00071; Xu et al., arXiv:2309.10333 (QubiC 2.0) |
| ARTIQ | M-Labs' control system for quantum-information experiments, widely used with trapped ions. Experiments are written in a Python-based language that is compiled and executed on FPGA hardware ("usually Kasli or Kasli-SoC"). Output events carry timestamps in machine units that "normally correspond to one nanosecond"; the coarse RTIO clock is most commonly 125 MHz. | m-labs.hk; ARTIQ manual, Real-Time I/O concepts |
| Quantum Machines OPX | A commercial controller whose documentation describes an "FPGA-based Pulse Processor" with "multiple cores designed to generate pulses". | Quantum Machines documentation, conceptual overview |
| RISC-Q | "A RISC-V–controlled SoC for superconducting-qubit control, written in SpinalHDL and targeting the AMD/Xilinx ZCU216 RFSoC board", with one RV32I core per qubit. The controller this course models. | RISC-Q repository README |
The simulator models RISC-Q, because its RTL, its documents and its firmware are public, so every latency in the model can name the document it comes from. Chapter 3 describes its architecture. The rest of this chapter covers the parts that every such system has.
2Converters, sample rates and batches
How does a number become a microwave pulse?
In this section: DACs, ADCs, the RFSoC, and why a sample clock of gigahertz forces the logic to work on batches of samples.
A DAC (digital-to-analog converter) turns a stream of numbers into a voltage that follows them, one number per sample period. An ADC does the reverse. A converter that samples at fs can represent frequencies up to fs/2, the Nyquist frequency; above it, a tone is indistinguishable from an image below it.
An RFSoC puts fast converters, FPGA logic and ARM processors on one chip. The AMD ZCU216 evaluation board, which both QubiC 2.0 and RISC-Q target, carries a Zynq UltraScale+ RFSoC Gen 3 ZU49DR with 16 RF-DACs of 14 bits at up to 9.85 GS/s and 16 RF-ADCs of 14 bits at up to 2.5 GS/s (AMD ZCU216 product page).
FPGA logic cannot run at 8 GHz. It runs at a few hundred megahertz, and each clock cycle it hands the converter several
samples at once. RISC-Q's x6y3 build clocks its DSP logic, the dspClk, at 500 MHz
(software/configs/x6y3.json, dsp_freq_hz), and the calibration's sample rates are 8 GS/s for the
DAC and 2 GS/s for the ADC. One dspClk cycle therefore carries
DAC: 8 GS/s / 500 MHz = 16 samples ADC: 2 GS/s / 500 MHz = 4 samples
That group of samples is a batch, and every time in the controller is a whole
number of batches (BATCH_SIZE = 16, ADC_BATCH = 4 in riscq/soc.mjs). The logic
computes 16 samples in parallel lanes, one lane per sample position in the batch. QubiC's first version shows the
same idea at a smaller ratio: 1 GS/s converters with a 250 MHz DSP clock, 4 samples per cycle.
A pulse window starts on a batch boundary and lasts whole batches. Finer timing is possible in principle, by shifting
the envelope inside the batch, but the model does not use it: the envelope carries the pulse's shape inside its
window, and the window is rounded up to whole batches. A 35 ns x90 occupies 18 batches, 36 ns.
Run the feed-forward program. How long is one batch on the transmon ring, in nanoseconds?
dspPeriodPs, the dspClk period in picoseconds: 2,000 ps, 2 ns, from
the 500 MHz clock of the x6y3 build. Every atBatch in the trace is multiplied by it to give
atPs.3Numerically controlled oscillators and carriers
How does digital logic make a 5 GHz sine wave?
In this section: the phase accumulator, frequency and phase codes, phase coherence, and why retuning a carrier takes time.
An NCO (numerically controlled oscillator) is an accumulator. Each sample it adds a fixed phase increment Δφ to a running phase φ and outputs cos φ and sin φ. The output frequency is
Because the phase keeps running whether or not a pulse is playing, every pulse on that carrier has a well-defined phase relative to all earlier ones. That phase coherence is what makes a virtual Z possible: the Z rotation is an offset added to φ for all later pulses of that qubit.
RISC-Q encodes the increment as a 16-bit code, the phase advance per DAC sample in units of π/32768
(freqCode in riscq/soc.mjs, after RISC-Q units.py):
resolution = lanes · fdsp / 65536 = 8 GS/s / 65536 ≈ 122.07 kHz on the ring
A phase is a 16-bit code in the same units (phaseCode), so phases resolve to 2π/65536. An amplitude is a code
up to 19,896, the largest that keeps RISC-Q's unsaturated datapath in range (AMP_SCALE, after RISC-Q
pulses/golden.py). The firmware writes these codes into channel registers; the
carrier register of a channel holds the frequency code.
The ion and atom controllers in the simulator run at 100 MHz with 16 lanes, 1.6 GS/s. What is the smallest step by which they can change a tone's frequency, in kHz?
riscq/platforms/neutral.mjs states the step in its header).
Retuning is not free. RISC-Q's pulse generator does not compute each lane's carrier from scratch every cycle; it holds
one phasor per lane and advances it. When the frequency changes, the lane phasors are regenerated one lane per
cycle through one CORDIC unit. The model derives the cost from RISC-Q's block latencies
(QControl/RiscQ/Timing.lean, regenCycles = lanes + cordic + 2): the carrier itself takes effect
36 cycles after release, and all 16 phasors after 52. These leads are used in chapter 4.
4Envelopes and pulse tables
Where does a pulse's shape come from?
A pulse is a carrier multiplied by an envelope. Storing the envelope as
samples in a memory next to the generator lets the processor start a complex pulse with one number: the address of its
first sample. RISC-Q channels have an envelope memory (4,096 lines on the x6y3 build, env_depth) and a
pulse table: a small list of entries, each holding an amplitude code, a
phase code, an envelope address and a duration in batches. Playing a calibrated x90 means
firing its entry.
The ring's calibration uses two envelope shapes: FAST_DRAG for the 35 and 70 ns drive pulses, and
cosine_square (a flat top with cosine edges) for the CZ tones, readout tones and demodulation weights. In the
model the envelope is named, not sampled: a pulse frame reports the scheduled codes, and the workspace draws a waveform
from them for display. Carrier synthesis is represented by its latency only. docs/riscq-controller.md lists
this under "Not modeled".
5IQ demodulation
How does a returning tone become one bit?
In this section: multiplying by a reference, integrating over a window, and thresholding.
A dispersive readout returns a tone at the resonator frequency whose amplitude and phase depend on the qubit state. The ADC samples it, and the logic multiplies each sample by a reference tone at the same frequency and sums over a window:
Here s[n] are the ADC samples, w[n] is a weight (the demodulation envelope), f is the readout frequency and φ a phase chosen so that the two qubit states separate along one axis. This is demodulation. The result is one complex number, plotted as a point in the IQ plane; points for |0⟩ and |1⟩ form two clusters, and a threshold line between them turns the point into a bit.
In RISC-Q a demodulation channel has a pulse table like a drive channel: firing its entry opens an acquisition window on
the ADC. Its carrier advances per ADC sample, so its code is four times the DAC code of the same frequency
(riscq/platforms/superconducting.mjs, after units.py). After the window, the readout decoder
takes 9 cycles (complex multiply 6, plus 1, plus log₂ of the 4 ADC lanes; ReadoutDecoder.md), and the result
travels back to the core's result sink, where a load of res stalls
until the value has settled. In the model the measured bit is an input you choose: the simulator does not produce IQ
samples.
ReadoutDecoder.md. Schematic drawing.6Digital lines and photon counters
Not every signal is a waveform. Laser shutters, camera triggers and trigger outputs are digital lines, and an ion's
detection is a stream of photon pulses on a digital input. RISC-Q's third channel kind, dio, drives sixteen
digital output lines from its table and timestamps changes on its inputs. Each input change becomes an event
{changed lines, levels} in a queue of depth 8 at the core's sink, which firmware reads through
pop, time, seq and count registers (EventLink.md).
On the simulator's ion machine each ion in a gate zone has its own photon-counter line. One firmware loop
(countEdges in riscq/firmware.mjs) drains the event queue during the detection window, adds up
the rising edges per line, and compares each count with the threshold: more than one photon is bright. The photon
edges themselves are inputs to the run, generated from the composite statistic of chapter 1.
7Clocks and synchronization
How do a dozen processors agree on what time it is?
In this section: one clock per board, the batch-time register, barriers, and synchronization between boards.
Inside one board, every channel and every core runs on the same dspClk, derived from one reference. RISC-Q keeps a
32-bit batch-time register that counts dspClk cycles; it wraps after 2³² batches, and the timing theorems of chapter
4 are stated with that wrap in mind. Each core reads a copy of the time at 0xBFF8. That copy lags the
converter edge by the link's delay; RISC-Q states a constant lag without a number, and the model assumes it equals the
link depth (coreTimeLag in riscq/soc.mjs, marked assumed).
Cores that must act together first meet at a barrier in the board hub. The last arrival releases all of them with one common time, and each core schedules its next writes relative to that time. Chapter 3 describes the hub.
Between boards the problem is harder: two boards have two oscillators that drift. White Rabbit, developed at CERN,
extends Ethernet and the Precision Time Protocol to distribute time with "sub-nanosecond accuracy and picoseconds precision"
(CERN White Rabbit project;
Lipiński et al., IEEE ISPCS 2011, doi:10.1109/ISPCS.2011.6070148).
RISC-Q's repository includes a White Rabbit time-sync node (src/riscq/wr/). RISC-Q's QEC system paper connects
three ZCU216 boards and synchronizes them with a minimal PTP over the boards' transceiver links, naming White Rabbit as a
future extension (Liu et al., arXiv:2603.16203). The simulator models one
board. Multi-board operation is listed as not modeled.
8Cables and signal speed
How long does a pulse spend on the wire?
A signal on a cable travels slower than light in vacuum, at c/√εr for a dielectric of relative permittivity
εr. The ratio to c is the cable's velocity factor. The project's interconnect library
(machine/interconnect.mjs) gives each medium one effective speed:
| Medium | Speed (mm/ns) | Delay per metre | Status |
|---|---|---|---|
| Coaxial cable | 200 | 5.0 ns | reference design value (velocity factor ≈ 0.67) |
| Optical fibre | 204 | 4.9 ns | reference design value |
| Free space | 299.792458 | 3.34 ns | exact, SI definition of the metre |
| Coplanar microwave trace on chip | 125 | 8.0 ns | reference design value |
| Differential copper pair | 195 | 5.1 ns | reference design value |
| Logic-level and DC copper | 190 | 5.3 ns | reference design value |
The library marks these as "reference design assumptions for geometry, velocity and transfer parameters" to be replaced by calibrated values for a specific installation.
In a hardware design document (chapter 6) a wire's delay is its routed length divided by its medium's speed, so moving a chip two metres farther away delays every arrival by 10 ns and changes nothing at the converters. The built-in transmon ring uses a fixed path: 1,050 mm of coax from the refrigerator flange to the chip (Krinner et al. 2019, Table 1) at an assumed 0.7 c, 5.003 ns.
In the feed-forward run, the first x90 pulse leaves the DAC port at some time and reaches qubit 0 later. How
many picoseconds does the trace say it spends between the two?
qubit0 carries atPs, when the pulse is at the converter, and
arrivesPs, when it reaches the qubit. The difference is 1,050 mm / (0.7 × 299.792458 mm/ns) ≈ 5,003 ps.9Acousto-optics and other optics
For ions and atoms, the last stage of the control chain is optical. An acousto-optic modulator (AOM) and an acousto-optic deflector (AOD) are the same device used two ways: an RF tone drives a piezoelectric transducer, which launches a sound wave through a crystal; the sound wave acts as a moving grating, and the laser beam is diffracted by it. The diffracted beam is shifted in frequency by the tone's frequency and deflected by an angle proportional to it. An AOM uses the first effect: turning the RF on and off switches the beam, and the RF phase becomes the light's phase, which is how a laser gate gets its phase. An AOD uses the second: the tone frequency sets the beam's direction, and with a lens, a position in the atom plane.
An AOD does not respond instantly. A frequency change reaches the beam only when the new sound has crossed it. The
simulator charges each tone a delay of 6.154 µs, the width of a 4 mm beam over an acoustic velocity of 650 m/s
(riscq/standards.mjs: velocity from Lu et al., arXiv:2510.11451, supplement; beam width from Endres et al. 2016;
marked derived). Static tweezer patterns come from a spatial light modulator, which the control system sets once
and does not sequence.
What to remember
- Qubit control needs determinism to the clock cycle. FPGA logic provides it; a small processor sequences it ahead of time.
- FPGA logic runs at hundreds of megahertz and hands the converters a batch of samples per cycle: 16 DAC and 4 ADC samples at 500 MHz.
- An NCO is a phase accumulator. Its 16-bit code sets the carrier frequency; a phase offset implements a virtual Z.
- A pulse is a table entry: amplitude, phase, envelope address and duration. Firing it plays it.
- Demodulation multiplies the returning tone by a reference and integrates it to one IQ point; a threshold makes the bit.
- One board shares one clock and meets at barriers. Between boards, protocols such as White Rabbit are needed; the model has one board.
- Cables delay signals by their length over the medium's speed, about 5 ns per metre of coax.
- AOMs switch and phase laser beams; AODs turn RF frequency into position, with an acoustic delay of microseconds.