Level 5 · Advanced Topics

The Variational Quantum Eigensolver (VQE): Finding Lowest Energies on Noisy Machines

About 4,901 words · roughly 22 minute read · sources checked December 2, 2026

The previous lesson showed quantum phase estimation, which can read out an energy precisely but needs long, deep circuits. Today’s machines cannot run such circuits. The variational quantum eigensolver, or VQE, is the compromise proposed for the noisy era: use a short quantum circuit with adjustable knobs, measure an energy, and let an ordinary computer tune the knobs until the energy is as low as it can get.

VQE is the best-known example of a hybrid quantum-classical algorithm. The quantum computer does the one thing it is good at, preparing and measuring states that are hard to store classically. The classical computer does everything else. That division of labour is why the idea spread so quickly after the first experiment on a photonic chip in 2013.

In this lesson we build VQE on a one-qubit example you can verify by hand, then scale to a two-qubit toy problem, and then look at the practical headaches: how many measurements you need, how to compute gradients on hardware, and why large circuits can become impossible to train. All numbers come from my own NumPy simulation, and the Qiskit outline is not executed.

One thing to be clear about early: VQE has not been shown to beat classical methods on a useful problem. It is an active research idea and a good way to learn how near-term quantum algorithms are structured. I will say where the evidence is thin.

What you will learn

  • The variational principle, and why a lower measured energy is always progress.
  • What an ansatz is and how a parameterised circuit defines one.
  • How to turn a Hamiltonian into measurable pieces and estimate its energy from shots.
  • How gradient descent and the parameter-shift rule optimise the circuit.
  • How many shots you need for a target precision, with real numbers.
  • What barren plateaus are, with a simulation showing the effect.
  • How the whole loop looks in Qiskit.

Helpful first: Quantum Phase Estimation, Quantum Gates.

The idea in one page

Every quantum system has an energy operator called the Hamiltonian, written H. It is a matrix. Its eigenvalues are the allowed energies, and the smallest one is the ground-state energy. For a molecule, the ground-state energy decides how stable it is and which reactions are possible, so finding it is one of the central goals of quantum chemistry.

The variational principle is a fact from quantum mechanics that makes VQE work. For any state |ψ⟩ whatsoever, the average energy ⟨ψ|H|ψ⟩ is at least the ground-state energy. You can never get below the true minimum by guessing. So if you try many states and keep the one with the lowest measured energy, you are always getting closer from above.

E(θ)  =  ⟨ψ(θ)| H |ψ(θ)⟩   ≥   E₀  (the ground-state energy)
The variational principle. Whatever parameters θ you choose, the energy you measure cannot fall below the true ground-state energy E₀.

VQE turns this into a loop:

  1. A classical computer picks parameters θ.
  2. The quantum computer runs a short circuit with those parameters, producing a state |ψ(θ)⟩, and measures it many times to estimate E(θ).
  3. The classical computer reads the estimate and picks better parameters, using an optimiser.
  4. Repeat until the energy stops improving.

The circuit with adjustable parameters is called the ansatz, a German word meaning an educated starting guess. The quality of the answer depends on how well the ansatz can represent the true ground state. A poor ansatz gives a poor answer no matter how good the optimiser is.

Peruzzo and colleagues reported the first demonstration in 2013. The abstract I opened says that their approach uses a quantum processor to prepare and measure states, uses a classical computer to optimise, needs much less coherent evolution than quantum phase estimation, and that they implemented it on a photonic processor to compute the ground-state energy of the molecule He-H⁺ to chemical accuracy. I use that as the historical anchor and do not claim more than the abstract states.

Why lower is always progress

Because of the variational principle, a measured energy that goes down is always a step in the right direction, even if the state is wrong in other ways. You cannot overshoot below the true answer, except by statistical noise in the measurement, which we examine later.

A one-qubit VQE you can check by hand

Take the Hamiltonian H = Z + 0.5·X. In matrix form, Z and X are the Pauli matrices. This H has two eigenvalues, ±√(1 + 0.25) = ±1.118034, so the ground-state energy is −1.118034. We pretend we do not know this and let VQE find it.

Choose the simplest ansatz: start from |0⟩ and apply a rotation about the Y axis by angle θ. The state is cos(θ/2)|0⟩ + sin(θ/2)|1⟩. Its average energy works out to a clean formula:

