Quantum Support Vector Machines
A quantum support vector machine uses a quantum computer to compute a kernel matrix, then trains a standard maximum-margin classifier classically on that matrix.
Structure of the method
A quantum support vector machine (QSVM) is a hybrid: the quantum device estimates the quantum kernel Gram matrix, and a classical convex optimizer solves the support vector machine dual using that matrix. Because the optimization is unchanged from classical SVMs, the method inherits their strong theory: a unique global optimum, sparse support vectors, and margin-based generalization bounds.
The training procedure
- For every pair of training points, run the overlap circuit to estimate k(x_i, x_j) and assemble the Gram matrix K.
- Solve the quadratic program to find the dual coefficients alpha_i and bias b.
- For a new point z, estimate k(x_i, z) for each support vector and evaluate the decision function sign(sum_i alpha_i y_i k(x_i, z) + b).
The support vectors are the only training points that matter at inference, so prediction cost scales with their number, not the full dataset. But building K costs a number of circuit evaluations that grows with the square of the dataset size, each requiring many shots. This is the dominant practical expense.
A worked outline
# QSVM via a precomputed quantum kernel matrix
from sklearn.svm import SVC
K_train = quantum_gram(X_train, X_train) # each entry from an overlap circuit
clf = SVC(kernel='precomputed')
clf.fit(K_train, y_train)
K_test = quantum_gram(X_test, X_train)
pred = clf.predict(K_test)
Advantages and limits
The clean separation of concerns is the method's strength: all quantum-ness lives in the kernel, and the learning theory is classical and well understood. There are no barren plateaus in a fixed feature map because there is no variational training of the circuit. The weakness is that a fixed kernel cannot adapt to the data the way a trainable model can, and exponential concentration can render the Gram matrix uninformative at scale.
Trainable kernels
A middle path parameterizes the feature map and tunes its parameters to align the kernel with the labels, a technique called kernel-target alignment. This reintroduces a training loop and some of its difficulties but can sharpen the similarity measure. As always, the honest test is whether the resulting classifier beats strong classical kernels on the same data, not merely whether it runs on quantum hardware.