QuantumCore

Lesson 50 · 110 min · advanced

Barren Plateaus

Loading progress…

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 2−n2^{-n}: 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 ∫dU UAU†=TrAdI\int\mathrm dU\,UAU^\dagger=\frac{\mathrm{Tr}A}{d}I with Schur's lemma and derive, from the Weingarten formula, E[⟨ψ∣A∣ψ⟩2]=Tr(A)2+Tr(A2)d(d+1)\mathbb E\big[\langle\psi\vert A\vert\psi\rangle^2\big]=\frac{\mathrm{Tr}(A)^2+\mathrm{Tr}(A^2)}{d(d+1)} for Haar-random states.

  • Derive the gradient formula ∂kC=i2⟨0∣U−†[Vk,U+†HU+]U−∣0⟩\partial_kC=\frac i2\langle0\vert U_-^\dagger[V_k,U_+^\dagger HU_+]U_-\vert0\rangle and the McClean et al. bound Var[∂kC]≤12n+1\mathrm{Var}[\partial_kC]\le\frac1{2^n+1} for a 2-design U−U_- and a Pauli-string HH, and translate it into a shot cost O(2n/ε2)O(2^n/\varepsilon^2).

  • Compute exactly, in the product model ⨂jRX(θj)∣0⟩⊗n\bigotimes_jR_X(\theta_j)\lvert0\rangle^{\otimes n}, Var[∂1CG]=18(38)n−1\mathrm{Var}[\partial_1C_G]=\frac18\big(\frac38\big)^{n-1} for the global cost and Var[∂1CL]=18n2\mathrm{Var}[\partial_1C_L]=\frac1{8n^2} 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
∫dU UAU†=TrAd I,∫dU (U∣0⟩⟨0∣U†)⊗2=I+Fd(d+1)\int\mathrm dU\,UAU^\dagger=\frac{\mathrm{Tr}A}{d}\,I,\qquad\int\mathrm dU\,\big(U\lvert0\rangle\langle0\rvert U^\dagger\big)^{\otimes2}=\frac{I+F}{d(d+1)}
formula · Gradient as a commutator
∂kC=i2 ⟨0∣U−† [Vk, U+†HU+] U−∣0⟩,Rk(θk)=e−iθkVk/2\partial_kC=\tfrac i2\,\langle0\vert U_-^\dagger\,[V_k,\,U_+^\dagger HU_+]\,U_-\vert0\rangle,\qquad R_k(\theta_k)=e^{-i\theta_kV_k/2}
theorem · McClean et al. variance bound
U− 2-design, H Pauli string:E[∂kC]=0,Var[∂kC]=Tr(A2)d(d+1)≤12n+1U_-\ \text{2-design},\ H\ \text{Pauli string}:\quad\mathbb E[\partial_kC]=0,\qquad\mathrm{Var}[\partial_kC]=\frac{\mathrm{Tr}(A^2)}{d(d+1)}\le\frac1{2^n+1}
formula · Product model: global versus local cost
Var[∂1CG]=18(38)n−1,Var[∂1CL]=18n2\mathrm{Var}[\partial_1C_G]=\frac18\Big(\frac38\Big)^{n-1},\qquad\mathrm{Var}[\partial_1C_L]=\frac1{8n^2}
theorem · Gradient at an identity-block initialisation
U(θ0)=I ⇒ ∂kC=i2 ⟨0∣[Qk,H]∣0⟩,Qk=W<k†VkW<kU(\theta^0)=I\ \Rightarrow\ \partial_kC=\tfrac i2\,\langle0\vert[Q_k,H]\vert0\rangle,\qquad Q_k=W_{<k}^\dagger V_kW_{<k}

When the gradient disappears#

Throughout, a parameterised circuit U(θ)U(\theta) on nn qubits, d=2nd=2^n, is a product of fixed gates and rotations Rk(θk)=e−iθkVk/2R_k(\theta_k)=e^{-i\theta_kV_k/2} with Pauli strings VkV_k, and the cost is C(θ)=⟨0∣U(θ)†HU(θ)∣0⟩C(\theta)=\langle0\vert U(\theta)^\dagger HU(\theta)\vert0\rangle for a Hermitian HH. The parameter-shift rule gives every derivative exactly from two circuit evaluations, and each evaluation is a mean of NN shots with variance at most ∥H∥2/N\lVert H\rVert^2/N.

Training starts from random angles. If the derivatives at a random point are typically of size 10−210^{-2}, a few thousand shots resolve them. If they are of size 10−810^{-8}, 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 ∂kC\partial_kC when θ\theta is random?

Definition

Barren plateau

A family of parameterised circuits and costs on nn qubits, with parameters drawn from a distribution θ∼Dn\theta\sim\mathcal D_n, has a barren plateau if for every parameter θk\theta_k Eθ[∂kC]=0andVarθ[∂kC]∈O(b−n)  for some b>1.\mathbb E_\theta[\partial_kC]=0\qquad\text{and}\qquad\mathrm{Var}_\theta[\partial_kC]\in O(b^{-n})\ \text{ for some } b>1 . By Chebyshev's inequality the probability that ∣∂kC∣≥δ\lvert\partial_kC\rvert\ge\delta is then at most Var[∂kC]/δ2\mathrm{Var}[\partial_kC]/\delta^2, which is exponentially small for any fixed δ\delta.

Averages over random unitaries#

Definition

Haar measure and unitary t-designs

The Haar measure dU\mathrm dU on the unitary group U(d)\mathrm U(d) is the unique probability measure that is invariant under left and right multiplication: ∫f(WU) dU=∫f(UW) dU=∫f(U) dU\int f(WU)\,\mathrm dU=\int f(UW)\,\mathrm dU=\int f(U)\,\mathrm dU for every fixed unitary WW. An ensemble ν\nu of unitaries is a unitary tt-design if it reproduces the Haar averages of all polynomials of degree at most tt in the entries of UU and of degree at most tt in those of Uˉ\bar U; equivalently Eν[U⊗tXU†⊗t]=∫U⊗tXU†⊗t dU\mathbb E_\nu\big[U^{\otimes t}XU^{\dagger\otimes t}\big]=\int U^{\otimes t}XU^{\dagger\otimes t}\,\mathrm dU for every operator XX on (Cd)⊗t(\mathbb C^d)^{\otimes t}. Random circuits of polynomial depth on nn qubits are approximate 2-designs (Brandão, Harrow and Horodecki), which is why the Haar computations below describe deep, randomly initialised ansätze.

