# Quantum Machine Learning

Quantum PCA could be exponentially faster than classical PCA on paper

Jacob Biamonte, Peter Wittek, Nicola Pancotti, Patrick Rebentrost, Nathan Wiebe, Seth Lloyd · arXiv · 2016-11-28

- **Problem** Quantum speedups for machine learning have only been shown in idealized complexity results. The yardstick classical algorithm is often unknown, and real hardware cannot yet confirm any advantage.
- **Method** qPCA loads a random data vector into a quantum state with qRAM. It then uses density matrix exponentiation and phase estimation to extract principal components and their eigenvalues.
- **Results** The authors give qPCA a complexity of O((log d)^2) against O(d^2) for classical PCA. The qRAM load itself still costs O(d) operations.

## Why a speedup is hard to pin down

The hope behind quantum machine learning is that a quantum processor might recognize patterns that a classical machine can't. Quantum algorithms are believed to outperform classical ones on some specific problems, and that potential is called quantum speedup. The catch is that a speedup needs the best classical algorithm as a yardstick, and for machine learning that yardstick is often unknown.

Shor's factoring case shows the same gap: no subexponential classical algorithm is known, yet none is ruled out.

Because real benchmarks need working hardware, speedups are usually stated with query complexity and gate complexity instead. Query complexity counts queries to the information source, and a quantum speedup means fewer such queries than the classical algorithm needs. Gate complexity counts elementary quantum operations, but neither measure says how a real device would scale.

So the resources classical machine learning needs are mostly measured numerically, and the same will likely hold for quantum methods.

## Linear algebra as the common building block

Many learning methods are matrix operations on vectors, and quantum mechanics is also built from matrix operations on vectors. An n-qubit state is a vector in a \\(2^n\\)-dimensional complex space, and each gate or measurement multiplies it by a \\(2^n \\times 2^n\\) matrix. Building on this, quantum computers can perform Fourier transforms, eigenvector and eigenvalue finding, and linear equation solving in time polynomial in n.

The best-known of these is the HHL algorithm, which solves linear systems of equations. Its original version assumed a sparse, well-conditioned matrix, and sparsity is unlikely in data science. Later variants relaxed sparsity to low-rank matrices, and this relaxation is what lets the subroutines reach more learning tasks.

It expands \\(\|b\\rangle\\) in the eigenvectors of A, runs phase estimation to read each eigenvalue \\(\\lambda\_n\\), and rotates an ancillary qubit by \\(\\arcsin(\\Lambda/\\lambda\_n)\\). If the ancillary qubit reads 1, each eigencomponent is divided by its eigenvalue, which applies the inverse. Amplitude amplification then needs \\(O(\\\|A\\\|/\\Lambda)\\) repetitions, which is the condition number of the matrix.

HHL takes \\(O((\\log N)^2)\\) quantum steps to output the solution state, compared to \\(O(N\\log N)\\) steps for the best known classical method.

## Quantum PCA, step by step

Principal component analysis diagonalizes the covariance matrix \\(C=\\sum\_j \\vec v\_j \\vec v\_j^{\\,T}\\) built from data vectors \\(\\vec v\_j\\) in d dimensions. The eigenvectors with large eigenvalues are the principal components, which compress the data and help predict future behavior.

qPCA picks one data vector at random and loads it into a quantum state with qRAM, giving a state on \\(\\log d\\) qubits. Because the vector is chosen at random, the averaged density matrix \\(\\rho=(1/N)\\sum\_j \|v\_j\\rangle\\langle v\_j\|\\) equals the covariance matrix up to an overall factor. Density matrix exponentiation, combined with quantum phase estimation, then splits a data state into principal components and their eigenvalues.

The properties of those components are probed by measuring the quantum representation of the eigenvectors.

The authors give qPCA a complexity of \\(O((\\log d)^2)\\) in both computational and query complexity. That is the basis for calling it exponentially more efficient than classical PCA, which scales as \\(O(d^2)\\). The qRAM load itself needs \\(O(d)\\) operations spread over \\(O(\\log d)\\) parallel steps, so it carries a cost of its own.

## Quantum support vector machines

The support vector machine seeks a separating hyperplane with the largest margin, and kernel functions let it fit nonlinear boundaries. A first quantum version used a variant of Grover's search and needed about \\(\\sqrt{N}/s\\) iterations to find s support vectors among N vectors.

