Part D · Lesson 1
A machine is a document
Until now each machine was written in code. A hardware design states the same machine as data: a board, cores, converters, qubits and resonators at positions in millimetres, the channels of each core, routed wires, and the calibrated pulses. The simulator derives the build, the pulse tables and every wire delay from that document.
This part needs lesson C1: the design here is the transmon ring written as a document. You will read the design through the same server routes the editor uses. Every number below comes from them.
1Why a document
In lesson C1 the ring came from machine() in riscq/platforms/superconducting.mjs: the
calibration file, RISC-Q's build file and a few lines of code that decide which core drives what, and that every
line has the same 1,050 mm of coax. To change any of that you had to change code. riscq/design.mjs
moves those decisions into a document of kind riscq-design. Its function ringDesign()
writes the same ring as such a document, and a test (tests/riscq-design.test.mjs) checks that the
designed ring plays exactly the pulses of the built-in one: same windows, same channels, same codes.
Three ways to get the document:
GET /api/riscq/design?template=ringreturns{ design, qasm }: the ring and the Bell program with feed-forward of lesson A1.template=ring-decoderadds a decoder core.node riscq/cli.mjs --ring-design > machine.jsonwrites it to a file, andnode riscq/cli.mjs --design machine.json --qasm circuit.qasmruns a program on it.- The hardware design editor starts from it and lets you edit it with the mouse.
2Board and parts
In this section: the seven part types and where the ring puts them.
board holds the numbers of the RISC-Q build: the control clock dspHz (500 MHz),
linkStages (the posted link depth, 2), memWords
per core (8,192), queueDepth (32) and envDepth (4,096). parts lists every
physical part with an id, a type and centerMm: [x, y, z]. The server lists
the allowed types at GET /api/riscq/design/rules:
| Type | What it is (from the rules route) | In the ring |
|---|
In the ring, the board stands at the origin with the eight cores in a column beside it, and the converters 60 mm
further along x. The chip is 700 mm along x and 350 mm below, at [700, 0, −350]: the qubits sit on a
circle of 3 mm radius, each resonator 4.5 mm out on the same spoke.
Load the ring with the reader below. How many parts of type dac does it contain?
dac_map) and DAC 8, the
shared readout line. There is a single ADC, number 12. A DAC is a part once, however many channels use it.3Channels belong to cores
channels lists every channel with an id, the
core it belongs to, a name unique on that core, a kind (pulse,
demod or dio), the converter part it uses, its number of pulse-table
slots and its interpolation. This is where you say who drives what. In the ring, core q0
owns q0.gate, q0.cz0, q0.cz1, q0.ro and q0.demod:
exactly the channels of lesson C1.
Several channels may name one DAC; their outputs are summed. That is how the eight readout tones share one line.
A dio channel needs no converter. RISC-Q requires every core to have at least one channel, and allows
at most 16.
How many channels of the ring name dac8 as their converter?
ro channel of every core. Their tones are at different frequencies, one per
resonator, and are summed on the shared readout line.Core q6 has only three channels, gate, ro and demod. Why?
- Qubit 6 is a spare qubit that is never driven.
- Both of qubit 6's couplings need second-level (EF) pulses that the lowering does not model, so the design has no coupling and no CZ channel for it.
- A core may have at most three channels.
- Qubit 6 shares core q5's CZ channels.
ringDesign() keeps only the pairs without an EF sandwich, as the built-in ring does.
One CZ channel is created per coupling a qubit takes part in: two for q0 to q4, one for q5 and q7, none for q6.4Wires have routes
wires joins parts. Each wire has from and to part ids, a medium
(coax, planar, fiber or beam) and a routeMm: the
centreline the wire follows, as a list of points that starts at from and ends at to. A
signal travels along wires in their direction only. The ring has three coax lines per qubit: drive
from its DAC to the qubit, tone from DAC 8 to the resonator, and return from the resonator
back to ADC 12. Lesson D2 turns these routes into delays.
5Qubits, couplings and calibrations
qubits is the list the program addresses: q[i] in OpenQASM is entry i. Each entry
names its qubit part and resonator part, its three channels (gate, ro, demod),
its frequency, its two calibrated pulses x90 and x (amplitude, phase, duration in ns,
envelope, and the calibration's virtual Z before and after), and its readout (tone frequency, amplitude
and duration, the delay and length of the acquisition window, the demodulation phase). Here is qubit 0 as the
document states it:
{ "part": "qubit0", "resonator": "resonator0", "gate": "q0.gate", "ro": "q0.ro", "demod": "q0.demod",
"freqHz": 5498857081.66909,
"x90": { "amp": 0.10560383, "phaseRad": 0, "durNs": 35, "envelope": "FAST_DRAG", "virtualZ": [0.0055315388, 0.0055315388] },
"x": { "amp": 0.10674013, "phaseRad": 0, "durNs": 70, "envelope": "FAST_DRAG", "virtualZ": [] },
"readout": { "freqHz": 6555406453.21587, "amp": 0.014866665, "durNs": 500, "envelope": "cosine_square",
"demodDelayNs": 398.57, "demodNs": 656.67, "demodPhaseRad": -54.25607 } }
couplings lists the two-qubit gates: the pair, the tone frequency and duration, one pulse per qubit
with the channel that plays it, and the virtual Z corrections that follow. A two-qubit gate in a program needs a
coupling between its qubits.
From all of this, machine() in design.mjs derives what lesson C1 took from code: one
RISC-Q core per core part with its channels in document order, one pulse-table entry per calibrated
pulse (entries of one channel share its carrier), and for each pulse a binding to the part it ends at, with the
delay of the fastest wired path to it.
Send the ring to POST /api/riscq/design/check (the Check button below does that). The answer
lists every calibrated pulse under pulses. How many are there?
x90, x, the readout tone and the acquisition window) and
two per coupling: 8 × 4 + 6 × 2 = 44. Each carries the part it ends at and its wire delay in ps.6Read it yourself
Design reader
The ring from GET /api/riscq/design?template=ring, summarized. Open the document below, edit any
field, and press Check to send it to POST /api/riscq/design/check. The answer lists rule
errors and warnings, the build the simulator would make, and every wire's length and delay.
The document (JSON)
How many wires does the ring have?
Load the ring-decoder template. It has one more core than the ring. What is that core's id?
decoder has a single dio channel, status, because
RISC-Q requires a channel on every core, and the design names it in its top-level decoder field. It
plays no pulse; it decodes syndromes and keeps the Pauli frame (lesson E2).7The editor and the debugger
The hardware design editor works on the same document. Its Start from menu offers
three transmons of the ring, the whole ring, or the ring with a decoder core. The left rail holds the
Components palette (click a type, then click the canvas), + Qubit with readout, which adds a qubit with
its resonator, core, channels, converters and three coax lines, and the Wire tool with its medium. The canvas
shows the parts in plan, side, front or 3D; dragging a part moves it and its wires follow. The dock below has the
tabs Rules, Signal timing, Program and Document; the inspector on the right edits the
selection's fields. The editor computes no rule and no delay itself: it asks the same /check route as the
reader above after every edit.
Run on this hardware ▶ hands the document and the program to the workspace, which runs them with the same
run as the command line. The example superconducting-design is the ring as a design with the
Bell program. Its chip view draws the qubits and resonators at the document's positions.
x90 reaches qubit 0.What to remember
- A
riscq-designdocument holds a board, parts with positions in mm, channels per core, routed wires, qubits and couplings. - Channels decide who drives what. Several channels may share a converter; a core has 1 to 16 channels.
- The build, the pulse tables and the bindings with their delays are derived from the document by
machine(). - The ring as a design plays exactly the pulses of the built-in ring; its positions are a chosen layout, not a measurement.
- The template, rules and check routes of
/api/riscq/designserve the editor, the course and scripts alike.