- Algorithms
Quantum Neural Network
A parameterized quantum circuit whose gate angles are trained via gradient-based optimization to minimize a loss function, used as a trainable model for learning tasks.
Quantum neural networks (QNNs) are the quantum computing field’s answer to deep learning: trainable circuit architectures where the parameters (rotation angles on qubit gates) are updated by gradient descent to fit a dataset or optimize an objective. The analogy to classical neural networks is structural: an encoding layer maps input data to qubit states, variational layers apply parameterized entangling operations, and a measurement layer produces an output. The hope is that the exponentially large Hilbert space acts as an implicit high-dimensional feature space that classical networks cannot access efficiently.
As of 2026, this hope remains unvalidated for practical tasks. QNNs are actively studied, widely implemented, and deeply problematic in ways that are instructive for understanding the limits of near-term quantum machine learning.
The details
A typical QNN circuit has three components:
- Encoding layer: Classical data is embedded into qubit rotations, for example via angle encoding on qubit , or amplitude encoding into the state vector.
- Variational layers: repeated blocks of parameterized single-qubit rotations , interleaved with fixed entangling gates (CNOT or CZ in a chosen topology).
- Measurement: Expectation values are computed and combined into a scalar output.
Gradients with respect to parameters are computed via the parameter-shift rule, which requires two circuit evaluations per parameter:
This rule is exact (not a finite-difference approximation) and is natively supported by PennyLane, the primary framework for QNN research. A minimal PennyLane QNN looks like:
import pennylane as qml
import numpy as np
dev = qml.device("default.qubit", wires=2)
@qml.qnode(dev)
def qnn(x, params):
# Encoding layer
qml.AngleEmbedding(x, wires=[0, 1])
# Variational layer
qml.BasicEntanglerLayers(params, wires=[0, 1])
return qml.expval(qml.PauliZ(0))
x = np.array([0.5, 1.2])
params = np.random.uniform(0, np.pi, (3, 2)) # 3 layers, 2 qubits
grad_fn = qml.grad(qnn, argnum=1)
grads = grad_fn(x, params)
The barren plateau problem is the central obstacle to scaling QNNs. For a random parameterized circuit on qubits, the variance of the gradient with respect to any single parameter decays exponentially in both circuit depth and qubit count:
In practice this means that for circuits with more than around 10-15 qubits and moderate depth, all gradients are exponentially small and indistinguishable from noise. Training becomes practically impossible. Proposed mitigations (layer-by-layer initialization, identity block initialization, local cost functions) reduce but do not eliminate the problem for deep circuits.
Why it matters for learners
QNNs are important to study not because they currently outperform classical models, but because they crystallize the central questions of near-term quantum machine learning. What is the quantum analogue of expressibility? Does circuit expressibility translate to learning performance? When does the overhead of quantum hardware pay off over classical computation?
The barren plateau result is particularly instructive. It shows that the same property that makes QNNs seem powerful (global entanglement across many qubits) is also what makes them untrainable. This is a deeper version of the vanishing gradient problem in classical deep networks, but exponentially worse and not solved by residual connections or normalization layers.
For learners coming from classical ML, QNNs are a good entry point to variational quantum algorithms because the training loop is familiar. PennyLane is the recommended framework for exploration.
Common misconceptions
Misconception 1: QNNs provide quantum advantage on classical machine learning tasks. There is no convincing experimental or theoretical evidence that QNNs outperform classical neural networks or kernel methods on any practical dataset (image classification, language, tabular data). Claims of quantum advantage in ML consistently use artificially constructed datasets or do not account for classical baselines fairly.
Misconception 2: More parameters means a more expressive QNN. For random circuits, adding parameters tends to worsen barren plateaus rather than improve expressibility in a useful sense. Expressibility in the Hilbert space sense (coverage of unitaries) and learnability from data are distinct properties. A circuit can be maximally expressive and entirely untrainable simultaneously.
Misconception 3: QNNs are quantum analogues of neural networks in a deep sense. The analogy is structural but not functional. Classical neural networks compute hierarchical feature representations via nonlinear activations. QNNs compute linear operations in Hilbert space (unitary evolution) with nonlinearity entering only at measurement. The two architectures have fundamentally different computational mechanisms, and lessons from classical deep learning do not transfer straightforwardly.