Laboratory 26 · Quantum model encoding · Independent self-study

What functions can a parameterized qubit actually represent?

Compose noncommuting rotations, encode an input angle, and read out a Pauli expectation. Verify the model's trigonometric dependence, sensitivity to parameters, and finite-shot readout.

Self-paced guided physicsParameterized unitary modelInput encoding and measurementsReproducible numerical checks

How does a sequence of rotations become a trainable prediction?

A parameterized quantum circuit is a function-producing physical process: it maps input data to state preparations, applies adjustable unitaries, and reads out an observable through repeated measurements. Its expressive power is constrained by the chosen encoding, the noncommuting rotations and the observable. A single qubit is transparent enough to derive the entire prediction analytically, making it possible to distinguish a mathematical trainable parameter from a parameter that has no effect on the selected measurement.

Make a prediction. Start with |0〉, apply Ry(x), Rz(θ), and Ry(β), then measure Z. Predict what happens to the θ dependence when x=0 or β=0. Does every gate parameter necessarily affect the readout?

Prerequisites: Bloch-sphere rotations, Pauli observables, the Born rule and parameter-shift identities.

Live readout and numerical experiments

Expectation value as a function of trainable θ

A changing rotation parameter only affects the chosen readout when the surrounding gates turn its phase into measurable population changes.

fθ(x)=cosβ cosx−sinβ sinx cosθ. The orange dot is the current parameter setting, and the curve's amplitude depends on both input encoding and the final readout basis.

How strongly does the observable respond to θ?

The derivative measures local trainability for this single parameter; a flat model output leads to a vanishing gradient.

∂θ f=sinβ sinx sinθ and equals [f(θ+π/2)−f(θ−π/2)]/2. Compare this direct result with shifted-circuit evaluations.

What function of the input x can the circuit express?

For fixed trainable rotations, the input dependence is an elementary combination of sinx and cosx; the chosen feature encoding fixes the available frequencies.

The one-layer encoding produces only first-harmonic trigonometric functions of x. Repeating input encoding may enrich the Fourier spectrum but also changes the trainable model and measurement cost.

From Bloch rotations to an exact measurable function

Prepare |0〉 and apply U(θ,x,β)=Ry(β)Rz(θ)Ry(x), where Rμ(α)=exp(−iασμ/2). The initial Bloch vector (0,0,1) becomes (sinx,0,cosx) after the first Y rotation. The Z rotation gives (sinx cosθ,sinx sinθ,cosx), while the final Y rotation mixes its x and z components.

fθ(x)=〈0|U†Z U|0〉=cosβ cosx−sinβ sinx cosθ.

The measured Z outcome takes values ±1. Its + probability is (1+f)/2, and for N independent shots the estimator mean is f while its variance is (1−f²)/N. The sample plotted in the readout uses a deterministic pseudorandom seed to facilitate reproducible comparisons.

The parameter appears in one Rz gate with generator σz/2. The standard parameter-shift identity therefore evaluates the exact derivative from two additional circuit settings:

∂θ f = sinβ sinx sinθ = ½[f(θ+π/2)−f(θ−π/2)].

If either sinx or sinβ vanishes, the chosen Z expectation is independent of θ, even though the circuit contains a tunable Rz gate. This illustrates the importance of data encoding and measurement choice to a trainable model's sensitivity.

Exactly checkable limits

For x=0, the first Rz rotation acts on a σz eigenstate and only adds a phase, so no θ dependence survives. For β=0, measuring Z directly after the Z rotation also erases sensitivity to θ. At β=π/2 and x=π/2, f(θ)=−cosθ and its derivative is sinθ. Finite-shot fluctuations vanish when the ideal readout equals exactly ±1.

Assumptions and error sources

Ideal noiseless one-qubit gates and projective Pauli Z readout, with stochasticity from finite independent shots only. The model has a single trainable parameter and one data input; performance on actual datasets, entangling circuits, and hardware noise are developed separately.

Follow three scientific questions

  1. Identify a redundant parameter. Set x=0 then β=0, varying θ each time. Explain the flat readout and why the parameter-shift derivative correctly becomes zero.
  2. Verify the shifted gradient. Choose x=β≈π/2 and θ≈π/2. Compute f(θ±π/2) and compare their difference with sinβ sinx sinθ.
  3. Estimate measurement cost. Pick a setting with f between −1 and +1, then change the number of shots. Compare the seeded finite-shot estimate with the exact f and its standard error.

Self-check: If β=0, what is the dependence of the measured Z expectation on trainable θ?

Extension: combine the circuit with a target y, a squared-error loss and a parameter-shift gradient update using the separate training laboratory.

What the result teaches

A quantum prediction is controlled jointly by data encoding, the structure of the trainable unitary and the measured observable. This toy example shows exact function expressivity, gradient evaluation and shot uncertainty while making no claim of a quantum learning advantage.

Mathematical source in the lecture notes: Parameterized quantum learning · Analytic gradients and measurement statistics.