Quantum AI / Quantum meets ML
Where quantum computing might help ML.
Reviewed by Yuvaraj
Quantum machine learning (QML) is the attempt to run part of a learning algorithm on quantum hardware in the hope of a speedup or a richer model class. It is a real and active research area, and it is also one of the most over-sold. So the honest headline first, before any of the machinery: as of today there is no demonstrated practical quantum advantage for mainstream machine learning. Nothing running on real quantum hardware beats good classical methods on a task anyone cares about. What follows explains the main approaches people actually pursue, works a real gradient by hand, and then confronts the three results, barren plateaus, dequantization, and the data-loading problem, that keep the promised speedups out of reach. Treat every forward-looking claim here as EMERGING research, not shipping technology.
The dominant approach in the current noisy era is the variational quantum circuit (VQC), also called a parameterized quantum circuit. A circuit with tunable gate angles prepares a state; you measure the expectation value of some observable to get a number; a classical optimizer adjusts to minimize a loss. The quantum computer evaluates the circuit and its gradients; a classical CPU does the optimization. It is a hybrid loop, structurally analogous to training a neural network, except the "layers" are quantum gates.
Ask about this lesson, or about anything in AI. Answers cite the lessons they draw on.
Finished this lesson?
Mark it complete to earn XP, keep your streak, and schedule a review.
The gradient step deserves attention because you cannot backpropagate through physical hardware. The parameter-shift rule gives exact analytic gradients from the same circuit run at shifted angles. For a parameter entering through a Pauli-generated gate (eigenvalues ), the gradient of an expectation is
Note the shift is , not an infinitesimal, this is an exact identity, not a finite-difference approximation.
Take one qubit in , apply a rotation , and measure the observable . The rotation gives
so the expectation value is
Now apply the parameter-shift rule. Using and ,
which is exactly the analytic derivative of . The rule recovers the true gradient with two circuit evaluations. In PennyLane this is the default:
import pennylane as qml
from pennylane import numpy as np
dev = qml.device("default.qubit", wires=1)
@qml.qnode(dev)
def circuit(theta):
qml.RY(theta, wires=0)
return qml.expval(qml.PauliZ(0))
theta = np.array(0.9, requires_grad=True)
print(circuit(theta)) # cos(0.9) ~= 0.6216
print(qml.grad(circuit)(theta)) # -sin(0.9) ~= -0.7833 (parameter-shift)
Two other families come up constantly, each with a catch.
Quantum kernels / feature maps. Encode each data point into a quantum state via a feature-map circuit, then use the squared overlap as a kernel inside an otherwise classical support vector machine. The hope is that a feature space hard to simulate classically yields better separation. The catch: a feature map being hard to compute classically does not imply it generalizes better. Follow-up work found classical methods frequently match quantum kernels, and expressivity without the right inductive bias just overfits.
HHL for linear systems. The Harrow–Hassidim–Lloyd algorithm solves in time polynomial in of the dimension, an apparent exponential speedup. The fine print removes most of the win: you need efficient preparation of the state encoding (loading classical data can cost as much as you hoped to save, the input problem); must be sparse and well-conditioned, since the cost scales with the condition number ; and the output is a quantum state , not the classical vector, so you can only extract summary statistics, not read out every entry (the output problem). HHL is not a drop-in fast linear solver.
| Approach | Core idea | The catch |
|---|---|---|
| Variational circuits | Train a parameterized circuit with a classical optimizer | Barren plateaus and hardware noise block scaling |
| Quantum kernels | Use a hard-to-simulate feature map inside a classical SVM | Hard to compute does not mean better generalization |
| HHL linear solver | Poly-log solution of a linear system in principle | Input loading, sparsity, conditioning, and output readout gut most uses |
The deepest obstacle to training VQCs is the barren plateau. For broad classes of randomly initialized, sufficiently expressive circuits, the gradient of the loss vanishes exponentially with the number of qubits: its variance shrinks like . The loss landscape becomes almost perfectly flat, so a gradient-based optimizer has no reliable direction to move, and the number of measurement shots needed to resolve a real gradient against sampling noise blows up exponentially. This is a fundamental scalability wall, not a tuning inconvenience, and mitigations (shallow or structured ansätze, local cost functions, careful initialization) are active research rather than a solved problem.
For a curious beginner
Imagine searching a vast, almost perfectly flat plateau for a downhill direction. Everywhere you stand it feels level, so you have no idea which way to step. As you add qubits the plateau gets exponentially flatter, and the tiny slope that remains is buried under measurement noise.
How it is actually used
The estimated gradient is dominated by shot noise because its true magnitude is exponentially small. To resolve a useful signal you would need an exponentially growing number of circuit runs, so ordinary gradient-based training simply stops making progress as the model scales up.
The underlying mechanism
For random circuits that form an approximate unitary 2-design, the gradient of the cost concentrates at zero with variance decaying as in the qubit count . With the mean at zero and variance vanishing exponentially, the gradient is exponentially unlikely to exceed the sampling error for any feasible number of shots.
A sobering line of results shows that some celebrated QML speedups were never really quantum. Starting with Ewin Tang's 2018 work on recommendation systems, researchers dequantized several algorithms: they built classical algorithms, using quantum-inspired sampling techniques, that match the quantum poly-logarithmic scaling for the same problems (recommendation systems, low-rank linear algebra, some HHL-based ML). The claimed exponential separation vanished. The lesson is methodological: an apparent quantum speedup is a conjecture until someone proves no comparable classical algorithm exists, and several did not survive that test. "Quantum-inspired" classical results are not quantum-hardware results, and both must be distinguished from genuine, provable separations.
To be explicit about confidence levels. KNOWN: the machinery is real, variational circuits, the parameter-shift rule, quantum kernels, and HHL are well-defined, and small proofs of concept run on today's hardware. EMERGING: whether any of them beats classical ML on a useful task is open and unproven; barren plateaus, noise, data loading, and dequantization each undercut the case. SPECULATIVE: claims of broad, near-term quantum advantage for machine learning. Study QML as a research frontier; do not deploy it expecting speedups.
Common mistakes