Comparison

Does a quantum layer help? HQNN vs a classical network on the same data

In our two runs, with a 5-qubit circuit on a noiseless simulator, no. We tested a hybrid quantum neural network (HQNN) on machine-failure and card-fraud data against gradient boosting and against its classical twin, the same network with the circuit replaced by a classical block of the same width and parameter count. Gradient boosting scored higher on both datasets, and the twin scored within noise of the hybrid on one and higher on the other. A fair HQNN vs classical comparison needs that twin, the same splits and several seeds; most published comparisons have none of the three, and the same test runs on your own data.

Updated

The verdict

Against the best classical model
Gradient boosting had the highest PR-AUC on both datasets, above the HQNN.
Against its classical twin, machine failures
Circuit minus twin: 0.022 ± 0.044 PR-AUC per seed, pp = 0.32. No measurable effect.
Against its classical twin, card fraud
Circuit minus twin: -0.030 ± 0.041 PR-AUC per seed, pp = 0.17. The twin did better.
Parameters
The circuit holds a minority of the HQNN's weights, and the classical twin has exactly as many. Size is not an advantage of either.
Training cost on a simulator
On AI4I, 23.3 s ± 1.2 s for HQNC against 1.1 s ± 0.1 s for its twin with the same parameter count

What is being compared, and why most comparisons are not fair

An HQNN is a classical network with a small quantum circuit inside: a linear layer maps the features onto a few qubits, the circuit encodes them as rotation angles and returns one expectation value per qubit, and a linear head makes the prediction. The quantum neural networks page explains the model; this page is about what it should be compared with.

There are three comparisons, and each answers a different question. Against the best classical model on the same split: is the HQNN worth using here? Against a plain classical network of the same size: does the hybrid architecture help? Against its own classical twin, the same network with the circuit replaced by a classical block of the same width and parameter count: does the quantum circuit itself help? Only the third isolates the quantum part.

Most HQNN results skip it. A typical report compares a hybrid model built on an LSTM or a deep MLP with a smaller or differently shaped classical network, so any gain may come from the classical layers. Others evaluate on a class-balanced subsample of a rare-event dataset, use one seed, or take the classical number from another paper with another split. Parameter counts are another trap: when the circuit holds a handful of angles among thousands of classical weights, a difference in total size says nothing about the circuit.

The literature that does control for this mostly finds no quantum effect. In a large benchmark of quantum classifiers on small datasets, out-of-the-box classical models did better overall, and removing the entanglement from a quantum model often gave results as good or better[1].

Machine failures: AI4I 2020

Synthetic milling data[4] at the real failure rate of 3.4%. Mean ± standard deviation over five seeds on the test split. Training time is for the selected configuration, on a laptop CPU shared with other jobs.

ModelPR-AUCMacro F1ParametersTraining time
HQNC (5-qubit circuit)0.587 ± 0.0850.778 ± 0.0408723.3 s ± 1.2 s
HQNC classical twin0.565 ± 0.0580.750 ± 0.029871.1 s ± 0.1 s
MLP backbone + circuit0.719 ± 0.0490.812 ± 0.021286323.9 s ± 0.7 s
MLP backbone + classical block0.700 ± 0.0720.819 ± 0.02528631.3 s ± 0.0 s
Plain MLP of HQNC's size0.534 ± 0.0870.753 ± 0.028900.7 s ± 0.0 s
Gradient boosting0.782 ± 0.0220.855 ± 0.018tree ensemble2.2 s ± 0.8 s

Run hqnn-predictive-maintenance of 2026-11-03, mean and spread over 5 seeds, on AI4I 2020 Predictive Maintenance Dataset (Matzka 2020), target 'Machine failure'. HQNC beats the plain MLP of its size, but its classical twin does too, so the gain is the pipeline's shape, not the circuit's. Behind the MLP backbone the circuit and the classical block are tied on PR-AUC (0.020 ± 0.049, pp = 0.42). Details on the predictive maintenance page.

Card fraud: OpenML 1597

Card transactions[5] with validation and test at the real fraud rate of 0.17%. Mean ± standard deviation over five seeds on the test split.

ModelPR-AUCMacro F1ParametersTraining time
HQNC (5-qubit circuit)0.731 ± 0.0680.890 ± 0.02219728.2 s ± 2.3 s
HQNC classical twin0.762 ± 0.0610.903 ± 0.0111971.3 s ± 0.2 s
MLP backbone + circuit0.730 ± 0.0920.889 ± 0.028427127.8 s ± 3.2 s
MLP backbone + classical block0.792 ± 0.0510.904 ± 0.01942711.6 s ± 0.3 s
Plain MLP of HQNC's size0.755 ± 0.0720.906 ± 0.0132000.9 s ± 0.1 s
Gradient boosting0.825 ± 0.0310.914 ± 0.016tree ensemble2.2 s ± 0.4 s

