Application

Breast cancer classification with a quantum SVM: a benchmark against classical models

We tested a quantum kernel SVM (QSVM) on 4 and 8 qubits, simulated exactly, against tuned classical models on the Wisconsin diagnostic breast cancer data, over ten splits. At this size the quantum kernel scores as well as an RBF SVM given the same PCA components, and below a plain linear SVM or logistic regression on all 30 features; an untuned hybrid quantum network scored lowest. It is a research benchmark on a public 1995 dataset: it says how the methods compare at this scale, not what larger circuits or other data could do, nothing about diagnosing anyone, and the same test runs on your own data.

Updated

Results at a glance

Best model
Logistic regression on all 30 features, balanced accuracy 0.980
Best quantum model
QSVC with the AngleCNOT map on 8 PCA components, 0.970, against the RBF SVM's 0.974 on the same components
Missed malignant tumours
Of 42 per test split, from 1.2 tumours (logistic regression) to 2.1 tumours (4-qubit QSVC) among tuned models
Hybrid quantum network, untuned
Balanced accuracy 0.946 on 8 qubits, the lowest in the table; untuned, so a floor for that architecture
Size of one error
One test tumour is 1/114 of accuracy, just under 0.9 points, so most gaps between the SVMs are a single tumour or less.

The dataset and the question

The Wisconsin diagnostic breast cancer data has 569 tumours, 212 malignant and 357 benign. Each has 30 real-valued features describing the cell nuclei in a digitised image of a fine needle aspirate: radius, texture, perimeter, smoothness and so on, each as a mean, a standard error and a worst value[1]. It ships with scikit-learn and with eigenkit as breast_cancer_wisconsin, so every number here can be rerun without a download.

It is a popular showcase for quantum machine learning because it is small, binary and public. It is also nearly linearly separable: a plain logistic regression gets close to the ceiling, which leaves little room for any model to win and makes it a good test of whether a quantum model at least keeps up. The question we asked: does eigenkit's quantum kernel SVM classify these tumours better than tuned classical models, when every model gets the same split, the same features and the same tuning budget?

The quantum model is a support vector machine whose kernel is the overlap of two quantum states, each prepared from one tumour's features[2]. A circuit needs one qubit per input, so the 30 features are reduced with PCA to 4 or 8 components first, and the classical models get the same components as well as the full 30. The QSVM vs SVM comparison explains the method and the benchmarking rules in detail; this page is the result on this one dataset.

Every model on the same splits

Ten seeds, each a stratified split of 455 training and 114 test tumours with 42 malignant in every test set. SVMs and logistic regression were tuned by 5-fold cross-validation on the training rows, with the same C grid and, for both kernel types, the same six bandwidths. Mean ± standard deviation over seeds. Fit time is the whole grid search plus the final fit, on a shared laptop CPU; the hybrid network's is a single training run.

Model and inputsBalanced accuracyROC-AUCMissed malignant (of 42)Fit time
QSVC, ZZ map, 4 qubits, PCA 40.961 ± 0.0180.995 ± 0.0052.1 ± 1.21.24 s
QSVC, AngleCNOT map, 4 qubits, PCA 40.965 ± 0.0170.995 ± 0.0031.8 ± 1.21.37 s
HQNC, 4 qubits, not tuned, PCA 40.925 ± 0.0200.986 ± 0.0095.1 ± 1.27.69 s
RBF SVM, PCA 40.964 ± 0.0140.995 ± 0.0042.0 ± 1.20.43 s
Logistic regression, PCA 40.971 ± 0.0160.995 ± 0.0031.6 ± 1.30.06 s
QSVC, ZZ map, 8 qubits, PCA 80.969 ± 0.0130.997 ± 0.0031.9 ± 1.010.89 s
QSVC, AngleCNOT map, 8 qubits, PCA 80.970 ± 0.0100.998 ± 0.0021.9 ± 0.96.53 s
HQNC, 8 qubits, not tuned, PCA 80.946 ± 0.0200.992 ± 0.0053.6 ± 1.684.84 s
RBF SVM, PCA 80.974 ± 0.0110.998 ± 0.0021.7 ± 0.80.47 s
Logistic regression, PCA 80.978 ± 0.0120.998 ± 0.0011.3 ± 1.20.06 s
Linear SVM, all 30 features0.977 ± 0.0120.998 ± 0.0021.4 ± 0.80.09 s
Logistic regression, all 30 features0.980 ± 0.0100.998 ± 0.0011.2 ± 0.80.07 s
Random forest, defaults, all 30 features0.965 ± 0.0110.990 ± 0.0101.9 ± 0.70.06 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). The quantum kernels tie the classical kernels on the same components; the linear models on all 30 features are the best rows. The linear SVM on 4 and 8 components is in the QSVM vs SVM comparison.