Theorem

First Haar moment

For every operator AA on Cd\mathbb C^d,   M:=∫dU UAU†=TrAd I\;M:=\int\mathrm dU\,UAU^\dagger=\frac{\mathrm{Tr}A}{d}\,I. Consequently, for a Haar-random (or 1-design) state ∣ψ⟩=U∣0⟩\lvert\psi\rangle=U\lvert0\rangle, E⟨ψ∣A∣ψ⟩=TrAd\mathbb E\langle\psi\vert A\vert\psi\rangle=\frac{\mathrm{Tr}A}d.

Proof (5 steps)
  1. Step 1:
    WMW†=∫dU (WU)A(WU)†=∫dU UAU†=M∀W∈U(d)WMW^\dagger=\int\mathrm dU\,(WU)A(WU)^\dagger=\int\mathrm dU\,UAU^\dagger=M\quad\forall W\in\mathrm U(d)
    Left invariance of the Haar measure: the substitution U↦WUU\mapsto WU does not change the integral. Hence MM commutes with every unitary.
  2. Step 2:
    Dj=I−2∣j⟩⟨j∣:(DjMDj)jk=−Mjk (k≠j) ⇒ Mjk=0D_j=I-2\lvert j\rangle\langle j\rvert:\quad (D_jMD_j)_{jk}=-M_{jk}\ (k\neq j)\ \Rightarrow\ M_{jk}=0
    This is Schur's lemma for the defining representation, proved by hand. The diagonal unitary DjD_j flips the sign of row jj and of column jj, so an off-diagonal entry in row jj changes sign; DjMDj=MD_jMD_j=M forces it to vanish. Thus MM is diagonal.
  3. Step 3:
    Pjk (transposition of ∣j⟩,∣k⟩):(PjkMPjk)jj=Mkk ⇒ Mjj=MkkP_{jk}\ \text{(transposition of }\lvert j\rangle,\lvert k\rangle):\quad (P_{jk}MP_{jk})_{jj}=M_{kk}\ \Rightarrow\ M_{jj}=M_{kk}
    Permutation matrices are unitary; conjugating a diagonal matrix by a transposition swaps two diagonal entries. All diagonal entries are therefore equal and M=cIM=cI.
  4. Step 4:
    cd=TrM=∫dU Tr(UAU†)=TrA ⇒ c=TrAdcd=\mathrm{Tr}M=\int\mathrm dU\,\mathrm{Tr}(UAU^\dagger)=\mathrm{Tr}A\ \Rightarrow\ c=\frac{\mathrm{Tr}A}d
    The trace is linear, cyclic (Tr(UAU†)=TrA\mathrm{Tr}(UAU^\dagger)=\mathrm{Tr}A), and the measure has total mass 11.
  5. Step 5:
    E ⟨ψ∣A∣ψ⟩=⟨0∣(∫dU U†AU)∣0⟩=TrAd\mathbb E\,\langle\psi\vert A\vert\psi\rangle=\langle0\vert\Big(\int\mathrm dU\,U^\dagger AU\Big)\vert0\rangle=\frac{\mathrm{Tr}A}{d}
    Apply the result to U†U^\dagger, which is again Haar distributed (invariance under U↦U−1U\mapsto U^{-1} follows from uniqueness of the measure). A 1-design reproduces this degree-(1,1)(1,1) 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 U⊗UU\otimes U: for operators A,B,C,DA,B,C,D on Cd\mathbb C^d, d≥2d\ge2, ∫dU Tr(AUBU†) Tr(CUDU†)=TrA TrB TrC TrD+Tr(AC) Tr(BD)d2−1−Tr(AC) TrB TrD+TrA TrC Tr(BD)d(d2−1).\int\mathrm dU\,\mathrm{Tr}(AUBU^\dagger)\,\mathrm{Tr}(CUDU^\dagger)=\frac{\mathrm{Tr}A\,\mathrm{Tr}B\,\mathrm{Tr}C\,\mathrm{Tr}D+\mathrm{Tr}(AC)\,\mathrm{Tr}(BD)}{d^2-1}-\frac{\mathrm{Tr}(AC)\,\mathrm{Tr}B\,\mathrm{Tr}D+\mathrm{Tr}A\,\mathrm{Tr}C\,\mathrm{Tr}(BD)}{d(d^2-1)} . As a sanity check, A=B=C=D=IA=B=C=D=I gives d4+d2d2−1−2d3d(d2−1)=d2\frac{d^4+d^2}{d^2-1}-\frac{2d^3}{d(d^2-1)}=d^2, the value of Tr(UU†)2\mathrm{Tr}(UU^\dagger)^2. A 2-design reproduces this formula, because the integrand has degree two in UU and two in Uˉ\bar U. Let F=∑i,j∣i⟩⟨j∣⊗∣j⟩⟨i∣F=\sum_{i,j}\lvert i\rangle\langle j\rvert\otimes\lvert j\rangle\langle i\rvert be the swap operator, F(∣a⟩⊗∣b⟩)=∣b⟩⊗∣a⟩F(\lvert a\rangle\otimes\lvert b\rangle)=\lvert b\rangle\otimes\lvert a\rangle.

Theorem

Second moment of a Haar-random state

For ∣ψ⟩=U∣0⟩\lvert\psi\rangle=U\lvert0\rangle with UU Haar-random (or from a 2-design),   E[(∣ψ⟩⟨ψ∣)⊗2]=I+Fd(d+1)\;\mathbb E\big[(\lvert\psi\rangle\langle\psi\rvert)^{\otimes2}\big]=\dfrac{I+F}{d(d+1)}, and for all operators A,CA,C:   E[⟨ψ∣A∣ψ⟩⟨ψ∣C∣ψ⟩]=TrA TrC+Tr(AC)d(d+1)\;\mathbb E\big[\langle\psi\vert A\vert\psi\rangle\langle\psi\vert C\vert\psi\rangle\big]=\dfrac{\mathrm{Tr}A\,\mathrm{Tr}C+\mathrm{Tr}(AC)}{d(d+1)}. In particular E[⟨ψ∣A∣ψ⟩2]=Tr(A)2+Tr(A2)d(d+1)\mathbb E\big[\langle\psi\vert A\vert\psi\rangle^2\big]=\dfrac{\mathrm{Tr}(A)^2+\mathrm{Tr}(A^2)}{d(d+1)}.

