Amplitude Encoding
Amplitude encoding packs a classical vector into the amplitudes of a quantum state, storing 2^n numbers in n qubits but at a steep preparation cost.
The most compact encoding
Amplitude encoding maps a normalized classical vector of length 2^n directly onto the amplitudes of an n-qubit state: the data point (a_0, a_1, ..., a_{N-1}) becomes the state sum_i a_i |i>, where |i> are the computational basis states. The compression is dramatic: a million-dimensional vector fits in twenty qubits. This is the encoding that motivates most claims of exponential space savings in data loading.
The catch: preparation cost
The space savings are real, but preparing an arbitrary amplitude-encoded state generally requires a circuit whose gate count grows linearly with the vector length, that is exponentially in the qubit count. If loading the data costs as much as the exponential dimension you hoped to exploit, the advantage evaporates. This state-preparation bottleneck is a recurring reason that promised speedups fail to materialize on real inputs.
- Storage: n qubits hold N = 2^n amplitudes, a genuine exponential compression.
- Normalization: the vector must be L2-normalized, so the encoding discards absolute magnitude unless a padding amplitude preserves it.
- Preparation: exact loading of a dense arbitrary vector needs order N gates in general.
- Readout: amplitudes are not directly observable; measurement returns basis samples, not the a_i values.
When it is affordable
Amplitude encoding is cheap when the state has structure: sparse vectors, states produced by an efficient generative process, or data that arrives already quantum need no expensive general routine. Quantum random access memory (QRAM) is often invoked to load data in logarithmic time, but a large fault-tolerant QRAM does not yet exist and carries its own hardware assumptions.
# Amplitude encoding of a normalized vector (schematic)
import numpy as np
v = np.array([0.1, 0.3, 0.2, 0.9])
v = v / np.linalg.norm(v) # must be unit norm
# amplitude_embedding(v, wires=[0, 1]) prepares 0.1|00> + ... after renorm
# Requires ~len(v) gates for a general dense vector.
Practical stance
Amplitude encoding is the theoretically appealing option and the practically hardest. On near-term hardware, cheaper schemes such as angle encoding are usually preferred despite their smaller capacity, because they avoid the deep state-preparation circuits that current devices cannot run reliably.