Back
Quantum Computing·Feb 1, 2026·3 min read

The Journey into Quantum Error Correction

How flag qubits could change fault-tolerant computing

Michael WangMichael Wang
The Journey into Quantum Error Correction

When I first walked into the Duke Quantum Center, I didn't know what a flag qubit was. Six months later, I'm designing multi-flag syndrome extraction circuits that could push fault-tolerant quantum computing closer to reality.

Why Error Correction Matters

Quantum computers are fragile. Every qubit is susceptible to environmental noise — thermal fluctuations, electromagnetic interference, even cosmic rays. Without error correction, quantum computations decohere faster than they can produce useful results.

Classical computers solved this decades ago with redundancy. If a bit flips, you check it against copies and correct it. But quantum mechanics complicates things: you can't copy a qubit (the no-cloning theorem), and measuring one disturbs its state.

Quantum error correction (QEC) gets around this by encoding a single logical qubit across multiple physical qubits. The trick is detecting errors without collapsing the quantum state — and that's where syndrome measurements come in.

The Two-Flag Approach

Traditional single-flag protocols have a fundamental limitation. A single flag qubit can detect that an error has spread, but it can't always distinguish between different types of multi-qubit errors. This ambiguity limits the codes you can protect.

The two-flag approach adds a second flag qubit to each syndrome extraction circuit. With two flags, you get a richer error signature — enough to uniquely identify and correct a broader class of errors. The cost is modest (one extra ancilla qubit per stabilizer), but the benefit is significant:

  • Higher code distances become fault-tolerantly accessible
  • More efficient decoding since flag patterns are more distinctive
  • Fewer rounds of syndrome extraction needed for reliable correction

Simulating at Scale with Stim

One of the most exciting developments in QEC research is Google's Stim simulator. Stim can simulate stabilizer circuits with millions of qubits at speeds that would have seemed impossible a few years ago.

For our two-flag work, Stim lets us:

  1. Define the full syndrome extraction circuit including flag qubits
  2. Inject realistic noise models (depolarizing, measurement errors, idle errors)
  3. Sample millions of error syndromes in seconds
  4. Feed the results into decoders like PyMatching to measure logical error rates

The workflow looks something like this:

import stim

circuit = stim.Circuit()
# Build syndrome extraction with two flag qubits
circuit.append("H", [flag_1, flag_2])
circuit.append("CX", [flag_1, data_0, flag_2, data_1])
# ... full stabilizer circuit
circuit.append("M", [flag_1, flag_2, syndrome])

What's Next

We're currently benchmarking the two-flag protocol against single-flag variants across several code families. Early results are promising — the logical error rates drop significantly for the same physical error rate, especially in the medium-distance regime (d = 5 to d = 9) that near-term devices will target.

The dream is a fault-tolerant quantum computer that can run algorithms long enough to solve problems classical computers can't. We're not there yet, but every improvement in error correction brings us one step closer.


This post is part of my ongoing research at the Duke Quantum Center with Balint Pato. If you're interested in QEC or quantum computing in general, feel free to reach out.

Quantum ComputingResearch