Proof (6 steps)
  1. Step 1:
    ⟨ψ∣A∣ψ⟩=⟨0∣U†AU∣0⟩=Tr(AU∣0⟩⟨0∣U†)\langle\psi\vert A\vert\psi\rangle=\langle0\vert U^\dagger AU\vert0\rangle=\mathrm{Tr}\big(AU\lvert0\rangle\langle0\rvert U^\dagger\big)
    Cyclicity of the trace; set B=D=∣0⟩⟨0∣B=D=\lvert0\rangle\langle0\rvert in the Weingarten formula, so TrB=TrD=Tr(BD)=1\mathrm{Tr}B=\mathrm{Tr}D=\mathrm{Tr}(BD)=1.
  2. Step 2:
    E[⟨ψ∣A∣ψ⟩⟨ψ∣C∣ψ⟩]=TrA TrC+Tr(AC)d2−1−Tr(AC)+TrA TrCd(d2−1)\mathbb E\big[\langle\psi\vert A\vert\psi\rangle\langle\psi\vert C\vert\psi\rangle\big]=\frac{\mathrm{Tr}A\,\mathrm{Tr}C+\mathrm{Tr}(AC)}{d^2-1}-\frac{\mathrm{Tr}(AC)+\mathrm{Tr}A\,\mathrm{Tr}C}{d(d^2-1)}
    Substitute into the Weingarten formula.
  3. Step 3:
    =(TrA TrC+Tr(AC)) d−1d(d2−1)=TrA TrC+Tr(AC)d(d+1)=\big(\mathrm{Tr}A\,\mathrm{Tr}C+\mathrm{Tr}(AC)\big)\,\frac{d-1}{d(d^2-1)}=\frac{\mathrm{Tr}A\,\mathrm{Tr}C+\mathrm{Tr}(AC)}{d(d+1)}
    Both fractions carry the same numerator; 1d2−1−1d(d2−1)=d−1d(d2−1)\frac1{d^2-1}-\frac1{d(d^2-1)}=\frac{d-1}{d(d^2-1)} and d2−1=(d−1)(d+1)d^2-1=(d-1)(d+1).
  4. Step 4:
    Tr[(A⊗C)F]=∑i,j⟨j∣A∣i⟩⟨i∣C∣j⟩=Tr(AC),Tr[(A⊗C)I]=TrA TrC\mathrm{Tr}\big[(A\otimes C)F\big]=\sum_{i,j}\langle j\vert A\vert i\rangle\langle i\vert C\vert j\rangle=\mathrm{Tr}(AC),\qquad\mathrm{Tr}\big[(A\otimes C)I\big]=\mathrm{Tr}A\,\mathrm{Tr}C
    Insert the definition of FF; the sum over ii is a resolution of the identity.
  5. Step 5:
    Tr[(A⊗C) E[(∣ψ⟩⟨ψ∣)⊗2]]=Tr[(A⊗C) I+Fd(d+1)]∀A,C\mathrm{Tr}\Big[(A\otimes C)\,\mathbb E\big[(\lvert\psi\rangle\langle\psi\rvert)^{\otimes2}\big]\Big]=\mathrm{Tr}\Big[(A\otimes C)\,\frac{I+F}{d(d+1)}\Big]\quad\forall A,C
    The left side is E[⟨ψ∣A∣ψ⟩⟨ψ∣C∣ψ⟩]\mathbb E\big[\langle\psi\vert A\vert\psi\rangle\langle\psi\vert C\vert\psi\rangle\big]; the right side is the same number by the previous two lines.
  6. Step 6:
    E[(∣ψ⟩⟨ψ∣)⊗2]=I+Fd(d+1)\mathbb E\big[(\lvert\psi\rangle\langle\psi\rvert)^{\otimes2}\big]=\frac{I+F}{d(d+1)}
    Product operators A⊗CA\otimes C span all operators on Cd⊗Cd\mathbb C^d\otimes\mathbb C^d, and an operator is fixed by its Hilbert–Schmidt inner products with a spanning set. Note that I+F2\frac{I+F}2 is the projector onto the symmetric subspace, of dimension d(d+1)2\frac{d(d+1)}2: the average is the normalised symmetric projector.

∎

Quick check

For a Haar-random two-qubit state (d=4d=4), what is E[⟨ψ∣Z⊗I∣ψ⟩2]\mathbb E\big[\langle\psi\vert Z\otimes I\vert\psi\rangle^2\big]?

tolerance ±0.001

The McClean et al. theorem#

Lemma

The gradient as an expectation of a commutator

Split the circuit at the kk-th rotation, U=U+Rk(θk)U−U=U_+R_k(\theta_k)U_-, with Rk(θ)=e−iθVk/2R_k(\theta)=e^{-i\theta V_k/2}, Vk2=IV_k^2=I, and absorb the rotation into the later part, writing U+U_+ for U+Rk(θk)U_+R_k(\theta_k). Then, with K=U+†HU+K=U_+^\dagger HU_+, ∂kC=i2 ⟨0∣U−† [Vk,K] U−∣0⟩=⟨ψ∣A∣ψ⟩,A=i2[Vk,K],∣ψ⟩=U−∣0⟩,\partial_kC=\frac i2\,\langle0\vert U_-^\dagger\,[V_k,K]\,U_-\vert0\rangle=\langle\psi\vert A\vert\psi\rangle,\qquad A=\frac i2[V_k,K],\quad\lvert\psi\rangle=U_-\lvert0\rangle , and AA is Hermitian and traceless.