Run hqnn-fraud-detection of 2026-11-03, mean and spread over 5 seeds, on creditcard (OpenML 1597): card transactions of European cardholders, September 2013 (Dal Pozzolo, Caelen, Johnson, Bontempi 2015), target 'Class'. Here the classical block beats the circuit in both layouts; behind the backbone the gap is -0.062 ± 0.085 PR-AUC (pp = 0.18). The plain MLP of HQNC's size also scores higher than HQNC. Details on the fraud detection page.

Does the circuit beat its classical twin? The paired intervals

Each row is the per-seed difference between HQNC and the same network with its circuit swapped for a classical block of the same width and parameter count, with its 95% interval. An interval that contains zero means the runs cannot tell the two apart. First the machine-failure run:

MetricHQNC minus twin95% interval, low95% interval, highPaired t-test pSeeds where HQNC is ahead (of 5)
PR-AUC0.022-0.0320.0770.324
Balanced accuracy0.047-0.0490.1430.244
Macro F10.029-0.0340.0910.273
ROC-AUC0.011-0.0100.0330.213

Run hqnn-predictive-maintenance of 2026-11-03, mean and spread over 5 seeds, on AI4I 2020 Predictive Maintenance Dataset (Matzka 2020), target 'Machine failure'.

The same intervals on card fraud

MetricHQNC minus twin95% interval, low95% interval, highPaired t-test pSeeds where HQNC is ahead (of 5)
PR-AUC-0.030-0.0810.0200.171
Balanced accuracy-0.016-0.0460.0130.201
Macro F1-0.012-0.0300.0050.121
ROC-AUC0.004-0.0080.0150.444

Run hqnn-fraud-detection of 2026-11-03, mean and spread over 5 seeds, on creditcard (OpenML 1597): card transactions of European cardholders, September 2013 (Dal Pozzolo, Caelen, Johnson, Bontempi 2015), target 'Class'.

HQNN vs classical network, side by side

HQNNClassical network of the same size
Score in our two runsBelow gradient boosting on both; equal to or below its twinEqual to or above the HQNN
Where the extra nonlinearity comes fromCosines of the encoded angles, a truncated Fourier series in the inputs[2]The activation function, here tanh
Training on a simulatorExact gradients, but each step simulates the circuit; slowOrdinary backpropagation; fast
Training on hardwareEach gradient needs repeated circuit runs with parameter shift, and carries shot noiseNot applicable
Trainability riskBarren plateaus as circuits grow wider and deeper[3]Vanishing gradients in deep networks, with known fixes
What it needs to be worth itA measured gain over its twin and over the best classical model, on the same splitsNothing; it is the baseline

What would change this verdict

The signal to look for is a hybrid whose paired interval against its twin sits above zero, on the same splits and over several seeds, and which then gets close to the best classical model. Neither run shows that. Three things could move it, and each can be tested with the code below rather than assumed.

A richer circuit. A circuit that encodes each input once can only produce a short Fourier series in it, and re-uploading the data several times widens that spectrum[2]. Wider and deeper circuits can also flatten their gradients[3], so the test is a re-uploading or wider layer in the same slot, with its own twin, and a look at the gradients before the scores.

Other data. Both runs are tabular classification, where tree ensembles are strong. On sequences the circuit usually sits behind an LSTM or GRU; the wind power page runs that recurrent hybrid against its twin on hourly data, where it also scored within noise of its twin. A dataset with structure that matches the circuit's Fourier features is the open case, and it is the twin test that would show it.

Real hardware. On a QPU every forward pass is a circuit run with shot noise, and every gradient takes repeated runs. Before planning on a device, check which QPUs can run a circuit of this size within their error budget and what a run costs.

Run it on a real QPU with EigenOrbit RouterA trained HQNC and its twin scored on the same test sample, the hybrid on a real QPU, to measure what noise and finite shots cost the circuit.In eigenkit: pip install "eigenkit[router]", then provider=RouterConfig(device=...) (docs).

Run the paired comparison yourself

import math
import warnings

import numpy as np
from scipy.stats import ttest_rel
from sklearn.datasets import load_breast_cancer
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from torch import nn

from eigenkit import HQNC, GenericClassifier, MinMaxNorm

warnings.simplefilter("ignore", UserWarning)  # the HQNC input-adapter notice

X, y = load_breast_cancer(return_X_y=True)

