← Quantum Computing
Quantum Computing

Variational Algorithms

Variational algorithms use shallow parameterized circuits with classical optimizers in a feedback loop for NISQ hardware

Source: mortalapps.com
TL;DR
  • Variational algorithms are hybrid quantum-classical algorithms designed for near-term (NISQ) hardware.
  • They use shallow, parameterized quantum circuits (ansatzes).
  • The variational principle guarantees that the measured energy is always $\ge$ the ground state energy.
  • A classical optimizer is used to update the circuit parameters.
  • They are highly susceptible to optimization challenges like barren plateaus.

Why This Matters

Variational Algorithms are a class of hybrid quantum-classical algorithms designed for the Noisy Intermediate-Scale Quantum (NISQ) era. Instead of requiring long, error-corrected circuits, variational algorithms use shallow, parameterized quantum circuits and offload the optimization task to a classical computer.

Core Intuition

Imagine you are trying to mold a piece of clay into the shape of a bowl. You don't have a machine that can instantly carve it. Instead, you use your hands to make small adjustments, checking the shape after each turn. In a variational algorithm, the quantum circuit is the clay, and the gate parameters (angles of rotation) are your hands. The quantum computer prepares a state and measures its 'energy' (or cost). A classical computer looks at this energy and calculates how to adjust the gate angles to lower the energy. This loop repeats until the clay is molded into the optimal shape, representing the ground state of a molecule or the solution to an optimization problem.

Visualization

VQE Hybrid Quantum-Classical Loop
VQE Hybrid Quantum-Classical Loop Illustrate the feedback loop between the quantum processor and classical optimizer.

Technical Explanation

The foundation of variational algorithms is the Variational Principle from quantum mechanics, which states that the expectation value of a Hamiltonian $H$ for any parameterized state $|\psi(\theta)\rangle$ is always greater than or equal to the ground state energy $E_0$:

$$\langle\psi(\theta)| H |\psi(\theta)\rangle \ge E_0$$

The Variational Quantum Eigensolver (VQE): To find the ground state energy of a Hamiltonian $H$: 1. Prepare Ansatz: Choose a parameterized quantum circuit $U(\theta)$ and prepare the state: $$|\psi(\theta)\rangle = U(\theta)|0\rangle^{\otimes n}$$ 2. Measure Expectation Value: Decompose the Hamiltonian into a sum of Pauli strings $H = \sum_i c_i P_i$ (where $P_i \in \{I, X, Y, Z\}^{\otimes n}$). Measure the expectation value of each term on the quantum computer: $$\langle H\rangle_\theta = \sum_i c_i \langle\psi(\theta)| P_i |\psi(\theta)\rangle$$ 3. Classical Optimization: Use a classical optimization algorithm (e.g., COBYLA, SPSA) to update the parameters $\theta$ to minimize $\langle H\rangle_\theta$: $$\theta^{(k+1)} = \text{Optimizer}(\theta^{(k)}, \langle H\rangle_{\theta^{(k)}})$$ 4. Iterate: Repeat until convergence.

Key Takeaways

Variational algorithms are hybrid quantum-classical algorithms designed for near-term (NISQ) hardware.
They use shallow, parameterized quantum circuits (ansatzes).
The variational principle guarantees that the measured energy is always $\ge$ the ground state energy.
A classical optimizer is used to update the circuit parameters.
They are highly susceptible to optimization challenges like barren plateaus.