Proof (5 steps)
  1. Step 1:
    C=⟨0∣U−†Rk†U+†HU+RkU−∣0⟩C=\langle0\vert U_-^\dagger R_k^\dagger U_+^\dagger HU_+R_kU_-\vert0\rangle
    Definition of the cost with the circuit split at gate kk; only RkR_k depends on θk\theta_k.
  2. Step 2:
    ∂kRk=−i2VkRk=−i2RkVk,∂kRk†=i2Rk†Vk\partial_kR_k=-\tfrac i2V_kR_k=-\tfrac i2R_kV_k,\qquad\partial_kR_k^\dagger=\tfrac i2R_k^\dagger V_k
    Differentiate the exponential e−iθV/2e^{-i\theta V/2}; VkV_k commutes with every function of itself.
  3. Step 3:
    ∂kC=i2⟨0∣U−†Vk K~ U−∣0⟩−i2⟨0∣U−† K~ VkU−∣0⟩,K~=Rk†U+†HU+Rk\partial_kC=\tfrac i2\langle0\vert U_-^\dagger V_k\,\tilde K\,U_-\vert0\rangle-\tfrac i2\langle0\vert U_-^\dagger\,\tilde K\,V_kU_-\vert0\rangle,\qquad\tilde K=R_k^\dagger U_+^\dagger HU_+R_k
    Product rule: the derivative hits Rk†R_k^\dagger on the left or RkR_k on the right; move VkV_k next to U−U_- using the second form of each derivative.
  4. Step 4:
    ∂kC=i2⟨0∣U−†[Vk,K]U−∣0⟩,K=(U+Rk)†H(U+Rk)\partial_kC=\tfrac i2\langle0\vert U_-^\dagger[V_k,K]U_-\vert0\rangle,\qquad K=(U_+R_k)^\dagger H(U_+R_k)
    Combine the two terms; K~\tilde K is KK for the renamed U+U_+. Right invariance of the Haar measure means that U+RkU_+R_k is a 2-design whenever U+U_+ is, so the renaming does not affect any assumption below.
  5. Step 5:
    [V,K]†=[K,V]=−[V,K] ⇒ A†=−i2 (−[V,K])=A,TrA=i2(Tr(VK)−Tr(KV))=0[V,K]^\dagger=[K,V]=-[V,K]\ \Rightarrow\ A^\dagger=-\tfrac i2\,(-[V,K])=A,\qquad\mathrm{Tr}A=\tfrac i2\big(\mathrm{Tr}(VK)-\mathrm{Tr}(KV)\big)=0
    VV and KK are Hermitian, so their commutator is anti-Hermitian and i2\frac i2 times it is Hermitian; a commutator is traceless by cyclicity.

∎

Theorem

Barren plateaus of 2-design circuits (McClean et al. 2018)

(a) If U−U_- or U+U_+ is a 1-design, independent of the other part, then E[∂kC]=0\mathbb E[\partial_kC]=0. (b) If U−U_- is a 2-design, then for every fixed U+U_+ Var[∂kC]=Tr(A2)d(d+1)≤Tr(H2)d(d+1),\mathrm{Var}[\partial_kC]=\frac{\mathrm{Tr}(A^2)}{d(d+1)}\le\frac{\mathrm{Tr}(H^2)}{d(d+1)}, which is at most 1d+1=12n+1\frac1{d+1}=\frac1{2^n+1} when HH is a Pauli string. (c) If instead U+U_+ is a 2-design and HH is a traceless Pauli string, Var[∂kC]=1−⟨ψ∣Vk∣ψ⟩22⋅dd2−1≤d2(d2−1)\mathrm{Var}[\partial_kC]=\frac{1-\langle\psi\vert V_k\vert\psi\rangle^2}{2}\cdot\frac{d}{d^2-1}\le\frac{d}{2(d^2-1)}.

Proof (8 steps)
  1. Step 1:
    EU−[⟨ψ∣A∣ψ⟩]=TrAd=0;EU+[K]=TrHdI ⇒ E[[Vk,K]]=0\mathbb E_{U_-}\big[\langle\psi\vert A\vert\psi\rangle\big]=\frac{\mathrm{Tr}A}d=0;\qquad\mathbb E_{U_+}[K]=\frac{\mathrm{Tr}H}{d}I\ \Rightarrow\ \mathbb E\big[[V_k,K]\big]=0
    (a) First Haar moment for U−U_- (with TrA=0\mathrm{Tr}A=0), or for U+U_+: the average of KK is a multiple of the identity, which commutes with VkV_k, and the commutator is linear in KK.
  2. Step 2:
    Var[∂kC]=E[⟨ψ∣A∣ψ⟩2]=Tr(A)2+Tr(A2)d(d+1)=Tr(A2)d(d+1)\mathrm{Var}[\partial_kC]=\mathbb E\big[\langle\psi\vert A\vert\psi\rangle^2\big]=\frac{\mathrm{Tr}(A)^2+\mathrm{Tr}(A^2)}{d(d+1)}=\frac{\mathrm{Tr}(A^2)}{d(d+1)}
    (b) The mean is zero by (a), and the second-moment theorem applies to ∣ψ⟩=U−∣0⟩\lvert\psi\rangle=U_-\lvert0\rangle with AA fixed by U+U_+.
  3. Step 3:
    Tr(A2)=−14Tr([V,K]2)=14Tr([V,K]†[V,K])\mathrm{Tr}(A^2)=-\tfrac14\mathrm{Tr}\big([V,K]^2\big)=\tfrac14\mathrm{Tr}\big([V,K]^\dagger[V,K]\big)
    A2=−14[V,K]2A^2=-\frac14[V,K]^2 and [V,K]†=−[V,K][V,K]^\dagger=-[V,K].
  4. Step 4:
    [V,K]†[V,K]=(KV−VK)(VK−KV)=K2−KVKV−VKVK+VK2V[V,K]^\dagger[V,K]=(KV-VK)(VK-KV)=K^2-KVKV-VKVK+VK^2V
    Expand and use V2=IV^2=I.
  5. Step 5:
    Tr([V,K]†[V,K])=2 Tr(K2)−2 Tr(VKVK)≤4 Tr(K2)=4 Tr(H2)\mathrm{Tr}\big([V,K]^\dagger[V,K]\big)=2\,\mathrm{Tr}(K^2)-2\,\mathrm{Tr}(VKVK)\le4\,\mathrm{Tr}(K^2)=4\,\mathrm{Tr}(H^2)
    Cyclicity gives Tr(VK2V)=Tr(K2)\mathrm{Tr}(VK^2V)=\mathrm{Tr}(K^2). By Cauchy–Schwarz for the Hilbert–Schmidt product, ∣Tr(VKV⋅K)∣≤∥VKV∥F∥K∥F=Tr(K2)\lvert\mathrm{Tr}(VKV\cdot K)\rvert\le\lVert VKV\rVert_F\lVert K\rVert_F=\mathrm{Tr}(K^2), and KK is unitarily similar to HH.
  6. Step 6:
    Var[∂kC]≤Tr(H2)d(d+1) =H2=I dd(d+1)=12n+1\mathrm{Var}[\partial_kC]\le\frac{\mathrm{Tr}(H^2)}{d(d+1)}\ \overset{H^2=I}{=}\ \frac{d}{d(d+1)}=\frac{1}{2^n+1}
    Combine the last three lines; a Pauli string squares to the identity, so Tr(H2)=d\mathrm{Tr}(H^2)=d. Equality holds when VkV_k anticommutes with KK.
  7. Step 7:
    ∂kC=Tr(HU+BU+†),B=i2[ρ,Vk], ρ=∣ψ⟩⟨ψ∣;TrB=0,  Tr(B2)=1−⟨ψ∣Vk∣ψ⟩22\partial_kC=\mathrm{Tr}\big(HU_+BU_+^\dagger\big),\quad B=\tfrac i2[\rho,V_k],\ \rho=\lvert\psi\rangle\langle\psi\rvert;\qquad\mathrm{Tr}B=0,\ \ \mathrm{Tr}(B^2)=\tfrac{1-\langle\psi\vert V_k\vert\psi\rangle^2}2
    (c) ⟨ψ∣[V,K]∣ψ⟩=Tr([ρ,V]K)\langle\psi\vert[V,K]\vert\psi\rangle=\mathrm{Tr}\big([\rho,V]K\big) by cyclicity. As before, Tr(B2)=14Tr([ρ,V]†[ρ,V])=14(2 Trρ−2 Tr(ρVρV))\mathrm{Tr}(B^2)=\frac14\mathrm{Tr}([\rho,V]^\dagger[\rho,V])=\frac14\big(2\,\mathrm{Tr}\rho-2\,\mathrm{Tr}(\rho V\rho V)\big) with ρ2=ρ\rho^2=\rho, V2=IV^2=I, and Tr(ρVρV)=⟨ψ∣V∣ψ⟩2\mathrm{Tr}(\rho V\rho V)=\langle\psi\vert V\vert\psi\rangle^2.
  8. Step 8:
    EU+[Tr(HU+BU+†)2]=Tr(H2) Tr(B2)d2−1−Tr(H)2 Tr(B2)d(d2−1)=d Tr(B2)d2−1\mathbb E_{U_+}\big[\mathrm{Tr}(HU_+BU_+^\dagger)^2\big]=\frac{\mathrm{Tr}(H^2)\,\mathrm{Tr}(B^2)}{d^2-1}-\frac{\mathrm{Tr}(H)^2\,\mathrm{Tr}(B^2)}{d(d^2-1)}=\frac{d\,\mathrm{Tr}(B^2)}{d^2-1}
    Weingarten with A=C=HA=C=H, B=D=BB=D=B, and TrB=0\mathrm{Tr}B=0; for a traceless Pauli string TrH=0\mathrm{Tr}H=0 and Tr(H2)=d\mathrm{Tr}(H^2)=d.

