From 77aa550ec52dd99b0ad3f89a55b5c9a61f863f25 Mon Sep 17 00:00:00 2001 From: oscarhiggott <29460323+oscarhiggott@users.noreply.github.com> Date: Fri, 23 Oct 2020 22:56:57 +0100 Subject: [PATCH 1/2] Update README.md --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2f5daf5c..02be14d0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # PyMatching -A library for decoding quantum error correcting codes (QECC) using the Minimum Weight Perfect Matching (MWPM) decoder. +PyMatching is a fast library for decoding quantum error correcting codes (QECC) using the Minimum Weight Perfect Matching (MWPM) decoder. PyMatching can decode codes for which each error generates a pair of syndrome defects (or only a single defect at a boundary). Codes that satisfy these properties include two-dimensional topological codes such as the [toric code](https://en.wikipedia.org/wiki/Toric_code), the [surface code](https://arxiv.org/abs/quant-ph/0110143) and [hyperbolic codes](https://arxiv.org/abs/1506.04029). PyMatching can handle boundaries, measurement errors and weighted edges in the matching graph. Since the core algorithms are written in C++, PyMatching is much faster than a pure Python NetworkX implementation. [![Build Status](https://travis-ci.org/oscarhiggott/PyMatching.svg?branch=master)](https://travis-ci.org/github/oscarhiggott/PyMatching) [![codecov](https://codecov.io/gh/oscarhiggott/PyMatching/branch/master/graph/badge.svg)](https://codecov.io/gh/oscarhiggott/PyMatching) @@ -25,7 +25,18 @@ Now to decode, simply run: ``` c = m.decode(z) ``` -which outputs a bitstring `c`, which is a numpy array of dtype int. Note that the `m` by `n` parity check matrix `H` should correspond to the Z (or X) stabilisers of a CSS QECC with `n` qubits and `m` Z (or X) stabilisers. +which outputs a bitstring `c`, which is a numpy array of ints corresponding to the minimum-weight correction. Note that the `m` by `n` parity check matrix `H` should correspond to the Z (or X) stabilisers of a CSS code with `n` qubits, `m` Z (or X) stabilisers, and with either one or two non-zero entries per column. + +To decode instead in the presence of measurement errors, each stabiliser measurement is repeated `L` times, and decoding then takes place over a 3D matching graph (see Section IV B of [this paper](https://arxiv.org/abs/quant-ph/0110143)), which can be constructed directly from the check matrix `H` using: +``` +m = Matching(H, repetitions=L) +``` +and then decoded from an `m` by `L` numpy array syndrome vector `z` using: +``` +c = m.decode(z) +``` + +The Matching object can also be constructed from a NetworkX graph instead of a check matrix, and can handle weighted edges. For full details see the documentation. ## Performance From d73eebc64d2d8f279c87c2afb8972c2e364a34c5 Mon Sep 17 00:00:00 2001 From: oscarhiggott <29460323+oscarhiggott@users.noreply.github.com> Date: Fri, 23 Oct 2020 22:58:15 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 02be14d0..f4c92c5e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ To decode instead in the presence of measurement errors, each stabiliser measure ``` m = Matching(H, repetitions=L) ``` -and then decoded from an `m` by `L` numpy array syndrome vector `z` using: +and then decoded from an `m` by `L` numpy array syndrome `z` using: ``` c = m.decode(z) ```