Variational Quantum Eigensolver (VQE)
The VQE is a hybrid quantum-classical algorithm for finding the ground state energy of a Hamiltonian . It uses the variational principle:
where is a parameterized quantum state and is the true ground state energy. The algorithm minimizes using classical optimization while evaluating the energy on a quantum computer.
Parameterized Quantum Circuits (PQCs)
A parameterized quantum circuit applies gates with tunable parameters :
where are parameterized rotations and are fixed entangling gates.
Common architectures:
- Hardware-efficient ansatz: native gate set, low depth
- UCCSD (Unitary Coupled Cluster): chemistry-inspired, systematic
- ADAPT-VQE: grows the circuit dynamically
The key challenge is avoiding barren plateaus β exponentially vanishing gradients in high-dimensional parameter spaces.
QAOA (Quantum Approximate Optimization Algorithm)
QAOA solves combinatorial optimization problems by alternating between problem and mixer Hamiltonians:
where:
- is the problem (cost) Hamiltonian
- is the mixer Hamiltonian
- is the QAOA depth
As , QAOA converges to the optimal solution. For MaxCut on 3-regular graphs, already gives a 0.6924 approximation ratio.
The Cost Function
For a combinatorial optimization problem with objective function , the cost Hamiltonian is:
The expectation value is estimated by sampling and averaged over many shots.
The optimization landscape can have local minima and saddle points, making classical optimizer choice critical.
Barren Plateaus
Barren plateaus are a fundamental challenge for variational algorithms. For random PQCs with qubits:
This means gradients vanish exponentially with system size.
Mitigation strategies:
- Layerwise training: start shallow, grow deeper
- Local cost functions: use local rather than global observables
- Symmetry preservation: exploit problem symmetries
- Noise-aware training: account for hardware noise in the circuit design
Python: VQE for H2 Molecule
import numpy as np
def vqe_h2():
# Simplified VQE for H2 molecule (minimal basis).
coeffs = {
'I': -0.4804, 'Z0': 0.3435, 'Z1': -0.4347,
'Z0Z1': 0.5716, 'X0X1': 0.0910, 'Y0Y1': 0.0910
}
def energy(theta):
e = coeffs['I']
e += coeffs['Z0'] * np.cos(2*theta)
e += coeffs['Z1'] * np.cos(2*theta)
e += coeffs['Z0Z1'] + coeffs['X0X1'] + coeffs['Y0Y1']
return e
from scipy.optimize import minimize
result = minimize(energy, 0.0, method='COBYLA')
print(f"Ground state energy: {result.fun:.6f} Ha")
print(f"Exact FCI energy: -1.1372 Ha")
vqe_h2()
This demonstrates the core VQE loop: prepare state, measure energy, optimize classically.
Circuit Ansatz Design
The choice of ansatz circuit is critical for VQE performance:
Hardware-efficient ansatz: uses native gate set with minimal depth. Pros: fast execution. Cons: may not represent ground state well.
UCCSD (Unitary Coupled Cluster Singles and Doubles): chemistry-inspired ansatz that systematically includes excitations. Pros: physically motivated. Cons: deep circuits.
ADAPT-VQE: dynamically grows the circuit by selecting the most impactful operator at each step. Pros: optimal circuit depth. Cons: requires adaptive circuit compilation.
Parameter Optimization Landscape
The VQE energy landscape can have:
- Local minima: suboptimal parameter configurations
- Saddle points: flat directions in parameter space
- Barren plateaus: exponentially vanishing gradients
- Noise-induced local minima: hardware errors create artificial minima
Strategies to handle these challenges:
- Multiple random initializations
- Layerwise training (start shallow, grow deeper)
- Gradient-free optimizers (COBYLA, Nelder-Mead)
- Noise-aware training