Quantum error correction

Break a qubit, watch the syndromes light up

Click a qubit to put an error on it. A Sparsr device works out which checks can see it - then find out whether the encoded qubit came through intact.

Sparsr VM starting a software model of the processor, running in this tab

This is a software model. The same kernels run unchanged through the Sparsr SDK on your own machine.

One protected qubit is spread across nine physical ones. Click any of the nine to damage it, and watch which of the eight checks notice.

The thing to try

Break one qubit. Some checks light up, and the encoded qubit comes through intact - the damage is found and undone. Try every qubit and it works each time. This code guarantees that for one error.

Now break two. Sometimes it comes through and sometimes it does not, and when it does not the page tells you the repair was the wrong one. Exactly half of the thirty-six pairs defeat it.

Then break these three: top-left, middle-left, bottom-left. Every check reports that everything is fine, and the encoded qubit is destroyed anyway.

That last case is the one worth thinking about.

Silent failure, and the code's distance

The checks do not measure the qubits. Measuring a quantum state destroys it, so that is not available. Each check measures a relationship between qubits - whether an even or an odd number of them have flipped - which reveals where damage is without revealing what the qubits hold.

The consequence is that a check pattern is a shadow of the error, not the error. Several different errors cast exactly the same shadow. So the decoder cannot look up the answer; it has to pick the most likely explanation and act on it. Usually it is right. Sometimes it is wrong, and it makes things worse.

Some errors escape the checks entirely. A chain of three flips crossing the lattice is invisible to every check and changes the answer the qubit stores. The shortest such chain is three, and that number is what people mean by the code's distance.

The check that runs on the device

Each check is a parity question over its four qubits: have an even or an odd number of them flipped?

That is one Sparsr instruction. The check picks out its qubits with an AND against a 4,096-bit register, and the machine reduces that whole register to one parity bit as part of the same operation. Eight checks, eight instructions.

The decoding is not on the device, and this page says so. Turning a check pattern into a best guess is a sixteen-entry lookup here, and it runs in your browser. Decoding is the expensive part of error correction at scale - it is where the research effort goes - and Sparsr is not what makes it cheap. What Sparsr makes cheap is the parity extraction, and that is what is running.

One click, 4,096 experiments

The kernel is built to run 4,096 independent copies of the experiment at once, one per bit of a wide register. The machine exists for exactly that: sampling millions of noise trajectories to find out how often a code fails.

You are describing one. So your error is copied into all 4,096 shots, and the instruction count on the page is the cost of answering your question 4,096 times over. It is a real number for a slightly silly use of the machine.

The code

The code here is the distance-3 rotated surface code. The data qubits form a 3×3 grid, and eight stabilizer checks over them protect one encoded qubit. It is the layout essentially every current hardware experiment uses, and with its eight measurement ancillas counted it is the one often called Surface-17.

The ancillas are not modelled here. This tracks where errors are, not the circuit that measures them. A circuit-level model would add the ancillas and their gates, along with the errors those bring. That is a much larger thing than this page.

Why there is no timing figure

Nothing about speed. The processor here is a software model running in your browser, so how long a click takes is a property of your laptop rather than of Sparsr. The instruction counts are exact. Timing is left out on purpose.

Nothing about a real quantum computer's error rates. You choose the errors here. A real device gets them from physics, at rates this page does not model.