|q⟩ Bad Qubits

intermediate · Programming · Variational Quantum Eigensolver (VQE)

Hardware-Efficient Ansätze

Every VQE experiment needs an ansatz: a parameterized circuit whose state ψ(θ)|\psi(\boldsymbol{\theta})\rangle we push toward the ground state by optimizing the angles θ\boldsymbol{\theta}. Choosing the right ansatz design is as important as choosing the right optimizer — a poorly chosen ansatz can never reach the true ground state regardless of how many iterations the optimizer runs.

This lesson compares the major design strategies and explains why the hardware-efficient ansatz (HEA) has become the dominant choice for near-term devices.

The design axes

Any ansatz lives on a spectrum defined by two competing properties.

Expressibility measures how large a fraction of the full state space the ansatz can reach. A circuit with dd free parameters can sweep out at most a dd-dimensional manifold of states; a fully expressive ansatz would cover the entire 2n2^n-dimensional Hilbert space, but that requires an exponential number of parameters and gates.

Trainability (also called efficient optimizability) measures how easy it is for the classical optimizer to find the minimum. Long circuits with many parameters tend to produce flat loss landscapes — the so-called barren plateau phenomenon — where every gradient is exponentially small and gradient-based optimizers stall.

A third practical constraint dominates on today's hardware: depth and connectivity. Real devices have limited qubit connectivity and short coherence times. Every two-qubit gate adds noise; a circuit that is too deep will be dominated by errors before any useful signal can accumulate.

Chemically motivated ansätze (UCC family)

For quantum chemistry the historically popular choice is the Unitary Coupled Cluster (UCC) family. The idea comes directly from classical coupled-cluster theory: start from the Hartree–Fock reference state HF|\mathrm{HF}\rangle and apply a unitary operator built from electron excitation and de-excitation operators,

ψUCC=eTTHF,|\psi_{\mathrm{UCC}}\rangle = e^{T - T^\dagger}|\mathrm{HF}\rangle,

where T=T1+T2+T = T_1 + T_2 + \ldots collects single, double, and higher excitations. Truncating at doubles gives UCCSD, which is both chemically accurate and expressible by a polynomial-size circuit in principle.

The practical difficulty is that the exact decomposition of eTTe^{T - T^\dagger} into native gates produces very deep circuits. On current hardware with gate error rates of 10210^{-2} to 10310^{-3} per two-qubit gate, a UCCSD circuit for even a small molecule (say, four qubits for H2_2 in a minimal basis) can accumulate enough noise to overwhelm any chemical accuracy.

Hardware-efficient ansätze

Rather than deriving the ansatz from chemistry, the HEA philosophy is to derive it from the hardware:

  1. Pick a layer structure that only uses the device's native single-qubit gates (typically RY(θ)R_Y(\theta) or RY(θ)RZ(ϕ)R_Y(\theta)\,R_Z(\phi) pairs) and its native two-qubit gates (CNOT or CZ along the device's connectivity graph).
  2. Repeat the layer LL times.
  3. Let the classical optimizer find the best angles.

For two qubits, a single HEA layer takes the form

ψ(θ)=CNOT01[RY(θ0)RY(θ1)]00.|\psi(\boldsymbol{\theta})\rangle = \mathrm{CNOT}_{01}\,\bigl[R_Y(\theta_0) \otimes R_Y(\theta_1)\bigr]\,|00\rangle.

Adding a second layer appends another RYRZR_Y R_Z block followed by another CNOT. With nn qubits and LL layers, the total parameter count is O(nL)O(nL) — linear in both qubits and depth, far fewer than the exponentially many parameters of an arbitrary unitary.

The circuit depth is O(L)O(L), which is small enough to run within the coherence window of a superconducting or trapped-ion processor. Because every gate is native, no further compilation is needed and the circuit incurs no overhead from basis translation.

Comparing the two families

| Property | UCCSD | HEA (1 layer) | |---|---|---| | Physical motivation | Chemistry (excitations) | Hardware topology | | Depth | Deep (Trotterized) | Shallow | | Parameter count | Scales with excitations | O(nL)O(nL) | | Expressibility | Targets the right subspace | Depends on LL | | Noise resilience | Poor for large circuits | Good for small LL |

The HEA wins on hardware resilience; UCCSD wins on chemical interpretability. A practical workflow often starts with the HEA to verify that the optimizer converges, then switches to a chemistry- informed ansatz when higher accuracy is required.

Brick-wall and other structured variants

Many real experiments use a brick-wall (also called alternating-layered) connectivity: in odd layers entangle qubits (0,1),(2,3),(0,1),(2,3),\ldots and in even layers entangle (1,2),(3,4),(1,2),(3,4),\ldots. This pattern ensures every qubit is entangled to its neighbors in at most two layers, requires only nearest-neighbor connectivity, and scales naturally from 4 to 50 or more qubits.

Another variant, the Real Amplitudes (or RYR_Y-only) ansatz, restricts all rotation axes to YY. Because RYR_Y keeps amplitudes real, the resulting states live in the real subspace of the full Hilbert space. Many ground states of real Hamiltonians — such as those arising in molecular orbital theory — are themselves real-valued, so this restriction costs no accuracy while halving the parameter count.

Choosing the number of layers LL

A single layer is enough for very small systems; in practice the choice L=2L = 2 to L=3L = 3 is a common starting point for systems of 4 to 12 qubits. Each added layer increases expressibility but also circuit depth and the risk of barren plateaus. The rule of thumb: add layers until the optimizer consistently converges, then stop.

Summary

Hardware-efficient ansätze dominate near-term VQE for three reasons: they are shallow (fitting within device coherence times), they use native gates (no compilation overhead), and they are parametrically efficient (O(nL)O(nL) angles). Their trade-off is that they are not guaranteed to include the true ground state — that gap is closed by increasing LL or by choosing a physically motivated variant such as Real Amplitudes for real-valued Hamiltonians. The art of VQE lies in finding the sweet spot between expressibility and trainability for the specific problem at hand.

Sign in on the full site to ask questions and join the discussion.