Table of Contents
Fetching ...

Sparse Blossom: correcting a million errors per core second with minimum-weight matching

Oscar Higgott, Craig Gidney

TL;DR

Sparse blossom presents a fast, exact MWEM decoder by directly solving the embedded matching problem on detector graphs, avoiding costly all-to-all Dijkstra searches. The approach relies on graph fill regions, compressed edges, region edges, and a timeline-driven architecture (matcher, flooder, tracker) to grow, collide, and shrink regions, forming matches and blossoms. It achieves real-time decoding performance on surface-code circuits (0.1% noise, distance-17) and scales to larger codes, with the open-source PyMatching v2 implementation supporting both $X$ and $Z$ bases and enabling parallelization. The work also introduces compression-inspired tracking and outlines worst-case bounds and negative-weight handling, offering practical pathways to real-time quantum error correction at scale.

Abstract

In this work, we introduce a fast implementation of the minimum-weight perfect matching (MWPM) decoder, the most widely used decoder for several important families of quantum error correcting codes, including surface codes. Our algorithm, which we call sparse blossom, is a variant of the blossom algorithm which directly solves the decoding problem relevant to quantum error correction. Sparse blossom avoids the need for all-to-all Dijkstra searches, common amongst MWPM decoder implementations. For 0.1% circuit-level depolarising noise, sparse blossom processes syndrome data in both $X$ and $Z$ bases of distance-17 surface code circuits in less than one microsecond per round of syndrome extraction on a single core, which matches the rate at which syndrome data is generated by superconducting quantum computers. Our implementation is open-source, and has been released in version 2 of the PyMatching library.

Sparse Blossom: correcting a million errors per core second with minimum-weight matching

TL;DR

Sparse blossom presents a fast, exact MWEM decoder by directly solving the embedded matching problem on detector graphs, avoiding costly all-to-all Dijkstra searches. The approach relies on graph fill regions, compressed edges, region edges, and a timeline-driven architecture (matcher, flooder, tracker) to grow, collide, and shrink regions, forming matches and blossoms. It achieves real-time decoding performance on surface-code circuits (0.1% noise, distance-17) and scales to larger codes, with the open-source PyMatching v2 implementation supporting both and bases and enabling parallelization. The work also introduces compression-inspired tracking and outlines worst-case bounds and negative-weight handling, offering practical pathways to real-time quantum error correction at scale.

Abstract

In this work, we introduce a fast implementation of the minimum-weight perfect matching (MWPM) decoder, the most widely used decoder for several important families of quantum error correcting codes, including surface codes. Our algorithm, which we call sparse blossom, is a variant of the blossom algorithm which directly solves the decoding problem relevant to quantum error correction. Sparse blossom avoids the need for all-to-all Dijkstra searches, common amongst MWPM decoder implementations. For 0.1% circuit-level depolarising noise, sparse blossom processes syndrome data in both and bases of distance-17 surface code circuits in less than one microsecond per round of syndrome extraction on a single core, which matches the rate at which syndrome data is generated by superconducting quantum computers. Our implementation is open-source, and has been released in version 2 of the PyMatching library.
Paper Structure (37 sections, 16 equations, 16 figures, 1 table, 1 algorithm)

This paper contains 37 sections, 16 equations, 16 figures, 1 table, 1 algorithm.

Figures (16)

  • Figure 1: Key differences between the quantum decoding problem solved by PyMatching and the minimum weight perfect matching problem. In the usual MWPM problem, all nodes must be matched and they are matched using a disjoint set of edges. In the decoding problem, (a) only a subset of nodes is excited, only these nodes need to be matched, and (b) the edge set used to match them is not required to be disjoint. The excited nodes are matched by finding an edge set where excited nodes have an odd number of neighbors in the edge set, non-excited nodes have an even number of neighbors in the edge set, and (c) there may be boundary nodes that can have any number of neighbors in the edge set. (d) The expected distribution of excited nodes is not uniform. It is generated by sampling edges, where each edge is independently included with some probability, and then exciting any nodes that have an odd number of neighbors in the sampled edge set. This results in it being exponentially unlikely to see large distances between excited nodes at low error rates, which has major implications on the expected runtime of the algorithm (see \ref{['sec:expected_running_time']}).
  • Figure 2: (a) Augmenting an augmenting path. Matched edges become unmatched, and unmatched edges become matched. (b) Examples of two alternating trees in the blossom algorithm for finding a maximum matching. Each tree has one unmatched node. The two trees have become connected via the red dashed edge. The path between the roots of the two trees, through the green edges and red edge, is an augmenting path. (c) An example of two alternating trees in the blossom algorithm for finding a minimum-weight perfect matching. Each node $v$ now has a dual variable $y_v$ which, when $y_v$ is positive, we can interpret as the radius of a region centred on the node. A new edge $(u, v)$ with weight $w_{u, v}$ can only be explored by the alternating tree if it is tight, meaning that the dual variables $y_u$ and $y_v$ satisfy $y_u+y_v=w_{u, v}$.
  • Figure 3: Key concepts in sparse blossom
  • Figure 4: The main events that change the structure of alternating trees. For clarity, the background detector graph has been omitted. Each node corresponds to a detection event, and each edge corresponds to a compressed edge. Some labels (e.g. of regions) have been included in the diagrams and correspond to those referred to in the main text in \ref{['sec:alt_tree_events']}.
  • Figure 5: Shattering a matched blossom. Solid lines within a blossom are edges in the topmost blossom cycle. Dashed lines are edges in the blossom cycle of the blossom-child of the topmost blossom.
  • ...and 11 more figures