I am trying to do decoding in presence of measurement error and bit-flip error for the repetition code. In the PyMatching version 0.2.2 https://pypi.org/project/PyMatching/0.2.3/ it mentions that
To decode instead in the presence of measurement errors, each stabiliser measurement is repeated
Ltimes, and decoding then takes place over a 3D matching graph (see Section IV B of this paper), which can be constructed directly from the check matrixHusing:
m = Matching(H, repetitions=L)
and then decoded from an
mbyLnumpy array syndromezusing:
c = m.decode(z)
I tried this for an example case with H as the repetition code syndrome
import numpy as np
from pymatching import *
N = 10 # number of qubits
H = np.zeros((N-1,N),dtype = int)
for i in range(N-1):
H[i,i] = 1
H[i,i+1] = 1
and syndrome histroy
z = array([[0, 1, 1, 0, 0, 0, 0, 0, 0],
[0, 1, 1, 0, 0, 1, 0, 0, 0],
[1, 1, 1, 0, 0, 1, 1, 1, 0],
[1, 0, 0, 0, 1, 0, 1, 0, 0],
[1, 0, 0, 0, 1, 1, 0, 1, 1],
[1, 0, 0, 0, 0, 0, 1, 1, 1],
[1, 0, 0, 0, 0, 1, 1, 1, 1],
[1, 0, 0, 0, 0, 1, 1, 0, 0],
[1, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0]])
but I am not getting the correct corrections. The weird thing is, even if I take no measurement error and bit-flip error and just repeat the syndrome, I get the wrong results so I think, I am doing something incorrect. Please help me with this.