on each of the physical qubits of the Steane code, thus making up an i.i.d channel $\cE^{\otimes 7}_0$. The subscript 0 makes reference to the fact that these are physical noise models. In a suitable representation (see the appendix), this 7-qubit channel is a $4^7\times 4^7$ real matrix in tensor product form. The action of the noise on $\rho_{0}$ produces a 8-qubit state $\rho_{\rm noisy}$. We then apply the error-correction circuit to $\rho_{\rm noisy}$. An error correction circuit comprises of syndrome measurements corresponding to the six stabilizer generators $S_j$. We numerically compute the probability $\Pr(\pm) = \frac 12(1\pm \Tr\{S_j\rho_{\rm noisy}\})$ for each measurement outcome and choose the outcome at random following that distribution, resulting in a post-measurement state $\rho_{\rm noisy}^{s}$, which depends on the measured syndrome $s$.

Given a syndrome $s$, we choose the Pauli operator $Q$ that maximizes the fidelity $F(\rho_0,Q \rho_{\rm noisy}^s Q)$ to the initial noiseless state $\rho_{0}$. While there a priori appears to be $4^7$ Pauli matrices $Q$ to choose from, there are really only 4 distinct ones to choose from, corresponding to the 4 logical Pauli operators. The error-corrected state $Q_{\rm max} \rho_{\rm noisy}^s Q_{\rm max}$ encodes a noisy entangled state between the encoded qubit 