I am trying to implement a single-shot error correction for the surface code with data + measurement errors (both with prob. p), using the (build-in) BP+OSD decoder. I am mostly following these papers:
- https://journals.aps.org/prxquantum/pdf/10.1103/PRXQuantum.4.020332
- https://arxiv.org/pdf/2309.11719.pdf
If I understand correctly, this is the algorithm: in order to get each point in the threshold-figure, one should average over N iterations. Each such iteration as a inner loop of n iterations as follow:
One starts with Hx (for example) of the surface code, but for each syndrome another 'fake' data qubit is added to account for measurement errors, such that: H=(Hx, I).
Now, For 1:n-1 iterations: Error = draw error in all data qubits (real and fake) with prob. p
If not first iteration: Error_eff = (Error + residual error) % 2
Calculate the syndrome and get a correction vector
residual error = (Error + correction vector) % 2
then feed this residual error to the next iteration, and so on.
If iteration n: the same thing, but now the 'fake' data qubits does not get an error.
Now, I'm puzzled: The length of the effective error + correction is the number of all data qubits (real and fake), whereas the length of logical needs to be checked is only the number of the real data qubits. So, how do you check for a logical error? Moreover, in the second paper mentioned above, they set N = 10^4, and n = 100. It thus seems, that they average only over N iterations, but nonetheless, in their figure 3 the error rate is up to 10^-6, meaning they also include the inner loop in the calculation for the error rate.
So, what is the correct algorithm to account for measurement errors in a single-shot decoder like this?
******* EDIT *******
So I talked with the author and I have an answer: First, after obtaining the residual error, the next step takes Error(t)+residual_error(t-1), without the correction of the measurement 'fake' qubits. Second, the error rate is define per logical qubits, so it is actually the average logical error/number of logical qubits.