Part D · Lesson 4

When a design breaks a rule

A design is only useful if the simulator can tell you when it describes a machine that cannot work. This lesson goes through every rule the checker applies, the message each one gives, and the one warning: a readout that returns after its acquisition window has opened.

This lesson assumes lessons D1 to D3. All verdicts on this page come from check() in riscq/design.mjs, through POST /api/riscq/design/check.

1Errors and warnings

check(design) returns { errors, warnings }. An error means the document does not describe a machine the simulator can build: machine() refuses it with "The hardware design breaks n rules" followed by the list, and no program runs. The editor marks the parts concerned in red and disables Run on this hardware. A warning describes a consequence you should see, but the machine is built and runs.

The check works in two phases. First it checks every part, channel and wire on its own. Only if that phase finds nothing does it look for paths: whether each calibrated pulse can actually reach the part it acts on. A design with a broken wire therefore does not also get a list of every path that wire would have completed.

2Rules on parts, channels and wires

In this section: the first phase, with the exact message of each rule.

RuleMessage (X, Y stand for ids)
The document's kind and versionA hardware design is { kind: "riscq-design", version: 1, … }.
Part ids are uniquePart id X is used twice.
Part types come from the listPart X has the unknown type T. Allowed: control-board, core, dac, adc, stage, qubit, resonator.
Every part has a positionPart X needs centerMm: [x, y, z].
One boardA design has exactly one control-board.
1 to 64 coresA board carries 1 to 64 cores.
Converter numbersEvery dac has its own index from 0 to 63. (The same for adc.)
Channel ids are uniqueChannel id X is used twice.
A channel belongs to a coreChannel X names Y, which is not a core.
Channel kindsChannel X has the unknown kind K.
Pulse channels use a DAC, demod channels an ADCChannel X of kind pulse needs a dac as its converter.
1 to 16 channels per coreCore X has N channels. A core has 1 to 16.
Channel names unique on a coreCore X has two channels of one name.
Wires join partsWire X joins A and B, and one of them is not a part.
Wire media come from the listWire X has the unknown medium M. Allowed: coax, planar, fiber, beam.
A route has pointsWire X needs routeMm with at least two points [x, y, z].
A route ends at its partsWire X must start at A and end at B: its route ends are more than 0.5 mm from them.

The last rule is why a route is not decoration: the length that sets the delay is the length of a path that really joins the two parts, within 0.5 mm at each end.

Break the ring

Tick one or more edits, then press Check. Each edit is applied to a fresh copy of the ring from GET /api/riscq/design?template=ring, and the copy is sent to the check route.

You shift the first point of drive0's route by 5 mm along x and leave everything else. What does the check say?

  1. Wire drive0 must start at dac0 and end at qubit0: its route ends are more than 0.5 mm from them.
  2. Nothing: only the length changed, so only the delay changes.
  3. Qubit 0: no wire leads from dac0 to qubit0.
  4. Wire drive0 has the unknown medium coax.
The route no longer starts at its part. To make a wire longer, change its path, not its ends: add a bend, as the editor does when you double-click a wire.

How many dio channels can you add to core q0 of the ring before the check reports an error?

q0 already has five channels, and a core takes at most 16: eleven more fit. The twelfth gives "Core q0 has 17 channels. A core has 1 to 16." A dio channel needs no converter, so nothing else is checked about it.

3Rules on paths

The second phase follows the wires (pathDelay, in their direction only, through stages). For each qubit it requires:

For each coupling, every pulse must name a pulse channel and a qubit, and its DAC must reach that qubit ("Coupling pulse on q0.cz0: no wire leads to qubit0."). A decoder, if given, must be a core ("The decoder is one of the cores.").

Delete the wire drive0 from the ring. How many errors does the check report?

Three. Qubit 0's gate DAC no longer reaches it, and neither do its two CZ channels, which drive the same DAC for the couplings (0, 1) and (7, 0). One missing cable breaks every pulse that used it.

You give drive0 the medium string and also delete the wire tone0. Which errors does the check report?

  1. Both: the unknown medium, and that no wire leads from dac8 to resonator0.
  2. Only the unknown medium.
  3. Only the missing path.
  4. None, since every remaining wire is valid.
The unknown medium is a first-phase error, so the path phase does not run. Fix it, check again, and the missing tone0 appears. The editor's Rules tab works the same way, one phase at a time.
One rule outside check(). A channel has one carrier. If two calibrated pulses with different frequencies name the same channel, for example a coupling pulse moved onto q0.gate, the check finds nothing, but building the machine fails with "Channel q0.gate is given two carrier frequencies. A channel has one carrier." The check route then answers with that message and HTTP status 400 instead of a verdict. Try it with the last edit in the widget above.

4The late-readout warning

What if the readout tone comes back after the window has opened?

A readout fires its tone, then opens the acquisition window demodDelayNs later. That delay comes from the calibration, and it assumes cables of a certain length. In a design the tone needs the delay of its wire to reach the resonator, and the response needs the delay of the return wire to reach the ADC. The check compares the two:

warning when demodDelayNs × 1000 < delay(tone wire path) + delay(return wire path) (in ps)

The message says how much of the window holds no signal, for example: "Qubit 3: the acquisition window opens 335.23 ns after the readout tone starts, but the tone needs … ns to reach the resonator and return. The first … ns of the window hold no signal."

A warning, not a model of the signal. The model does not shift the window and does not compute the returning signal: the acquisition binding has no delay, and the result is still the outcome you chose. The warning tells you that on real hardware this design would integrate noise at the start of its window.

Each qubit has its own calibrated delay, from 335.23 ns to 750 ns, and in the ring its tone and return wires together take about 10 ns. Moving the chip farther along x lengthens both wires by the same amount.

As you move the chip farther along x, which qubit's readout is warned about first? Give its index.

The qubit with the least slack between its calibrated delay and its tone-plus-return delay. Qubit 3 has the shortest calibrated delay, 335.23 ns, and about 325.2 ns of slack in the ring. The order of the warnings in the message list is the order of the qubits, not the order in which they appear.

How far, in metres, can you move the chip along x before the first warning appears? Compute it from the wire delays the check reports, then confirm it with the widget above.

Qubit 3's slack is 335,230 − (4,949 + 5,089) = 325,192 ps. Each mm of x adds 1 mm to the tone wire and 1 mm to the return wire, 10 ps in all at 200 mm/ns. So the warning appears after about 32,519 mm: 32.52 m. Rounding each wire to a picosecond moves the exact threshold by a fraction of a millimetre.

What to remember

  1. Errors stop a design from running; warnings describe consequences. Both come from check().
  2. The check first validates parts, channels and wires, then, only if they are sound, every path a pulse needs.
  3. A route must start and end within 0.5 mm of its parts; a core takes 1 to 16 channels; a pulse channel needs a DAC.
  4. One missing wire breaks every pulse that used it, including coupling pulses.
  5. A readout whose tone and return take longer than its calibrated delay is warned about. The model does not shift the window.