Following Decoding Small Surface Codes with Feedforward Neural Networks, I am trying to train a similar neural network decoder with stim.
Decoding is reduced to a classification problem, by decomposing the error $E$ into $$E = SCL$$
where $S$ is a stabilizer, $C$ pure Error, and $L$ logical operator. A pure error decoder is used to find a plausible pure error $C$, and the network should predict the remaining logical operator $L$.
With stim, it is straightforward to sample syndrome measurements and logical observable from the circuit.
It seems that to find the correct logical operator (serving as the training label) given the predicted pure error $C$, syndromes, and logical observable measured at the end of the circuit, I need to access the data qubits, which is not possible based on this answer.
I wanted to double-check if the stim::FrameSimulator suggested in the answer above, is the way to go, or if I misunderstood the training procedure?
What happens if the correction $C$ on the data qubits by the pure error decoder (PED) flips the logical observable? If I understand correctly I don't have access to the underlying data qubits and will therefore not know which logical operator $L$ to apply if the logical qubit gets accidentally flipped by the PED.
– jerol Jul 18 '22 at 19:08stim.Circuit.compile_m2d_converterto convert the measurements to detections/observables. But this extra work won't be achieving anything that makes your decoder better, it's just taking the long way instead of the shortcut. – Craig Gidney Jul 18 '22 at 19:22