E(θ)  =  cos θ  +  0.5 · sin θ
Energy of the state Ry(θ)|0⟩ for H = Z + 0.5·X. The term cos θ comes from Z and 0.5·sin θ comes from X.

We can check a few values by hand or with a calculator. E(0) = 1.0. E(1) = 0.96104. E(2) = 0.0385. E(3) = −0.91943. The energy falls as θ moves toward π, and the exact minimum is at θ* = π + arctan(0.5) = 3.6052, where E = −1.118034, matching the eigenvalue.

Gradient descent, step by step

To let a computer do the tuning, we use gradient descent: move θ a little against the slope of E. With a step size of 0.4 and starting at θ = 0, I got:

IterationθE(θ)Gradient
00.01.00.5
1−0.20.880730.6887
2−0.47550.660190.9023
3−0.83640.299021.0773
4−1.2673−0.178321.1037
5−1.7088−0.632820.9217
6−2.0775−0.922470.6317
7−2.3302−1.05110.381
8−2.4826−1.096770.217
9−2.5694−1.111450.1211
10−2.6178−1.116020.0672
11−2.6447−1.117420.0372
12−2.6596−1.11785—

Gradient descent on the one-qubit problem with step size 0.4, starting at θ = 0. The gradient shown is the slope at the θ on the same row. The energy drops from 1.0 to −1.11785, close to the exact −1.118034.

The final angle −2.6596 is not the same number as 3.6052, but the two differ by exactly 2π (3.6052 − 6.2832 = −2.678, near −2.66), so they describe the same rotation. This is a good reminder that angles wrap around, and the optimiser can land at any equivalent value.

Computing the gradient on hardware

On a real device you cannot differentiate the circuit symbolically, but for rotation gates there is a neat trick called the parameter-shift rule. The slope is obtained from two extra energy measurements at shifted angles:

dE/dθ  =  [ E(θ + π/2)  −  E(θ − π/2) ] / 2
The parameter-shift rule for a gate of the form e^(−iθP/2), where P is a Pauli operator. It gives the exact slope, not an approximation.

I checked it numerically on this problem. At θ = 0.3 the rule gave 0.182148, at θ = 1.0 it gave −0.57132, and at θ = 2.5 it gave −0.999044. These match the analytic derivative −sin θ + 0.5 cos θ in all three cases. The price is that every gradient component costs two extra circuit evaluations, so a circuit with 100 parameters needs about 200 evaluations per gradient step.

A two-qubit toy problem

To see something closer to real chemistry, I built a two-qubit Hamiltonian from five Pauli terms: ZI with coefficient −0.4, IZ with 0.2, ZZ with 0.5, XX with 0.3 and YY with 0.3. These coefficients are my own invention for teaching. They are not the constants of any real molecule such as hydrogen, and I want to be clear about that, since real values must be taken from a chemistry package.

The four exact energies, from diagonalising the 4×4 matrix, are −1.34853, 0.3, 0.34853 and 0.7. The target for VQE is therefore −1.34853.

The ansatz

The ansatz uses four parameters: Ry(θ₀) on qubit 0, Ry(θ₁) on qubit 1, a CNOT from qubit 0 to qubit 1, then Ry(θ₂) on qubit 0 and Ry(θ₃) on qubit 1. The CNOT makes the state entangled, which a product of single-qubit rotations alone cannot do. This matters because many interesting ground states are entangled.

q0: ──Ry(θ₀)──●──Ry(θ₂)──  measure
              │
q1: ──Ry(θ₁)──⊕──Ry(θ₃)──  measure
The two-qubit ansatz: single-qubit Y rotations, one CNOT, then more Y rotations.

Optimising it

I ran the derivative-free optimiser COBYLA from six random starting points. All six reached −1.348528, an error of about 1.2×10⁻¹⁰, using between 48 and 75 energy evaluations. A gradient-descent run using the parameter-shift rule with step size 0.15 reached −1.348528 as well. Sampling its energy every sixth step over 60 steps gave about −0.1415, −1.2699, −1.3432, −1.3476, −1.3483, −1.3485, and finally −1.348528.

Two things to keep in mind. First, this was an ideal simulation with no shot noise and no hardware noise. Second, the problem has only two qubits, so a classical computer solves it instantly. The toy shows the mechanics, not any advantage.

Measuring the energy: groups, shots and error bars