The least-squares quantum support vector machine instead builds on qBLAS, with data loaded from qRAM or prepared by a quantum subroutine. Quantum phase estimation and matrix inversion (HHL) process the data, and the authors state that construction and testing can take poly(log N) time. Polynomial and radial basis function kernels are also discussed, along with Gaussian process regression.

The approach was demonstrated experimentally in a nuclear magnetic resonance testbed on a handwritten digit recognition task. That is a small proof of concept, not a measured scaling advantage.

## Quantum Boltzmann machines and their training

A classical Boltzmann machine is a set of bits with tunable interactions, trained until its thermal statistics match the data. Quantizing it means writing the network as interacting quantum spins, a tunable Ising model. The input neurons are fixed, the system is allowed to thermalize, and the output qubits are read out.

Training minimizes the quantum relative entropy \\(S(\\rho\_{train}\\\|\\sigma)\\) between the training state and the model state \\(\\sigma = e^{-\\sum\_j w\_j H\_j}/\\mathrm{Tr}(e^{-\\sum\_j w\_j H\_j})\\). The relative entropy itself is hard to learn experimentally, but its gradient is easier to estimate from expectation values and a simulator for \\(\\mathrm{Tr}(\\sigma H\_j)\\).

Gradient descent then updates the weights as \\(\\vec w \\to \\vec w - \\eta\\nabla S\\) with \\(\\eta\>0\\).

The stated efficiency rests on stoquastic Hamiltonians, whose off-diagonal matrix elements are real and non-positive in the standard basis. For non-stoquastic Hamiltonians, the authors note that no efficient classical analogue is known in general.

The authors show one training run on a random state, a uniform mixture of 4 random states drawn from the Haar measure. Fewer than 10 gradient steps (epochs) were enough to approximately generate that state with a complete set of Hamiltonian terms. This is one run on one state, and the text gives no classical training baseline for it.

The authors expect quantum methods could make thermalization quadratically faster than classical counterparts, a possibility they draw from prior work. Quantum Boltzmann machines also output quantum states, which lets them learn to generate states of a wide range of systems.

## Hardware that could run these methods

Quantum annealers with about 2000 qubits have been built and operated on integrated superconducting circuits. A D-Wave device has run a deep quantum learning protocol on more than a thousand spins. Connectivity and more general tunable couplings remain the main challenges for annealers.

Programmable photonic arrays with about 100 tunable interferometers exist in silicon, but optical loss limits how far they scale. Gate-based machines of 50-100 qubits are projected to become available through cloud computing.

A qRAM for N data items uses a branching array of 2N quantum switches that must operate coherently during a call. A memory call takes \\(O(\\log\_2 N)\\) time and tolerates error rates up to \\(O(1/\\log\_2 N)\\) per switching operation. Proof-of-principle qRAM demonstrations exist, but building large arrays of switches is still difficult.

Heuristic search reached gate fidelity above 99.9% for nearest-neighbor coupled superconducting artificial atoms in the presence of noise. The authors connect that level to an accepted threshold for fault-tolerant quantum computing.

## Limits on practical advantage

HHL's solution is a quantum state, and reading the full vector needs \\(O(N)\\) repetitions. So HHL mainly yields features such as moments of the solution or expectation values, and least squares fitting avoids this by giving a smaller output. The input vector also has to be prepared, which may be expensive, and the matrix must be well conditioned with \\(e^{-iA}\\) efficiently simulatable.

The HHL scaling of \\(O((\\log N)^2)\\) is attractive, but current cost estimates for practical problems are described as prohibitive. One proposed realization of HHL, without significant optimization effort, grows the circuit size and depth overhead to 1025.

Loading classical data can require exponential time, and qRAM may be too costly for big data. The output problem is that learning the full solution as a bit string needs an exponential number of bits. Summary statistics may sidestep this, but more work is needed.

Little is known about the actual gate counts of these algorithms, so the crossover point with classical methods is still open. Benchmarking against modern heuristic methods is also hard, and lower bounds for quantum machine learning would partly help.

Most speedups are idealized complexity results, and the training run in Box 3 is the one computation the authors report themselves.

## Paper info