∎

Corollary

Chebyshev bound and shot cost

Under (b), for every δ>0\delta>0:   Pr⁡[∣∂kC∣≥δ]≤1(2n+1)δ2\;\Pr\big[\lvert\partial_kC\rvert\ge\delta\big]\le\frac1{(2^n+1)\delta^2}. To estimate a gradient of the typical size σ=Var[∂kC]\sigma=\sqrt{\mathrm{Var}[\partial_kC]} to relative precision ε\varepsilon with the parameter-shift rule, N≥12ε2σ2N\ge\frac{1}{2\varepsilon^2\sigma^2} shots per evaluation are needed, which is of order 2n/ε22^n/\varepsilon^2 when σ2\sigma^2 is of order 2−n2^{-n}, as for the anticommuting case σ2=12n+1\sigma^2=\frac1{2^n+1}.

Proof (3 steps)
  1. Step 1:
    Pr⁡[∣X−EX∣≥δ]≤VarXδ2\Pr\big[\lvert X-\mathbb EX\rvert\ge\delta\big]\le\frac{\mathrm{Var}X}{\delta^2}
    Chebyshev's inequality, applied to X=∂kCX=\partial_kC with EX=0\mathbb EX=0 and the variance bound of the theorem.
  2. Step 2:
    g^=12[f^+−f^−],Var[g^]=(1−f+2)+(1−f−2)4N≤12N\hat g=\tfrac12\big[\hat f_+-\hat f_-\big],\qquad\mathrm{Var}[\hat g]=\frac{(1-f_+^2)+(1-f_-^2)}{4N}\le\frac1{2N}
    Shot noise of the parameter-shift estimator for a Pauli-string HH (lesson on finite differences): each evaluation averages NN outcomes ±1\pm1.
  3. Step 3:
    12N≤εσ ⟺ N≥12ε2σ2=2n+12ε2for σ2=12n+1\sqrt{\tfrac1{2N}}\le\varepsilon\sigma\ \Longleftrightarrow\ N\ge\frac1{2\varepsilon^2\sigma^2}=\frac{2^n+1}{2\varepsilon^2}\quad\text{for }\sigma^2=\tfrac1{2^n+1}
    The worst-case standard deviation 12N\frac1{\sqrt{2N}} must be below the precision εσ\varepsilon\sigma we ask for; when f±f_\pm are close to 00, as on a plateau, the shot-noise variance is close to its maximum 12N\frac1{2N}, 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 V(θ)=RX(θ1)⊗⋯⊗RX(θn)V(\theta)=R_X(\theta_1)\otimes\cdots\otimes R_X(\theta_n) on ∣0⟩⊗n\lvert0\rangle^{\otimes n}, with independent angles uniform on [0,2π)[0,2\pi). The task is to return to ∣0⋯0⟩\lvert0\cdots0\rangle, measured in two ways: the global cost CG=1−∣⟨0⋯0∣V(θ)∣0⋯0⟩∣2C_G=1-\lvert\langle0\cdots0\vert V(\theta)\vert0\cdots0\rangle\rvert^2 asks whether all qubits are back, and the local cost CL=1−1n∑j⟨0∣ρj∣0⟩C_L=1-\frac1n\sum_j\langle0\vert\rho_j\vert0\rangle averages over single qubits. Both vanish exactly at θ=0\theta=0.

Derivation