A quantum computer measures qubits in one chosen basis at a time, normally the Z basis. The Hamiltonian is a sum of Pauli terms, and not all of them can be read from the same measurement. To estimate the energy you split the terms into groups that can be measured together, run the circuit many times for each group, and add up the averages.

For our two-qubit toy there are three groups. The terms ZI, IZ and ZZ can all be read from ordinary Z-basis measurements. The XX term needs a rotation that turns X into Z before measuring, and the YY term needs a different rotation. So each energy estimate needs three separate sets of shots.

E  =  −0.4⟨ZI⟩ + 0.2⟨IZ⟩ + 0.5⟨ZZ⟩   (group 1: Z basis)
     + 0.3⟨XX⟩                        (group 2: rotate to X basis)
     + 0.3⟨YY⟩                        (group 3: rotate to Y basis)
The five Pauli terms of the toy Hamiltonian split into three measurement groups.

Each shot gives a random result, so the estimate of each group has a statistical error that falls as 1/√S, where S is the number of shots. At the optimal state I computed the variance contribution of each group: 0.18 for the Z-basis group, 0.045 for XX and 0.045 for YY, for a total of 0.27. With S shots for each group, the standard error of the energy is √(0.27/S).

Shots per group STotal shots (3 groups)Standard error of E
1003000.052
1,0003,0000.0164
10,00030,0000.0052
100,000300,0000.00164
1,000,0003,000,0000.00052

Standard error of the energy estimate for the toy problem, using the group variances above. Every factor of 100 in shots buys only a factor of 10 in precision.

What chemical accuracy demands

Chemists often use chemical accuracy as the target: an error of 1 kcal/mol, which equals 1.5936 millihartree (mHa). To reach a standard error of 1.59 mHa on this toy problem needs about 106,318 shots per group, or about 318,955 shots in total, for a single energy estimate. And an optimiser needs many energy estimates. The toy’s coefficients are not in real chemical units, so this number only shows the scaling. For real molecules the Hamiltonian has thousands or millions of terms, and the shot counts grow enormously.

Noise can fool the optimiser

Because each energy estimate is noisy, the measured value can dip below the true ground-state energy by pure chance. The variational principle holds for the exact energy, not for a noisy estimate. A good VQE run reports error bars and checks the final energy with extra shots.

Why classical simulation stops being an option

For small systems we can check VQE on a classical computer by storing the full state vector. The memory needed for n qubits at 16 bytes per amplitude grows as 2ⁿ:

QubitsMemory for the state vector
200.0168 GB
3017.2 GB
4017,592 GB
5018,014,399 GB

State-vector memory at 16 bytes per amplitude. Around 30 qubits an ordinary computer is stretched; at 50 qubits brute-force storage is out of reach.

This table shows why quantum hardware is interesting at all, but it does not prove VQE wins. Classical chemists have clever methods that do not store the full state vector, and they can handle many systems well beyond 50 qubits’ worth of orbitals. Whether VQE will beat them on a useful problem is an open question.

Barren plateaus: when training becomes impossible

A serious obstacle to VQE is that for some circuits the energy landscape becomes almost completely flat. The slope is near zero in nearly every direction, so the optimiser has nothing to follow. McClean, Boixo, Smelyanskiy, Babbush and Neven studied this in 2018. The abstract I opened says that for a broad class of parameterised circuits, the probability that a gradient is non-zero by more than a given amount decays exponentially with the number of qubits. They call the effect a barren plateau.

I tried to see the effect myself. I built random circuits of single-qubit rotations (Rx, Ry, Rz chosen at random) followed by a chain of CZ gates, repeated for L layers. I then measured the variance of the gradient with respect to the first parameter across 150 random samples per cell. With 150 samples, each variance has an uncertainty of roughly ±12%, so treat the digits as approximate.

I compared two kinds of cost function. A global cost measures the parity Z⊗Z⊗…⊗Z across all qubits. A local cost measures only qubit 0.

CostLayers Ln = 2n = 4n = 6n = 8n = 10
global20.08530.04880.01080.003060.00112
global100.1050.02240.003830.001170.000285
global400.08720.0230.004570.00127—
local20.2620.2380.2510.30.28
local100.1030.09730.06920.06760.0609
local400.09160.02750.008380.0105—

Variance of the gradient for the first parameter in my random-circuit experiment (150 samples per cell, so about ±12% each). A dash means I did not run that cell.

