Skip to main contentSkip to user menuSkip to navigation

Quantum ML

Learn quantum ML: quantum computing for machine learning, quantum algorithms, and hybrid classical-quantum systems.

40 min readAdvanced
Not Started
Loading...

What is Quantum Machine Learning?

Quantum machine learning (QML) studies whether quantum information processing can improve a machine learning task. A quantum circuit may encode an input, transform a quantum state, and produce measurements that a classical program turns into a prediction, loss, kernel value, or optimization update.

QML matters because some algorithms have compelling theoretical complexity results and because quantum-native data may contain structure that is expensive to reconstruct classically. The core engineering invariant is stricter: a useful advantage must survive the entire path from input preparation through repeated measurement and must beat a strong classical method at the same quality target.

Most practical QML work today is research. A small circuit or simulator result can establish feasibility, but it cannot by itself establish faster, cheaper, or more accurate end-to-end learning.

Treat phrases such as "quantum parallelism" and "exponential speedup" as claims with assumptions, not as product capabilities. State preparation, error correction, measurement, output size, and the classical baseline all belong in the comparison.

Input

Prepare the state

Count feature loading or quantum-native acquisition

Circuit

Transform amplitudes

Depth, connectivity, compilation, and noise constrain execution

Shots

Estimate observables

Measurement returns samples rather than every amplitude

Evidence

Compare end to end

Match quality, uncertainty, and resource boundaries

Start with the learning problem, not the quantum circuit

A QML proposal is an ML system proposal first. Define the prediction or optimization target, acceptable error, latency or throughput boundary, and data-access model before selecting gates.

Separate three kinds of input

  • Classical records: images, vectors, or graphs must be encoded into a quantum state. Loading cost is part of the algorithm.
  • Quantum-native states: outputs of a quantum sensor, material, or process can sometimes be processed without reconstructing a full classical description.
  • Classically generated problem instances: an optimization objective may be mapped into a Hamiltonian or circuit, but objective construction and decoding remain classical work.

Define success with matched boundaries

  • Compare models at the same predictive quality or solution quality.
  • Include data preparation, compilation, queueing, circuit execution, measurements, mitigation, and classical optimization.
  • Report variability across seeds, calibrations, and repeated hardware jobs.
  • Use a tuned, task-appropriate classical baseline rather than a deliberately weak comparator.

Encoding required

Learn from classical data

Quantum kernels and variational classifiers can process encoded vectors. The experiment must show that encoding and measurement do not erase the proposed gain.

Native state

Learn from quantum data

A circuit can classify or characterize states produced by a quantum process. Avoiding complete classical tomography may be the central research opportunity.

Hybrid search

Optimize a classical objective

QAOA or annealing proposes candidates while classical code constructs the objective, tunes parameters, and validates the result.

Quantum control

Improve a quantum workflow

ML can also help calibrate devices, decode errors, or design circuits. This is machine learning for quantum systems, a related but distinct direction.

A quantum model returns measurements, not a hidden vector

A qubit state is described by amplitudes, but measurement exposes a sampled classical outcome. Many QML models therefore estimate an expectation value: the average result of repeatedly measuring an observable such as a Pauli operator.

For an observable with outcomes +1 and -1, the independent-shot variance is 1 - μ², where μ is the expectation. Increasing shots reduces sampling error approximately with 1 / √shots; it does not remove systematic device error.

Explore the measurement budget

Change backend, shots, and circuit size. Notice when more shots resolve the sign of the signal and when hardware bias becomes the larger error.

Read the result correctly

  • A confidence interval that crosses zero cannot reliably resolve the signal's sign under the model.
  • Doubling shots does not halve uncertainty; approximately four times as many shots are needed.
  • Parameter-shift gradients execute multiple circuits per trainable parameter.
  • Error mitigation can reduce bias while multiplying circuit executions.
  • Device drift and correlated noise can invalidate an independent-shot approximation.
Estimate a measurement and gradient budget

Follow the hybrid quantum-classical training loop

Near-term QML is usually hybrid. Classical infrastructure owns data preparation, orchestration, optimization, evaluation, and experiment tracking; a simulator or quantum processor evaluates selected circuits.

  1. 1

    Classical

    Prepare a bounded input

    Normalize features or acquire a quantum state. Record preparation time, fidelity assumptions, and any compression.

  2. 2

    Quantum

    Execute parameterized circuits

    Compile to the device topology, run observable groups, and retain calibration and queue metadata.

  3. 3

    Measure

    Estimate loss and gradients

    Aggregate repeated shots with uncertainty. Parameter-shift or finite-difference methods multiply circuit evaluations.

  4. 4

    Classical

    Update and decide

    The optimizer proposes new parameters, checks stopping criteria, and compares validation quality with the baseline.