What the numbers say

The quantum kernel keeps up, and no more. On 4 components, both quantum feature maps land within a fraction of a point of the RBF SVM; on 8 components the RBF SVM is slightly ahead. None of the four QSVC rows is above its classical row on average, and the paired per-seed differences are within one or two test tumours.

PCA costs more than the kernel choice. Going from 4 to 8 components helps every model by more than the gap between the kernels, and the linear models on all 30 features do best of all. Matching them feature for feature would take a 30-qubit kernel, which a laptop can no longer simulate quickly and which would concentrate badly at most bandwidths.

The tuned quantum kernel picked its most classical setting. Cross-validation chose one of the two smallest bandwidths in nearly every run. There the encoded states hardly differ, kernel values stay close to 1 and the kernel acts like a smooth low-order function of the inputs, which is what a linear or RBF kernel already provides. At large bandwidths the 8-qubit ZZ kernel's values fall towards zero, the exponential concentration that limits expressive quantum kernels[3] and the kernel cousin of the barren plateau.

The hybrid network is a lower bound. The hybrid quantum neural network (HQNC) used the settings of eigenkit's own breast cancer example and was not tuned, because one 8-qubit training run took longer than the whole grid search of any SVM. It missed the most malignant tumours. Tuning would likely raise it, so read its rows as a floor for that architecture, not its best result.

What this does not show

No quantum advantage, and no evidence against one in general. This is one small tabular dataset that a linear model nearly solves, two feature maps, and kernels computed exactly on a noiseless statevector simulator. Shot noise and device noise on hardware would make the quantum rows worse, not better. The result agrees with independent benchmarks in which out-of-the-box classical models did better than the quantum classifiers tested[4], and with the wider picture in the guide on when quantum machine learning makes sense.

The uncertainty is larger than the spreads suggest. The ten splits share most of their rows, so the standard deviations over seeds understate how much the scores would move on new data, and the paired test p-values in the run are not corrected for multiple comparisons. Older write-ups of this use case also paired the quantum kernel with an HHL-based least-squares SVM; eigenkit has no such classifier, and the HHL page explains why reading out its solution cancels the promised speed-up.

What would change this result

The signal to look for is a quantum kernel that beats a tuned classical kernel on the same components, over several splits, by more than one or two test tumours. Here it did not. Three things could move that, and each can be tested rather than assumed.

Data with structure a quantum feature map matches. This dataset is nearly linear, so a smooth classical kernel already fits it. The original quantum kernel study used data generated to be separable by its own feature map[2]; on real data the open question is whether such structure exists. The test is the one on this page: the same split, a tuned RBF and linear model next to the quantum kernel, several seeds.

More qubits without losing the kernel. PCA cost more than the kernel choice, so a wider circuit that keeps more of the 30 features could help. Wider feature maps also concentrate: kernel values crowd together, and telling them apart can take a number of shots that grows exponentially with the qubits[3]. A wider kernel has to keep a narrow bandwidth, and its spread of kernel values is worth checking before its accuracy.

Real hardware. Every kernel entry is a circuit run, estimated from shots, and gate noise pulls values away from the exact ones used here. Before planning on a QPU, check which devices 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 kernel.In eigenkit: pip install "eigenkit[router]", then provider=RouterConfig(device=...) (docs).

