Quantum Algorithms Database
Quantum Anomaly Detection
Quantum approaches to identifying unusual or outlier data points within a larger dataset, relevant to fraud detection and system monitoring.
Year
2018
Inventor(s)
Nana Liu and Patrick Rebentrost (quantum anomaly detection); related work by Romero, Olson, and Aspuru-Guzik on quantum autoencoders
Speedup Type
Polynomial Speedup
Difficulty
★★★★☆
Overview
Anomaly detection means finding data points that do not fit the usual pattern, such as a fraudulent transaction, a failing machine, or an unusual particle collision. Classical methods like isolation forests and one-class support vector machines learn what normal looks like and flag deviations. Quantum anomaly detection proposes to do the same with quantum states and quantum subroutines, especially when the data is itself quantum.
The most cited paper, by Nana Liu and Patrick Rebentrost in 2018, treats anomaly detection for quantum states: given many copies of states that are mostly normal, it identifies those that deviate. Other proposals use quantum kernels, quantum autoencoders, or amplitude estimation for classical data. As in much of quantum machine learning, demonstrated advantages on real data are still missing.
The problem it solves
Identifying data points that deviate significantly from the normal pattern in a dataset, without needing labeled examples of what 'abnormal' looks like.
History and background
Liu and Rebentrost published Quantum Machine Learning for Quantum Anomaly Detection in Physical Review A in 2018. They described three algorithms based on quantum principal component analysis, quantum kernel principal component analysis, and quantum autoencoders, and showed that for low-rank data the cost can scale polylogarithmically with the dimension of the quantum states.
Quantum autoencoders were introduced separately by Romero, Olson, and Aspuru-Guzik in 2017 as a way of compressing quantum data. Later applications explored hybrid quantum-classical models for detecting unusual events in high-energy physics data, including experiments on small quantum devices and simulators, and for financial fraud and network intrusion benchmarks. These works generally report performance comparable to classical baselines on small problems.
How it works
Uses quantum kernel methods or density estimation techniques to measure how far a data point's quantum-encoded representation differs from the bulk of the dataset.
A natural way to detect anomalies is to learn the typical structure of the data and measure how far a new point is from it. In principal component analysis, the typical structure is the span of the top principal components, and an anomaly is a point with large weight outside that span.
For quantum data, the typical structure is described by a density matrix averaged over normal states. Quantum principal component analysis extracts its dominant eigenvectors. A new state is projected onto the complement of the dominant subspace, and the probability of being found there is the anomaly score. A high score means the state looks unlike the training states.
A quantum autoencoder follows the same logic with a trained circuit. It compresses normal states into fewer qubits and can reconstruct them accurately, but an anomalous state cannot be compressed without losing information, so the reconstruction error signals an anomaly.
Step by step
- Collect many copies of states or encoded data points that are mostly normal, to define the baseline.
- Build the average density matrix of the normal data, or train a quantum autoencoder or kernel model on it.
- Extract the dominant subspace with quantum PCA, or learn the compression circuit by optimizing parameters on a quantum or hybrid computer.
- For each new test point, project it onto the dominant subspace or compress and decompress it, and measure the overlap or reconstruction fidelity.
- Convert the overlap or error into an anomaly score and compare it with a threshold chosen to balance false alarms and missed detections.
- Flag points above the threshold as anomalies and review them.
A worked example
Suppose a sensor produces quantum states that, when healthy, lie almost entirely in a two-dimensional subspace of a 1,024-dimensional space. Quantum PCA, given copies of the average state, finds that subspace. A new state is tested by measuring the weight outside the subspace. If the weight is 0.02, the state is normal. If it is 0.4, the state is flagged.
With a quantum autoencoder, a circuit is trained to compress healthy states from 10 qubits to 3. A test state that compresses with fidelity of 0.99 is normal, while one with fidelity of 0.6 is an anomaly. The cost depends on training the circuit, which is a variational optimization problem.
Complexity and resources
| Item | Detail |
|---|---|
| Quantum PCA based | Polylogarithmic in dimension for low-rank data, given copies of the density matrix |
| Classical equivalent | Polynomial in dimension for explicit covariance methods; quantum-inspired methods can match low-rank cases |
| Quantum autoencoder | Training cost depends on a variational optimization, with no proven speedup |
| Data requirement | Many copies of quantum states, or efficient encoding of classical data |
| Output | An anomaly score from an overlap or fidelity measurement |
What hardware it needs
- For quantum PCA, a fault-tolerant machine with the ability to prepare many copies of the data states.
- For autoencoders and kernels, small variational circuits on noisy devices are enough for demonstration.
- A classical pipeline for thresholds and evaluation.
Applications
- Detecting faulty states in quantum devices and quantum sensors.
- Screening unusual events in particle physics data.
- Fraud detection and network intrusion as proposed use cases for quantum-enhanced models.
- Monitoring quantum networks and communication channels for tampering.
Limitations and caveats
- No advantage over strong classical anomaly detectors such as isolation forests has been shown on real classical data.
- Loading classical data into quantum states removes much of the theoretical speedup.
- Quantum PCA assumptions are similar to those that dequantization targets.
- Variational models can be hard to train because of barren plateaus.
Common misconceptions
- Quantum anomaly detection is not generally better than classical methods today.
- It does not need labeled anomalies, since it learns from normal data, but it does need a well-defined baseline.
How it compares
- Quantum PCA and quantum kernel methods supply the underlying techniques.
- Classical isolation forests, autoencoders, and one-class SVMs are fast and widely used.
- Quantum k-means and quantum SVM address clustering and classification with similar tools.
Real-world impact
An active research direction for potential applications like fraud detection and network security monitoring, though — like most quantum ML proposals — without demonstrated advantage on real-world datasets yet.
Why it matters
Anomaly detection is among the commercially most important applications of machine learning, so it is a natural target for quantum techniques. The proposals also have a clear niche where quantum data is the input, such as monitoring quantum sensors and devices.
The field illustrates the careful path from idea to evidence: the theory is promising for quantum data, while for classical data the burden is to show a benefit after counting data loading costs.
Frequently asked questions
What is quantum anomaly detection?
A set of quantum algorithms that identify unusual data points by learning a model of normal data and measuring how far new points deviate from it.
Which methods does it use?
Quantum principal component analysis, quantum kernel methods, and quantum autoencoders.
Is it better than classical anomaly detection?
Not demonstrated on real classical data. The strongest case is for quantum data that is already in the form of quantum states.
What is a quantum autoencoder?
A parameterized quantum circuit trained to compress quantum states into fewer qubits and reconstruct them, so that failure to reconstruct signals an anomaly.
Can I try it on current hardware?
Yes, in small demonstrations using variational circuits and simulators, though results are comparable to classical baselines.
Keep learning
- Related algorithm: Quantum Principal Component Analysis
- Related algorithm: Quantum Kernel Estimation
- Related algorithm: Quantum k-Means Clustering
- Related algorithm: SWAP Test
This page is written for educational purposes. Complexity statements describe the best known results at the time of review (September 30, 2026), and research in this area moves quickly, so check recent papers before relying on a specific bound.