Fig. 5: Data-qubit leakage detection.

a Average response in time of the HMMs (diamonds) to leakage, in comparison to the actual leakage probability extracted from the density-matrix simulations (dashed lines). The average is computed by selecting single realizations where \({p}_{{\rm{DM}}}^{{\mathcal{L}}}\left(Q\right)\) was below a threshold \({p}_{{\rm{th}}}^{{\mathcal{L}}}=0.5\) for at least 5 QEC cycles and then above it for 5 or more rounds. Error bars, estimated by bootstrapping, are smaller than the symbol sizes. b Precision-recall curves for the data qubits over 4 × 104 runs of 50 QEC cycles each using the HMM predictions (solid) and the leakage probability from the density matrix (dashed). The dotted line corresponds to a random guess classifier for which \({\mathcal{P}}\) is equal to the fraction of leakage events (occurring with probability given by the density matrix) over all QEC cycles and runs.