Reading the table: for the global cost the variance falls by roughly half with each added qubit, regardless of depth. By n = 10 it is about a thousand times smaller than at n = 2. For the local cost with shallow circuits (L = 2) the variance stays flat near 0.25 to 0.3. But with deep local circuits (L = 40) it falls too, like the global case.

This is consistent with what the literature reports: the trouble depends on circuit depth, the choice of cost function and the starting point. The variational algorithms review by Cerezo and colleagues, whose abstract I opened, lists trainability, accuracy and efficiency as the key challenges for this whole family of methods. My small experiment supports the first of these, but it is a toy, not a proof.

Practical lessons

Prefer shallow circuits. Prefer cost functions built from local measurements. Do not start with fully random parameters on a deep circuit. These are common heuristics in the field; my experiment backs the first two but I did not test the third.

Why the entangling gate matters: a measured comparison

It is easy to say that the ansatz must be expressive enough. Here is a concrete case. I ran the same optimisation on the two-qubit toy problem with the CNOT removed, so the ansatz was just a product of single-qubit rotations, each qubit independent of the other. I used ten random starts with COBYLA and kept the best.

AnsatzBest energy foundExact ground energyGap
Rotations only (no CNOT, product states)−1.1000−1.34850.2485
Rotations + CNOT + rotations (entangled)−1.3485−1.3485about 0

Same Hamiltonian and optimiser, with and without the entangling gate. The product ansatz cannot get below −1.1 for this Hamiltonian, however long you optimise.

The gap of about 0.25 is not an optimiser failure. No product state can reach lower, because the true ground state of this Hamiltonian is entangled. The XX and YY terms reward correlations between the two qubits, and independent qubits cannot supply them. This is the first and most important rule of ansatz design: if the answer is entangled, the circuit must be able to entangle.

The one-qubit energy landscape

The one-qubit problem has a landscape you can print in one table. Here is E(θ) = cos θ + 0.5 sin θ at steps of 0.5 radians.

θE(θ)θE(θ)
0.01.03.5−1.1118
0.51.11734.0−1.032
1.00.9614.5−0.6996
1.50.56955.0−0.1958
2.00.03855.50.3559
2.5−0.50196.00.8205
3.0−0.9194——

The energy landscape of the one-qubit problem. It is a smooth wave with one minimum near θ = 3.6 and one maximum near θ = 0.46 (value 1.118).

Notice that the starting point θ = 0 is not at the maximum. At θ = 0 the energy is 1.0 and the slope is +0.5, so gradient descent moves to negative θ first, which is why the table earlier went from 0.0 to −0.2. It travels the long way round the circle to reach the same minimum. A landscape on a circle always has two directions to a minimum, and the optimiser takes whichever the starting slope points to.

A trap: the lowest of many noisy estimates

There is a subtle way to fool yourself with VQE. Suppose you evaluate the energy at many parameter settings, each with a noisy estimate, and then report the lowest value you saw. Even if every estimate is unbiased, the lowest of many is biased downward, because you are selecting the luckiest draws.

I tested this on the one-qubit problem. I evaluated the energy on 25 evenly spaced angles around the circle, with S shots for each of the two measurement groups, repeated the whole scan 200 times, and recorded the lowest estimate from each scan. The exact answer is −1.118034.

Shots per group SAverage of the lowest estimateFraction of scans reporting below −1.118034
10−1.2980.89
100−1.14680.745
1,000−1.11970.51
10,000−1.11580.365

The lowest of 25 noisy estimates sits below the true ground-state energy in most scans when shots are few. This is a simulation of a one-qubit toy and shows the direction of the effect, not a universal size.

With only 10 shots per group, 89% of the scans reported an energy below the true minimum, which is physically impossible for the exact energy. At 10,000 shots the average sits slightly above the truth, because the estimates are tight enough that the selection effect is small compared with the gap between the grid and the true minimum, but 36.5% of scans still dipped below it.

How to avoid fooling yourself

When VQE finishes, take the final parameters and re-measure the energy with a fresh, large batch of shots. Report that number, not the lowest value seen during the search.

Choosing the pieces: ansatz, optimiser, and what the molecule becomes

A real VQE project involves three design choices. I describe them at the level of what is commonly said in the field, and I flag that I verified none of these claims against an opened source beyond the abstracts listed in the references.

The ansatz