Closed forms and Pauli operators of the two costs

  1. Step 1:
    RX(θ)∣0⟩=cos⁡θ2∣0⟩−isin⁡θ2∣1⟩,⟨Z⟩=cos⁡2θ2−sin⁡2θ2=cos⁡θR_X(\theta)\lvert0\rangle=\cos\tfrac\theta2\lvert0\rangle-i\sin\tfrac\theta2\lvert1\rangle,\qquad\langle Z\rangle=\cos^2\tfrac\theta2-\sin^2\tfrac\theta2=\cos\theta
    RX(θ)=cos⁡θ2I−isin⁡θ2XR_X(\theta)=\cos\frac\theta2I-i\sin\frac\theta2X applied to ∣0⟩\lvert0\rangle.
  2. Step 2:
    ∣⟨0∣RX(θ)∣0⟩∣2=cos⁡2θ2=1+cos⁡θ2=⟨I+Z2⟩\lvert\langle0\vert R_X(\theta)\vert0\rangle\rvert^2=\cos^2\tfrac\theta2=\frac{1+\cos\theta}{2}=\Big\langle\frac{I+Z}2\Big\rangle
    The double-angle formula; ∣0⟩⟨0∣=I+Z2\lvert0\rangle\langle0\rvert=\frac{I+Z}2.
  3. Step 3:
    CG=1−∏j=1ncos⁡2θj2=⟨I−⨂jI+Zj2⟩=⟨(1−2−n)I−2−n ⁣ ⁣∑∅≠S⊆[n] ⁣ ⁣ZS⟩C_G=1-\prod_{j=1}^n\cos^2\tfrac{\theta_j}2=\Big\langle I-\bigotimes_j\frac{I+Z_j}2\Big\rangle=\Big\langle\big(1-2^{-n}\big)I-2^{-n}\!\!\sum_{\emptyset\neq S\subseteq[n]}\!\!Z_S\Big\rangle
    The overlap of a product state factorises. Expanding the tensor product of the nn binomials I+Zj2\frac{I+Z_j}2 gives 2−n∑SZS2^{-n}\sum_SZ_S with ZS=∏j∈SZjZ_S=\prod_{j\in S}Z_j and Z∅=IZ_\emptyset=I.
  4. Step 4:
    CL=1−1n∑j=1ncos⁡2θj2=⟨I−1n∑jI+Zj2⟩=⟨12I−12n∑j=1nZj⟩C_L=1-\frac1n\sum_{j=1}^n\cos^2\tfrac{\theta_j}2=\Big\langle I-\frac1n\sum_j\frac{I+Z_j}2\Big\rangle=\Big\langle\frac12I-\frac1{2n}\sum_{j=1}^nZ_j\Big\rangle
    The reduced state of qubit jj is that of RX(θj)∣0⟩R_X(\theta_j)\lvert0\rangle. The global cost needs all 2n2^n Pauli words; the local one only n+1n+1.

Result

CG=⟨(1−2−n)I−2−n∑S≠∅ZS⟩,CL=⟨12I−12n∑jZj⟩\boxed{C_G=\langle(1-2^{-n})I-2^{-n}\textstyle\sum_{S\neq\emptyset}Z_S\rangle,\qquad C_L=\langle\tfrac12I-\tfrac1{2n}\textstyle\sum_jZ_j\rangle}
Derivation

Exact gradient variances

  1. Step 1:
    ddθcos⁡2θ2=−2cos⁡θ2sin⁡θ2⋅12=−12sin⁡θ\frac{\mathrm d}{\mathrm d\theta}\cos^2\tfrac\theta2=-2\cos\tfrac\theta2\sin\tfrac\theta2\cdot\tfrac12=-\tfrac12\sin\theta
    Chain rule; 2cos⁡xsin⁡x=sin⁡2x2\cos x\sin x=\sin2x.
  2. Step 2:
    ∂1CG=12sin⁡θ1∏j=2ncos⁡2θj2,∂1CL=12nsin⁡θ1\partial_1C_G=\tfrac12\sin\theta_1\prod_{j=2}^n\cos^2\tfrac{\theta_j}2,\qquad\partial_1C_L=\frac1{2n}\sin\theta_1
    Only the factor, or the summand, with j=1j=1 depends on θ1\theta_1.
  3. Step 3:
    E[sin⁡θ]=12π∫02πsin⁡θ dθ=0 ⇒ E[∂1CG]=E[∂1CL]=0\mathbb E[\sin\theta]=\frac1{2\pi}\int_0^{2\pi}\sin\theta\,\mathrm d\theta=0\ \Rightarrow\ \mathbb E[\partial_1C_G]=\mathbb E[\partial_1C_L]=0
    Independence lets the expectation of a product factorise; the factor E[sin⁡θ1]\mathbb E[\sin\theta_1] vanishes.
  4. Step 4:
    E[sin⁡2θ]=12π∫02π1−cos⁡2θ2 dθ=12\mathbb E[\sin^2\theta]=\frac1{2\pi}\int_0^{2\pi}\frac{1-\cos2\theta}2\,\mathrm d\theta=\frac12
    cos⁡2θ\cos2\theta integrates to zero over a full period.
  5. Step 5:
    E[cos⁡4θ2]=E[(1+cos⁡θ2)2]=14(1+2 E[cos⁡θ]+E[cos⁡2θ])=14(1+0+12)=38\mathbb E\big[\cos^4\tfrac\theta2\big]=\mathbb E\Big[\Big(\frac{1+\cos\theta}2\Big)^2\Big]=\frac14\Big(1+2\,\mathbb E[\cos\theta]+\mathbb E[\cos^2\theta]\Big)=\frac14\Big(1+0+\frac12\Big)=\frac38
    Expand the square; E[cos⁡θ]=0\mathbb E[\cos\theta]=0 and E[cos⁡2θ]=12\mathbb E[\cos^2\theta]=\frac12 as for sin⁡2\sin^2.
  6. Step 6:
    Var[∂1CG]=E[(∂1CG)2]=14 E[sin⁡2θ1]∏j=2nE[cos⁡4θj2]=18(38)n−1\mathrm{Var}[\partial_1C_G]=\mathbb E\big[(\partial_1C_G)^2\big]=\tfrac14\,\mathbb E[\sin^2\theta_1]\prod_{j=2}^n\mathbb E\big[\cos^4\tfrac{\theta_j}2\big]=\frac18\Big(\frac38\Big)^{n-1}
    The mean is zero, so the variance is the second moment; the nn factors are independent.
  7. Step 7:
    Var[∂1CL]=14n2 E[sin⁡2θ1]=18n2\mathrm{Var}[\partial_1C_L]=\frac1{4n^2}\,\mathbb E[\sin^2\theta_1]=\frac1{8n^2}
    The same computation with a single factor.

Result

Var[∂1CG]=18(38)n−1=13 e−nln⁡(8/3),Var[∂1CL]=18n2\boxed{\mathrm{Var}[\partial_1C_G]=\tfrac18\big(\tfrac38\big)^{n-1}=\tfrac13\,e^{-n\ln(8/3)},\qquad\mathrm{Var}[\partial_1C_L]=\tfrac1{8n^2}}

