PyMatching: A Python package for decoding quantum codes with minimum-weight perfect matching

Oscar Higgott
5/27/2021
quant-ph

Official code: oscarhiggott/PyMatching (378 stars, C++, Apache-2.0, last commit 2026-01-22).

Abstract

This paper introduces PyMatching, a fast open-source Python package for decoding quantum error-correcting codes with the minimum-weight perfect matching (MWPM) algorithm. PyMatching includes the standard MWPM decoder as well as a variant, which we call local matching, that restricts each syndrome defect to be matched to another defect within a local neighbourhood.

Show full abstract

The decoding performance of local matching is almost identical to that of the standard MWPM decoder in practice, while reducing the computational complexity approximately quadratically. We benchmark the performance of PyMatching, showing that local matching is several orders of magnitude faster than implementations of the full MWPM algorithm using NetworkX or Blossom V for problem sizes typically considered in error correction simulations. PyMatching and its dependencies are open-source, and it can be used to decode any quantum code for which syndrome defects come in pairs using a simple Python interface. PyMatching supports the use of weighted edges, hook errors, boundaries and measurement errors, enabling fast decoding and simulation of fault-tolerant quantum computing.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

PyMatching: A Python/C++ library for decoding quantum error correcting codes with minimum-weight perfect matching.

37880C++, PythonNov 8, 201910 months agoApache-2.0
minimum-weight-perfect-matchingquantum-error-correctionsurface-code

Similar Papers

Cite this paper

@article{higgott2021pymatching,
  title  = {PyMatching: A Python package for decoding quantum codes with minimum-weight perfect matching},
  author = {Oscar Higgott},
  year   = {2021},
  eprint = {2105.13082},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2105.13082}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2105.13082.svg)](https://codeofpaper.com/paper/2105.13082)

Discussion