Part C · Lesson 1

Superconducting: from OpenQASM to microwaves

On a transmon machine a gate is a calibrated microwave pulse, a Z rotation is a number added to later pulses, and a measurement is a tone followed by an acquisition window. This lesson takes OpenQASM down to those three things on a real calibration.

You should know what a batch, a pulse table and a fire are (lessons A2 and B1). The background chapter on qubits explains what a transmon is. No quantum state is simulated in this lesson or anywhere in the simulator.

1The machine: an eight-transmon ring

In this section: where the numbers come from, and which channels each control core owns.

The superconducting machine is not invented for this course. It is the eight-qubit ring of RISC-Q's example calibration, examples/cal-config-x6y3.yaml at commit 243d814. The script validation/riscq/extract_calibration.py copies the control-relevant numbers into validation/riscq/x6y3-calibration.json unchanged: qubit frequencies from 5.23 to 5.91 GHz, pulse durations, amplitudes as a fraction of DAC full scale, phases, and the readout of each qubit. The controller is RISC-Q's x6y3 build: a 500 MHz control clock, so one batch is 2 ns; a DAC that takes 16 samples per batch (8 GS/s); an ADC that takes 4 samples per batch (2 GS/s).

There is one control core per qubit. Each core owns a few channels, and each channel sits in front of a converter:

core q0 RV32I, own RAM gate (x90, x) cz0 (pair 0-1) cz1 (pair 7-0) ro (tone) demod (window) DAC 0 DAC 8 (shared) ADC 12 (shared) qubit 0 drive line readout line → resonators ← returning signal
Core q0 and its five channels. Gate and CZ channels feed qubit 0's DAC. Every core's readout tone goes to DAC 8 and every acquisition reads ADC 12, as RISC-Q's x6y3.json maps them (dac_map, adc_map). Schematic drawing.

You can see these channels in the workspace: open the run below in the Control system view and select q0. The run bundle lists them too, under machine.cores.

Two pairs are missing. The ring has eight couplings, but the calibration realizes the CZ of pairs (5, 6) and (6, 7) with extra pulses on qubit 6's second excited level, a "sandwich" of EF pulses before and after the tone. The lowering does not model those pulses, so the two pairs are not offered. Qubit 6 has no CZ channel at all, and qubits 5 and 7 have one each.

2A gate is a calibrated pulse

What exactly does the controller play for sx q[0]?

A transmon rotates about an axis in the X–Y plane when a microwave tone at its frequency reaches its drive line. The angle depends on the pulse's area, and the axis depends on the pulse's phase. A calibration fixes one shape for each rotation the machine offers. Here the calibration offers two: x90, a 90° rotation, and x, a 180° rotation. On qubit 0 they are 35 ns and 70 ns long, with amplitudes of 0.1056 and 0.1067 of full scale and the FAST_DRAG envelope. DRAG shapes are the standard way to keep a short pulse from leaking into the transmon's second excited level (Motzoi et al., Phys. Rev. Lett. 103, 110501 (2009), arXiv:0901.0534).

Each calibrated pulse becomes one row of the gate channel's pulse table: an amplitude code (the fraction times 19,896), a phase code, an envelope address and a duration in batches. The firmware fires row 0 for an x90 and row 1 for an x. The amplitude, envelope and carrier are fixed in the table. Only the phase changes from one fire to the next, for a reason the next section explains.

The calibration says 35 ns for qubit 0's x90. Run the feed-forward example. How long is the x90 pulse window on q0.gate?

A pulse window is a whole number of batches. 35 ns is 17.5 batches of 2 ns, so the lowering rounds up to 18 batches, 36 ns (span in riscq/platforms/superconducting.mjs). The envelope carries the shape inside the window. The 70 ns x needs no rounding.

3Z rotations play nothing

In this section: virtual Z, the decomposition of every standard gate, and how a phase reaches the hardware.

A rotation about Z changes only the phase between the qubit's two levels. Instead of playing a pulse for it, the controller can rotate its own reference: every later drive pulse on that qubit is played with its phase shifted by minus the angle. The result is the same as a physical Z rotation followed by those pulses, and it costs no time. This is the virtual Z gate (McKay et al., Phys. Rev. A 96, 022330 (2017), arXiv:1612.00858).

