Fig. 1: Decoding logical circuits.

a, Decoding can be framed as a binary classification task. On a physical level, the device noise \({\mathcal{N}}\) causes physical errors, and we detect them by measuring stabilizers, which give rise to error syndromes. Each error syndrome (blue squares for violated Z stabilizers) can result from two classes of X errors: class ‘0’ errors preserve the logical Z, while class ‘1’ errors flip it. Conventional algorithmic decoders infer physical errors from syndromes using the error probability \({p}_{\tilde{{\mathcal{N}}}}\) under a prior noise model \(\tilde{{\mathcal{N}}}\). By contrast, a pretrained ML decoder directly classifies the syndrome as logical 0 or 1. b, A sketch of the logical circuit that prepares a logical Bell pair. H and I correspond to the Hadamard and identity logical operations, respectively. Both logical qubits are initialized in \({\left\vert 0\right\rangle }_{L}\) state in logical Z basis. The black squares represent quantum error correction (QEC) rounds where stabilizers are measured. Syndromes are constructed from neighboring stabilizer measurements. \({S}_{t}^{(i)}\) refers to the syndromes of logical qubit i at the tth QEC cycle. c, An ML decoder takes sequences of syndromes from different logical qubits and predicts whether a logical error happened for each logical qubit, denoted as \({\mathbf{y}}_{z}^{(i)}\) for logical qubit i. Our ML-based decoder is composed of a decoding module network that parallels the corresponding logical circuits. Prob, probability. d, Entangling logical operations propagates physical error from one logical qubit to the other. As marked by the red lines, a physical X error on the control logical qubit (top) can propagate through a logical CNOT gate to the target logical qubit (bottom). The syndromes of control and target qubit are correlated, and both reflect the original physical X error in the control qubit.