The global variance decays exponentially, by the factor 38\frac38 per qubit (rate ln⁡83≈0.98\ln\frac83\approx0.98), 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 n=4n=4 on it is smaller and the gap widens quickly. Exact values against a Monte-Carlo estimate with the simulator engine (2×1052\times10^5 random parameter vectors per row, shifted circuits simulated as statevectors):

nnVar[∂1CG]\mathrm{Var}[\partial_1C_G] exactsampledVar[∂1CL]\mathrm{Var}[\partial_1C_L] exactsampled
24.6875×10−24.6875\times10^{-2}4.7065×10−24.7065\times10^{-2}3.1250×10−23.1250\times10^{-2}3.1219×10−23.1219\times10^{-2}
46.5918×10−36.5918\times10^{-3}6.6004×10−36.6004\times10^{-3}7.8125×10−37.8125\times10^{-3}7.8127×10−37.8127\times10^{-3}
69.2697×10−49.2697\times10^{-4}9.2409×10−49.2409\times10^{-4}3.4722×10−33.4722\times10^{-3}3.4738×10−33.4738\times10^{-3}
81.3036×10−41.3036\times10^{-4}1.3174×10−41.3174\times10^{-4}1.9531×10−31.9531\times10^{-3}1.9478×10−31.9478\times10^{-3}

At n=6n=6 the exact global value 9.270×10−49.270\times10^{-4} compares with 9.241×10−49.241\times10^{-4} 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 cos⁡2θj2\cos^2\frac{\theta_j}2 is close to 11. Its kurtosis E[g4]/E[g2]2=32(3518)n−1\mathbb E[g^4]/\mathbb E[g^2]^2=\frac32\big(\frac{35}{18}\big)^{n-1} (from E[sin⁡4θ]=38\mathbb E[\sin^4\theta]=\frac38 and E[cos⁡8θ2]=35128\mathbb E[\cos^8\frac\theta2]=\frac{35}{128}) grows exponentially, so the relative standard error (κ−1)/S\sqrt{(\kappa-1)/S} of a sampled variance grows too, about 1.4 %1.4\,\% at n=6n=6 and 2.8 %2.8\,\% at n=8n=8 for S=2×105S=2\times10^5. Even measuring the plateau gets harder as it gets flatter.

Quick check

In the product model with n=3n=3 qubits, what is Var[∂1CG]\mathrm{Var}[\partial_1C_G]?

tolerance ±0.000001
Proposition

The local cost is faithful to the global one

For every nn-qubit state ρ\rho, with Pj=∣0⟩⟨0∣jP_j=\lvert0\rangle\langle0\rvert_j and Π0=∣0⋯0⟩⟨0⋯0∣\Pi_0=\lvert0\cdots0\rangle\langle0\cdots0\rvert, the costs CG=Tr[ρ(I−Π0)]C_G=\mathrm{Tr}\big[\rho(I-\Pi_0)\big] and CL=Tr[ρ 1n∑j(I−Pj)]C_L=\mathrm{Tr}\big[\rho\,\frac1n\sum_j(I-P_j)\big] satisfy   CL≤CG≤n CL\;C_L\le C_G\le n\,C_L. In particular CL=0  ⟺  CG=0C_L=0\iff C_G=0: minimising the local cost solves the global task.

Proof (4 steps)
  1. Step 1:
    Π0=∏jPj,I−Π0=∑x≠0∣x⟩⟨x∣,1n∑j(I−Pj)=∑x∣x∣n∣x⟩⟨x∣\Pi_0=\prod_jP_j,\qquad I-\Pi_0=\sum_{x\neq0}\lvert x\rangle\langle x\rvert,\qquad\frac1n\sum_j(I-P_j)=\sum_x\frac{\lvert x\rvert}{n}\lvert x\rangle\langle x\rvert
    All three operators are diagonal in the computational basis; ∣x∣\lvert x\rvert is the number of ones in the bit string xx, i.e. the number of qubits not in ∣0⟩\lvert0\rangle.
  2. Step 2:
    x≠0:∣x∣n≤1≤∣x∣;x=0:0≤0≤0x\neq0:\quad\frac{\lvert x\rvert}n\le1\le\lvert x\rvert;\qquad x=0:\quad0\le0\le0
    Compare the diagonal entries: 1≤∣x∣≤n1\le\lvert x\rvert\le n for every nonzero string.
  3. Step 3:
    1n∑j(I−Pj) ≤ I−Π0 ≤ ∑j(I−Pj)\frac1n\sum_j(I-P_j)\ \le\ I-\Pi_0\ \le\ \sum_j(I-P_j)
    Diagonal operators are ordered entrywise.
  4. Step 4:
    CL≤CG≤n CLC_L\le C_G\le n\,C_L
    X≤YX\le Y implies Tr(ρX)≤Tr(ρY)\mathrm{Tr}(\rho X)\le\mathrm{Tr}(\rho Y) for every state ρ≥0\rho\ge0.

∎

TypeScriptrunnable
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
Pythonrunnable
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.06

The TypeScript cell builds both costs as Pauli sums, so CGC_G needs 2n2^n terms, and differentiates the real circuit with the engine's parameter-shift routine (two shifted evaluations plus the value). With S=4000S=4000 the global estimate at n=6n=6 is already off by 8 %8\,\%, consistent with its relative standard error of about 10 %10\,\%; the NumPy cell uses 2×1052\times10^5 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 CGC_G has Var[∂kC]\mathrm{Var}[\partial_kC] exponentially small in nn already at depth O(1)O(1), while a local cost of depth O(log⁡n)O(\log n) has Var[∂kC]∈Ω(1/poly(n))\mathrm{Var}[\partial_kC]\in\Omega(1/\mathrm{poly}(n)) (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 q<1q<1 acting after each of LL layers, the gradient satisfies ∣∂kC∣≤c n qL+1\lvert\partial_kC\rvert\le c\,\sqrt n\,q^{L+1} for every parameter value, with cc fixed by the Pauli coefficients of the cost, so Var[∂kC]≤c2n q2L+2\mathrm{Var}[\partial_kC]\le c^2n\,q^{2L+2}, which decays at least like qLq^{L} (Wang et al. 2021). When LL grows linearly with nn 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 Var[∂kC]\mathrm{Var}[\partial_kC] 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 (RYR_Y and RZR_Z on every qubit followed by a CZ ladder, repeated 88 times) with uniform random angles, for the global observable Z⊗nZ^{\otimes n} and the local one 1n∑qZq\frac1n\sum_qZ_q, together with the 2−n2^{-n} 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 CL≤CG≤nCLC_L\le C_G\le nC_L, so nothing is lost at the optimum, and the product model shows the gain: 18n2\frac1{8n^2} instead of 18(38)n−1\frac18(\frac38)^{n-1}. 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 Bb=Wb(θb′)†Wb(θb)B_b=W_b(\theta'_b)^\dagger W_b(\theta_b), a shallow block followed by its mirror image with independent parameters. At initialisation the forward angles θb\theta_b are random and θb′=θb\theta'_b=\theta_b, 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.

