Quantum Machine Learning: How It Works
Photo: N43 and HermesUnderstand feature maps, quantum kernels, variational circuits, and the data, noise, and benchmarking constraints behind QML claims.
FIG 1 · QML alternates classical data and optimization with quantum state evolution and measurement.
FIG 2 · Qubit counts for a two-feature toy example: basis/angle use one qubit per feature; amplitude can pack two amplitudes into one qubit, but state preparation is not free.
FIG 3 · Illustrative 1/√shots behavior; actual error depends on the observable and distribution.
01 What “quantum machine learning” means
Quantum machine learning is an umbrella, not one algorithm. It includes quantum subroutines inside classical learning pipelines, quantum-enhanced feature maps and kernels, variational quantum classifiers, quantum generative models, and proposals that use quantum data. The common pattern is to encode information into a quantum state, apply a trainable or problem-specific circuit, measure an output, and use classical optimization around the device.02 Encoding is the first bottleneck
A qubit does not accept an arbitrary floating-point row for free. Angle encoding maps features to gate rotations; amplitude encoding can use fewer qubits but requires a state-preparation routine; basis encoding is simple but discrete. Data loading can dominate the alleged speedup. Before comparing models, count circuit executions and ask whether the classical data-to-state map is cheaper than the classical model you are replacing.03 A minimal variational classifier circuit
import numpy as np
from qiskit import QuantumCircuit
from qiskit.circuit import ParameterVector
from qiskit.quantum_info import Statevector x = ParameterVector("x", 2) # classical feature angles
w = ParameterVector("w", 2) # trainable weights
qc = QuantumCircuit(2)
qc.ry(x[0], 0); qc.ry(x[1], 1) # data encoding
qc.cx(0, 1) # entangling feature map
qc.ry(w[0], 0); qc.ry(w[1], 1) # variational layer
qc.measure_all() # Bind real samples before execution; optimize w classically.
ready = qc.assign_parameters({x[0]: 0.3, x[1]: -0.8, w[0]: 0.2, w[1]: -0.1})
print(Statevector.from_instruction(ready.remove_final_measurements(inplace=False)))The code shows the architecture, not a complete accuracy claim. A training loop would bind each sample, execute many shots, compute a loss from measured expectations or class probabilities, and update w with a classical optimizer. For a reproducible experiment, freeze the train/test split, random seeds, backend, shot count, transpilation settings, and classical baseline.
04 Kernels, circuits, and the classical boundary
A quantum kernel compares states through an estimated overlap or a related measurement. A variational model instead learns circuit parameters end-to-end. Both are hybrid: data preparation and optimization are classical; measurement is statistical; the quantum circuit is a feature map or nonlinear transformation in Hilbert space. Qiskit’s machine-learning stack exposes quantum kernels and neural-network primitives, but APIs and backend capabilities change quickly.05 Where a quantum advantage could hide
The strongest arguments are conditional. A quantum feature map may make a decision boundary difficult for a chosen classical kernel, or a quantum-native dataset may be expensive to simulate classically. But “higher-dimensional feature space” is not itself an advantage: classical random features and tensor methods also expand representations. A credible claim needs a task, data-access model, complexity argument, and a comparison against tuned classical models.06 The limitations practitioners hit first
Noise, finite shots, barren plateaus, trainability, qubit connectivity, and repeated circuit latency all matter. Small datasets make statistical conclusions fragile; large classical datasets make loading expensive. A simulator can be exponentially costly even when the circuit is short. Hardware noise may erase the margin, while a flexible classical model can memorize the same benchmark. These are engineering constraints, not footnotes.07 A sober evaluation checklist
Use accuracy, calibration, and wall-clock cost—not accuracy alone. Compare logistic regression, SVMs, tree ensembles, and a neural baseline with tuned hyperparameters. Report the number of qubits, circuit depth, shots per example, optimizer evaluations, and preprocessing. Test robustness to label noise and distribution shift. If the quantum model wins, publish the complete feature map and training script so the result can be reproduced rather than narrated as inevitability.References & further reading
- Wikipedia · Quantum machine learning — taxonomy, quantum kernels, and limitations.
- Qiskit Machine Learning documentation — quantum kernels, neural networks, and classifiers.
- Qiskit · Quantum machine learning course — feature maps, variational circuits, and hybrid workflows.
- Kurzgesagt · Quantum Computers Explained – Limits of Human Technology — 19M views observed in YouTube search; broad popular context for quantum algorithms and applications.
By N43 and Hermes for Sailor Bob News.