Count the missed tumours yourself

Python
from sklearn.decomposition import PCA
from sklearn.metrics import balanced_accuracy_score, confusion_matrix
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC

from eigenkit import QSVC
from eigenkit.datasets import load_dataset

data = load_dataset("breast_cancer_wisconsin", test_size=0.2, random_state=0)
X_train, y_train, X_test, y_test = data["X_train"], data["y_train"], data["X_test"], data["y_test"]
print(f"train {len(y_train)}, test {len(y_test)}, malignant in test {(y_test == 0).sum()}")

models = {
    # 4 PCA components on 4 qubits; scale 0.1 and C 100 are what the tuned runs chose most often
    "QSVC, PCA 4": make_pipeline(StandardScaler(), PCA(n_components=4), StandardScaler(),
                                 QSVC(feature_map="AngleCNOT", reps=2, scale=0.1, C=100)),
    "Linear SVM, all 30": make_pipeline(StandardScaler(), SVC(kernel="linear", C=0.1)),
}
for name, model in models.items():
    pred = model.fit(X_train, y_train).predict(X_test)
    missed = confusion_matrix(y_test, pred, labels=[0, 1])[0, 1]  # label 0 is malignant
    print(f"{name}: balanced accuracy {balanced_accuracy_score(y_test, pred):.3f}, missed malignant {missed}")

One split and fixed settings, so it runs in about a second on a laptop CPU with pip install eigenkit[qml]. It prints the split (455 training and 114 test tumours, 42 of them malignant) and, for each model, its balanced accuracy and the malignant tumours it called benign. On the run we checked, both models missed the same number of malignant tumours and the linear SVM had the higher balanced accuracy. Change random_state to see how much one split moves the scores.

Questions

Can quantum machine learning classify breast cancer better than classical models?

Not in our benchmark, with 4- and 8-qubit kernels on a simulator. On the Wisconsin diagnostic data, a quantum kernel SVM tied an RBF SVM on the same PCA components, and a linear SVM or logistic regression on all 30 features did better than every quantum model. The dataset is nearly linearly separable, so there is little room for any model to win; data with less simple structure is the more informative test.

What accuracy does QSVM get on the Wisconsin breast cancer dataset?

In our ten-seed run its balanced accuracy was within one test tumour of the RBF SVM on the same 4 or 8 PCA components and below the linear models on all 30 features; the results table on this page has the exact values. A single split with 114 test tumours moves accuracy by almost a point per tumour, so a single-split score says little about which model is better.

Why use PCA before a quantum SVM?

Because the feature map uses one qubit per input, and simulating or running 30 qubits per kernel entry is expensive. PCA to 4 or 8 components keeps the circuit small, but in our run every model scored lower on 4 components than on 8, and the best scores came from classical models on all 30 features.

Is this model suitable for diagnosing breast cancer?

No. It is a benchmark of machine learning methods on a public dataset from 1995 with small test sets. None of the models is validated for clinical use, and none should be used to make decisions about patients.

Do I need a quantum computer to run this benchmark?

No. Everything here ran on eigenkit's built-in statevector simulator on a laptop, with exact kernel values. A 4-qubit kernel SVM fits in milliseconds. On hardware, the training kernel alone would need about a hundred thousand circuits for 455 training tumours, each repeated for many shots.

Sources

  1. W. Wolberg, O. Mangasarian, N. Street, W. Street. Breast Cancer Wisconsin (Diagnostic). UCI Machine Learning Repository, dataset 17, CC BY 4.0, 1995.
  2. 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.
  3. S. Thanasilp, S. Wang, M. Cerezo, Z. Holmes. Exponential concentration in quantum kernel methods. Nature Communications 15, 5200, 2024. arXiv:2208.11060.
  4. J. Bowles, S. Ahmed, M. Schuld. Better than classical? The subtle art of benchmarking quantum machine learning models. arXiv preprint, 2024. arXiv:2403.07059.

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