Skip to main content
QUICK REVIEW

[Paper Review] PyMatching: A fast implementation of the minimum-weight perfect matching decoder

Oscar Higgott|arXiv (Cornell University)|May 27, 2021
Quantum Computing Algorithms and ArchitectureComputer Science15 references3 citations
TL;DR

PyMatching is a fast, open-source Python package that implements the minimum-weight perfect matching (MWPM) decoder for quantum error-correcting codes, including a novel local matching variant that reduces computational complexity nearly quadratically while maintaining near-identical decoding performance. It enables efficient simulation and decoding of fault-tolerant quantum computing with support for weighted edges, hook errors, and measurement errors.

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. 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.

Motivation & Objective

  • To develop a high-performance, open-source decoder for quantum error-correcting codes that scales efficiently with code size.
  • To reduce the computational complexity of minimum-weight perfect matching (MWPM) decoding without sacrificing decoding fidelity.
  • To support practical fault-tolerant quantum computing simulations by enabling efficient handling of syndrome defects, weighted edges, hook errors, and measurement errors.
  • To provide a simple, extensible Python interface for decoding any quantum code with paired syndrome defects.
  • To outperform existing MWPM implementations in speed while maintaining decoding performance close to the standard MWPM algorithm.

Proposed method

  • Implements the standard minimum-weight perfect matching (MWPM) decoder for quantum error correction using efficient graph matching algorithms.
  • Introduces a local matching variant that restricts each syndrome defect to be matched only to another defect within a predefined local neighborhood.
  • Uses a graph-based representation where syndrome defects are nodes and error edges are weighted by error probability or syndrome measurement outcomes.
  • Supports weighted edges to model probabilistic error channels and includes hooks and boundaries to improve realism in error models.
  • Leverages optimized data structures and algorithms in Python to achieve high performance, avoiding reliance on slower external solvers for general matching.
  • Enables integration with quantum code simulations through a simple, user-friendly Python API for decoding syndrome outcomes.

Experimental results

Research questions

  • RQ1Can a localized variant of MWPM decoding achieve near-identical performance to the standard MWPM decoder while significantly reducing computational cost?
  • RQ2How does the performance of PyMatching compare to existing MWPM implementations such as those in NetworkX or Blossom V in terms of speed and accuracy?
  • RQ3To what extent can local matching preserve decoding fidelity across various quantum code sizes and error models?
  • RQ4How efficiently can PyMatching handle complex error features such as weighted edges, hook errors, and measurement errors in fault-tolerant simulations?
  • RQ5What is the scalability of the local matching approach relative to full MWPM as code size increases?

Key findings

  • The local matching variant achieves decoding performance nearly identical to the standard MWPM decoder in practical simulations.
  • Local matching reduces computational complexity approximately quadratically compared to full MWPM, leading to significant speedups.
  • PyMatching is several orders of magnitude faster than implementations using NetworkX or Blossom V for typical error correction simulation problem sizes.
  • The package supports advanced features including weighted edges, hook errors, boundaries, and measurement errors, enabling realistic fault-tolerant quantum computing simulations.
  • PyMatching provides a simple, extensible Python interface that allows users to decode any quantum code with paired syndrome defects efficiently.
  • The open-source nature of PyMatching and its dependencies facilitates reproducibility and integration into broader quantum simulation and error correction research pipelines.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.