Amplitude Encoding
Encodes normalized feature vectors into quantum state amplitudes, achieving exponential compression.
Qubits
2
Depth
4
Total Gates
6
Simulability
Not simulable
Mathematical Formulation
Description
Amplitude encoding maps an n-dimensional classical feature vector into the amplitudes of a quantum state using only ⌈log₂(n)⌉ qubits. This provides exponential compression of classical data into the quantum Hilbert space — for example, 1024 features can be encoded into just 10 qubits.
The trade-off is circuit depth: preparing an arbitrary quantum state requires O(2^n) gates via the Möttönen decomposition (uniformly controlled RY and RZ rotations with CNOT ladders). This makes amplitude encoding impractical on current NISQ hardware for large feature counts, though it is theoretically optimal for qubit efficiency.
A critical subtlety is normalization: the input vector must have unit L2 norm, so the encoding discards absolute magnitude information. Vectors [1, 2, 3] and [10, 20, 30] map to the same quantum state. Non-power-of-2 feature counts are zero-padded to the next power of 2.
Circuit Diagram
Property Radar
Properties
Resource Scaling
How resource requirements grow with the number of input features.
| Features | Qubits | Depth | Gates | 2Q Gates |
|---|---|---|---|---|
| 2 | 1 | 2 | 2 | 0 |
| 4 | 2 | 4 | 6 | 2 |
| 8 | 3 | 8 | 14 | 6 |
| 16 | 4 | 16 | 30 | 14 |
Code Examples
Amplitude encoding with PennyLane. 4 features encoded into 2 qubits.
from encoding_atlas import AmplitudeEncoding
import pennylane as qml
import numpy as np
enc = AmplitudeEncoding(n_features=4)
dev = qml.device("default.qubit", wires=enc.n_qubits)
@qml.qnode(dev)
def circuit(x):
enc.get_circuit(x, backend="pennylane")
return qml.state()
x = np.array([0.5, 0.5, 0.5, 0.5])
state = circuit(x)When to Use This Encoding
- Encoding high-dimensional data with minimal qubit count
- Quantum linear solvers (HHL algorithm) requiring state preparation
- Quantum kernel methods (QSVM) with amplitude-based kernels
- Quantum PCA and dimensionality reduction
- Fault-tolerant quantum computing where deep circuits are acceptable
Pros & Cons
Advantages
- Exponential compression: n features in ⌈log₂(n)⌉ qubits
- Maximal expressibility — any quantum state is reachable
- Ideal for high-dimensional datasets (e.g., images, genomics)
- Theoretically optimal qubit efficiency
Limitations
- Exponential circuit depth O(2^n) — impractical on NISQ hardware
- Low trainability (~0.5) due to deep circuits and barren plateaus
- L2 normalization discards magnitude information
- Zero-padding wastes Hilbert space for non-power-of-2 features
- Sensitive to noise accumulation in deep circuits
References
- [1]Möttönen, M., et al. (2005). Transformation of quantum states using uniformly controlled rotations. Quantum Information & Computation, 5(6), 467–473.
- [2]Shende, V.V., Bullock, S.S., & Markov, I.L. (2006). Synthesis of quantum-logic circuits. IEEE Transactions on Computer-Aided Design, 25(6), 1000–1010.
- [3]Schuld, M. & Petruccione, F. (2018). Supervised Learning with Quantum Computers. Springer.