Lecțiile acestui traseu sunt publicate deocamdată doar în engleză, așa că lecția de mai jos apare în engleză. Restul — module, quiz și materiale — funcționează la fel.
Decoders: Matching, Union-Find, Neural Nets and the Real-Time Budget
Vei putea să:
You can explain what a decoder optimises (most likely error class given a syndrome), why the surface-code decoding problem reduces to matching on a graph, how MWPM, union-find and neural decoders trade accuracy for speed, and why a decoder that falls behind the syndrome stream is a correctness bug, not just a slowdown.
From syndrome to correction
A decoder is the classical program that watches the syndrome stream and decides which correction to apply. It is the piece of a fault-tolerant machine that most resembles ordinary software engineering, and it is also the piece whose failure modes are easiest to underestimate.
What the decoder is actually optimising
The syndrome does not determine the error. Many different physical error patterns produce the same lit checks; in the surface code, every pattern that differs from another by a stabilizer gives the same syndrome and the same effect. The decoder's real task is to pick the most probable equivalence class of errors and apply any representative of it. If the true error and the chosen correction together form a stabilizer, the data is restored. If together they form a logical operator, the decoder has caused a logical error.
Why the surface code reduces to matching
In the surface code every single X or Z error lights at most two checks. Build a graph whose nodes are the checks (plus a special boundary node) and whose edges are the possible single errors, each edge joining the checks it would flip. A syndrome is a set of lit nodes; a candidate error is a set of edges; and the error is consistent with the syndrome exactly when each lit node is touched by an odd number of edges and each unlit node by an even number. The lowest-probability-cost explanation is the minimum-weight perfect matching (MWPM) of the lit nodes, with edge weights log((1 − p)/p) so that rare errors cost more. That matching can be found exactly in polynomial time with Edmonds' blossom algorithm, which is the engine inside PyMatching.
Y errors flip both an X-check pair and a Z-check pair, so they are not single edges. In practice the detector error model is "decomposed" so a Y error becomes an X edge plus a Z edge, and the two graphs are decoded separately. That is what the decompose_errors flag in Stim is for, and it is a (small) approximation.
Worked example: a 5-qubit repetition code under matching
Five data qubits q0…q4, four checks c0 = Z0Z1, c1 = Z1Z2, c2 = Z2Z3, c3 = Z3Z4. The matching graph is a line: boundary – c0 – c1 – c2 – c3 – boundary, with each edge being one data qubit.
- Error on q1 alone: lights c0 and c1. The decoder matches c0 to c1 along the edge q1. Correct.
- Errors on q1 and q2: lights c0 and c2 (c1 sees both and cancels). Cheapest pairing is c0–c2 via q1, q2 (weight 2); the alternative c0–boundary via q0 and c2–boundary via q3, q4 costs 3. Correct.
- Errors on q1 and q4: lights c0, c1, c3. Matching c0–c1 (q1) and c3–boundary (q4), total weight 2. Correct.
- Errors on q0, q1, q2: lights only c2. The decoder matches c2 to the nearest boundary through q3, q4 (weight 2) rather than through q0, q1, q2 (weight 3). The correction plus the real error flips all five qubits — a logical X. The decoder did exactly the right thing given its information; three errors simply exceed what a distance-5 code promises to fix. You will reproduce these four cases in the mission.
The three families you will meet
Minimum-weight perfect matching. The accuracy benchmark for surface-code decoding. Historically slow, but PyMatching 2's "sparse blossom" implementation (Higgott and Gidney) decodes on the order of a million detection events per second on one core at typical error rates, which was a step change for simulation and a serious option for real-time use.
Union-find (Delfosse and Nickerson). Grow clusters around lit checks, merge clusters that touch, and once every cluster has even parity, peel a spanning forest to read off a correction. Almost linear time, simple enough for hardware (FPGA/ASIC), and with only a modest loss in threshold compared with MWPM. This is the decoder most groups reach for when latency is the constraint.
Neural decoders. Google DeepMind's AlphaQubit (Bausch et al.) trains a recurrent transformer on simulated data and then fine-tunes on real device syndromes. Because it can consume analogue readout information, leakage flags and learned cross-talk patterns that a matching graph cannot represent, it outperformed MWPM in accuracy on Sycamore data. The costs: throughput that was not yet real-time at scale, a training pipeline per device, and no guarantee of behaviour on error patterns absent from training.
The real-time budget
Superconducting processors produce one syndrome round every microsecond or so. A decoder that is slower than that is not merely late — it is wrong. Terhal's backlog argument is the thing to remember: logical non-Clifford gates (module 6) require the decoder's output before the next operation can be chosen, so if decoding throughput is below the syndrome rate, the queue of undecoded rounds grows with the depth of the computation and the effective error rate climbs with it. Google's 2024 paper reports a real-time decoder keeping pace at distance 5 with a latency of tens of microseconds; whether the same can be done at distance 25, with the far larger syndrome volume that implies, is one of the open engineering problems in the field. Trapped-ion and neutral-atom machines run far slower, which relaxes the decoder budget — a real trade-off between platforms.
What to remember
- A decoder picks the most probable error class consistent with the syndrome; it never needs the exact error.
- Surface-code errors light at most two checks, so decoding is minimum-weight matching on a graph with boundary nodes.
- A logical failure is usually the decoder being correct about an ambiguous syndrome, not a bug.
- MWPM is the accuracy reference; union-find trades a little accuracy for near-linear speed and hardware-friendliness; neural decoders win on accuracy by using richer inputs but cost throughput and trust.
- Decoding slower than the syndrome rate is a correctness failure because of the backlog problem.
Materiale selectate
1.8hMunca de profunzime se întâmplă aici — lecția este briefingul tău.
- PyMatching: A Python package for decoding quantum codes with minimum-weight perfect matching (Oscar Higgott)Lucrare· 30 min
- Almost-linear time decoding algorithm for topological codes — the union-find decoder (Delfosse, Nickerson)Lucrare· 40 min
- Learning to Decode the Surface Code with a Recurrent, Transformer-Based Neural Network (Bausch et al., Google DeepMind)Lucrare· 40 min
În direct pe aiqbench
Subiectul acestei lecții în restul site-ului, astăzi.
În știri, ultimele 30 de zile
- GPU decoder keeps pace with a superconducting qubit clock on a continuous stream, with NVIDIA NVQLink interconnectAlice & Bob ·
- Classiq and Diraq Partner on Fault-Tolerant Silicon Quantum ComputingThe Quantum Insider ·
- Classiq and Diraq Collaborate to Advance Fault-Tolerant Quantum Computing on SiliconHPCwire ·
Testează-ți cunoștințele
5 întrebări în 100 de secunde, pe o pagină separată. Citește mai întâi tot ce este mai sus.
Testează-ți cunoștințele →Misiunea modulului
30–40 minpip install pymatching. Build the parity-check matrix of a 5-qubit repetition code (4 checks × 5 bits) and load it with pymatching.Matching(H). Feed it the syndromes for a single error on each qubit, then for errors on qubits 1 and 2, then on qubits 1 and 4, and finally on qubits 0, 1 and 2. Record which correction the decoder returns each time and explain, in two sentences each, why the multi-error cases succeed or fail (the last one should produce a logical error — say why that is the decoder doing its job, not a bug). Finish by sketching, by hand, the matching graph the decoder was walking.
Se încarcă lucrarea ta…