Part C · Lesson 2

Trapped ions: shuttling is a waveform

In a trapped-ion computer the qubits move. An ion travels from one zone of the trap to another because the voltages on the electrodes around it change. For the controller, every hop is a set of DAC waveforms that must start on the same clock cycle.

This lesson assumes lesson C1 and the idea of a timed write (lesson B2). The background chapter on qubits describes ion traps. The examples here call QCCD Studio, which needs Python and the QCCD checkout next to this repository; the course server has both.

1A trap with zones

A QCCD machine holds ions in a segmented trap. Some zones are gate zones, where lasers act on the ions held there. Other zones are for storage and transit. A two-qubit gate needs both ions in the same gate zone, so programs are full of shuttles: an ion is pushed from one site to the next by changing the voltages on the electrodes beneath it (Kielpinski, Monroe and Wineland, Nature 417, 709 (2002)). Quantinuum's H-series machines work this way. The machine in this lesson is QCCD Studio's model of the H2 race-track trap (Moses et al., Phys. Rev. X 13, 041052 (2023), arXiv:2305.03828).

QCCD Studio is a separate project that compiles and checks programs for such traps. QuantumOS does not recompute ion physics. It asks Studio for three things and builds the controller underneath them:

  1. Studio's compiler turns OpenQASM into a TSIR program, Studio's control IR: where each ion starts, which gates run in which zone, and which ions move over which trap edges (bridge/qccd_compile.py).
  2. Studio's replay executes that program on its architecture and reports a list of cycles. Each cycle states its kind, the ions and sites involved, its time, and, for a shuttle, which electrode control channels act (bridge/qccd_studio.py).
  3. QuantumOS turns each cycle into one hardware instruction, then into timed writes on RISC-Q cores (riscq/platforms/qccd.mjs).

Here is the program this lesson follows, the example qccd-ghz3:

OPENQASM 2.0;
include "qelib1.inc";
qreg q[3];
creg c[3];
h q[0];
cx q[0],q[1];
cx q[1],q[2];
measure q -> c;

Studio places q0 in zone DG03, q1 in DG02 and q2 in DG01. To entangle q0 with q1 it moves q0 through the transit site AUXD2 into DG02. Then it moves q1 through AUXD1 into DG01 for the second gate. Open the run in the workspace and read the TSIR layer in the right-hand column to follow the moves.

2Cycles become hardware instructions

In this section: the six instruction kinds, and where each duration comes from.

Studio cycleHardware instructionWhat the controller doesStandard duration
shuttletransportone waveform on every engaged electrode control channel63.8 µs per Studio unit
gate Rrotateone laser modulator pulse with the gate's angle and axis5 µs
gate MSmsone Mølmer–Sørensen pulse per gate zone25 µs
measuremeasurea detection pulse and photon counting120 µs
coolcoolone broadcast cooling pulse550 µs
gate VZframenothing: a virtual Z0

Studio's H2 model reports time in abstract units, not microseconds. When a program's cycles follow one another in unit time, the lowering gives each cycle the published duration of its kind from riscq/standards.mjs. All of them come from Pino et al., Nature 592, 209 (2021), arXiv:2003.01293, the paper that demonstrated the QCCD architecture on a Honeywell trap. Table III gives 5 µs for a single-qubit rotation, 25 µs for a two-qubit gate, 120 µs for detection and 550 µs for Doppler cooling. Table II gives 58 µs for an intrazone shift of 110 µm, and its caption adds about 10% to every operation for interpolation and electronics delays: 58 × 1.1 = 63.8 µs.

An assumption. One Studio time unit of a shuttle is mapped to one 63.8 µs shift. A Studio cycle that spans two units takes 127.6 µs. That mapping is this project's, not Studio's or Pino's, and it is listed among the assumptions in docs/riscq-controller.md. A Studio design that states its own times in µs, such as the example qccd-rotation, keeps them.

Run qccd-ghz3. The second shuttle moves q0 from AUXD2 into DG02 (hardware instruction tsir-5-0). How long does it take?

Studio reports this cycle as two time units, so it takes two standard shifts: 2 × 63.8 = 127.6 µs. The first shuttle, DG03 to AUXD2, is one unit, 63.8 µs.

3The control machine

The ion controller runs at 100 MHz, so one batch is 10 ns. A pulse-table entry holds up to 65,535 batches, 655 µs, long enough for the 550 µs cooling pulse. The lowering builds three kinds of core from what the program uses:

A rotation sets its angle through the pulse area: the core writes the table entry's amplitude as 19,896 × |θ| / π before it fires, and its phase as the rotation axis φ (plus π for a negative angle). An MS pulse scales its amplitude with θ / (π/2). The pulse length stays the standard duration.

How many control cores does the qccd-ghz3 run use?

One transport core for the four control channels the shuttles engage, one core for each of the gate zones DG01, DG02 and DG03, and the light core. The Control system view of the workspace draws them.

The first instruction after cooling is a rotation of q0 by θ = π/2 in DG03. Which amplitude code does its pulse window on zone.DG03.rotate land with?

19,896 × (π/2) / π = 9,948. Every rotation of this program is ±π/2, so every rotate pulse has this amplitude. Only the phase code changes with the axis.

4A shuttle is a burst of waveforms

What does the controller do while an ion moves?

For a transport instruction the lowering takes the control channels Studio names for that cycle and fires one waveform on each of them, all with the same start time. In the GHZ program each shuttle engages a single control channel, named after the zone it serves. In the example qccd-rotation each cycle engages 24: twelve on a horizontal bank and twelve on a vertical bank, moving two ions at once.

