Quantum kernel vs RBF kernel: how to run a fair QSVM benchmark
A quantum support vector machine (QSVM, or QSVC for the classifier and QSVR for regression) is an ordinary SVM whose kernel values come from a quantum circuit, so the fair comparison is a classical SVM on the same features, the same split and the same tuning budget, bandwidth included. In our ten-seed benchmark on the Wisconsin breast cancer data, with 4- and 8-qubit kernels simulated exactly, the quantum kernel tied the RBF SVM on the same inputs and scored below a linear SVM on all 30 features. It did best at the bandwidth where it behaves most like a classical kernel, which tells you what to check on your own data before reading anything into a QSVM score.
Updated
The verdict
- Same 4 inputs, 4 qubits
- Balanced accuracy: QSVC 0.961 and 0.965 with two feature maps, against the RBF SVM's 0.964. A tie.
- Same 8 inputs, 8 qubits
- QSVC 0.969 and 0.970, against the RBF SVM's 0.974. The classical kernel is slightly ahead.
- Best model overall
- Logistic regression on all 30 features, 0.980. No quantum model reached it.
- Ranking quality
- ROC-AUC of every SVM, quantum or classical, is between 0.995 and 0.998.
- Cost on a simulator
- One 4-qubit QSVC fit takes 0.004 s on the simulator; on hardware the same Gram matrix is over a hundred thousand circuits.
What a QSVM is, and what it is compared with
A QSVM, called QSVC in eigenkit, encodes each input vector as a quantum state with a feature-map circuit and uses the overlap of two such states as the kernel: . The state lives in a space of amplitudes for qubits, a superposition of every basis state, and that large space is the original argument for trying it[1].
Everything after the kernel is classical. The circuit fills a Gram matrix with one row and one column per training sample, and a standard SVM solves its usual convex problem on it. So a QSVM vs SVM comparison is a comparison of two kernels inside the same solver, and the classical kernel to beat is the one with the same job: the RBF kernel, which also measures similarity by distance and also has a width to tune. A linear SVM and a logistic regression belong next to both, because on many tabular datasets a straight line is already close to the best possible score.
A large state space is not enough by itself. Classical models trained on data can match quantum kernels unless the quantum kernel sees structure in the data that the classical kernel cannot[4], and in a large independent benchmark out-of-the-box classical models did better than the quantum classifiers tested, kernel models included[5]. The guide on when quantum machine learning makes sense covers that wider question; this page is about measuring it on your own data.
How to run a fair QSVM vs SVM benchmark
Most published QSVM results break at least one of these rules. Each one changed the picture in our run.
Same split, several seeds
Train and test every model on exactly the same rows, and repeat over several random splits. On a test set of about a hundred samples, one sample moves accuracy by about one point, which is the size of most reported quantum gains.
Same features for both kernels
A circuit needs one qubit per input, so quantum kernels usually see a PCA reduction of the data. Give the classical kernel the same components, fitted on the training rows only inside the pipeline, and then add a classical model on all the features to show what the reduction cost.
Tune the bandwidth of both kernels
A quantum kernel has a bandwidth too: multiply the inputs by a factor before encoding. Shaydulin and Wild showed that this factor moves a quantum kernel from overfitting to underfitting, as the width does for an RBF kernel, and that with it tuned, quantum kernels stop losing accuracy as qubits are added[2]. Search it with the same grid size as the RBF width; for small distances an angle-encoded kernel behaves like an RBF kernel with , so one grid covers both.
Score what matters, and report the spread
Tune on cross-validation inside the training rows only. Report the mean and spread over seeds, the paired per-seed difference between the quantum and the classical row, and the test size, so a reader can see how many samples a gap is worth. Use balanced accuracy or ROC-AUC when the classes are uneven.
Count the cost
On a statevector simulator a Gram matrix costs one state evolution per sample and a matrix product. On hardware it costs circuits for training samples, each run for many shots, plus one circuit per test and training pair at prediction time. The quantum computing cost guide prices a kernel matrix on each route.
Our run: QSVM vs SVM on the Wisconsin breast cancer data
569 tumours with 30 features[6], 455 for training and 114 for testing per seed, 10 seeds. Every SVM was tuned by 5-fold cross-validation over the same C grid, and both kernels over the same six widths. Balanced accuracy and ROC-AUC on the test split, mean ± standard deviation over seeds; exact kernel values from eigenkit's statevector simulator.
| Model and inputs | Balanced accuracy | ROC-AUC | Final fit |
|---|---|---|---|
| QSVC, ZZ map, 4 qubits, PCA 4 | 0.961 ± 0.018 | 0.995 ± 0.005 | 0.005 s |
| QSVC, AngleCNOT map, 4 qubits, PCA 4 | 0.965 ± 0.017 | 0.995 ± 0.003 | 0.004 s |
| RBF SVM, PCA 4 | 0.964 ± 0.014 | 0.995 ± 0.004 | 0.002 s |
| Linear SVM, PCA 4 | 0.967 ± 0.014 | 0.995 ± 0.003 | 0.005 s |
| QSVC, ZZ map, 8 qubits, PCA 8 | 0.969 ± 0.013 | 0.997 ± 0.003 | 0.046 s |
| QSVC, AngleCNOT map, 8 qubits, PCA 8 | 0.970 ± 0.010 | 0.998 ± 0.002 | 0.027 s |
| RBF SVM, PCA 8 | 0.974 ± 0.011 | 0.998 ± 0.002 | 0.002 s |
| Linear SVM, PCA 8 | 0.976 ± 0.008 | 0.997 ± 0.002 | 0.015 s |
| RBF SVM, all 30 features | 0.967 ± 0.020 | 0.996 ± 0.005 | 0.001 s |
| Linear SVM, all 30 features | 0.977 ± 0.012 | 0.998 ± 0.002 | 0.001 s |
| Logistic regression, all 30 features | 0.980 ± 0.010 | 0.998 ± 0.001 | 0.001 s |
Run qsvm-breast-cancer of 2026-11-03, mean and spread over 10 seeds, on Breast Cancer Wisconsin (Diagnostic), via eigenkit.datasets 'breast_cancer_wisconsin' (sklearn load_breast_cancer). On the same components the quantum and classical kernels are within one test tumour of each other; going from 4 to 8 components helps every model more than the choice of kernel does. Final fit is one fit with the selected settings, on a shared laptop CPU. Per-model details and the hybrid network's rows are on the breast cancer benchmark page.
Why the tuned quantum kernel chose its most classical setting
The grid gave each quantum kernel six bandwidths. In nearly every tuned run, for both feature maps and both circuit sizes, cross-validation picked one of the two smallest, together with a large C. At those scales the encoded states barely move between samples, every off-diagonal kernel entry stays close to 1, and the kernel reduces to a smooth, low-order function of the inputs: the regime that a linear or RBF kernel already covers. The quantum kernel scored best where it was least quantum.
At the large bandwidths the opposite happens. The 8-qubit ZZ kernel's off-diagonal entries fall close to zero, so every pair of different samples looks equally unrelated and the SVM has nothing to separate. This is exponential concentration: with expressive embeddings, entanglement, global measurements or noise, kernel values crowd towards a fixed value as qubits are added, and telling them apart then needs exponentially many shots[3]. It is the kernel version of the barren plateau that stalls trainable circuits, and the bandwidth is the main control for it[2].
Read together, the two ends say where a quantum kernel can earn its place: at a bandwidth wide enough that it is not a classical kernel in disguise, and narrow enough that its values do not concentrate. On this dataset that window held nothing a linear model needed. Check both ends on your own data before reading anything into a QSVM score.
QSVM vs classical SVM, side by side
| QSVM (quantum kernel) | Classical SVM (RBF or linear kernel) | |
|---|---|---|
| What is learned | Nothing in the circuit, unless the map is trained; the SVM weights are fitted classically | The SVM weights |
| Kernel width | The input scale before encoding | for RBF; none for linear |
| Inputs | One qubit per feature, so usually a PCA reduction | Any number of features |
| Training on a simulator | One state evolution per sample, exponential in qubits | Milliseconds on a laptop for a few hundred samples |
| Training on hardware | circuits per Gram matrix, each with many shots | Not applicable |
| Main failure mode | Kernel values concentrate as qubits and expressivity grow[3] | Over- or underfitting from a badly chosen width, which a grid search fixes |
| Score in our breast cancer run | Tied the RBF SVM on the same components | Equal or better; best on all 30 features |
What would change this verdict
The signal to look for is a quantum kernel ahead of a tuned RBF SVM on the same components, over several seeds, by more than one or two test samples, and then close to the best model on all the features. This run shows neither. Three things could move it, and each can be tested rather than assumed.
Data whose structure a quantum kernel sees and a classical one does not. Huang et al. give a way to check this before any tuning: compare the geometry of the quantum and the classical kernel matrices on your data, and only a large difference leaves room for the quantum kernel to predict better[4]. The original experiment used data generated to suit its feature map[1]; whether real tabular data has such structure is the open question, and the protocol above is how to answer it.
A kernel that is trained, not fixed. Both maps here are fixed circuits with one bandwidth. A feature map with weights, trained to align the kernel with the labels, can move away from the near-classical setting that cross-validation picked here; it belongs next to the same tuned RBF SVM, with the same check for concentration.
Real hardware. A Gram matrix on a QPU is many circuits, each estimated from shots and moved by gate noise, so the hardware score starts below the exact one. Before planning on a device, check which QPUs can run an 8-qubit feature map within their error budget and what a run costs.
Run it on a real QPU with EigenOrbit RouterA sample of 8-qubit kernel entries estimated from shots on a real QPU and set against the exact values, to measure how far hardware noise moves the Gram matrix.In eigenkit: pip install "eigenkit[router]", then provider=RouterConfig(device=...) (docs).
Run QSVC against an RBF SVM with the same budget
import warnings
from sklearn.decomposition import PCA
from sklearn.metrics import balanced_accuracy_score
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC
from eigenkit import QSVC
from eigenkit.benchmark import compare, custom_metric
warnings.filterwarnings("ignore", message=".*non-sklearn components.*")
C = [0.1, 1, 10, 100, 1000]
SCALE = [0.05, 0.1, 0.25, 0.5, 1, 2] # quantum bandwidth: inputs are multiplied by it
def tuned(clf, grid):
# Both kernels see the same 4 PCA components, fitted on the training rows only.
pipe = make_pipeline(StandardScaler(), PCA(n_components=4), StandardScaler(), clf)
step = pipe.steps[-1][0]
grid = {f"{step}__{k}": v for k, v in grid.items()}
return GridSearchCV(pipe, grid, scoring="balanced_accuracy", cv=5)
result = compare(
models={
"QSVC, 4 qubits": tuned(QSVC(feature_map="AngleCNOT", reps=2), {"C": C, "scale": SCALE}),
# gamma = scale**2 / 4 searches the same widths as the quantum kernel
"RBF SVM": tuned(SVC(kernel="rbf"), {"C": C, "gamma": [s * s / 4 for s in SCALE]}),
"Linear SVM": tuned(SVC(kernel="linear"), {"C": C}),
},
dataset="breast_cancer_wisconsin",
metrics=["accuracy", custom_metric(balanced_accuracy_score, direction="higher", name="balanced_accuracy")],
n_seeds=3,
test_size=0.2,
validation_size=0.0,
)
print(result.table())Three seeds of the protocol above, the AngleCNOT kernel only, in a few seconds on a laptop CPU with pip install eigenkit[qml,benchmark]. It prints one row per model with accuracy and balanced accuracy, mean ± standard deviation over seeds. On the run we checked, the three rows were within about one test tumour of each other and the linear SVM was on top. Swap in your own dataset as a dict with X_train, y_train, X_test and y_test.
Questions
Is QSVM better than a classical SVM?
Not on the data we tested, with 4- and 8-qubit kernels on a simulator. On the Wisconsin breast cancer data, a tuned quantum kernel SVM tied an RBF SVM given the same PCA components and lost to a linear SVM and a logistic regression on all 30 features. Independent benchmarks of quantum classifiers point the same way. A quantum kernel is worth testing when the data has structure a classical kernel cannot see, and the test needs equal tuning for both.
What is a quantum support vector machine?
It is a support vector machine whose kernel is computed by a quantum circuit. Each input is encoded as a quantum state, the kernel value is the squared overlap of two states, and a standard SVM solver is trained on the resulting Gram matrix. The circuit only supplies similarities; the learning itself is classical.
What is the bandwidth of a quantum kernel?
It is a factor that multiplies the inputs before they are encoded. A small factor keeps all states close together and makes the kernel nearly constant and almost linear; a large one spreads them so far apart that kernel values concentrate near zero. Tune it like the gamma of an RBF kernel.
Why do quantum kernels get worse with more qubits?
With expressive feature maps, kernel values over different inputs concentrate exponentially towards a fixed value as qubits are added, so the model cannot tell samples apart without exponentially many measurements. Entanglement, global measurements and noise make it worse. Tuning the bandwidth reduces the effect.
Can a QSVM run on real quantum hardware?
Yes, for small problems. The original quantum kernel experiment ran on a superconducting processor, and eigenkit can submit kernel jobs to IBM and IQM devices. The cost is the barrier: a Gram matrix needs n(n-1)/2 circuits for n training samples, about a hundred thousand for 455 samples, each repeated for many shots.
Sources
- V. Havlicek, A. D. Córcoles, K. Temme, A. W. Harrow, A. Kandala, J. M. Chow, J. M. Gambetta. Supervised learning with quantum enhanced feature spaces. Nature 567, 209–212, 2019. arXiv:1804.11326.
- R. Shaydulin, S. M. Wild. Importance of kernel bandwidth in quantum machine learning. Physical Review A 106, 042407, 2022. arXiv:2111.05451.
- S. Thanasilp, S. Wang, M. Cerezo, Z. Holmes. Exponential concentration in quantum kernel methods. Nature Communications 15, 5200, 2024. arXiv:2208.11060.
- H.-Y. Huang, M. Broughton, M. Mohseni, R. Babbush, S. Boixo, H. Neven, J. R. McClean. Power of data in quantum machine learning. Nature Communications 12, 2631, 2021. arXiv:2011.01938.
- J. Bowles, S. Ahmed, M. Schuld. Better than classical? The subtle art of benchmarking quantum machine learning models. arXiv preprint, 2024. arXiv:2403.07059.
- W. Wolberg, O. Mangasarian, N. Street, W. Street. Breast Cancer Wisconsin (Diagnostic). UCI Machine Learning Repository, dataset 17, 1995.
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