- **Authors**: Jacob Biamonte, Peter Wittek, Nicola Pancotti, Patrick Rebentrost, Nathan Wiebe, Seth Lloyd
- **Venue**: arXiv · Preprint
- **First published**: 2016-11-28
- **Added**: 2026-11-11
- **Updated**: 2018-5-10
- **Version**: v2
- **arXiv**: 1611.09347
- **DOI**: 10.1038/nature23474
- **Category**: quant-ph · cond-mat.str-el · stat.ML
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1611.09347v2) · [PDF ↗](https://arxiv.org/pdf/1611.09347v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Jacob Biamonte, Peter Wittek, Nicola Pancotti, Patrick Rebentrost, Nathan Wiebe, Seth Lloyd (2016). Quantum Machine Learning. arXiv:1611.09347v2. https://doi.org/10.1038/nature23474

**BibTeX**

```
@article{biamonte2016quantum,
  title = {{Quantum Machine Learning}},
  author = {Jacob Biamonte and Peter Wittek and Nicola Pancotti and Patrick Rebentrost and Nathan Wiebe and Seth Lloyd},
  year = {2016},
  eprint = {1611.09347},
  archivePrefix = {arXiv},
  doi = {10.1038/nature23474},
  url = {https://arxiv.org/abs/1611.09347v2}
}
```

## Other paper commentary

- [Categorical Reparameterization with Gumbel-Softmax](https://refivu.com/en/papers/c907a642-9316-44dc-97d4-0d4eebe881fa-categorical-reparameterization-with-gumbel-softmax.md)
- [A Survey Of Methods For Explaining Black Box Models](https://refivu.com/en/papers/e8fafeb3-dfaa-4e9a-b461-dc36765f1ed6-a-survey-of-methods-for-explaining-black-box.md)
- [Explanation in Artificial Intelligence: Insights from the Social Sciences](https://refivu.com/en/papers/97a0e87f-2056-41e6-ba4d-00a7f2aa4ab0-explanation-in-artificial-intelligence-insights-from-the.md)
- [MissForest - nonparametric missing value imputation for mixed-type data](https://refivu.com/en/papers/ab5b3748-ade4-4bb9-b016-975b4f82baee-missforest-nonparametric-missing-value-imputation-for-mixed.md)
- [Federated Machine Learning: Concept and Applications](https://refivu.com/en/papers/d845d53f-b001-4e9b-be12-12d49f74b856-federated-machine-learning-concept-and-applications.md)
- [A Comprehensive Survey on Transfer Learning](https://refivu.com/en/papers/c3ef16ed-6b27-4ef6-a0f1-b20616ba3e47-a-comprehensive-survey-on-transfer-learning.md)
- [Markerless tracking of user-defined features with deep learning](https://refivu.com/en/papers/9875063c-f7bc-4b74-ac4c-90b07da3fab3-markerless-tracking-of-user-defined-features-with-deep.md)
- [Bottom-Up and Top-Down Attention for Image Captioning and Visual Question Answering](https://refivu.com/en/papers/6c6f90a1-fe13-482d-9dc4-046620898e40-bottom-up-and-top-down-attention-for-image.md)
- [SwinIR: Image Restoration Using Swin Transformer](https://refivu.com/en/papers/16285f4a-51a3-41dc-9740-c5a9259d2b18-swinir-image-restoration-using-swin-transformer.md)
- [Unsupervised Domain Adaptation by Backpropagation](https://refivu.com/en/papers/5b06ce85-04aa-40bd-a8ba-094e15a092f1-unsupervised-domain-adaptation-by-backpropagation.md)
- [GhostNet: More Features from Cheap Operations](https://refivu.com/en/papers/54dc4d80-177d-40dc-bde2-a797c18077da-ghostnet-more-features-from-cheap-operations.md)
- [Visual Genome: Connecting Language and Vision Using Crowdsourced Dense Image Annotations](https://refivu.com/en/papers/f53fd829-f514-4443-ae13-a5df28e84536-visual-genome-connecting-language-and-vision-using.md)

## Terms in this paper

- [gradient descent](https://refivu.com/en/terms/7557852c745c-gradient-descent)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/4a48fd95-dc32-4a89-a21e-fd794e33df6d-quantum-machine-learning)