The trace confirms the move only if every waveform of the cycle opened on time on the same batch (ionTimeline in riscq/platforms/qccd.mjs). The workspace draws an ion on the straight line between its sites, at the fraction of the move window that has passed. Start the run below: it opens at the step where the first shuttle's waveform reaches the electrodes of zone DG03.

The GHZ program on Studio's H2 trap, at the first shuttle of q0. Press Play to watch q0 and then q1 move.
The chip view of the GHZ run: ions move between zones while the cores drive electrodes and lasers
The same run, recorded. From the end of cooling to the last detection, one frame per batch time. The card at the top names the trace step, the hardware instruction, the TSIR line, the OpenQASM line and the firmware word.

5The cost of a burst: preroll

In this section: why many simultaneous waveforms delay the start of a segment.

A core issues one write at a time. Each timed write is issued one lead (96 batches) before it must start. If eight waveforms of one core must start on the same batch, the core cannot issue all eight in the last 96 batches: the table loop that issues them is budgeted 32 core cycles per write (TABLE_COST in riscq/firmware.mjs), and the model assumes one batch per core cycle. The compiler moves the earlier writes back and, when they would have to leave before the segment begins, starts the whole segment later. That delay is the preroll.

preroll = (n − 1) × 32 batches for n simultaneous writes on one core

The relation is tested in tests/riscq-limits.test.mjs. Every pulse still opens on the same batch; the cost is time before the first one.

Run qccd-rotation. Its 24 control channels are split over three transport cores. By how many microseconds does the preroll delay its segment?

Each core starts eight waveforms on one batch, so the preroll is (8 − 1) × 32 = 224 batches of 10 ns: 2.24 µs. The run bundle lists it per segment in preroll, in batches.

Why not one core for all channels? Program memory. Each timed write of the table loop takes four words of RAM. A core here has 16,384 words, of which 320 at the top hold the table of shared bits, so a program can use 16,064. Running Studio's full H2 GHZ program with 16 control channels on one core needs 16,577 words, and the compiler rejects it (tests/riscq-qccd.test.mjs checks the rejection). With eight channels per core the H2 program fits on three transport cores.

Why does the lowering give a transport core at most eight electrode control channels?

  1. RISC-Q allows at most eight channels on a core.
  2. A DAC has eight outputs.
  3. Program size and burst width grow with the channels per core; at 16 the H2 program no longer fits the core's RAM.
  4. Studio groups electrodes in banks of eight.
A RISC-Q core takes up to 16 channels. The limit of eight is a choice of the lowering (channelsPerCore), made because every waveform of a channel is issued from its core's RAM and because wider bursts cost more preroll.

6Measurement is photon counting

An ion is measured by shining a laser that makes one qubit state fluoresce and leaves the other dark. A detector counts the photons. Many photons mean "bright", one or none mean "dark". In the lowering, one detect pulse per gate zone lights all its ions for 120 µs. Each ion in the zone is imaged onto its own counter line, and the zone core runs one firmware loop that counts rising edges on those lines until the window closes. A count of at least 2 reads as 1.

Those photon numbers are a composite of two machines, because no H-series paper states them: a bright 171Yb+ ion gives about 10 photons per window (Wright et al., Nat. Commun. 10, 5464 (2019), arXiv:1903.08181), and an ion is called bright when more than one photon is counted (Egan et al., Nature 598, 281 (2021), arXiv:2009.11482).

The outcome is still yours. You choose which ions are bright, for example outcome=q0=1&outcome=q2=1 in the workspace address. The model then puts 10 pulses on that ion's counter line, each a rising and a falling edge, and the firmware counts them like real clicks.

Run qccd-ghz3 with q0 and q2 bright. How many edge frames does the trace record on the counter lines?

Two bright ions, 10 photons each, two edges per photon: 40. q0 is counted alone in DG02. q1 and q2 share DG01, one detection pulse and two counter lines. q1 is dark and produces no edge.

7Where the time goes

Add up the durations of the GHZ run's hardware instructions and you find that the controller is idle most of the time. It is waiting for physics measured in hundreds of microseconds. Compare that with the 2.6 µs of a whole superconducting run in lesson C1.

What percentage of the GHZ program's hardware time (the span of its hardware instructions) is the initial cooling?

550 µs of 1,331.6 µs, 41.3%. Transport takes 446.6 µs, detection 240 µs, and all gates together 95 µs. Cooling and shuttling, not gates, set the pace of this machine.

Try it: your own circuit on the ion trap

Edit the OpenQASM 2 program and run it. The server calls QCCD Studio's compiler, replays the TSIR program in Studio, lowers the cycles and runs the firmware (POST /api/riscq/run with { platform: "qccd", qasm }). This takes a few seconds.

What to remember

  1. QCCD Studio compiles and replays the program; each Studio cycle becomes one hardware instruction.
  2. A shuttle is one waveform per engaged electrode control channel, all started on the same batch by transport cores.
  3. Durations are published values (Pino et al. 2021): 63.8 µs per shuttle unit, 5 µs, 25 µs, 120 µs, 550 µs. One unit per shift is an assumption.
  4. Many simultaneous writes on one core cost preroll, (n − 1) × 32 batches; RAM limits a core to a few channels.
  5. Detection counts photon edges in firmware; the photons come from outcomes you choose.