Statistical Validation of the Formulon Physics Legendre Encoder: Shot-Noise Scaling, Decoder Efficiency and Deterministic Accuracy on a PennyLane Simulator
WHAT THIS PAPER IS ABOUT Imagine a quantum computer wants to understand a number, say 0.35. It cannot just read it. So the number is first converted into a special pattern called Legendre features. These come from Legendre polynomials, a set of smooth curves in maths that act like a fingerprint of the number. WHAT WAS TESTED Formulon Physics is a Python library that does this conversion and can also reverse it, getting the original number back. I wanted to check two things: is it correct, and how accurate is it? HOW I TESTED IT 1. Correctness check: I compared Formulon's answers with SciPy, a trusted maths library. Over 1,312 values, the biggest difference was about one part in a quadrillion, which is just computer rounding. 2. Accuracy check: A quantum computer gives answers by measuring many times. Each measurement is called a shot. I ran 4,100 tests using 100, 500, 1,000 and 5,000 shots, on a simulator in Google Colab. WHAT I FOUND - More shots means a smaller error. It follows a simple rule: 4 times more shots cuts the error to half. This is just like a coin toss. Flip it 10 times and the result is rough; flip it 1,000 times and you get close to 50-50. - The error matched the maths prediction. It was within about 5% of what theory says, so nothing strange is happening inside the tool. - Higher degree recovers the number better. Using more features (degree 12 instead of 2) brought back the original number much more accurately. - The decoder is nearly perfect. It gets almost the best accuracy that is mathematically possible. LIMITS This was a simulator, not a real noisy quantum machine. I ran only 5 repeats per setting. The code also reused some random seeds. I also did not claim any quantum advantage. WHY IT MATTERS Anyone using Formulon now knows how many shots they need for the accuracy they want. For example, about 516 shots give an error of 0.01 with degree 8.
WHAT THIS PAPER IS ABOUT Imagine a quantum computer wants to understand a number, say 0.35. It cannot just read it. So the number is first converted into a special pattern called Legendre features. These come from Legendre polynomials, a set of smooth curves in maths that act like a fingerprint of the number. WHAT WAS TESTED Formulon Physics is a Python library that does this conversion and can also reverse it, getting the original number back. I wanted to check two things: is it correct, and how accurate is it? HOW I TESTED IT 1. Correctness check: I compared Formulon's answers with SciPy, a trusted maths library. Over 1,312 values, the biggest difference was about one part in a quadrillion, which is just computer rounding. 2. Accuracy check: A quantum computer gives answers by measuring many times. Each measurement is called a shot. I ran 4,100 tests using 100, 500, 1,000 and 5,000 shots, on a simulator in Google Colab. WHAT I FOUND - More shots means a smaller error. It follows a simple rule: 4 times more shots cuts the error to half. This is just like a coin toss. Flip it 10 times and the result is rough; flip it 1,000 times and you get close to 50-50. - The error matched the maths prediction. It was within about 5% of what theory says, so nothing strange is happening inside the tool. - Higher degree recovers the number better. Using more features (degree 12 instead of 2) brought back the original number much more accurately. - The decoder is nearly perfect. It gets almost the best accuracy that is mathematically possible. LIMITS This was a simulator, not a real noisy quantum machine. I ran only 5 repeats per setting. The code also reused some random seeds. I also did not claim any quantum advantage. WHY IT MATTERS Anyone using Formulon now knows how many shots they need for the accuracy they want. For example, about 516 shots give an error of 0.01 with degree 8.
Quantum computers don't hold still. Their error rates drift: defects switch on and off, and cosmic rays briefly scramble groups of qubits. Most decoders are tuned to one fixed noise model, so when the noise moves they keep correcting for a chip that no longer exists. Drift is a neural decoder that watches its own data instead. Alongside every shot it gets a "fingerprint": how often each detector has fired over the last 2,000 shots it decoded. It never sees calibration data or the true noise, only what its own syndromes tell it. In circuit-level simulation at code distance 5, on large error bursts it was never trained on, a three-model ensemble reaches a logical error rate of 0.0457. Standard matching gets 0.0980, the best sliding-window reweighted matching 0.0896, and matching that knows the true noise 0.0426. A control experiment separates the two sources of this gain. With the fingerprint frozen, the same network scores 0.0576 (paired McNemar p = 3×10⁻²⁴⁷), close to a network trained without one. So the decoder genuinely adapts to synthetic drift, but most of its lead over matching comes from being a better decoder in the first place. The same network can also point to which qubits went bad. It does this better than a simple baseline on bursts like those it trained on, but not clearly on larger, unfamiliar ones. Four architectural extensions were judged by decision rules set before each run; all four failed, and the paper reports them. Every result uses three training seeds and five independent test streams. Every version-1 number can be recomputed from the released per-shot data, and a claim-by-claim audit was run before release. All results are from simulation at distance 5 or less. v2: adds a pre-registered physics-based drift evaluation (SI1000 device noise with TLS, cosmic-ray, slow and coupler drift). Without retraining, all four ensembles beat MWPM calibrated to the device (logical error rate 0.0016–0.0017 against 0.0022); the live fingerprint gives no gain on this drift. Round-10 streams regenerate from the manifest in the repository.
Fault-tolerant quantum computers must continually decode noisy parity-check data, known as the syndrome, to determine whether an encoded logical qubit has been corrupted. The standard decoder, minimum-weight perfect matching (MWPM), assumes independent, graph-like errors and is sub-optimal under realistic circuit-level noise. We present a compact residual 3D convolutional neural network (0.5–0.6 million parameters) that reads the space-time syndrome of a rotated surface code as a volumetric image. Trained on Stim simulations at code distances d = 3 and d = 5 and evaluated on 3.6 million held-out shots, a three-seed ensemble outperforms correlated MWPM, the strongest baseline we test, at all 18 noise settings, with 6–46% fewer logical errors (paired McNemar p-value below 0.03 in every setting). On real Google Sycamore data (d = 3, five rounds), the network is pre-trained on the device's fitted error model and fine-tuned on half of the shots. It achieves a logical error rate of 13.03%, compared with 13.57% for correlated MWPM on the same held-out shots, and outperforms it on all eight cross-validation folds, although it does not match belief-matching or tensor-network decoders. Its outputs are well calibrated (ROC AUC = 0.998): discarding the 10% least-confident shots reduces errors tenfold. An ablation study identifies space-time locality as the essential inductive bias. All models train in 49 minutes on two freely available GPUs, and the data and code are publicly available.
Fault-tolerant quantum computers need fast and accurate error decoding. We present CoDecoder, a small neural frontend that composes with an existing decoder to improve accuracy and reduce mean decoding time. It predicts each shot's logical outcome, retains confident predictions and routes the remaining shots to the unchanged fallback. A logical-operator-aware output head scores shifted logical operators, combining equivalent logical lines on surface codes and deciding logical qubits jointly on bivariate-bicycle (BB) codes. Fused GPU inference and efficient routing reduce the overhead paid on every shot. In registered tests under circuit-level noise, composition reduces failures by 6.4-31.4% relative to correlated matching on surface codes of distance 7-17 and by 22-50% relative to full-DEM Relay-BP on two BB codes, with 2.3-124-fold speed-ups across these comparisons. With our re-implementations of the neural decoder Cascade, composition reduces decoding time in all four settings. A joint decision of both decoders on the routed shots keeps this speed and makes the composition more accurate than Cascade in all four, with 14-18% fewer failures on the [[72,12,6]] code. On the [[72,12,6]] BB code, a conventional head with independent logical outputs fails 3.8-5.0 times as often as our joint class score under matched training conditions. Per-shot analysis shows how composition gains accuracy. On retained shots, the frontend corrects more fallback errors than it introduces, even when it is less accurate overall.
Quantum computers have the possibility of a much reduced calculation load compared with classical computers in specific problems. Quantum error correction (QEC) is vital for handling qubits, which are vulnerable to external noise. In QEC, actual errors are predicted from the results of syndrome measurements by stabilizer generators, in place of making direct measurements of the data qubits. Here, we propose Quantum Golay code Error Correction (QGEC), a QEC method using Golay code, which is an efficient coding method in classical information theory. We investigated our method's ability in decoding calculations with the Transformer. We evaluated the accuracy of the decoder in a code space defined by the generative polynomials with three different weights sets and three noise models with different correlations of bit-flip error and phase-flip error. Furthermore, under a noise model following a discrete uniform distribution, we compared the decoding performance of Transformer decoders with identical architectures trained respectively on Golay and toric codes. The results showed that the noise model with the smaller correlation gave better accuracy, while the weights of the generative polynomials had little effect on the accuracy of the decoder. In addition, they showed that Golay code requiring 23 data qubits and having a code distance of 7 achieved higher decoding accuracy than toric code which requiring 50 data qubits and having a code distance of 5. This suggests that implementing quantum error correction using a Transformer may enable the Golay code to realize fault-tolerant quantum computation more efficiently.
A quantum neural network (QNN) built from gates that conserve the Hamming weight keeps its data in one weight sector, so the shots that left the sector can be discarded at readout. This is the qg filter of the qang library [1, 2]. We show that, with equal amplitude damping (T1) on every qubit, the filtered readout of such a network is exactly the noiseless one in any weight sector. The kept fraction of shots is (1 − γ)k d for weight k and depth d, and training under T1 with the filter gives exactly the parameters of noiseless training. We then measure what this is worth on four small classification datasets. Every result is reported with the filter and without it, and every prediction was committed before its run, failures included. Over 60 runs per model, a network trained on a simulator and run under T1 gains +2.5 points from the filter at weight 1 (95% CI [0.8, 4.1]) and +16.5 points at weight 2 ([11.8, 21.2]), recovering its noiseless accuracy exactly. A network trained under the calibrated noise without the filter catches up (diflerences of 0.1 points), and the filter alone corrects neither dephasing nor unequal T1 across qubits, although it loses less than one point up to a ±80% spread of 1/T1. Unequal T1 is corrected by training UÏtl the filter under the calibrated decay rates: the kept state depends only on their ratios, so the model lands within 0.5 points of noiseless at a ±100% spread, ignores a 10% calibration error and, at weight 2, loses 0.7 points under a 1.5-fold drift of all T1 that costs the raw noise-aware model 10. With noise-aware training and a richer readout, the model without the filter was 1.2 points better in one study, but over 60 new runs that gap shrank to +0.5 points and was not significant. The weight-2 deficit comes from the pair-product encoding, not from the readout; with an encoding that fills the whole sector and a full-rank readout, weight 2 reaches the weight-1 accuracy. On noise models of IBM and IonQ devices the filter cuts the error of the measured qgZ by 2.7-3.6×; on the IonQ Forte-1 noise model over 189 inputs of four datasets the filtered model is 1.1 points more accurate than the raw one, and calibrating the errors the filter keeps with five echo circuits per model halves the remaining error of the decision value: decisions that difler from the noiseless model fall from 15 (raw) and 7 (filter) to 3 over 945 readings on five device noise models. With a faithful weight-2 encoding the advantage of the unfiltered model under noise-aware training disappears, and a classifier given both the filtered and the raw features gains nothing over the filter alone. Over 513 readout configurations, including kept fractions down to 2.6 ×10−7, unequal T1 and dephasing, the filter has the lower readout error whenever about 20 shots are kept, and a closed-form rule predicts the winner. The same holds beyond the first model: at 8 qubits a weight-2 network keeps its noiseless 0.965 with the filter and drops to 0.705 without it; a five-class classifier (one class per qubit) keeps its noiseless accuracy under T1 with the filter and loses 15-18 points without it on five-class digits; training from 100 or 1000 shots per step with the filter is 1.0-1.5 points ahead of training without it; and the filtered gradient equals the noiseless one, while the raw one is K times smaller at weight 1. On five device noise models the echo calibration turns class confusions back: flipped decisions of the five-class model fall from 51 (raw) and 24 (filter) to 15 over 500 readings. The echo helped only where the filtered error was well above shot noise, and it still removed a third of the filtered error with a 28 × 28 matrix at 8 qubits. These models are classically simulable and no quantum advantage is claimed. The filter is
We first provide a simple proof showing that any single-shot code is self-correcting. We then show that any [[n,k]] CSS quantum low-density parity-check (QLDPC) code can be transformed into an [[nm,k]] CSS QLDPC code with single-shot (SS) quantum error correction and an efficient local decoder which runs in O(logm) parallel time. Below a constant threshold pRG>0 for joint local stochastic physical and measurement noise, the logical failure probability over T correction rounds is bounded by \begin{equation*}
O(T n)\exp[-Ω(m^α)] \end{equation*} for a constant α>0; we say that the \textit{threshold} is pRG and \textit{error suppression} is Ω(mα). Moreover, if the input code is equipped with a single-shot decoder with threshold pc>0 and error suppression Ω(nβ), then the output code \textit{enhances} the error suppression to Ω(mαnβ), while maintaining the decoder-independent threshold pRG, and thus \textit{enhanced} if pc<pRG.