There are two broad families. A chemistry-inspired ansatz is built from the structure of the molecule and tends to be deep but physically motivated. A hardware-efficient ansatz uses whatever gates the device supports natively, in repeating layers, and tends to be shallower but less tied to the physics. The trade-off is that shallow, generic circuits are easier to run and more prone to the trainability problems described above, while physically motivated circuits may be deeper than current hardware can run.

The optimiser

Gradient-free methods like COBYLA are simple and worked well in my small examples. Gradient-based methods using the parameter-shift rule can converge in fewer steps but need many evaluations per step. With shot noise, optimisers that tolerate noisy evaluations are preferred. In my toy runs COBYLA needed 48 to 75 energy evaluations; I did not benchmark other optimisers fairly, so I will not rank them.

From molecule to Hamiltonian

To use VQE on a molecule, a chemistry package first computes the electron integrals for the chosen atoms and basis set, then a mapping converts the electronic Hamiltonian into a sum of Pauli terms on qubits. This lesson skipped that step on purpose and used a made-up Hamiltonian, since I did not run a chemistry package and will not invent constants for a real molecule. The next lessons on quantum chemistry take up the mapping at a conceptual level.

One iteration, end to end

  1. The optimiser proposes parameters, for example θ = (0.5, 1.0, 0.3, 0.2).
  2. The program binds those numbers into the ansatz circuit. For this θ my simulation gives an exact energy of 0.3524.
  3. For each of the three measurement groups, the circuit is run S times, with the right basis rotation appended, and the counts are collected.
  4. The program computes each Pauli expectation from the counts, multiplies by the coefficients and adds them to get an energy estimate.
  5. The optimiser compares the estimate with earlier ones and proposes the next θ.

Each pass through this loop might take seconds on real hardware because of queueing and readout, and a run may need hundreds or thousands of passes. That wall-clock cost is a practical limit in its own right.

A Qiskit outline

Below is the shape of a VQE program in Qiskit for the two-qubit toy problem. I could not run it, because Qiskit was not installed here, and Qiskit’s optimiser and estimator interfaces change between versions. Treat it as an outline to adapt after reading the current documentation.

import numpy as np
from scipy.optimize import minimize
from qiskit import QuantumCircuit
from qiskit.circuit import Parameter
from qiskit.quantum_info import SparsePauliOp
from qiskit.primitives import StatevectorEstimator

H = SparsePauliOp.from_list([
    ("ZI", -0.4), ("IZ", 0.2), ("ZZ", 0.5), ("XX", 0.3), ("YY", 0.3)])

th = [Parameter(f"t{i}") for i in range(4)]
ansatz = QuantumCircuit(2)
ansatz.ry(th[0], 0); ansatz.ry(th[1], 1)
ansatz.cx(0, 1)
ansatz.ry(th[2], 0); ansatz.ry(th[3], 1)

est = StatevectorEstimator()
def energy(x):
    job = est.run([(ansatz, H, x)])
    return float(job.result()[0].data.evs)

res = minimize(energy, np.random.uniform(0, 2*np.pi, 4), method="COBYLA")
print(res.fun)   # expected near -1.3485 for this toy H
VQE outline. Not run here. In SparsePauliOp strings, the rightmost character acts on qubit 0, so check which qubit each of your coefficients applies to.

The ZI/IZ ordering matters. In Qiskit’s convention the string is read right to left, so “ZI” means Z on qubit 1 and identity on qubit 0. My simulation used the same convention. If you swap them, the Hamiltonian changes, and so does the answer.

The Estimator primitive hides the grouping and the basis rotations described earlier. On real hardware you would use the hardware Estimator, set a shot budget, and probably add error mitigation. I have not tested any of that here.

Honest limits of VQE

  • The ansatz may not contain the ground state. A circuit that is too simple gives a biased answer, and you cannot tell how biased without knowing the truth.
  • The optimisation is hard. The energy surface can have many local minima, and the noise makes gradient steps unreliable.
  • Measurement cost is large. The shot counts for realistic Hamiltonians can be enormous, as the chemical-accuracy example hinted.
  • Noise on current hardware biases the energy. Error mitigation helps but adds more cost.
  • No demonstrated advantage over the best classical methods on a useful problem. Preskill’s 2018 NISQ paper, whose abstract I opened, describes near-term devices of roughly 50 to 100 qubits and says noise limits the circuit size. VQE is one candidate approach for that era, not a proven winner.

