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.
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
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 corrects neither dephasing nor unequal T1 across qubits, although alone it loses less than one point up to a ±80% spread of 1/T1. 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. These models are classically simulable and no quantum advantage is claimed. The filter is a way to make noise-free training valid under relaxation, at a shot cost known in advance. The models are released as qang. qml (version 0.6.13, pip install qang).
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.
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.
Extensive quantum error correction is necessary in order to perform a useful computation on a noisy quantum computer. Moreover, quantum error correction must be implemented based on imperfect parity check measurements that may return incorrect outcomes or inject additional faults into the qubits. To achieve fault-tolerant error correction, Shor proposed to repeat the sequence of parity check measurements until the same outcome is observed sufficiently many times. Then, one can use this information to perform error correction. A basic implementation of this fault tolerance strategy requiresΩ(rd2)parity check measurements for a distance-dcode defined byrparity checks. For some specific highly structured quantum codes, Bombin has shown that single-shot fault-tolerant quantum error correction is possible using onlyrmeasurements. In this work, we consider a phenomenological noise model for parity check measurements assuming that each bit of a codeword and the measurement outcome suffer from independent bit flips with some error ratep. For this model, we demonstrate that fault-tolerant quantum error correction can be achieved usingO(dlog(d))measurements for any code with distanced≥Ω(nα)for some constantα>0. Moreover, we prove the existence of a sub-single-shot fault-tolerant quantum error correction scheme using fewer thanrmeasurements. In some cases, the number of parity check measurements required for fault-tolerant quantum error correction is exponentially smaller than the number of parity checks defining the code. The short measurement sequences constructed generally have high weight and our phenomenological noise model is not realistic in this regime. Our error correction strategy could find applications to small codes and LDPC codes if one can manage to keep the weight of the measured parity checks low.