• Error Correction
  • Also: MWPM
  • Also: blossom decoder

Minimum Weight Perfect Matching

A graph algorithm used as the standard decoder for surface codes, pairing error syndrome defects in a way that minimizes the total estimated error weight.

Minimum weight perfect matching (MWPM) is a classical graph algorithm that serves as the standard decoding strategy for the surface code. When syndrome measurements reveal errors, they produce defects (syndrome bits that flip from their expected value). The decoder’s job is to pair these defects and determine the most likely error that caused them. MWPM finds the pairing of defects that minimizes the total weight (estimated error probability), then applies the corresponding correction.

How it works

In the surface code, errors on data qubits cause pairs of adjacent syndrome defects. A single XX error on a data qubit flips the two neighboring ZZ-stabilizers; a single ZZ error flips the two neighboring XX-stabilizers. The decoder sees only the defect locations, not the errors themselves.

The decoding problem is formulated as a graph matching problem:

  1. Build a graph: Create a complete graph where each node is a syndrome defect. The weight of each edge is the minimum number of physical errors needed to connect the two defects (or equivalently, the negative log-probability of the error chain connecting them).

  2. Add boundary nodes: Defects can also be paired with the code boundary (representing error chains that reach the edge of the lattice). Virtual boundary nodes are added to the graph for this purpose.

  3. Find the minimum weight perfect matching: Use Edmonds’ blossom algorithm to find a set of edges that pairs every node exactly once while minimizing total weight. This gives the most likely pairing of defects.

  4. Infer corrections: For each matched pair, determine the shortest error chain connecting them and apply the corresponding correction.

Complexity and performance

Edmonds’ blossom algorithm runs in O(n3)O(n^3) time for nn nodes. For a distance-dd surface code with d2d^2 physical qubits, the number of defects per round is typically O(d2p)O(d^2 p) where pp is the physical error rate. In practice, MWPM decoders have been optimized to run in nearly linear time for sparse defect patterns using techniques like the Union-Find decoder (a faster approximation) or sparse blossom implementations.

The key performance requirement is that the decoder must run faster than the surface code’s syndrome measurement cycle (typically 1 microsecond for superconducting qubits). This real-time decoding constraint is one of the major engineering challenges for fault-tolerant quantum computing. Dedicated hardware implementations (FPGAs, ASICs) are being developed to meet this requirement.

MWPM achieves near-optimal decoding performance for independent noise models, reaching close to the surface code’s theoretical threshold of approximately 10.3%10.3\% for phenomenological noise. For more realistic circuit-level noise, MWPM with appropriate edge weights achieves thresholds around 0.5%0.5\% to 1%1\%.

Limitations

MWPM has known limitations:

  • It assumes errors are independent, which is not exactly true on real hardware where correlated errors (crosstalk) occur
  • It does not handle YY errors optimally (a YY error produces defects in both the XX and ZZ syndrome graphs, but standard MWPM decodes them independently)
  • More sophisticated decoders like neural network decoders or tensor network decoders can outperform MWPM, especially for correlated noise

Despite these limitations, MWPM remains the benchmark decoder due to its simplicity, well-understood performance, and availability of efficient implementations.

Why it matters for learners

MWPM illustrates a critical point about quantum error correction: the quantum part (syndrome extraction) and the classical part (decoding) must work together in real time. The decoder is not an afterthought; its speed and accuracy directly determine the logical error rate. Understanding MWPM also provides intuition for why the surface code works: errors create local defect pairs, and as long as the decoder correctly matches most pairs, the logical information is preserved.

See also