None of this makes VQE worthless. It is a clean, teachable template for hybrid algorithms, and the techniques it uses (parameterised circuits, measurement grouping, parameter-shift gradients) appear all over the field, including the quantum machine learning lesson that follows.

Experiment: gradient descent with noisy gradients

The earlier gradient-descent table used exact numbers. On a real device each energy is an estimate from a finite number of shots, so each gradient is noisy. To see what that does, I repeated the one-qubit problem H = Z + 0.5X with the ansatz Ry(θ)|0⟩. Each energy was estimated by simulated sampling: N shots to measure Z and N shots to measure X, at both shifted angles of the parameter-shift rule. I started at θ = 0.5, ran 40 steps with step size 0.5, and repeated the whole run 30 times for each N. The exact minimum is −1.118034. This is my own NumPy simulation.

Shots per measurement NMean final energySpread (std of 30 runs)Best runWorst run
10−1.10930.0106−1.1180−1.0776
100−1.11740.0007−1.1180−1.1151
1,000−1.11800.0001−1.1180−1.1177
10,000−1.11800.0000−1.1180−1.1180

Final energy of noisy gradient descent on the one-qubit VQE problem, 30 runs per row. My own simulation. The starting angle 0.5 sits close to the top of the energy curve, where the gradient is small.

Two things stand out. First, even with only 10 shots per measurement, the optimiser ends within 0.01 of the minimum on average, because the problem is tiny and smooth. Second, the spread falls sharply with N: from 0.0106 to 0.0007 when N grows tenfold, which is faster than the square-root law because the landscape is flat at the minimum, so errors in θ cost energy only quadratically. A small error in the angle gives a much smaller error in the energy.

The starting point matters

The angle 0.5 is close to the maximum of E(θ), where the exact gradient is only −0.04. With noisy gradients, the first few steps can go either way. Runs with few shots sometimes wandered for several steps before descending. Starting away from a flat region, as the first table did at θ = 0, makes the early steps reliable.

Noise in the energy matters more for the final answer than noise in the path, because a result is judged by its last energy. The practical advice is to use few shots early, when the direction is clear, and more shots near the end, when small differences matter. I describe this as a common tactic and did not test an adaptive schedule here.

What a VQE run costs in circuit executions

Put the pieces together and count circuit runs for a small problem. Suppose the Hamiltonian splits into g measurement groups, each estimated with N shots, and the optimiser takes S steps with the parameter-shift rule on k parameters. Each step needs two evaluations per parameter, and each evaluation needs g groups of N shots.

total circuit runs  =  S × 2k × g × N
The cost of a VQE optimisation using the parameter-shift rule. This is my own bookkeeping, not a formula from a source.
CaseS stepsk parametersg groupsN shotsTotal runs
One-qubit toy above401210016,000
Small molecule (illustrative)2008101,00032,000,000
Larger molecule (illustrative)5004010010,00040,000,000,000

Total circuit executions for three illustrative VQE runs. The first row matches my simulation (2 groups: Z and X; 100 shots). The other two rows use made-up sizes to show the scaling.

The toy needs 16,000 circuit runs, which takes a fraction of a second on a simulator. The illustrative larger case needs 40 billion. At 10,000 runs per second that is 4 million seconds, about 46 days, before counting queue times. This is the arithmetic behind the statement that variational algorithms are limited by measurement cost. It also shows why methods that reduce the number of groups g, or the number of parameters k, matter.

Ways to reduce the cost

  • Group commuting Pauli terms so they are measured together, which reduces g.
  • Use an ansatz with fewer parameters, which reduces k, at the risk of missing the ground state.
  • Use adaptive shots, with fewer early and more late.
  • Start from a good classical guess so S is small.

Each of these trades some accuracy or generality for cost. The VQE lesson's earlier sections on the ansatz choice and barren plateaus describe the other side of the trade.

Frequently asked questions

How is VQE different from phase estimation?

Phase estimation uses long coherent circuits and gives a precise energy in one go, but needs fault-tolerant hardware. VQE uses short circuits many times over, plus classical optimisation, and gives a rougher answer on noisy hardware. It trades circuit depth for repetition.

Is VQE guaranteed to find the ground state?

No. It finds the best state its ansatz can reach, and only if the optimiser succeeds. The variational principle guarantees the true energy is not below E₀, not that you reach it.