With virtual Z, every single-qubit gate can be written with two x90 pulses and three phase changes. The lowering (nativeGate in riscq/platforms/superconducting.mjs) uses exactly that form for a general unitary:

U(θ, φ, λ) = Z(φ + π) · SX · Z(θ + π) · SX · Z(λ) up to a global phase

Read right to left: a frame update by λ, an x90, a frame update by θ + π, another x90, a frame update by φ + π. That is the ZSXZSXZ form. The common gates have shorter forms in the same table:

OpenQASMHardware instructions
xx
sxx90
z, s, t, rz(θ), p(θ)one frame (π, π/2, π/4, θ, θ)
hframe(π/2), x90, frame(π/2)
yframe(π), x
rx(θ), ry(θ), U(θ,φ,λ)the ZSXZSXZ form above
cx, cy, swapHadamards and S gates around one or three cz

The calibration adds its own small frame updates. On qubit 0 it asks for a Z rotation of 0.0055 rad before and after every x90, to correct a phase error of the pulse. The scheduler inserts them as more frame instructions. The test file tests/riscq-superconducting.test.mjs checks every decomposition as a 2×2 matrix against the gate it replaces.

Which sequence does the lowering emit for U(θ, φ, λ), in time order?

  1. One x pulse with phase φ and amplitude set by θ.
  2. x90, frame(θ), x90.
  3. frame(λ), x90, frame(θ + π), x90, frame(φ + π).
  4. Three physical pulses about Z, X and Z.
The amplitude of a calibrated pulse never changes, so the angle θ cannot be set by amplitude. Two fixed 90° pulses with three phase changes reach every single-qubit rotation. Only the two x90 take time.

How the phase reaches the channel. The lowering keeps one running frame per qubit. A frame instruction subtracts its angle. When a drive pulse fires, the core first writes the channel's phaseOffset register with the current frame as a 16-bit code (one turn is 65,536), then fires the table row. So the same table row plays with a different phase each time. The run bundle records the phase code each window landed with (summary.pulses[].phase), and the box below lists it.

Try it: compile your own OpenQASM for the ring

Edit the program and run it. The server compiles it with the same code as the workspace (POST /api/riscq/run with { platform: "superconducting", qasm }), runs the firmware in the Lean model, and returns the run. Below are its hardware instructions and the pulse windows the trace recorded. Qubits 0 to 7 exist. A two-qubit gate needs one of the six calibrated pairs: 0-1, 1-2, 2-3, 3-4, 4-5, 7-0.

Compile a program whose only gate is ry(0.5) q[0]; (keep the header lines, drop the measurement). How many hardware instructions does it become?

ry(θ) is U(θ, 0, 0): three frame updates and two x90. Each x90 on qubit 0 brings two calibration frame updates with it, one before and one after. That makes 3 + 2 + 4 = 9 instructions, of which two play a pulse.

4A CZ is two tones and a phase correction

The two-qubit gate of this calibration is a CZ. For the pair (0, 1) the calibration states one tone at 5.3327 GHz, 400 ns long, with the cosine_square envelope, played on both qubits' drive lines at the same time: amplitude 0.394 on each, phase 0 on qubit 0 and 0.267 rad on qubit 1. The file gives the tone's parameters, not the physical mechanism of the gate, and this course does not guess it.

The lowering turns one cz instruction into two fires on the same batch: q0.cz0 on core q0 and q1.cz0 on core q1. The two cores act independently. They land on the same batch because both were given the same start time after a common barrier, and the timed queues make every parameter land exactly at its start time.

After the tones, the calibration asks for Z corrections, including on a spectator qubit that took no part in the gate. For (0, 1) they are 1.467 rad on qubit 0, 1.994 rad on qubit 1, and 0.086 rad on qubit 2. The scheduler adds them as frame instructions labeled CZ frame correction at the end of the CZ.

In the feed-forward example, cx q[0], q[1] contains one CZ. How many frame corrections does the scheduler add after it?

Three: one for each qubit of the pair and one for the spectator, qubit 2. Find them in the Hardware instructions layer of the workspace at the CZ's end time, 436 ns. A spectator correction changes qubit 2's frame, so it changes the phase of qubit 2's later pulses, here the conditioned x.

