DeepPractise
DeepPractise

What are Variational Quantum Algorithms?

Track: Variational & NISQ Algorithms · Difficulty: Intermediate · Est: 12 min

What are Variational Quantum Algorithms?

Overview

Variational quantum algorithms exist because near-term quantum hardware is powerful enough to run small circuits, but too noisy to run very deep, fully fault-tolerant algorithms.

A variational algorithm reframes “solve a hard problem” as:

  • choose a parameterized quantum circuit (a controllable family of circuits)
  • measure a quantity that tells you how good the current parameters are
  • use a classical optimizer to update parameters
  • repeat

This hybrid approach is a practical fit for NISQ devices because it can use:

  • relatively shallow circuits
  • repeated sampling (shots)
  • classical computation to steer the search

Intuition

Variational means “optimization,” not magic

“Variational” here means we search over a family of candidate solutions.

  • The quantum computer generates candidates (via a parameterized circuit).
  • The classical computer decides how to change the parameters.

It’s similar in spirit to tuning a control knob:

  • turn knobs → run experiment → observe outcome → adjust knobs → repeat

The hybrid loop

A useful mental model is a feedback loop:

  1. Quantum step: prepare a state using parameters θ\theta
  2. Measurement step: estimate a score (cost) from repeated measurements
  3. Classical step: update θ\theta to improve the score

The quantum computer is not “doing the optimization.” It is producing measurement data that the classical optimizer uses.

Difference from gate-based “one-shot” algorithms

Many textbook quantum algorithms (like the Deutsch family or Grover) are:

  • a fixed sequence of gates
  • one final measurement
  • a direct interpretation of the output

Variational algorithms are different:

  • they are iterative
  • they rely on noisy estimates (shot noise)
  • the final output is often an estimated quantity or best-found parameter set

Formal Description

A variational algorithm can be described by three ingredients.

1) An ansatz (a parameterized circuit)

You choose a circuit family U(θ)U(\theta). Running U(θ)U(\theta) on a simple initial state (often 00|0\cdots 0\rangle) produces a state that depends on parameters θ\theta.

The ansatz is your “search space.”

2) A cost function

You define a real-valued objective C(θ)C(\theta) that you want to minimize (or maximize). In variational quantum settings, C(θ)C(\theta) is often defined via expectation values measured from the circuit.

3) A classical optimizer

A classical algorithm proposes parameter updates:

  • choose θ0\theta_0
  • repeat: measure C(θ)C(\theta) and propose θθ\theta \leftarrow \theta'

The key constraints in NISQ:

  • you only observe C(θ)C(\theta) through noisy sampling
  • each evaluation of C(θ)C(\theta) costs circuit executions

Worked Example

Imagine you want a circuit to produce a state that makes measuring 1 on a particular qubit likely. Define a simple cost:

  • C(θ)=1Pθ(measure 1)C(\theta) = 1 - P_\theta(\text{measure }1)

If Pθ(1)P_\theta(1) is high, the cost is low.

Workflow:

  1. pick an initial θ\theta
  2. run the circuit many shots to estimate Pθ(1)P_\theta(1)
  3. compute C(θ)C(\theta)
  4. update θ\theta to try to reduce CC

This toy example captures the variational pattern without needing a specific named algorithm.

Turtle Tip

Turtle Tip

A variational algorithm is a feedback loop: quantum circuits generate data, and a classical optimizer uses that data to tune parameters.

Common Pitfalls

Common Pitfalls
  • Thinking “variational” means the quantum computer is solving the whole optimization. The optimizer is classical.
  • Expecting a single run to produce the answer. Variational methods require repeated evaluations.
  • Ignoring noise sources: shot noise, gate noise, and readout noise all affect the cost estimate.

Quick Check

Quick Check
  1. What are the three core ingredients of a variational algorithm?
  2. Why are variational methods a good fit for NISQ hardware?
  3. In one sentence, how do variational methods differ from fixed gate-based algorithms?

What’s Next

Next we zoom in on the quantum side of the loop: parameterized quantum circuits (PQCs). We’ll discuss what the parameters mean, why ansatz choice matters, and the tradeoff between expressivity and trainability.