Quantum machine learning (QML) integrates the principles of quantum computing with machine learning algorithms, aiming to exploit quantum mechanical effects for computational advantages. The field draws on the formalism of quantum mechanics—superposition, entanglement, and interference—to represent and process information in ways that classical systems cannot replicate. Although still nascent, QML has produced theoretical results suggesting potential exponential speedups for certain tasks, and experimental demonstrations on small-scale quantum devices are growing.
1.1 Quantum Computing Basics
Quantum computing relies on the laws of quantum mechanics to perform computations. Unlike classical bits, which take values 0 or 1, quantum bits (qubits) can exist in superpositions of states. Operations on qubits are governed by unitary transformations, and measurement collapses the quantum state to a classical outcome.
1.1.1 Qubits and Quantum Gates
| A qubit is a two-level quantum system, described by a state vector \( | \psi\rangle = \alpha | 0\rangle + \beta | 1\rangle\) with \( | \alpha | ^2 + | \beta | ^2 = 1\). Quantum gates are reversible operations represented by unitary matrices. Common single-qubit gates include the Pauli-X, Y, Z gates, the Hadamard gate (H), and phase gates. Two-qubit gates, such as the controlled-NOT (CNOT) and controlled-Z, create entanglement. |
|---|
1.1.2 Superposition and Entanglement
Superposition is the ability of a qubit to be in a linear combination of basis states. Entanglement is a non-classical correlation between qubits such that the state of one cannot be described independently of the others. These phenomena are key resources: superposition enables parallel evaluation of many possibilities, and entanglement allows for correlations that classical systems cannot efficiently simulate.
1.1.3 Quantum Circuits
A quantum circuit is a sequence of quantum gates applied to a set of qubits, followed by measurements. Circuits are the standard model for quantum computation. They are represented as directed acyclic graphs with wires for qubits and nodes for gates. Deep circuits (many sequential gates) are required for complex algorithms, but noise in current devices limits depth.
1.2 Machine Learning Basics
Machine learning (ML) is a subfield of artificial intelligence focused on algorithms that improve through experience. The core tasks include classification, regression, clustering, and generation of data.
1.2.1 Supervised, Unsupervised, and Reinforcement Learning
Supervised learning uses labeled data to train models that map inputs to outputs. Unsupervised learning finds patterns in unlabeled data, such as clusters or latent representations. Reinforcement learning involves an agent learning to take actions in an environment to maximize cumulative reward. QML explores quantum versions of all three paradigms.
1.2.2 Classical Neural Networks and Kernel Methods
Neural networks consist of layers of interconnected nodes (neurons) with adjustable weights, trained via backpropagation. Kernel methods, such as support vector machines (SVMs), map data into high-dimensional feature spaces via a kernel function, enabling non-linear classification. Quantum computing can provide alternative feature maps that are hard to compute classically.
1.3 Motivation for Quantum Machine Learning
The impetus for QML comes from the possibility of achieving computational advantages—either provable speedups or practical improvements—over classical ML algorithms. Two main sources of motivation are the ability to operate in exponentially large Hilbert spaces and the existence of data that is inherently quantum.
1.3.1 Potential Speedups and Feature Spaces
Quantum computers can represent and process information in a \(2^n\)-dimensional Hilbert space with only \(n\) qubits. This enables efficient manipulation of high-dimensional feature maps that are exponentially costly for classical computers. For example, kernel methods that rely on inner products in a quantum feature space may yield classification advantages. Additionally, quantum algorithms such as Grover’s search can speed up certain subroutines in ML, like finding nearest neighbors.
1.3.2 Quantum Data Sources
Data generated by quantum systems—such as outputs from quantum sensors or quantum simulators—is naturally described by quantum states. Classical processing of such data often requires exponential resources. QML algorithms can directly process quantum data, potentially extracting information more efficiently. This motivates applications in quantum chemistry, material science, and fundamental physics.
2.1 Quantum Data Encoding
To process classical data on a quantum computer, the data must be mapped to a quantum state. The encoding method significantly influences the algorithm’s performance and resource requirements.
2.1.1 Amplitude Encoding
| Amplitude encoding represents a classical vector \(\mathbf{x} \in \mathbb{R}^N\) as the amplitudes of a quantum state: \( | \psi_{\mathbf{x}}\rangle = \frac{1}{\|\mathbf{x}\|}\sum_i x_i | i\rangle\), where \( | i\rangle\) are computational basis states. This uses \(\log_2 N\) qubits, making it efficient for large datasets, but the state preparation can be costly. |
|---|
2.1.2 Basis Encoding
In basis encoding, each classical data point is assigned a unique binary string, and the quantum state is a superposition of basis states corresponding to the data. For example, a dataset of bit strings \(\{0,1\}^n\) can be encoded as an equal superposition of those strings. This is straightforward but requires many qubits for high-dimensional data.
2.1.3 Angle Encoding
Angle encoding maps each feature to a rotation angle on a single qubit. For an \(n\)-dimensional vector, a circuit of \(n\) qubits applies rotation gates (e.g., \(R_x\), \(R_y\), \(R_z\)) with angles proportional to the features. The resulting state lives in a low-dimensional space but is easy to implement on current hardware.
2.2 Variational Quantum Circuits
Variational quantum circuits (VQCs) are parameterized quantum circuits whose gate angles can be optimized. They are the workhorse of many QML algorithms, especially on near-term devices.
2.2.1 Parameterized Gates
A parameterized gate, such as \(R_y(\theta)\) or \(R_z(\theta)\), has a free parameter \(\theta\) that can be adjusted. Layers of such gates are interleaved with entangling gates (e.g., CNOT) to form a circuit. The structure (ansatz) can be hardware-efficient or problem-inspired.
2.2.2 Cost Function Measurement
| The output of a VQC is typically the expectation value of an observable, e.g., \(\langle \psi(\boldsymbol{\theta}) | H | \psi(\boldsymbol{\theta}) \rangle\). This value serves as the cost function to be minimized. In ML, the cost might be the cross-entropy loss or mean squared error, computed from measurement outcomes. |
|---|
2.3 Hybrid Classical-Quantum Workflows
Most current QML implementations are hybrid, combining a classical optimizer with a quantum processor.
2.3.1 Optimization Loops
A classical optimizer (e.g., gradient descent, COBYLA) updates the parameters \(\boldsymbol{\theta}\) based on cost values measured from the quantum device. The quantum circuit is executed repeatedly, each time with updated parameters. This loop continues until convergence.
2.3.2 Gradient Estimation (Parameter Shift Rule)
Gradients of the cost function with respect to gate parameters can be estimated using the parameter shift rule. For a gate \(G(\theta)\) with generator \(G\), the derivative is proportional to the difference of two expectation values measured at shifted parameters: \(\partial_\theta \langle H \rangle = \frac{1}{2} \left( \langle H \rangle_{\theta+\pi/2} - \langle H \rangle_{\theta-\pi/2} \right)\). This avoids the need for a quantum gradient circuit and is compatible with noisy hardware.
3.1 Variational Quantum Eigensolver (VQE) and QAOA
VQE and QAOA are variational algorithms originally designed for quantum chemistry and combinatorial optimization, but they also serve as building blocks for QML.
3.1.1 VQE for Ground State Problems
| VQE finds the ground state energy of a Hamiltonian \(H\) by minimizing \(\langle \psi(\boldsymbol{\theta}) | H | \psi(\boldsymbol{\theta}) \rangle\) over a parameterized ansatz. In QML, VQE can be used to learn properties of quantum systems or as a subroutine for kernel methods. |
|---|
3.1.2 QAOA for Combinatorial Optimization
The Quantum Approximate Optimization Algorithm (QAOA) applies alternating layers of problem Hamiltonian and mixing Hamiltonian evolution. It is used to approximate solutions to MaxCut, graph partitioning, and other optimization problems that appear in ML (e.g., clustering).
3.2 Quantum Kernel Methods
Quantum kernel methods leverage a quantum computer to compute inner products in a high-dimensional feature space that is difficult to simulate classically.
3.2.1 Quantum Feature Maps
| A quantum feature map \(\phi(\mathbf{x})\) embeds a classical data point \(\mathbf{x}\) into a quantum state \( | \phi(\mathbf{x})\rangle\). The kernel function is then \(k(\mathbf{x}_i, \mathbf{x}_j) = | \langle \phi(\mathbf{x}_i) | \phi(\mathbf{x}_j) \rangle | ^2\). Designing feature maps that are hard to compute classically is an active area. |
|---|
3.2.2 Quantum Support Vector Machines
A quantum SVM uses the quantum kernel to solve the classical SVM optimization problem. The kernel matrix is estimated by measuring overlaps on a quantum computer, and the dual problem is solved classically. This can yield classification accuracy superior to classical kernels for certain datasets.
3.3 Quantum Neural Networks
Quantum neural networks (QNNs) are VQCs trained to perform tasks such as classification, regression, or function approximation.
3.3.1 Parameterized Quantum Circuit Architectures
Common ansätze include layered hardware-efficient circuits, alternating layers of single-qubit rotations and entangling blocks, and designs inspired by tensor networks. The architecture choice affects expressivity and trainability.
3.3.2 Data Re-uploading
Data re-uploading is a technique of repeatedly encoding classical data into the quantum circuit at multiple layers. This increases the expressivity of the QNN, allowing it to approximate arbitrary functions. The circuit alternates between data-encoding gates and trainable gates.
3.3.3 Training via Hybrid Gradients
QNNs are trained using hybrid gradients: the parameter shift rule estimates quantum gradients, while classical backpropagation handles any classical post-processing. The overall gradient is then used to update parameters in a classical optimizer.
3.4 Quantum Generative Models
Generative models learn the probability distribution of a dataset. Quantum versions may offer advantages in sampling from complex distributions.
3.4.1 Quantum Boltzmann Machines
A quantum Boltzmann machine is a stochastic neural network with visible and hidden units governed by a quantum Hamiltonian. The learning rule involves computing expectation values of the Hamiltonian and its approximations, which can be done on a quantum computer. It can model distributions that classical Boltzmann machines cannot.
3.4.2 Quantum Generative Adversarial Networks (QGANs)
In a QGAN, either the generator, the discriminator, or both are implemented as quantum circuits. The generator produces quantum states that mimic a target data distribution, while the discriminator tries to distinguish real from generated data. The adversarial training loop involves both quantum and classical components.
3.5 Quantum Reinforcement Learning
Quantum reinforcement learning (QRL) adapts quantum computing to the agent-environment interaction framework.
3.5.1 Quantum Exploration Strategies
Quantum superposition can be used to explore multiple actions simultaneously, potentially speeding up the search for optimal policies. Algorithms like quantum amplitude amplification can be applied to evaluate action values more efficiently.
3.5.2 Policy Gradient Methods
In policy gradient QRL, a quantum circuit parameterizes the policy—a mapping from states to action probabilities. The policy is updated using gradient ascent on the expected cumulative reward, with gradients estimated using the parameter shift rule. Hybrid classical-quantum loops handle the environment interaction.
4.1 Quantum Processing Units (Noisy Intermediate-Scale Devices)
Current quantum processors are noisy and limited in qubit count (typically 50–1000 qubits). They are referred to as NISQ devices.
4.1.1 Superconducting Qubits
Superconducting qubits (e.g., transmon, flux qubits) are fabricated on chips and operated at millikelvin temperatures. They offer fast gate times (tens of nanoseconds) and moderate coherence times. Leading platforms include IBM, Google, and Rigetti.
4.1.2 Trapped Ions
Trapped-ion systems confine ions in electromagnetic fields and manipulate them with laser pulses. They have high gate fidelities and long coherence times but slower operations (microseconds). IonQ and Honeywell are major developers.
4.1.3 Photonic Systems
Photonic quantum computers use photons as qubits, manipulated with linear optics and detectors. They operate at room temperature and are well-suited for networking, but suffer from probabilistic gates and photon loss. Xanadu is a notable proponent.
4.2 Classical Simulation and Emulation Platforms
Before deploying on real hardware, QML algorithms are often tested on classical simulators.
4.2.1 State Vector Simulators
State vector simulators store the full \(2^n\)-dimensional state vector, limiting \(n\) to about 30–40 qubits on a typical computer. They are exact but memory-intensive. Examples include Qiskit Aer and QuEST.
4.2.2 Tensor Network Simulators
Tensor network simulators represent quantum states as efficient tensor decompositions (e.g., matrix product states). They can simulate larger systems for shallow circuits or low entanglement, at the cost of approximation errors. Examples include the Tensor Network Library (TN) and Quimb.
4.3 Software Frameworks and Toolkits
Several open-source frameworks facilitate QML research.
4.3.1 Qiskit, Pennylane, Cirq
- Qiskit (IBM): Provides Qiskit Machine Learning module with VQCs, quantum kernels, and gradient computation. Integrates with IBM’s cloud quantum hardware.
- Pennylane (Xanadu): A library for differentiable quantum computing, supporting multiple backends (including simulators and real hardware) and automatic differentiation.
- Cirq (Google): Focuses on NISQ devices, with optimizers for native gates and noise models.
4.3.2 Hybrid Runtime Environments
Hybrid runtimes allow seamless switching between classical and quantum computation. Examples include Qiskit Runtime, which executes a classical optimization loop on IBM’s cloud alongside quantum circuit execution, and Amazon Braket’s hybrid jobs.
5.1 Classification and Regression
QML models are frequently applied to classification and regression tasks on benchmark datasets.
5.1.1 Quantum Variational Classifiers
A variational classifier encodes data into a circuit and measures a set of observables, whose expectation values are fed into a classical softmax layer. The circuit parameters are trained to minimize cross-entropy loss. Experiments on small datasets (e.g., Iris, MNIST reduced) show comparable accuracy to classical models.
5.1.2 Kernel-Based Classification
Quantum kernel methods have been used for binary and multi-class classification. On tasks like handwritten digit recognition (using small images), quantum SVMs with engineered feature maps have achieved competitive performance, especially when the kernel is hard to simulate classically.
5.2 Clustering and Dimensionality Reduction
Unsupervised learning can also benefit from quantum resources.
5.2.1 Quantum k-Means
Quantum k-means uses the quantum nearest-neighbor algorithm (based on Grover search or amplitude estimation) to accelerate the assignment step. The distance computation can be performed in a quantum feature space. Full quantum speedups require fault-tolerant hardware.
5.2.2 Quantum Principal Component Analysis
Quantum PCA computes the principal components of a covariance matrix using density matrix exponentiation and phase estimation. It can be exponentially faster than classical PCA for low-rank matrices, but requires many ancilla qubits and long coherence times.
5.3 Optimization in Science and Engineering
QML bridges quantum computing with real-world optimization.
5.3.1 Portfolio Optimization
QAOA and VQE can be applied to financial portfolio optimization, reducing risk or maximizing return under constraints. Hybrid algorithms combine quantum subroutines with classical stochastic models.
5.3.2 Material and Drug Discovery
VQE is used to compute molecular ground states for drug design and material science. Quantum generative models can propose new molecular structures. QML accelerates the screening of candidate compounds by efficiently evaluating quantum chemical properties.
5.4 Natural Language Processing (Conceptual)
Researchers have proposed QML for NLP tasks, such as encoding word embeddings into quantum states and using circuit-based models for sentiment analysis or text classification. These approaches remain largely theoretical but exploit the high-dimensional Hilbert space to represent semantic relationships.
5.5 Quantum Data Analysis (e.g., from Quantum Sensors)
Quantum sensors produce quantum states that encode measurements (e.g., magnetic field strength). QML algorithms can process sensor outputs directly, performing tasks like parameter estimation or state classification without converting to classical data. This is promising for quantum metrology and imaging.
6.1 Noise, Decoherence, and Error Mitigation
Current quantum devices are affected by noise from environmental interactions and imperfect gate operations.
6.1.1 Error Suppression Techniques
Error mitigation methods, such as zero-noise extrapolation, probabilistic error cancellation, and readout error correction, reduce the impact of noise without full quantum error correction. They are crucial for obtaining meaningful results on NISQ devices.
6.1.2 Quantum Error Correction Overhead
Fault-tolerant quantum computing requires error-correcting codes (e.g., surface codes) that use many physical qubits to encode one logical qubit. The overhead is currently prohibitive for QML, but progress in code efficiency and hardware may eventually enable large-scale, noise-free QML.
6.2 Scalability and Resource Requirements
QML algorithms often require many qubits and deep circuits, which are not available on near-term devices.
6.2.1 Qubit Count and Connectivity
Many QML proposals need hundreds to thousands of qubits. Moreover, connectivity constraints (e.g., nearest-neighbor couplings) limit the implementation of entangling gates, increasing circuit depth through SWAP operations.
6.2.2 Circuit Depth Constraints
Due to limited coherence times, circuit depth must be kept shallow. Deep circuits accumulate noise that washes out quantum advantages. Techniques such as circuit cutting and distributed quantum computing are being explored to mitigate depth issues.
6.3 Algorithmic Advantage and Complexity
Determining when QML outperforms classical ML is an open question.
6.3.1 Provable Speedups vs. Heuristic Gains
Some QML algorithms, such as quantum linear systems solvers or quantum principal component analysis, offer provable speedups under certain conditions. However, many variational QML methods are heuristic, and their advantage over classical neural networks remains unproven and often disputed.
6.3.2 Barren Plateaus and Trainability
Variational QML models can suffer from barren plateaus—regions of exponentially vanishing gradients—which make training intractable. This is linked to the expressivity of the ansatz and the number of qubits. Methods to mitigate barren plateaus include layered ansätze, pre-training, and gradient-free optimizers.
6.4 Open Problems and Integration with Classical ML
The long-term vision of QML is to integrate with classical ML pipelines.
6.4.1 Data Loading Bottleneck
Encoding classical data into quantum states is often inefficient. Amplitude encoding requires deep state preparation circuits, while angle encoding uses many qubits. This “data loading” cost can erase any quantum advantage. Solutions include using quantum random access memory (QRAM) or encoding data in the Hamiltonian.
6.4.2 Benchmarking and Standardization
There is a lack of standardized benchmarks for QML. Comparisons between quantum and classical models are often unfair (e.g., limited qubits vs. classical state-of-the-art). Establishing reproducible benchmarks, problem instances, and metrics is critical for the field’s progress. Integration with classical ML is expected to be incremental, with quantum subroutines accelerating specific bottlenecks rather than replacing entire workflows.