I am running distance 3 surface code with 3 rounds:
Here is the parity check matrix of X stabilizers for distance three surface code:
H_d3x = csr_matrix(np.array([
[1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1]
]))
My syndrome measurements are as follows:
Round = 0, X syndromes are: (1, 1, 1, 0, 1, 0, )
Round = 1, X syndromes are: (0, 0, 1, 0, 0, 0, )
Round = 2, X syndromes are: (1, 1, 0, 1, 1, 0, )
So the detection events at the end of the third round is: detection_events = [0,0,1,1,0,0] (because at the end of the all rounds, syndrome 1,2,5 and 6 stayed same so they did not get affected by errors so detection is 0. However, syndrome3 and 4 changed) Now in Pymatching: I can simply say:
m3x = Matching(H_d3x)
But then, for decoding errors, should I say
xdecode = list(reversed(m3x.decode(detection_events)))
?
or should I say
xdecode = list(reversed(m3x.decode(Xsyndromes)))
?
I assume that I should put detection events in decode
fucntion.
However, I see some codes in github, they used syndrome measurements directly so I wanted to double check here