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).
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).
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. 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.0, pip install qang).
Circuits built from gates that conserve the Hamming weight keep their state in one weight sector, so the shots that left the sector can be discarded at read-out: the qg filter of the open-source library qang [1], a form of symmetry verification [2, 3]. We make it usable on IBM devices through IBM Runtime and Qiskit, and measure it on the noise models of twenty IBM devices. The library adds a Qiskit transpiler pass that decides whether the filter applies, read-out correction from each device's published per-qubit errors, qg read-outs of IBM Runtime Sampler and Estimator results, zero-noise extrapolation by gate folding that stacks with the filter, a prediction of the filter's kept fraction from the calibration, qubit selection with that prediction, a shot planner, and the weight-conserving quantum neural network (QNN) of qang as one parameterized job and as a qiskit-machine-learning SamplerQNN. Every prediction was committed before its run and is reported as passed or failed. On ten five-qubit weight-1 circuits the filter lowers the error of the measured qgZ = ⟨Z⟩ from 0.065-0.104 to 0.018-0.023 on three devices (0.013-0.022 with read-out correction), and filter plus zero-noise extrapolation reaches 0.011-0.015. On seventeen further devices never used before, the filter cuts the error 2.4-8.9× on every one (median 3.1× with read-out correction). Choosing the qubits by the predicted kept fraction keeps 6-17 points more shots than Qiskit's default layout on chain circuits, avoids a qubit published as reading 1 always, and the shot planner met a 0.02 target precision on three devices. For classification the gain is small: the QNN recovers 5-6 of the 10 decisions noise costs it. Reading a known five-component principal-component spectrum out of the data's density matrix in the weight-1 sector, filter plus read-out correction lowers the error 4.6× (median over twenty-one devices) and orders the spectrum correctly on 18 of 21 (13 raw). In Trotter simulation of the XY chain the filter halves the best error and moves the optimal number of Trotter steps deeper (16 of 21 devices), and in a quantum walk it turns a raw spreading indistinguishable from a classical random walk (exponent 0.87) into ballistic spreading (1.84). With two or three interacting excitations (XXZ chain) the gain falls from 5.6× to 2.6×: larger sectors let more of the noise through. Two interoperability bugs were found, one in qiskit-machine-learning and one in the library. All results are on device noise models; no hardware run is reported.
We write fifteen standard quantum gates and fourteen standard quantum algorithms in qg units [1]. An -qubit state is described by its qg values, for every Pauli string , and a gate acts as . With this one rule each gate becomes a table of qg transformations and each algorithm a readout identity: which qg values hold the answer. The formulation is the Pauli (Heisenberg) representation and adds no new physics. It gives three practical classifications in the units used by the rest of the qang project: which gates conserve Hamming weight, and therefore admit the qg symmetry witness and filter; which algorithms are read out from a few qg values and which need the full outcome histogram; and where reading qg values is strictly worse than the standard readout. Three readout identities are, as far as we know, not stated in this form elsewhere: the per-qubit polar bias after Grover iterations, Simon’s secret as the unique non-trivial Z-parity equal to one, and quantum counting as a single . Every identity is checked numerically and pinned by tests in the open-source library qang (version 0.5.1, pip install qang), module qang.formulation.
In the qg framework [1] a qubit is described by its polar bias . When a circuit conserves a Hamming weight, the average of over the register is fixed in advance: for excitations on qubits. This one number is a reference-free witness of noise that changes the conserved quantity, and its shot-level version is the known symmetry-verification filter [2], [3]. We measure when the witness and the filter help, and when they do not, on six problems with classical controls and on four molecules for the rotated-basis extension, using calibration-based and vendor noise models. (i) On H the filter lowers the energy error from 18 to 5.5 mHa, below Hartree–Fock (20.3 mHa), and it stays below Hartree–Fock along the dissociation curve. (ii) Across noise channels the witness predicts the outcome: it moves under T1 and the filter removes 94–95% of the error for free, while under dephasing it stays at its ideal value and the filter does nothing. Zero-noise extrapolation is complementary and fails on idle decoherence; the combination reaches mHa. (iii) With separate spin-up and spin-down witnesses, a second filter pays off only when a spin-leak witness is nonzero. Qubit routing on a heavy-hex device creates such leak in 1D Hubbard dynamics. (iv) In QAOA with an “exactly ” constraint, the filter doubles the success probability of the constraint-preserving ansatz. Penalty QAOA at depth does not beat a random feasible guess, and a greedy algorithm beats all quantum variants. (v) The witness relies on calibrated readout. A heralded sweep separates thermal population from asymmetric readout error, which the standard calibration conflates, and gives an unbiased effective temperature ( mK) together with and . (vi) On IonQ’s trapped-ion noise models the filter doubles the constraint-preserving QAOA success and halves the H error in every run, while zero-noise extrapolation, which must fold native gates because CX folding is undone by the compiler, is nearly unbiased but too noisy at the 2000-shot limit. (vii) Beyond symmetries, every stabilizer expectation of the repetition and Leung codes is a power of one single-qubit qg, so the syndromes track noise drift for free and choose between codes by the rule . (viii) Z-basis filtering cannot reach Hamiltonian terms measured in rotated bases, which hold most of the LiH error. Parity and mod 4 checks on two ancillas do reach them: they cut the LiH error (below Hartree–Fock on a generic model, on IonQ’s forte-1 model) and approach the full number-projection ceiling up to 12 qubits (H, HO, H). That ceiling shrinks with depth, because number-conserving errors grow. Coherent over-rotation of the entangling gate passes through native-gate ZNE untouched, while the filter removes 94% of it. We also report where the method stops: Hubbard circuits beyond 190 two-qubit gates, where the witness correctly reports unital scrambling. No result is a quantum advantage over classical computation. Every number is reproduced by a script and pinned by a regression test.
Quantum Neural Network (QNN) is a promising application towards quantum advantage on near-term quantum hardware. However, due to the large quantum noises (errors), the performance of QNN models has a severe degradation on real quantum devices. For example, the accuracy gap between noise-free simulation and noisy results on IBMQ-Yorktown for MNIST-4 classification is over 60%. Existing noise mitigation methods are general ones without leveraging unique characteristics of QNN and are only applicable to inference; on the other hand, existing QNN work does not consider noise effect. To this end, we present RoQNN, a QNN-specific framework to perform noise-aware optimizations in both training and inference stages to improve robustness. We analytically deduct and experimentally observe that the effect of quantum noise to QNN measurement outcome is a linear map from noise-free outcome with a scaling and a shift factor. Motivated by that, we propose post-measurement normalization to mitigate the feature distribution differences between noise-free and noisy scenarios. Furthermore, to improve the robustness against noise, we propose noise injection to the training process by inserting quantum error gates to QNN according to realistic noise models of quantum hardware. Finally, post-measurement quantization is introduced to quantize the measurement outcomes to discrete values, achieving the denoising effect. Extensive experiments on 8 classification tasks using 6 quantum devices demonstrate that RoQNN improves accuracy by up to 43%, and achieves over 94% 2-class, 80% 4-class, and 34% 10-class MNIST classification accuracy measured on real quantum computers. We also open-source our PyTorch library for construction and noise-aware training of QNN at this https URL .