Theorem

Gradient at an identity-block initialisation

Let U=BL⋯B1U=B_L\cdots B_1 with Bb=Wb(θb′)†Wb(θb)B_b=W_b(\theta'_b)^\dagger W_b(\theta_b), evaluated at θb′=θb\theta'_b=\theta_b for all bb, so U=IU=I. Let θk\theta_k be a parameter of the forward part of block bb, Wb(θb)=W>kRk(θk)W<kW_b(\theta_b)=W_{>k}R_k(\theta_k)W_{<k} with Rk=e−iθkVk/2R_k=e^{-i\theta_kV_k/2}. Then ∂kC=i2 ⟨0∣[Qk,H]∣0⟩,Qk=W<k†VkW<k,\partial_kC=\frac i2\,\langle0\vert[Q_k,H]\vert0\rangle,\qquad Q_k=W_{<k}^\dagger V_kW_{<k}, which depends only on the gates of block bb that precede RkR_k, not on the number LL of blocks. If H∣0⋯0⟩=h∣0⋯0⟩H\lvert0\cdots0\rangle=h\lvert0\cdots0\rangle, then ∂kC=0\partial_kC=0.

Proof (5 steps)
  1. Step 1:
    ∂kU=BL⋯Bb+1 Wb(θb′)† W>kRk(−i2Vk)W<k Bb−1⋯B1\partial_kU=B_L\cdots B_{b+1}\,W_b(\theta'_b)^\dagger\,W_{>k}R_k\big(-\tfrac i2V_k\big)W_{<k}\,B_{b-1}\cdots B_1
    Only block bb depends on θk\theta_k, and ∂kRk=Rk(−i2Vk)\partial_kR_k=R_k(-\frac i2V_k).
  2. Step 2:
    Bj=I (j≠b),Wb(θb)†W>kRk=W<k† ⇒ ∂kU=−i2 W<k†VkW<k=−i2QkB_j=I\ (j\neq b),\qquad W_b(\theta_b)^\dagger W_{>k}R_k=W_{<k}^\dagger\ \Rightarrow\ \partial_kU=-\tfrac i2\,W_{<k}^\dagger V_kW_{<k}=-\tfrac i2Q_k
    At initialisation every other block is the identity and θb′=θb\theta'_b=\theta_b; multiply Wb(θb)=W>kRkW<kW_b(\theta_b)=W_{>k}R_kW_{<k} from the left by Wb(θb)†W_b(\theta_b)^\dagger and from the right by W<k†W_{<k}^\dagger.
  3. Step 3:
    ∂kC=⟨0∣(∂kU)†HU∣0⟩+⟨0∣U†H ∂kU∣0⟩=i2⟨0∣QkH∣0⟩−i2⟨0∣HQk∣0⟩\partial_kC=\langle0\vert(\partial_kU)^\dagger HU\vert0\rangle+\langle0\vert U^\dagger H\,\partial_kU\vert0\rangle=\tfrac i2\langle0\vert Q_kH\vert0\rangle-\tfrac i2\langle0\vert HQ_k\vert0\rangle
    Product rule at U=IU=I; QkQ_k is Hermitian, so (−i2Qk)†=i2Qk(-\frac i2Q_k)^\dagger=\frac i2Q_k.
  4. Step 4:
    ∂kC=i2⟨0∣[Qk,H]∣0⟩\partial_kC=\tfrac i2\langle0\vert[Q_k,H]\vert0\rangle
    Collect the two terms. QkQ_k is the Pauli string VkV_k propagated backwards through the gates of one block, so it acts only inside the backward light cone of VkV_k in a circuit of depth at most that of WbW_b.
  5. Step 5:
    H∣0⟩=h∣0⟩ ⇒ ⟨0∣[Qk,H]∣0⟩=h⟨0∣Qk∣0⟩−h⟨0∣Qk∣0⟩=0H\lvert0\rangle=h\lvert0\rangle\ \Rightarrow\ \langle0\vert[Q_k,H]\vert0\rangle=h\langle0\vert Q_k\vert0\rangle-h\langle0\vert Q_k\vert0\rangle=0
    HH is Hermitian, so also ⟨0∣H=h⟨0∣\langle0\vert H=h\langle0\vert.

∎

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 HH the derivative involves only the qubits inside that light cone, so its distribution does not depend on nn at all. The last statement adds a caveat: if the reference state is an eigenvector of HH, the identity point is a stationary point and every first derivative vanishes there exactly. Both observables of the plotter, Z⊗nZ^{\otimes n} and 1n∑qZq\frac1n\sum_qZ_q, have ∣0⋯0⟩\lvert0\cdots0\rangle 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 2−n2^{-n} 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 Wb(θb′)†Wb(θb)W_b(\theta'_b)^\dagger W_b(\theta_b), each of depth 4, initialised with θb′=θb\theta'_b=\theta_b. The cost is ⟨X1⟩\langle X_1\rangle. Which statement about the gradient with respect to an angle in block 11 at initialisation is correct?

Select one answer

Lab and references#

In the lab you compute both exact variances of the product model at n=6n=6 and then reproduce them by Monte Carlo from a black-box cost function, with exactly two circuit evaluations per random parameter vector.

References

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  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
  7. 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
  8. 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
  9. 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
  10. 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-graded

    Quantify the barren plateau of the exactly solvable product model V(θ)=⨂jRX(θj)V(\theta)=\bigotimes_jR_X(\theta_j) on ∣0⋯0⟩\lvert0\cdots0\rangle. First compute the exact gradient variances of the global cost CG=1−∏jcos⁡2θj2C_G=1-\prod_j\cos^2\frac{\theta_j}2 and the local cost CL=1−1n∑jcos⁡2θj2C_L=1-\frac1n\sum_j\cos^2\frac{\theta_j}2 at n=6n=6; 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.

    Open lab