Chapter 12 Attention as Computation: Measurement-Based Quantum Computing and Spherical Natural Gradients
“If we make the observer part of the picture, whether something appears as a particle or a wave seems to depend on the observer’s attention.”
At the end of Chapter 11, we saw a striking reversal in hardware control: a virtual gate rotates a qubit around its energy axis without firing a single nanosecond of microwave pulse, simply by shifting the phase reference of the observer’s future control and readout axes. Closing Part III (From Plane to Sphere), this chapter follows that clue — treating the observer’s measurement orientation as an active computational resource — across three major pillars of modern quantum information:
- Measurement-Based Quantum Computing (MBQC): Once an entangled cluster resource state is prepared, no further entangling two-qubit unitary gates need to be applied during the computation. By sequentially choosing equatorial measurement angles (steering the observer’s attention) and feeding classical measurement outcomes forward to adapt later measurement axes, projective measurements alone drive universal quantum logic!
- The Pauli Parameter-Shift Rule: When optimizing a parametrized quantum circuit, evaluating the analytical gradient of an expectation value with respect to a single Pauli rotation angle requires no finite-difference limit . Because a single Pauli rotation slices a pure first-order sinusoid on the sphere, evaluating (or estimating from repeated measurement shots) the expectation value at two orthogonal parameter settings yields the exact analytical derivative with zero finite-difference truncation error (while finite-shot estimation retains ordinary statistical sampling uncertainty)!
The same number of shots, scatters more than ten times apart. At with only 100 shots per setting, each trial drops one cyan dot (half the difference a quarter turn each way) and one magenta dot (the small-step difference) on the gauge. The cyan dots crowd the dashed tangent slope with a width of about 0.035; the magenta dots spread about 0.58. Both scatters are shot noise, and the small step magnifies it (Remark 12.3).
- Riemannian Natural Gradients and Equatorial Concentration: Along a negative Riemannian gradient flow on a manifold, the potential-energy drop equals the integrated squared norm of the velocity (Theorem 12.4). Yet as qubit count grows and ambient dimension scales as , measure on high-dimensional spheres concentrates overwhelmingly into a narrow equatorial belt orthogonal to any fixed measurement axis — setting the geometric stage (under specific random-circuit design assumptions) for barren plateaus; separately, as a standalone spectral counting result for nonnegative summable sequences, a finite trace identity supplies a sufficient upper bound on the number of modes above any threshold (Corollary 12.6).
Figure 12. The chapter at a glance: Panel I is a measuring angle becoming a gate on another node, Panel II is a quarter turn each way giving the exact slope, and Panel III is the distribution crowding onto the equator as the dimension grows. In Panel I the amber pointer is the measuring angle and the dashed arrow carries the classical bit to the output node; in Panel II the amber point sits at , the two cyan points to either side, and the dashed line is the tangent; Panel III shows the exact density of , flat for and a cyan spike at the equator for . MBQC, the parameter-shift rule and equatorial concentration are literature results, not formalized in this book (Remark 12.8), so none of the three panels carries a green chip.
12.1 Cluster Measurements and Classical Feedforward
In the standard circuit model, computation is pictured as unitary gates pushing a state vector forward in time, while measurement merely reads out the final answer at the end. In one-way quantum computing (MBQC) (for the literature result, see Remark 12.8), the sequence of measurements itself drives the computation.
We begin with the foundational trace-conservation law for projective record measurements in the Lean module Conditioning. For a finite decidable index type and a finite outcome type (DecidableEq kappa is omitted from this theorem), a family satisfies IsRecordMeasurement P when each is self-adjoint (), idempotent (), pairwise orthogonal ( for ), and complete (). For any complex matrix , the outcome weight is .
Let be a finite index type with decidable equality, let be a finite index type, and let satisfy . Then for every complex matrix ,
Expanding and using linearity of the matrix trace together with completeness gives
The full proof is checked by the Lean kernel.
Note the mathematical contract of Lemma 12.1: it holds for an arbitrary complex matrix (weights are complex until positivity and unit trace of are supplied separately, at which point the branch weights sum to ), and it certifies branch-weight conservation rather than cluster-state preparation or MBQC universality.
Now watch how measuring one qubit of a two-qubit link turns the observer’s chosen angle into a unitary gate on the unmeasured qubit (Panel I of Figure 12):
-
Apply CZ to input and ancilla: Prepare qubit 1 in and qubit 2 in , and apply to obtain .
-
Project along equatorial angle : Measure qubit 1 in the equatorial basis , with outcome . Contracting qubit 1 against leaves qubit 2 in the unnormalized state
with probability for each outcome when is normalized.
-
Classical feedforward and the Pauli byproduct: The chosen angle implements on the second qubit with the byproduct . Up to a global phase, applying immediately when yields in a fixed output frame. Alternatively, feed forward to adapt the next measurement angle as and update a known Pauli frame after each measurement. This propagates the byproduct to the output rather than making it disappear. Delivering a quantum state in a fixed frame still requires the corresponding output Pauli correction; for final classical readout, the known byproduct can be absorbed into the readout basis or a relabeling of outcomes. Individual measurement outcomes remain random; the logical computation is deterministic after these corrections or readout adjustments.
Either outcome will do: half a turn about brings the branch onto the branch. The Bloch sphere shows qubit 2 for the two outcomes: the amber point is , the grey point , each with chance one half; the amber curved arrow, half a turn about the violet axis, is the feedforward . Here and the input is a generic state; the two chances of add to , as Lemma 12.1 requires. MBQC is a literature result, not formalized in this book (Remark 12.8).
12.2 Pauli Angles and Exact Parameter Shift
How does a measurement probability change as a Hamiltonian generator acts for real time ? In the Lean module ProjectionProbabilityFlow (cross-referencing Chapter 7’s Proposition 7.2), for a finite decidable type , a density state , a Hermitian matrix , and a star projection (IsStarProjection P, meaning and ), define the evolved density and real readout .
Let be a finite index type with decidable equality, let , and let . If is Hermitian (H.IsHermitian) and is a star projection (IsStarProjection P), then all three properties hold:
-
Coercion equality with complex Born trace: For every ,
-
Exact commutator derivative and realness: For every , has derivative at equal to
and this complex trace expression is purely real:
-
Conservation under commutation: If , then for every ,
Positivity and Hermiticity of and ensure that is real, establishing claim 1. Differentiating gives ; multiplying by , taking the trace, and cycling yields , which is purely real since and are Hermitian. When , the derivative vanishes for all , so the probability remains constant. The full proof is checked by the Lean kernel.
When a circuit parameter enters a single occurrence of an involutory Pauli rotation, the classical two-sample shift formula paired with Proposition 12.2 is recorded below (Panel II of Figure 12; Remark 12.3).
A quarter turn each way: half the difference is the slope. With the amber point sits at and the two cyan points at and , at heights and ; half their difference, , is exactly the slope of the dashed tangent, which is computed from the commutator formula of Proposition 12.2. In the dial the two cyan arrows are perpendicular to the amber one, and their heights on the measured axis are these two values.
Literature result, not formalized in this book. For a single occurrence of a Pauli rotation with and , the involution collapses the matrix exponential into Euler’s formula . Conjugating any observable by produces products of and of degree two, which by double-angle trigonometry contain only the zeroth and first harmonics :
On any pure first-harmonic sinusoid , shifting the angle by uses and , canceling the constant and turning the derivative into the two-sample parameter-shift identity (Schuld et al., 2019; see Remark 12.8):
Geometrically, instead of nudging the sphere by a tiny angle , the observer evaluates the expectation value at two orthogonal shifts on the sphere. Keep the boundary explicit: Proposition 12.2 certifies the infinitesimal commutator derivative and its realness, whereas the finite shift rule relies additionally on the single-gate involutory Pauli frequency expansion (Remark 12.8).
Once the two settings sit only a small step apart instead of , the difference is no longer exact where the slope is nonzero: for , the chord through has times the slope of the tangent, about short in magnitude at , while at stationary points both are zero; making smaller shrinks this gap like , but divides the shot noise by a smaller (the comparison at the start of this chapter).
A small-step difference always falls a little short. The same , with the amber point at ; the magenta chord through the points away is flatter than the dashed tangent, and on the gauge the magenta bar is shorter than the tangent (), while the cyan bar (half the difference a quarter turn each way) sits on the tangent.
The two-point rule with a quarter turn each way has no such gap: it is an identity for a first harmonic, at any angle and on any such curve.
Another angle, another curve: still exact. A tilted state and measured axis give the curve , raised by the constant and shifted in phase. As sweeps a full turn, the cyan bar on the gauge stays on the dashed tangent line while the magenta bar (the small-step difference) falls short wherever the derivative is nonzero, and both vanish where it is zero; the constant cancels in the difference (Remark 12.3).
The curve and the shots come together in the full lab below: the smaller , the smaller the truncation gap and the wider the shot-noise scatter.
The parameter-shift rule: the full lab. Two scenes on one rail: the curve (drag the curve or the arrow in the dial to set the angle, switch the curve, change the small step ) and the shots (change the number of shots per setting and watch how the two scatters change with and ).
12.3 Riemannian Gradients and Dissipation
Once gradients are evaluated on a curved state manifold , steepest descent follows the intrinsic Riemannian gradient rather than Euclidean coordinate differences. In the Lean module GradientDissipation, let be a finite-dimensional real inner-product space and let be a Hausdorff (T2Space M), connected (ConnectedSpace M) smooth manifold modeled on (with ) and equipped with a continuous Riemannian tangent-bundle structure (RiemannianBundle, IsContinuousRiemannianBundle). At , the Riesz gradient of is
The next frozen theorem proves that for any potential and any curve on () whose closed-interval within-derivative (continuous on , corresponding in coordinates to ContinuousOn (fun t => derivWithin x (Set.Icc 0 T) t) (Set.Icc 0 T)) equals , the full-derivative speed and squared speed are interval-integrable and the potential drop equals the integrated squared speed.
The potential drops by exactly the area under the squared speed. The downhill gradient flow of on the unit sphere, starting at (the amber point): the ink curve is , the magenta area is the area under over , and the magenta bar on the right is the drop , also . This is a numerical check of Theorem 12.4 on the flow of step 3 of Example 12.7.
Let be a finite-dimensional real inner-product space, and let be a Hausdorff connected smooth manifold modeled on with a continuous Riemannian tangent bundle. For real , a potential (ContMDiff 𝕀 IR 1 V), and a curve on (ContMDiffOn IR 𝕀 1 x (Icc 0 T)), suppose that at every the closed-interval within-derivative satisfies
Then all three conclusions hold:
-
is interval-integrable on with respect to Lebesgue
volume; -
is interval-integrable on with respect to Lebesgue
volume; -
The potential difference across satisfies
The frozen proof (S2_dissipation) proceeds in three steps without assuming that the arbitrary total extension has a continuous full derivative at the endpoints and :
- Closed-interval continuity of the within-interval speed (
within_velocity_norm_continuous): Fromhx : ContMDiffOn IR 𝕀 1 x (Set.Icc 0 T)(whose 1D coordinate counterpart isContinuousOn (fun t => derivWithin x (Set.Icc 0 T) t) (Set.Icc 0 T)) and the continuous Riemannian bundle metric, the within-interval speed and its square are continuous on the compact closed interval (ContinuousOn ... (Set.Icc 0 T)), henceIntervalIntegrableon . - Transfer of integrability to the full speed via interior agreement (
within_velocity_eq_velocity): On the open interior , is a neighborhood of , somfderivWithinagrees with the full derivativemfderiv: . Because the two endpoints have Lebesgue measure zero,IntervalIntegrable.congr_uIootransfers interval integrability on to and its square (claims 1 and 2). - Interior chain rule and fundamental theorem of calculus: The composite is continuous on the closed interval (
ContinuousOn (V ∘ x) (Set.Icc 0 T)), while at every interior point the curve is differentiable with , so the chain rule and Riesz pairing (actual_gradient_flow_chain_rule) give for all . ApplyingintervalIntegral.integral_eq_sub_of_hasDerivAt_of_leover yields . The full proof is checked by the Lean kernel.
Note the mathematical contract of Theorem 12.4: endpoints need not have two-sided derivatives for the arbitrary total extension , and the theorem makes no claim of asymptotic convergence, global optimality, or geodesic shortest paths.
12.4 Equator Concentration and Conditions for Barren Plateaus
When we scale from a single qubit to qubits with dimension , why do high-dimensional state spaces become overwhelmingly orthogonal to any fixed measurement axis (Panel III of Figure 12; Remark 12.5)?
On the ordinary sphere the heights of points are spread evenly. At the dots spread up and down the circle, and on the right the exact density is a vertical straight line at ; the equator belt with holds 10% of the uniform measure; of the 1500 sampled points shown, 142 are cyan (about 9.47%) and the rest are magenta. The even spread of heights is a classical result of Archimedes, not formalized in this book.
As the dimension rises from , the same belt with holds more and more of the points.
The higher the dimension, the more the points crowd onto the equator. The rail raises the dimension from to : the dots crowd onto the equator perpendicular to the measured axis, the bump on the right grows narrower and taller, and the two short ticks at close in with it; at only 0.13% lies outside, and the bump is too thin to see, so the magnifier at the upper right enlarges the equator 32 times: there it is still wide. The width comes from (Remark 12.5).
Literature result, not formalized in this book. On the restricted real-amplitude unit sphere (), for a uniform real unit vector , symmetry across the coordinates gives , so Markov’s inequality yields
At qubits () and , at least of the sphere lies inside the narrow equatorial band (for the separate random-circuit barren-plateau hypotheses, see Remark 12.8).
The Markov bound always lies above the actual share. With , across and a log scale up the side: the solid magenta line is the exact outside share and the dashed magenta line the bound , lying above the solid one everywhere. The amber line stops at : share 0.023, bound 0.195, more than eight times larger (Remark 12.5).
At , with the belt narrowed to , this bound is the of the remark above.
Twenty qubits: every point lies in the narrow equator belt. At and every dot lands on the equator and the density shrinks to a thin needle there; the magnifier at the upper right enlarges the equator 1024 times, and the needle turns out to be a bump wide, with the belt edges far outside the window. The Markov bound gives ; the exact share, computed by the page from the incomplete beta function, is about . This is concentration of measure on the restricted real-amplitude model, not a law for circuit gradients (Remark 12.8).
Separately from uniform sphere measure and random-circuit gradient laws, when a nonnegative summable sequence obeys a finite trace identity , the frozen theorem in FiniteRankConcentrationModeBound provides a sufficient counting upper bound on the number of modes above any threshold . (Keep its scope exact: summability is a sufficient condition for the upper bound , not a necessary condition even for finite superlevel sets — for instance, the non-summable harmonic sequence also has finitely many terms above each — and a finite trace budget neither prevents zero gradients nor provides an escape from barren plateaus, as finite-dimensional density matrices already have unit trace.)
Let be a real sequence, and let , , and be real numbers such that:
- For all , ;
- ;
- ;
- .
Then the superlevel set is finite (Set.Finite), and its cardinality satisfies
Summability of with implies that only finitely many indices can satisfy . Summing over the finite set gives , and dividing by yields the stated bound. The full proof is checked by the Lean kernel.
The geometric spectrum: three clear the line, the wall stands at 8. The geometric spectrum of step 5 of Example 12.7, whose total is the trace budget . At the amber threshold three cyan bars clear the line, , each with an amber notch at the height to show that it pays at least ; the notches add up to no more than the whole budget, so the count stays short of the magenta wall , which is Corollary 12.6.
Note that Corollary 12.6 does not separately assume or (the trace identity with implies only that the product satisfies , not that and individually — for instance, and satisfy all hypotheses), and it concerns a sufficient spectral superlevel counting bound rather than learnability, uniform sphere measure, random-circuit gradients, or a barren-plateau tail bound.
The short film below strings the chapter’s two frozen results together: a quarter turn each way measures the slope, the commutator rate of a projection probability stands behind that slope, and a finite trace budget caps the number of modes above a threshold.
Two turns measure a slope (2 min 30 s). The amber arrow rests at with height , the average of many runs; two dashed cyan arrows turn back and forward and read and , and half their difference, , is exactly the slope of the dashed white tangent, and wherever the arrow goes half the difference still equals the tangent’s slope; the magenta chord is too shallow. The shadow on the wall and the dashed violet arrow a quarter turn ahead are an analogy; the two-point rule for one involutory Pauli rotation is a literature result (Remark 12.3). The general rule behind the tangent is Proposition 12.2: on the dial with and the probability changes at (the arrow at ) at the rate , twice of which is the slope of the height; with the generator , which commutes with the projector, the amber arrow spins about the violet measured axis and the probability stays at . Splitting a dollar so that at most ten people get a dime is an analogy; for the geometric spectrum , as the amber threshold drops to , three cyan bars clear the line and the magenta wall stands at (Corollary 12.6). Barren plateaus of random circuits are literature results, and the mode count cannot stop a slope from vanishing; every number in the film is computed on screen.
-
Cluster teleportation and adaptive feedforward: Set input , ancilla , and apply . Measuring the first qubit in with outcome leaves the unnormalized second qubit
with probability per branch for normalized input. Up to global phase, the byproduct-corrected output is . With input and , both corrected branches give . Because flips the sign of subsequent -rotation angles, later measurement bases require outcome-dependent adaptation; a 1D wire is not by itself a universal entangling resource, whereas a suitable 2D cluster state is universal.
-
Exact parameter shift for a single Pauli rotation: For a single occurrence of (, ) and a fixed state and observable, satisfies . For at , we have , , , and
(while has derivative , with instantaneous Bloch speed and Fubini–Study speed ). A shared parameter appearing in multiple gates requires a sum of partial derivatives, and a general generator has different shifts and weights; moreover, this example illustrates the two-term parameter-shift identity (Remark 12.8) and instantaneous Fubini–Study / Bloch speed rather than a pure-ket derivative theorem requiring a horizontal gauge hypothesis (whereas the centered rotors and satisfy , an uncentered equator lift has and an asymmetric relative-phase parameterization has , equal to at , whereas the density-matrix commutator flow Proposition 12.2 is automatically invariant under local phase choices).
-
Spherical gradient and discrete retraction: On unit , take at . The induced-sphere gradient is
so along one has at this point. Taking a discrete step followed by norm retraction (a discrete illustration rather than the exact continuous flow of Theorem 12.4) gives
Notice also that the tangent gradient field vanishes at the north and south poles (), with Poincaré–Hopf index sum — a direct manifestation of the Hairy Ball Theorem of Chapter 10 (Remark 10.11, literature result, not formalized in this book) in spherical variational optimization: because , admits no nowhere-vanishing smooth tangent descent field, so every smooth spherical cost landscape necessarily harbors critical equilibria (extrema or saddle singularities) where the Riemannian gradient vanishes.
-
Equatorial concentration on : For a uniform real unit vector in with , symmetry gives , hence . With and ,
so at least of the sphere lies in the equatorial belt (a literature second-moment/Markov bound, not a proven circuit-gradient law or a universal statement).
-
Explicit check of the frozen spectral mode bound: Instantiating Corollary 12.6 with , , , and , the eigenvalues sum to , precisely satisfy , and .
Concentration at the equator: the full lab. The rail is the dimension ( from 1 to 20); change the belt half-width or redraw the points. The small plot shows the width , the exact outside share and the Markov bound on logarithmic axes.
Literature result, not formalized in this book. Four bodies of literature govern the algorithms and high-dimensional asymptotics discussed in this chapter:
- Measurement-based quantum computing (MBQC) (R. Raussendorf & H. J. Briegel, Phys. Rev. Lett. 86, 5188, 2001, DOI 10.1103/PhysRevLett.86.5188): Universal MBQC requires resource entanglement (such as a 2D cluster state), destructive single-qubit measurements, outcome randomness, Pauli byproduct corrections, and adaptive classical feedforward. The frozen branch-sum identity Lemma 12.1 does not prove teleportation or computational universality.
- Parameter-shift rule (M. Schuld et al., Phys. Rev. A 99, 032331, 2019, DOI 10.1103/PhysRevA.99.032331): The exact two-sample shift rule requires a single occurrence of the parameter in a gate generated by a Hermitian involution . Proposition 12.2 (cross-referencing Chapter 7’s Proposition 7.2) certifies the infinitesimal commutator derivative and its realness, not the two-sample finite-shift identity.
- Quantum natural gradient (J. Stokes et al., Quantum 4, 269, 2020, DOI 10.22331/q-2020-05-25-269): On pure-state rays, natural gradient descent uses the Fubini–Study metric (up to a stated constant); for , , so the unit-Bloch-sphere gradient and Fubini–Study gradient differ by a factor of four in these coordinates, and singular parameter-space metrics require quotient or pseudoinverse regularization. Theorem 12.4 is conditional on the negative Riesz gradient ODE and does not prove convergence, global optimality, or geodesic trajectories.
- Measure concentration and barren plateaus (J. R. McClean et al., Nat. Commun. 9, 4812, 2018, DOI 10.1038/s41467-018-07090-4; M. Cerezo et al., Nat. Commun. 12, 1791, 2021, DOI 10.1038/s41467-021-21728-w): Exponentially vanishing gradient variance in parametrized quantum circuits depends on the random-circuit distribution, unitary -design assumptions, observable locality, and circuit depth. The real-amplitude sphere is a restricted state model (general normalized complex -qubit vectors lie on , with physical rays in ), and neither equator concentration by itself nor the spectral trace budget Corollary 12.6 proves exponentially small circuit gradients.
12.4.1 Summary of Part III: One Sphere Closed, Many Spheres Ready to Entangle
Across Part III (Chapter 9 through Chapter 12), backed by Lean-verified theorem blocks, we have closed the single-qubit sphere from static axes to dynamical hardware and measurement-driven computation:
- Chapter 9 established the existence of a common unit normal to any vector pair in (Lemma 9.1), traced two-angle addressing from the North Pole, proved finite-word generation of from any two noncollinear axes (Theorem 9.2), showed with the Lie–Trotter formula (Theorem 9.3) that alternating ever smaller rotations about two axes tends to the single rotation with the summed generator, and locked the minimal size of an open orthogonality-free cover of at via an explicit rational six-axis cover (Proposition 9.5) and matching topological lower bound (Corollary 9.6);
- Chapter 10 separated sequential instrument order (Proposition 10.5) and the Hairy Ball / Hopf obstructions on from the global rotor frame on , proved that equal full complex Gram matrices reconstruct state families up to a common ambient unitary (Theorem 10.7, Lemma 10.8), computed complex latitude overlaps (Corollary 10.4), and showed that the three-point Bargmann trace is a scalar part plus the oriented volume of the three Bloch vectors (Theorem 10.2);
- Chapter 11 proved eigenvector exponentiation (Lemma 11.1) and energy-eigenstate stationarity (Theorem 11.2), juxtaposed the rotating-frame microwave pulse-area model (Chapter 11 Remark 11.4), bounded the real trace error of three ordered pulse kernels (Proposition 11.5), and established the observer pullback trace identity (Corollary 11.7) alongside passive virtual- phase-reference scheduling (Chapter 11 Remark 11.6);
- Chapter 12 connected record-measurement branch conservation (Lemma 12.1) and commutator probability flow (Proposition 12.2) to MBQC and parameter-shift gradients, proved the Riemannian gradient-dissipation identity (Theorem 12.4), and contrasted high-dimensional equatorial concentration with finite-trace spectral mode bounds (Corollary 12.6).
In Part IV (Entangled Resonance — Many Spheres), we step beyond a single Bloch sphere to see how multiple spheres lock together through tensor-product correlation planes to produce Bell entanglement, the CHSH inequality violation, stabilizer codes, and the grand unification of quantum algorithms.