- Fundamentals
- Also: state initialization
- Also: amplitude encoding
State Preparation
The process of initializing a quantum register into a specific target quantum state, a necessary first step for many quantum algorithms that requires careful circuit design.
State preparation is the process of transforming the default initial state of a quantum register (typically ) into a specific target state . This is a prerequisite for many quantum algorithms: Grover’s algorithm starts from a uniform superposition, VQE starts from a chemically-motivated ansatz state, and quantum machine learning algorithms often require encoding classical data into quantum amplitudes. The efficiency of state preparation directly impacts the overall feasibility of these algorithms.
General state preparation
An arbitrary -qubit state has complex amplitudes (subject to normalization), so preparing a fully general state requires a circuit with gates. This exponential cost means that efficient state preparation is possible only for states with special structure.
The standard approach decomposes the target state using a sequence of controlled rotations. For example, to prepare a 2-qubit state :
- Apply to qubit 0 to set the amplitudes of the and subspaces
- Apply controlled- gates conditioned on qubit 0 to set the amplitudes within each subspace
This recursive “divide and conquer” approach generalizes to qubits with CNOT gates and rotation gates.
Efficient special cases
Several important state classes can be prepared efficiently:
Uniform superposition: requires only Hadamard gates (depth 1).
Product states: Any state of the form requires only single-qubit gates.
W states: can be prepared with gates.
GHZ states: requires one Hadamard and CNOTs (depth , or with ancillas).
Sparse states: States with only nonzero amplitudes can be prepared in gates.
Matrix product states: States with bounded entanglement (low Schmidt rank across any bipartition) can be prepared in polynomial depth.
Amplitude encoding
A particularly important application of state preparation is amplitude encoding: loading a classical data vector into the amplitudes of a quantum state:
This encodes classical values into qubits, an exponential compression. However, the preparation circuit requires gates, which can negate the quantum speedup of the subsequent algorithm. This “data loading bottleneck” is a major challenge for quantum machine learning.
State preparation on hardware
On real devices, state preparation circuits contribute errors just like any other circuit. For NISQ algorithms, simpler (shallower) state preparation is usually better, even if it produces a less accurate initial state. Variational state preparation, where the initial state is a parameterized circuit optimized during the algorithm, is an alternative that trades preparation accuracy for reduced circuit depth.
Why it matters for learners
State preparation is where many quantum algorithms face their first practical bottleneck. Understanding the costs and tradeoffs of different preparation methods helps you evaluate algorithm claims realistically. A quantum algorithm with an exponential speedup in the “main computation” but an exponential cost in state preparation may offer no end-to-end advantage.