Can VQE find excited states?

Variants exist, but I did not study them here, so I will not describe them in detail.

Why is the parameter-shift rule useful?

It gives an exact gradient from hardware measurements alone, with no need to differentiate the circuit. The cost is two extra evaluations per parameter.

Practice questions

Check yourself

For H = Z + 0.5X and the ansatz Ry(θ)|0⟩, what is E(θ)?

E(θ) = cos θ + 0.5 sin θ, with minimum −√1.25 = −1.118034.

Why can a noisy energy estimate fall below E₀?

The variational bound is for the exact energy. A finite number of shots adds random error that can push the estimate down.

How many extra circuit evaluations does one parameter-shift gradient need for a circuit with 20 parameters?

Two per parameter, so 40.

In the toy problem, why do we need three measurement groups?

ZI, IZ and ZZ share the Z basis, but XX needs an X-basis rotation and YY needs a Y-basis rotation.

What did the barren-plateau table show for the global cost as n grows?

The gradient variance fell by about half for each added qubit.

Extra practice: VQE numbers

These problems use the numbers from this lesson. Try each before opening the answer. All values were computed in Python.

Check yourself

V1. The energy is E(θ) = cos θ + 0.5 sin θ. What is the exact minimum value, and at what θ does it occur (between 0 and 2π)?

The minimum is −√(1 + 0.25) = −1.118034. It occurs where the derivative −sin θ + 0.5 cos θ is zero and the energy is negative, which is θ = π + arctan(0.5) = 3.6052. This matches the value used in the practice sets.

V2. A run uses S = 100 steps, k = 4 parameters, g = 6 measurement groups and N = 500 shots with the parameter-shift rule. How many circuit runs is that?

Total = S × 2k × g × N = 100 × 8 × 6 × 500 = 2,400,000 circuit runs. At 5,000 runs per second that is 480 seconds, 8 minutes, ignoring queue time and classical processing.

V3. Why does the noisy-descent experiment end closer to the true minimum than the shot noise alone would suggest?

Near the minimum the energy is flat, so a small error in θ changes the energy only by a term proportional to the error squared. A noisy angle therefore costs much less energy than a noisy gradient suggests. This is a property of smooth minima and does not hold for sharp landscapes.

V4. Why can a VQE energy that goes down still be misleading?

By the variational principle the estimate cannot go below the true ground-state energy in exact arithmetic, but with shot noise an individual estimate can. A lower number may be a lucky fluctuation, so compare averages over repeated evaluations before accepting it.

Summary

  • VQE minimises the measured energy of a parameterised circuit, using a classical optimiser, and the variational principle guarantees the exact energy stays above E₀.
  • The parameter-shift rule gives exact gradients from hardware at the cost of two extra evaluations per parameter.
  • Shot noise sets precision: the standard error falls only as 1/√S, so chemical accuracy can need very many shots.
  • Barren plateaus can flatten the landscape as qubits are added, especially for global costs and deep circuits.
  • VQE is a teaching template and a research idea, with no demonstrated advantage yet.

References and further reading

I opened the arXiv pages for Peruzzo et al. 2013 (the first VQE experiment), McClean et al. 2018 (barren plateaus), Cerezo et al. 2020 (the review of variational quantum algorithms) and Preskill 2018 (the NISQ era). Statements I attribute to a paper are limited to what the abstract says. The parameter-shift rule and the measurement-grouping idea are standard techniques that I verified numerically rather than from a source opened here. Qiskit was not installed, so the code is not run. Every number in the tables comes from my own simulation.

  1. A variational eigenvalue solver on a quantum processor (arXiv (Peruzzo et al., 2013)) Opened the abstract. First VQE experiment on a photonic processor; He-H⁺ to chemical accuracy; less coherent evolution than phase estimation.
  2. Barren plateaus in quantum neural network training landscapes (arXiv / Nature Communications (McClean et al., 2018)) Opened the abstract. Gradient probability decays exponentially with qubit number for a broad class of circuits.
  3. Variational Quantum Algorithms (arXiv (Cerezo et al., 2020)) Opened the abstract. Names trainability, accuracy and efficiency as key challenges.
  4. Quantum Computing in the NISQ era and beyond (arXiv / Quantum (J. Preskill, 2018)) Opened the abstract. Near-term devices of about 50 to 100 qubits, limited by noise.