Lesson 50 · 110 min · advanced
Barren Plateaus
A variational circuit is trained by following gradients, and the previous lessons showed how to measure them. This lesson asks how large they are. For circuits random enough to form a unitary 2-design, the derivative of a cost with respect to any one angle has mean zero and a variance that decays like : the landscape is exponentially flat almost everywhere, a barren plateau, and resolving a gradient costs exponentially many shots. We prove this from the first two Haar moments, solve a product model exactly to see that the plateau depends on the cost function (global costs are flat, local costs are not), survey the other known causes, and justify the standard mitigations.
Prerequisites: The Parameter-Shift Rule
Objectives and key results
Prove the Haar first moment with Schur's lemma and derive, from the Weingarten formula, for Haar-random states.
Derive the gradient formula and the McClean et al. bound for a 2-design and a Pauli-string , and translate it into a shot cost .
Compute exactly, in the product model , for the global cost and for the local cost, and verify both by Monte Carlo.
Name the other known sources of barren plateaus (global observables, entanglement, hardware noise, expressibility) with the precise statements of the literature.
Justify local costs, identity-block initialisation, layerwise training and parameter correlation as mitigations, and prove that at an identity-block initialisation the gradient only depends on one block.
- identity · Haar moments
- formula · Gradient as a commutator
- theorem · McClean et al. variance bound
- formula · Product model: global versus local cost
- theorem · Gradient at an identity-block initialisation
When the gradient disappears#
Throughout, a parameterised circuit on qubits, , is a product of fixed gates and rotations with Pauli strings , and the cost is for a Hermitian . The parameter-shift rule gives every derivative exactly from two circuit evaluations, and each evaluation is a mean of shots with variance at most .
Training starts from random angles. If the derivatives at a random point are typically of size , a few thousand shots resolve them. If they are of size , no realistic budget does: the estimated gradient is pure shot noise and the optimiser performs a random walk. The question of this lesson is therefore statistical: what is the distribution of when is random?
Definition
Barren plateau
A family of parameterised circuits and costs on qubits, with parameters drawn from a distribution , has a barren plateau if for every parameter By Chebyshev's inequality the probability that is then at most , which is exponentially small for any fixed .
Averages over random unitaries#
Definition
Haar measure and unitary t-designs
The Haar measure on the unitary group is the unique probability measure that is invariant under left and right multiplication: for every fixed unitary . An ensemble of unitaries is a unitary -design if it reproduces the Haar averages of all polynomials of degree at most in the entries of and of degree at most in those of ; equivalently for every operator on . Random circuits of polynomial depth on qubits are approximate 2-designs (Brandão, Harrow and Horodecki), which is why the Haar computations below describe deep, randomly initialised ansätze.
First Haar moment
For every operator on , . Consequently, for a Haar-random (or 1-design) state , .
Proof (5 steps)
- Step 1:Left invariance of the Haar measure: the substitution does not change the integral. Hence commutes with every unitary.
- Step 2:This is Schur's lemma for the defining representation, proved by hand. The diagonal unitary flips the sign of row and of column , so an off-diagonal entry in row changes sign; forces it to vanish. Thus is diagonal.
- Step 3:Permutation matrices are unitary; conjugating a diagonal matrix by a transposition swaps two diagonal entries. All diagonal entries are therefore equal and .
- Step 4:The trace is linear, cyclic (), and the measure has total mass .
- Step 5:Apply the result to , which is again Haar distributed (invariance under follows from uniqueness of the measure). A 1-design reproduces this degree- average by definition.
∎
The second moment needs more than Schur's lemma for one copy. We state the Weingarten formula (Collins and Śniady), which follows from Schur–Weyl duality for : for operators on , , As a sanity check, gives , the value of . A 2-design reproduces this formula, because the integrand has degree two in and two in . Let be the swap operator, .
Second moment of a Haar-random state
For with Haar-random (or from a 2-design), , and for all operators : . In particular .
Proof (6 steps)
- Step 1:Cyclicity of the trace; set in the Weingarten formula, so .
- Step 2:Substitute into the Weingarten formula.
- Step 3:Both fractions carry the same numerator; and .
- Step 4:Insert the definition of ; the sum over is a resolution of the identity.
- Step 5:The left side is ; the right side is the same number by the previous two lines.
- Step 6:Product operators span all operators on , and an operator is fixed by its Hilbert–Schmidt inner products with a spanning set. Note that is the projector onto the symmetric subspace, of dimension : the average is the normalised symmetric projector.
∎
Quick check
For a Haar-random two-qubit state (), what is ?
The McClean et al. theorem#
The gradient as an expectation of a commutator
Split the circuit at the -th rotation, , with , , and absorb the rotation into the later part, writing for . Then, with , and is Hermitian and traceless.
Proof (5 steps)
- Step 1:Definition of the cost with the circuit split at gate ; only depends on .
- Step 2:Differentiate the exponential ; commutes with every function of itself.
- Step 3:Product rule: the derivative hits on the left or on the right; move next to using the second form of each derivative.
- Step 4:Combine the two terms; is for the renamed . Right invariance of the Haar measure means that is a 2-design whenever is, so the renaming does not affect any assumption below.
- Step 5:and are Hermitian, so their commutator is anti-Hermitian and times it is Hermitian; a commutator is traceless by cyclicity.
∎
Barren plateaus of 2-design circuits (McClean et al. 2018)
(a) If or is a 1-design, independent of the other part, then . (b) If is a 2-design, then for every fixed which is at most when is a Pauli string. (c) If instead is a 2-design and is a traceless Pauli string, .
Proof (8 steps)
- Step 1:(a) First Haar moment for (with ), or for : the average of is a multiple of the identity, which commutes with , and the commutator is linear in .
- Step 2:(b) The mean is zero by (a), and the second-moment theorem applies to with fixed by .
- Step 3:and .
- Step 4:Expand and use .
- Step 5:Cyclicity gives . By Cauchy–Schwarz for the Hilbert–Schmidt product, , and is unitarily similar to .
- Step 6:Combine the last three lines; a Pauli string squares to the identity, so . Equality holds when anticommutes with .
- Step 7:(c) by cyclicity. As before, with , , and .
- Step 8:Weingarten with , , and ; for a traceless Pauli string and .
∎
Chebyshev bound and shot cost
Under (b), for every : . To estimate a gradient of the typical size to relative precision with the parameter-shift rule, shots per evaluation are needed, which is of order when is of order , as for the anticommuting case .
Proof (3 steps)
- Step 1:Chebyshev's inequality, applied to with and the variance bound of the theorem.
- Step 2:Shot noise of the parameter-shift estimator for a Pauli-string (lesson on finite differences): each evaluation averages outcomes .
- Step 3:The worst-case standard deviation must be below the precision we ask for; when are close to , as on a plateau, the shot-noise variance is close to its maximum , so the bound is essentially tight.
∎
An exactly solvable model: global versus local costs#
The 2-design theorem says nothing about shallow circuits, and it hides how much depends on the cost. Cerezo, Sone, Volkoff, Cincio and Coles isolated the effect of the cost in a model with no entanglement at all: the product ansatz on , with independent angles uniform on . The task is to return to , measured in two ways: the global cost asks whether all qubits are back, and the local cost averages over single qubits. Both vanish exactly at .
Closed forms and Pauli operators of the two costs
- Step 1:applied to .
- Step 2:The double-angle formula; .
- Step 3:The overlap of a product state factorises. Expanding the tensor product of the binomials gives with and .
- Step 4:The reduced state of qubit is that of . The global cost needs all Pauli words; the local one only .
Result
Exact gradient variances
- Step 1:Chain rule; .
- Step 2:Only the factor, or the summand, with depends on .
- Step 3:Independence lets the expectation of a product factorise; the factor vanishes.
- Step 4:integrates to zero over a full period.
- Step 5:Expand the square; and as for .
- Step 6:The mean is zero, so the variance is the second moment; the factors are independent.
- Step 7:The same computation with a single factor.
Result
The global variance decays exponentially, by the factor per qubit (rate ), although the circuit has depth one and creates no entanglement: the plateau comes from the cost alone. The local variance decays only polynomially. For two and three qubits the global variance is still the larger one; from on it is smaller and the gap widens quickly. Exact values against a Monte-Carlo estimate with the simulator engine ( random parameter vectors per row, shifted circuits simulated as statevectors):
| exact | sampled | exact | sampled | |
|---|---|---|---|---|
| 2 | ||||
| 4 | ||||
| 6 | ||||
| 8 |
At the exact global value compares with sampled. The global estimates scatter more than the local ones, and that is part of the phenomenon: the derivative is tiny except on the rare draws where every is close to . Its kurtosis (from and ) grows exponentially, so the relative standard error of a sampled variance grows too, about at and at for . Even measuring the plateau gets harder as it gets flatter.
Quick check
In the product model with qubits, what is ?
The local cost is faithful to the global one
For every -qubit state , with and , the costs and satisfy . In particular : minimising the local cost solves the global task.
Proof (4 steps)
- Step 1:All three operators are diagonal in the computational basis; is the number of ones in the bit string , i.e. the number of qubits not in .
- Step 2:Compare the diagonal entries: for every nonzero string.
- Step 3:Diagonal operators are ordered entrywise.
- Step 4:implies for every state .
∎
import { mulberry32, parameterShiftGradient } from '@/lib/quantum-simulator';
// Product ansatz V(theta) = R_X(t1) (x) ... (x) R_X(tn) on |0...0>, with R_X(t) = exp(-i t X / 2).
function productCircuit(n: number) {
const names = Array.from({ length: n }, (_, q) => 't' + (q + 1));
return {
version: 1 as const,
numQubits: n,
numClbits: 0,
parameters: names.map((name) => ({ name, value: 0 })),
ops: names.map((name, q) => ({ kind: 'gate' as const, gate: 'RX' as const, targets: [q], params: [{ param: name }] })),
};
}
// C_G = 1 - |0..0><0..0| = (1 - 2^-n) I - 2^-n sum_{S nonempty} Z_S; C_L = 1/2 - (1/2n) sum_j Z_j.
function globalCost(n: number) {
const terms = [{ coeff: 1 - 2 ** -n, ops: 'I'.repeat(n) }];
for (let mask = 1; mask < 1 << n; mask++) {
let word = '';
for (let q = 0; q < n; q++) word += (mask >> (n - 1 - q)) & 1 ? 'Z' : 'I';
terms.push({ coeff: -(2 ** -n), ops: word });
}
return terms;
}
function localCost(n: number) {
const terms = [{ coeff: 0.5, ops: 'I'.repeat(n) }];
for (let j = 0; j < n; j++) terms.push({ coeff: -1 / (2 * n), ops: 'I'.repeat(j) + 'Z' + 'I'.repeat(n - j - 1) });
return terms;
}
const S = 4000; // random parameter vectors per (n, cost)
for (const n of [2, 4, 6]) {
const circuit = productCircuit(n);
const costs = [
{ name: 'global', H: globalCost(n), exact: (1 / 8) * (3 / 8) ** (n - 1) },
{ name: 'local ', H: localCost(n), exact: 1 / (8 * n * n) },
];
for (const { name, H, exact } of costs) {
const rng = mulberry32(50 + n);
const g: number[] = [];
let worst = 0;
let evaluations = 0;
for (let s = 0; s < S; s++) {
const bindings: Record<string, number> = {};
for (let q = 0; q < n; q++) bindings['t' + (q + 1)] = 2 * Math.PI * rng();
const res = parameterShiftGradient(circuit, H, { bindings, params: ['t1'] });
evaluations += res.evaluations;
g.push(res.gradient.t1);
// closed form: (1/2) sin t1 prod_{j>=2} cos^2(tj/2) (global), sin t1 / (2n) (local)
let rest = 1;
for (let q = 2; q <= n; q++) rest *= Math.cos(bindings['t' + q] / 2) ** 2;
const closed = name === 'global' ? 0.5 * Math.sin(bindings.t1) * rest : Math.sin(bindings.t1) / (2 * n);
worst = Math.max(worst, Math.abs(res.gradient.t1 - closed));
}
const mean = g.reduce((a, x) => a + x, 0) / S;
const variance = g.reduce((a, x) => a + (x - mean) ** 2, 0) / (S - 1);
console.log('n = ' + n + ', ' + name + ': Var exact ' + exact.toExponential(4) + ', sampled ' + variance.toExponential(4) +
' (ratio ' + (variance / exact).toFixed(3) + '), ' + H.length + ' Pauli terms, ' + evaluations / S + ' evaluations per gradient, |engine - closed form| < 1e-12: ' + (worst < 1e-12));
}
}Expected output
n = 2, global: Var exact 4.6875e-2, sampled 4.7064e-2 (ratio 1.004), 4 Pauli terms, 3 evaluations per gradient, |engine - closed form| < 1e-12: true n = 2, local : Var exact 3.1250e-2, sampled 3.1410e-2 (ratio 1.005), 3 Pauli terms, 3 evaluations per gradient, |engine - closed form| < 1e-12: true n = 4, global: Var exact 6.5918e-3, sampled 6.3754e-3 (ratio 0.967), 16 Pauli terms, 3 evaluations per gradient, |engine - closed form| < 1e-12: true n = 4, local : Var exact 7.8125e-3, sampled 7.7206e-3 (ratio 0.988), 5 Pauli terms, 3 evaluations per gradient, |engine - closed form| < 1e-12: true n = 6, global: Var exact 9.2697e-4, sampled 8.5063e-4 (ratio 0.918), 64 Pauli terms, 3 evaluations per gradient, |engine - closed form| < 1e-12: true n = 6, local : Var exact 3.4722e-3, sampled 3.4955e-3 (ratio 1.007), 7 Pauli terms, 3 evaluations per gradient, |engine - closed form| < 1e-12: true
import numpy as np
S = 200_000 # samples per qubit number
rng = np.random.default_rng(50)
def cost_global(theta): # C_G = 1 - prod_j cos^2(theta_j / 2)
return 1 - np.prod(np.cos(theta / 2) ** 2, axis=-1)
def cost_local(theta): # C_L = 1 - (1/n) sum_j cos^2(theta_j / 2)
return 1 - np.mean(np.cos(theta / 2) ** 2, axis=-1)
def shift_gradient(cost, theta): # d C / d theta_1 = (1/2) [C(theta + pi/2 e_1) - C(theta - pi/2 e_1)]
plus, minus = theta.copy(), theta.copy()
plus[:, 0] += np.pi / 2
minus[:, 0] -= np.pi / 2
return 0.5 * (cost(plus) - cost(minus))
print(" n | Var[d1 C_G] exact sampled | Var[d1 C_L] exact sampled | max |shift - analytic|")
for n in (2, 4, 6):
theta = rng.uniform(0.0, 2 * np.pi, size=(S, n))
g_glob = shift_gradient(cost_global, theta)
g_loc = shift_gradient(cost_local, theta)
analytic_glob = 0.5 * np.sin(theta[:, 0]) * np.prod(np.cos(theta[:, 1:] / 2) ** 2, axis=1)
analytic_loc = np.sin(theta[:, 0]) / (2 * n)
err = max(np.max(np.abs(g_glob - analytic_glob)), np.max(np.abs(g_loc - analytic_loc)))
exact_glob = (1 / 8) * (3 / 8) ** (n - 1)
exact_loc = 1 / (8 * n * n)
print(f"{n:2d} | {exact_glob:.4e} {g_glob.var(ddof=1):.4e} | {exact_loc:.4e} {g_loc.var(ddof=1):.4e} | {'< 1e-12' if err < 1e-12 else err}")
kurt = np.mean(g_glob ** 4) / np.mean(g_glob ** 2) ** 2
print(f" kurtosis E[g^4]/E[g^2]^2 of d1 C_G: exact 1.5 (35/18)^(n-1) = {1.5 * (35 / 18) ** (n - 1):.2f}, sampled {kurt:.2f}")Expected output
n | Var[d1 C_G] exact sampled | Var[d1 C_L] exact sampled | max |shift - analytic|
2 | 4.6875e-02 4.6701e-02 | 3.1250e-02 3.1189e-02 | < 1e-12
kurtosis E[g^4]/E[g^2]^2 of d1 C_G: exact 1.5 (35/18)^(n-1) = 2.92, sampled 2.92
4 | 6.5918e-03 6.5836e-03 | 7.8125e-03 7.8115e-03 | < 1e-12
kurtosis E[g^4]/E[g^2]^2 of d1 C_G: exact 1.5 (35/18)^(n-1) = 11.03, sampled 11.08
6 | 9.2697e-04 9.2669e-04 | 3.4722e-03 3.4781e-03 | < 1e-12
kurtosis E[g^4]/E[g^2]^2 of d1 C_G: exact 1.5 (35/18)^(n-1) = 41.69, sampled 42.06The TypeScript cell builds both costs as Pauli sums, so needs terms, and differentiates the real circuit with the engine's parameter-shift routine (two shifted evaluations plus the value). With the global estimate at is already off by , consistent with its relative standard error of about ; the NumPy cell uses samples and also checks the kurtosis formula.
Other sources of barren plateaus#
Randomness of the whole circuit is one mechanism among several. The statements below are quoted from the literature without proof; each is a theorem in the cited paper.
- Global observables. For alternating layered ansätze whose two-qubit blocks form local 2-designs, a global cost such as has exponentially small in already at depth , while a local cost of depth has (Cerezo et al. 2021). The product model above is the depth-one instance of this dichotomy.
- Entanglement-induced plateaus. If the visible qubits of a model satisfy a volume law of entanglement with hidden qubits, their reduced state is exponentially close to maximally mixed and the gradients of local costs on the visible qubits vanish exponentially (Ortiz Marrero, Kieferová and Wiebe 2021). Too much entanglement destroys trainability even for local costs.
- Noise-induced plateaus. For local Pauli noise of strength acting after each of layers, the gradient satisfies for every parameter value, with fixed by the Pauli coefficients of the cost, so , which decays at least like (Wang et al. 2021). When grows linearly with this is exponential decay that no initialisation strategy can avoid, because the bound is deterministic.
- Expressibility. The more uniformly an ansatz covers the unitary group, the closer its gradient variance is to the 2-design value; Holmes, Sharma, Cerezo and Coles (2022) bound in terms of the distance of the ansatz ensemble from a 2-design. High expressibility and trainability pull in opposite directions.
The plotter above samples the hardware-efficient ansatz of the earlier lessons ( and on every qubit followed by a CZ ladder, repeated times) with uniform random angles, for the global observable and the local one , together with the reference line. Deep enough random HEA circuits approach a 2-design, which is the regime of the McClean et al. theorem.
Mitigation strategies and why they work#
Local costs. Replace a global cost by a local one with the same zero set. The proposition above shows , so nothing is lost at the optimum, and the product model shows the gain: instead of . For shallow layered circuits the local variance stays polynomial (Cerezo et al. 2021). A local cost does not help against deep random circuits, whose variance is exponentially small for every observable by the McClean et al. theorem.
Identity-block initialisation. Grant, Wossnig, Ostaszewski and Benedetti build the circuit from blocks , a shallow block followed by its mirror image with independent parameters. At initialisation the forward angles are random and , so every block, and the whole circuit, is exactly the identity, while each parameter can still move independently. The following theorem makes precise what the gradient sees at that point.
Gradient at an identity-block initialisation
Let with , evaluated at for all , so . Let be a parameter of the forward part of block , with . Then which depends only on the gates of block that precede , not on the number of blocks. If , then .
Proof (5 steps)
- Step 1:Only block depends on , and .
- Step 2:At initialisation every other block is the identity and ; multiply from the left by and from the right by .
- Step 3:Product rule at ; is Hermitian, so .
- Step 4:Collect the two terms. is the Pauli string propagated backwards through the gates of one block, so it acts only inside the backward light cone of in a circuit of depth at most that of .
- Step 5:is Hermitian, so also .
∎
The theorem is the justification: however many blocks the circuit has, the initial gradient is that of a circuit of the depth of one block, whose light cone is finite and whose randomness is far from a 2-design. For a local term of the derivative involves only the qubits inside that light cone, so its distribution does not depend on at all. The last statement adds a caveat: if the reference state is an eigenvector of , the identity point is a stationary point and every first derivative vanishes there exactly. Both observables of the plotter, and , have as an eigenvector, so the identity-block samples below must be read against the theorem: whatever variance the plot reports in this mode is floating-point rounding, far below the line, and it says nothing about a plateau. Grant et al. use the initialisation for problems such as VQE, where the reference state is not an eigenstate of the Hamiltonian and the initial gradient is generically nonzero.
Layerwise training. Skolik, McClean, Mohseni, van der Smagt and Leib grow the circuit during training. A few layers are trained first; each new layer is appended with its angles set to zero, so it acts as the identity and the cost is unchanged, and only the newest layers are optimised while the earlier ones are frozen. Every optimisation phase therefore acts on a shallow trainable part, outside the 2-design regime, and a final phase trains larger groups of layers together.
Parameter correlation. Reusing one angle in several gates, for example the same angle in every layer, shrinks the effective parameter space, so the ensemble of circuits is no longer close to a 2-design. Volkoff and Coles show that such correlations can produce gradient variances that do not vanish exponentially for circuits whose uncorrelated versions have barren plateaus. The derivative with respect to a shared angle is the sum over its occurrences (lesson on the parameter-shift rule), which also adds the contributions coherently.
Quick check
A 40-qubit circuit consists of 30 identity blocks , each of depth 4, initialised with . The cost is . Which statement about the gradient with respect to an angle in block at initialisation is correct?
Lab and references#
In the lab you compute both exact variances of the product model at and then reproduce them by Monte Carlo from a black-box cost function, with exactly two circuit evaluations per random parameter vector.
References
- J. R. McClean, S. Boixo, V. N. Smelyanskiy, R. Babbush and H. Neven, Barren plateaus in quantum neural network training landscapes, Nature Communications 9, 4812 (2018). arXiv:1803.11173.doi:10.1038/s41467-018-07090-4
- M. Cerezo, A. Sone, T. Volkoff, L. Cincio and P. J. Coles, Cost function dependent barren plateaus in shallow parametrized quantum circuits, Nature Communications 12, 1791 (2021). arXiv:2001.00550.doi:10.1038/s41467-021-21728-w
- E. Grant, L. Wossnig, M. Ostaszewski and M. Benedetti, An initialization strategy for addressing barren plateaus in parametrized quantum circuits, Quantum 3, 214 (2019). arXiv:1903.05076.doi:10.22331/q-2019-12-09-214
- A. Skolik, J. R. McClean, M. Mohseni, P. van der Smagt and M. Leib, Layerwise learning for quantum neural networks, Quantum Machine Intelligence 3, 5 (2021). arXiv:2006.14904.doi:10.1007/s42484-020-00036-4
- S. Wang, E. Fontana, M. Cerezo, K. Sharma, A. Sone, L. Cincio and P. J. Coles, Noise-induced barren plateaus in variational quantum algorithms, Nature Communications 12, 6961 (2021). arXiv:2007.14384.doi:10.1038/s41467-021-27045-6
- C. Ortiz Marrero, M. Kieferová and N. Wiebe, Entanglement-induced barren plateaus, PRX Quantum 2, 040316 (2021). arXiv:2010.15968.doi:10.1103/PRXQuantum.2.040316
- Z. Holmes, K. Sharma, M. Cerezo and P. J. Coles, Connecting ansatz expressibility to gradient magnitudes and barren plateaus, PRX Quantum 3, 010313 (2022). arXiv:2101.02138.doi:10.1103/PRXQuantum.3.010313
- T. Volkoff and P. J. Coles, Large gradients via correlation in random parameterized quantum circuits, Quantum Science and Technology 6, 025008 (2021). arXiv:2005.12200.doi:10.1088/2058-9565/abd891
- B. Collins and P. Śniady, Integration with respect to the Haar measure on unitary, orthogonal and symplectic group, Communications in Mathematical Physics 264, 773–795 (2006).doi:10.1007/s00220-006-1554-3
- F. G. S. L. Brandão, A. W. Harrow and M. Horodecki, Local random quantum circuits are approximate polynomial-designs, Communications in Mathematical Physics 346, 397–434 (2016). arXiv:1208.0692.doi:10.1007/s00220-016-2706-8
Hands-on labs
Global versus local costs on a barren plateau
2 steps · auto-gradedOpen labQuantify the barren plateau of the exactly solvable product model on . First compute the exact gradient variances of the global cost and the local cost at ; then estimate them by Monte Carlo from a black-box cost function, using the parameter-shift rule with exactly two circuit evaluations per random parameter vector.