Curriculum / Quantum Machine Learning / Quantum Kernels
Quantum Kernels
Quantum-enhanced similarity measures for classification.
Quantum Kernels
Kernel Methods in Classical ML
A kernel function K(x, x') measures similarity between two data points. In classical ML, kernel methods, especially Support Vector Machines (SVMs), use kernels to classify data by finding optimal decision boundaries in a (possibly infinite-dimensional) feature space.
The kernel trick: instead of explicitly computing the feature map , compute the dot product directly. This allows working in very high-dimensional spaces without the computational cost of explicit feature computation.
Common classical kernels:
- •Linear:
- •Polynomial:
- •RBF (Gaussian):
- •Laplace:
The choice of kernel encodes assumptions about data structure. The RBF kernel assumes nearby points are similar with exponentially decaying similarity. Polynomial kernels capture interaction effects.
Quantum Feature Maps
A quantum feature map encodes classical data into a quantum state:
where is a parameterized quantum circuit that depends on the input data x. Each data point maps to a quantum state in an exponentially large Hilbert space ( dimensions for n qubits).
The quantum kernel is the inner product between two such states:
Measuring this quantity requires running a circuit and checking the probability of the all-zeros outcome. This probability equals the kernel value.
The ZZ Feature Map as a Kernel
You already built the standard construction in the Quantum Feature Maps lesson earlier in this track: H on every qubit, single-qubit rotations, then pairwise cx--cx blocks with , repeated twice. Plugged into the definition above, that circuit is : its pairwise cross-terms are what make the resulting kernel hard to reproduce classically.
This is the opening of the lesson. The full walkthrough, the interactive circuit, and the graded challenge continue inside myqubit.
How this lesson works
A guided reading lesson with interactive knowledge checks. Concepts are explained step by step with circuit diagrams and runnable examples, and you confirm understanding before moving on.
Part of: Quantum Machine Learning
Apply quantum computing to machine learning with variational circuits and optimization.
This lesson is part of Pro
Unlock Quantum Machine Learning and all 10 tracks with Pro: $12.99/month, $79/year, or $97 lifetime. Start with the free track first if you are new.