def models(seed):
    train = dict(n_classes=2, epochs=15, lr=0.01, show_progress=False, random_state=seed)
    hqnc = HQNC(in_features=30, n_qubits=5, depth=2, variational_type="strong", **train)
    # The ablation: the same network, the circuit swapped for Linear(5, 5) + Tanh.
    ablation = GenericClassifier(
        model=nn.Sequential(nn.Linear(30, 5), MinMaxNorm(5, min_val=0.0, max_val=math.pi),
                            nn.Linear(5, 5), nn.Tanh(), nn.Linear(5, 2)),
        in_features=30, **train)
    return hqnc, ablation

diffs = []
for seed in range(5):
    X_tr, X_te, y_tr, y_te = train_test_split(X, y, test_size=0.3, stratify=y, random_state=seed)
    scaler = StandardScaler().fit(X_tr)
    X_tr, X_te = scaler.transform(X_tr), scaler.transform(X_te)
    q, c = (roc_auc_score(y_te, m.fit(X_tr, y_tr).predict_proba(X_te)[:, 1])
            for m in models(seed))
    diffs.append(q - c)
    print(f"seed {seed}: HQNC {q:.3f}, ablation {c:.3f}")

d = np.array(diffs)
half = 2.776 * d.std(ddof=1) / math.sqrt(len(d))  # t quantile, 4 degrees of freedom
print(f"HQNC minus ablation: {d.mean():+.3f}, 95% CI [{d.mean() - half:+.3f}, {d.mean() + half:+.3f}]")
print(f"paired t-test p = {ttest_rel(d, np.zeros_like(d)).pvalue:.2f}")

Five seeds, each a new split, with the hybrid and its twin trained on the same split and seed. Runs in under ten seconds on a laptop CPU. On the run we checked, the 95% interval included zero. Breast cancer is close to the ceiling for every model, so this shows the method; for the verdict, run it on your own data with strong classical baselines next to it.

Questions

Is an HQNN better than a classical neural network?

Not in our runs, with a 5-qubit circuit on a simulator. On machine-failure and card-fraud data, the hybrid quantum classifier scored below gradient boosting, and replacing its circuit with a classical block of the same width and parameter count gave a score within noise of it on one dataset and a higher one on the other. Published benchmarks with careful classical baselines point the same way.

Do quantum neural networks need fewer parameters than classical ones?

Not in a way that matters here. In a hybrid model most weights are classical, and the circuit in our runs had as many trainable angles as the classical block that replaced it. Comparisons that report fewer total parameters usually compare different classical architectures, not the circuit.

How do I compare an HQNN with a classical network fairly?

Use the same splits, seeds, tuning budget and threshold rule for every model. Add the classical twin of the HQNN, the same network with the circuit swapped for a classical block of equal width and parameter count, and report the paired per-seed difference with a confidence interval. Put a tuned gradient-boosting model next to both.

HQNN vs LSTM: which is better for time series?

The two runs on this page do not answer it, because both are tabular. Hybrid models for time series usually put the circuit after an LSTM or GRU, so the right test is the same recurrent network with and without the circuit. Our wind power forecasting run did that on hourly data: the LSTM followed by a circuit was behind the plain LSTM 1 hour ahead and tied with it at 6 hours. eigenkit's RecurrentHQNC and GenericClassifier make the same comparison possible on your own series.

Is training an HQNN slower than training a classical network?

Yes, on a simulator. In our runs the hybrid classifier took many times as long to train as its classical twin with the same number of parameters, because every step simulates the circuit; the timings are in the result tables on this page. On hardware, every gradient needs many repeated circuit runs, which is slower still.

Sources

  1. J. Bowles, S. Ahmed, M. Schuld. Better than classical? The subtle art of benchmarking quantum machine learning models. arXiv preprint, 2024. arXiv:2403.07059.
  2. M. Schuld, R. Sweke, J. J. Meyer. Effect of data encoding on the expressive power of variational quantum machine learning models. Physical Review A 103, 032430, 2021. arXiv:2008.08605.
  3. J. R. McClean, S. Boixo, V. N. Smelyanskiy, R. Babbush, H. Neven. Barren plateaus in quantum neural network training landscapes. Nature Communications 9, 4812, 2018. arXiv:1803.11173.
  4. S. Matzka. AI4I 2020 Predictive Maintenance Dataset. UCI Machine Learning Repository, dataset 601, 2020.
  5. A. Dal Pozzolo, O. Caelen, G. Bontempi. creditcard (credit card fraud detection). OpenML, dataset 1597, 2015.

Run it yourself with eigenkit

eigenkit is EigenOrbit's open-source Python library: write a circuit once, run it on any simulator or QPU, and test it against a classical baseline on your own data before you invest in it or rule it out.

$ pip install eigenkit