I am trying to reproduce the dataset in this paper [arXiv:1705.00857] using Stim. The paper decomposes the errors into a "pure-error", which is any error that generates the observed syndrome, and a logical error which they train a neural-network to decode. Their dataset comprises of ancilla measurements as inputs, and 4 labels indicating the logical error that occured in the experiment as the target.
In the paper, the dataset is obtained by keeping track of all the data qubit errors in the circuit, rather then using a decoding algorithm. They then calculate the logical error based on the actual data qubit errors happening in the circuit.
I am trying to reproduce their dataset using Stim
. In order to do that, I need to be able to obtain both the $X$ and $Z$ logical observables, indicating what error has occurred. Is there an easy way to do that using Stim
(preferably using the pre-generated surface codes in the package, but not necessarily)?
I tried doing that by initializing the circuit to some state, then simulating it twice with the same random seed, once measuring the $X$ observable and once the $Z$ observable (essentially, preparing the same state and performing two measurements). The problem is,
- I understand that it is terrible practice to force the noise to be the same, and indeed it doesn't look like the errors stay exactly the same between circuits.
- Not really a problem since I can write my own circuit, but the $X$ and $Z$ generated circuits initialize a different initial state.
Is there a way to do that using a single circuit? Clearly, a circuit that measures both $X$ and $Z$ observables is non-physical, but is there a way to keep track of the logical errors without performing a measurement using Stim
?
I don't think that I necessarily want to measure the logical observables, since I just need to know how the logical state has changed, not what it is. Really what I want to do is to compare the end logical values to the initial logical values to obtain the actual logical error.