The bottleneck can move each iteration

  • Encoding-bound: state preparation costs more than the circuit saves.
  • Queue-bound: remote hardware latency dominates a small computation.
  • Shot-bound: many observables, gradients, or mitigation variants multiply executions.
  • Optimization-bound: noisy gradients or barren plateaus require too many iterations.
  • Classical-bound: preprocessing, decoding, or baseline search dominates total time.

Choose an algorithm family by its assumption

Similarity

Quantum kernel method

Estimate pairwise similarities with a quantum feature map, then train a classical kernel model. Kernel-matrix size, state preparation, and shots are central costs.

Trainable circuit

Variational quantum model

Optimize circuit parameters from measured losses. Expressivity must be balanced against depth, trainability, and device noise.

Fault-tolerant target

Quantum linear-algebra method

Some algorithms offer strong asymptotic results under efficient data access, condition-number, precision, and output assumptions. Audit each assumption explicitly.

Candidate search

Quantum optimization method

Use QAOA, annealing, or another quantum routine to sample candidate solutions. Compare quality and total resource cost with competitive classical solvers.

Do not collapse different claims

  • A circuit can be hard to simulate classically without solving a useful ML task.
  • Better accuracy on a tiny dataset does not imply computational advantage.
  • An asymptotic speedup may start beyond any useful problem size.
  • Fewer logical operations do not imply lower wall-clock time on noisy hardware.

Gate a quantum-advantage claim with complete evidence

A credible study fixes the task, quality target, hardware boundary, and baseline before looking at the winning run. The claim should be narrow enough to falsify, such as: "For this quantum-native classification task and accuracy target, method A uses fewer measured resources than baseline B."

Design the comparison

Use the gate to see why a circuit-only timer and a naive baseline cannot support an end-to-end advantage claim. Then select a complete boundary, competitive baseline, and enough repeated trials.

Report evidence rather than a winner label

  • Publish solution or prediction quality with confidence intervals.
  • Report total elapsed time and the resource breakdown.
  • Disclose state-preparation, mitigation, hyperparameter, and baseline-search budgets.
  • Separate simulator evidence from hardware evidence.
  • Release seeds, device calibration context, and failed runs when possible.
Block incomplete advantage claims

Recognize the failure modes before scaling

Noise changes the objective

  • Gate, decoherence, and readout errors can bias expectation values.
  • Deeper circuits accumulate more error and may compile into many native operations.
  • Error mitigation estimates a less biased result by spending more executions; it is not full error correction.

Optimization can become uninformative

  • Barren plateaus: gradients can concentrate near zero as some circuit families grow.
  • Shot noise: finite measurements can hide a useful gradient direction.
  • Optimizer mismatch: methods that work on deterministic losses may react poorly to noisy estimates.
  • Calibration drift: the effective objective can change during a long experiment.

Classical simulation remains a moving baseline

Tensor-network, stabilizer, and problem-specific simulators can handle important circuit families more efficiently than generic state-vector simulation. A claim must compare with the best applicable classical method, not only brute-force simulation.

Fault tolerance changes the resource model

Fault-tolerant algorithms reason in logical qubits and logical operations. Physical-qubit overhead, magic-state production, decoding, and error-correction cycles can dominate a practical estimate. Keep logical complexity and hardware resource estimation as separate artifacts.

Build a responsible QML experiment

  1. 1

    Baseline

    Establish a classical floor

    Tune an appropriate classical model or solver and record quality, compute, search budget, and variability.

  2. 2

    Correctness

    Validate the circuit on a simulator

    Check encoding, observables, gradients, and small-instance behavior without claiming hardware performance.

  3. 3

    Evidence

    Profile the complete hardware path

    Measure compilation, queues, shots, mitigation, retries, optimizer iterations, and output processing.

  4. 4

    Decision

    Scale only the surviving hypothesis

    Continue only when the same narrow claim survives matched quality, repeated trials, and competitive baselines.

Select tools by responsibility

  • Circuit construction: Qiskit, Cirq, and similar SDKs describe and compile circuits.
  • Differentiable hybrid models: PennyLane and related libraries connect circuit evaluations to classical autodiff workflows.
  • Managed execution: cloud quantum services provide simulator and hardware queues; preserve backend and calibration metadata.
  • Classical orchestration: NumPy, JAX, PyTorch, experiment trackers, and workflow systems still own most of the surrounding ML system.

The best first QML milestone is often a negative result with a trustworthy benchmark. It identifies which assumption failed and prevents a larger experiment from optimizing the wrong boundary.

No quiz questions available
Could not load questions file
Spotted an issue or have a better explanation? This page is open source.Edit on GitHub·Suggest an improvement