5Readout: a tone, a delay, a window

In this section: how a measurement becomes two pulses and one bit, and what the model assumes.

A transmon is read through a resonator coupled to it. A tone near the resonator's frequency is sent in. The resonator's response shifts with the qubit's state, and the returning signal is digitized and compared with a reference (Blais et al., Rev. Mod. Phys. 93, 025005 (2021), arXiv:2005.12667). Many resonators at different frequencies can share one line. That is why one DAC and one ADC serve all eight qubits here.

A measure instruction becomes three actions on the qubit's core. The ro channel fires the readout tone: 500 ns for qubit 0. After the calibrated delay, the demod channel opens the demodulation window on ADC 12: 398.57 ns after the tone for qubit 0, rounded up to 200 batches, and 656.67 ns long, rounded up to 329 batches. The demodulation carrier is four times the tone's frequency code, because the ADC takes 4 samples per batch where the DAC takes 16. The core then reads the result register, which stalls until the window has closed and the decoder has settled.

What is an input here. The bit is the sign of the real part of the integrated signal, as in RISC-Q's ReadoutDecoder. The simulator does not compute that signal. You choose the outcome, for example c=1 in the address of a run, and the model returns it with an illustrative magnitude.

In the feed-forward run, how many nanoseconds after the readout tone on q0.ro opens does the acquisition window on q0.demod open?

The calibration's 398.57 ns becomes 200 batches of 2 ns: 400 ns. The tone and the window overlap: the window opens while the tone is still playing, and stays open after it ends, for the resonator's ring-down.

6From the DAC to the chip

The pulse leaves the DAC and travels down coax into the cryostat. The model gives that path a length: 200 + 290 + 250 + 170 + 140 = 1,050 mm, the cable sections between the room-temperature flange and the chip listed in Table 1 of Krinner et al., EPJ Quantum Technology 6, 2 (2019), arXiv:1806.07862. At an assumed signal speed of 0.7 c (209.85 mm/ns) that is a delay of 5.003 ns. The value is listed in each run's machine.provenance.delay.

In the trace, a pulse window opening at the converter produces an effect frame on the qubit or resonator. Its state.arrivesPs is the time the signal reaches the chip. The live run below starts at the step where the two CZ tones reach qubit 0 and qubit 1. Step forward once and you see the second one.

The feed-forward program on the ring, at the step where the CZ tone of q0.cz0 reaches qubit 0.

Read the first effect frame on qubit0. How many nanoseconds after the window opens at the DAC does the signal arrive at the qubit?

arrivesPs − atPs is 5,003 ps: 1,050 mm at 209.85 mm/ns, rounded to a picosecond. In the built-in ring every line has this length. In part D2 every wire gets its own routed length.

7What the ring cannot do

The ring has fixed couplings. A cz or cx between qubits that are not a calibrated pair is rejected with the line that asked for it. There is no routing pass for this machine yet, so you place the circuit on the ring yourself, for example with swap through neighbours. ch and ccx are rejected too: lower them to one- and two-qubit gates first. Try both in the box above.

What happens to a program with the line cz q[5], q[6];?

  1. It runs, with the EF sandwich pulses on qubit 6.
  2. It is rejected: the pair has no CZ the lowering offers.
  3. The compiler routes it through qubit 4.
  4. It runs as two single-qubit Z rotations.
The pair (5, 6) is calibrated with second-level pulses that the lowering does not model, so it is left out of machine().pairs. The message is "no calibrated CZ between qubits 5 and 6. Route the circuit onto the ring first."

What to remember

  1. The ring is RISC-Q's own eight-qubit calibration on its x6y3 build: 2 ns batches, 8 GS/s DACs, 2 GS/s ADCs.
  2. Each qubit has one core with a gate channel, one CZ channel per partner, a readout tone and an acquisition window.
  3. Single-qubit gates are two calibrated pulses and phase bookkeeping: U is ZSXZSXZ. A Z rotation changes the phase code of later fires.
  4. A CZ is two simultaneous 400 ns tones on two cores, then frame corrections, including on spectators.
  5. A measurement is a tone, a delayed demodulation window and a bit you choose. The coax adds 5.003 ns to every arrival.