1

I'm considering the repetition code in presence of measurement and qubit error as discussed in SEC IV B of this paper. I am trying to use pymatching for the syndrome decoding using mwvp in presence of qubit error, so it should work but it doesn't. First, I defined the basis setup

import numpy as np
from pymatching import Matching
N = 10 # num of qubits
H = np.zeros((N-1,N), dtype = int) # check-matrix

for i in range(N-1): H[i,i] = 1 H[i,(i+1)] = 1

Consider the following syndrome measurement :

L = 10
z = np.array([[0, 0, 0, 0, 1, 1, 1, 1, 1, 1],
              [0, 0, 1, 1, 0, 0, 0, 0, 0, 0],
              [0, 0, 1, 1, 1, 1, 1, 1, 1, 1],
              [1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
              [1, 1, 1, 0, 0, 0, 0, 0, 0, 1],
              [0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
              [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
              [1, 1, 1, 1, 1, 1, 1, 0, 0, 0],
              [1, 1, 1, 1, 1, 1, 1, 0, 0, 0]])

Here z[:,i] represents the syndrome measurements at time $t = i$. The decoding can be done as follow:

m = Matching(H, repetitions=L)
c = m.decode(z)
np.array([0, 0, 0, 0, 1, 1, 0, 0, 1, 0], dtype=uint8)

but the corrections are incorrect. On the other hand, if I just take the final syndrome at $t = L$ then

m = Matching(H)
z = z[:,-1]
c = m.decode(z)
np.array([0, 1, 1, 0, 0, 1, 0, 0, 0, 0], dtype=uint8)

which in fact the correct correction operators. I want to know why does the repetition approach gives the wrong result, and way to improve upon that. Thanks

AG47
  • 1,575
  • 3
  • 16
Himanshu
  • 215
  • 1
  • 10

1 Answers1

1

As far as I can tell, there is nothing wrong in either case. You do not state what you expect the correction to be in the first case. If you expect the correction to be $0$ everywhere, it means that you read the syndrome row by row instead of column by column:

Syndrome matching

Vertices are stabilizer measurements, red vertices correspond to the syndrome, lines are potential qubit errors. The matching is in red, with $25$ deduced qubit errors, most of which cancel each other since Pauli errors are Hermitian operators.

The column on the left indicates the sum modulo 2 of the qubit errors.

The deduced correction is exactly array([0, 0, 0, 0, 1, 1, 0, 0, 1, 0], dtype=uint8).

AG47
  • 1,575
  • 3
  • 16