Skip to content

Commit

Permalink
Update README and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarhiggott committed Nov 23, 2020
1 parent c92a878 commit ed421dc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ When using PyMatching for research, please cite:
```
@misc{higgott2020pymatching,
author = {Higgott, Oscar},
title = {{PyMatching}: A library for decoding quantum error correcting codes using minimum-weight perfect matching},
title = {{PyMatching}: A Python package for decoding quantum error correcting codes using minimum-weight perfect matching},
year = {2020},
publisher = {GitHub},
journal = {GitHub repository},
Expand Down
39 changes: 18 additions & 21 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,43 @@
PyMatching
==========

PyMatching is a Python library for decoding quantum codes with the
PyMatching is a Python package for decoding quantum codes with the
minimum-weight perfect matching (MWPM) decoder, and is designed to
be fast and easy to use.

While a Python library such as NetworkX can also be used to
While a Python package such as NetworkX can also be used to
implement MWPM, it is far too slow to be used for large
fault-tolerance simulations, which often require
matching graphs with many thousands of nodes. On the other hand,
the widly used C++ BlossomV library is fast, but using it to decode
the widely used C++ BlossomV library is fast, but using it to decode
quantum codes also requires path-finding algorithms, which must
also be implemented in C++ for a fast implementation. Furthermore,
attempting to solve the full matching problem even with BlossomV
can become prohibitively expensive for matching graphs with more
than a few thousand nodes, since the average complexity is
empirically roughly quadratic in the number of nodes. BlossomV
is also not open-source since it does not have a permissive license.
than a few thousand nodes, since the complexity is worse than
quadratic in the number of nodes. BlossomV is also not
open-source since it does not have a permissive license.

PyMatching is intended to provide the best of both
worlds: all the
core functionality of PyMatching is useable via the Python
bindings, making it easy to use
in conjunction with numpy, scipy and NetworkX. However the
core algorithms and data structures are implemented
in C++ for good performance (with the help of the open-source
Lemon and the Boost Graph libraries),
using a local variant of the matching decoder given in the
Appendix of https://arxiv.org/abs/2010.09626, which empirically
has an average runtime roughly linear in the number of nodes
PyMatching is typically faster than a BlossomV/C++ implementation
of the full matching problem, while being easy to use in conjunction
with numpy, scipy and NetworkX using the Python bindings.
The core algorithms and data structures are implemented in C++
for good performance (with the help of the open-source Lemon
and Boost Graph libraries), using a local variant of the matching
decoder given in the Appendix of https://arxiv.org/abs/2010.09626,
which empirically has an average runtime roughly linear in the number of nodes
and gives the same output as full matching in practice. Since
PyMatching uses the open-source Lemon C++ library for matching,
which has similar performance to BlossomV, both PyMatching and
PyMatching uses the open-source Lemon C++ library for the Blossom algorithm,
which has similar performance to Kolmogorov's BlossomV library, both PyMatching and
its dependencies have permissive licenses. PyMatching can be
applied to any quantum code for which
defects come in pairs (or in isolation at a boundary),
and does not require knowledge of the specific geometry
and it does not require knowledge of the specific geometry
used.

Compared to a pure Python NetworkX implementation of MWPM, PyMatching
can be orders of magnitude faster, as shown here for the
toric code under an independent noise model at :math:`p=0.5`:
toric code under an independent noise model at :math:`p=0.05`:

.. figure:: _static/pymatching_vs_networkx.png
:width: 300
Expand Down

0 comments on commit ed421dc

Please sign in to comment.