A single qubit, re-used many times, can act as a universal binary classifier (Pérez-Salinas et al., "Data re-uploading for a universal quantum classifier"). Each of the L layers re-encodes the same 2D input point and adds one trainable rotation:
layer l: R_x(π·x₁) · R_z(π·x₂) · R_y(θ_l)
output: ⟨Z⟩ = ⟨ψ_L| Z |ψ_L⟩ ∈ [-1, 1]
predict: ŷ = sign(⟨Z⟩)
This 2D build swaps the WebGL Bloch sphere for a flat, hand-drawn Bloch-disk projection (drag it to spin the view — pure 2D trig, no 3D engine), a raster decision-boundary heatmap, and a scrolling loss/accuracy chart so you can watch training converge over time, not just at one instant.
Training minimises MSE loss L = mean[(⟨Z⟩ − y)²] over the dataset. Each θ_l is a Pauli-Y rotation angle, so its exact gradient comes from the parameter-shift rule — no backprop through the quantum state is needed, only two extra circuit evaluations:
∂⟨Z⟩/∂θ_l = [ ⟨Z⟩(θ_l+π/2) − ⟨Z⟩(θ_l−π/2) ] / 2
- L slider — more re-uploading layers ⇒ more expressive boundary, but slower/harder to train.
- Drag the Bloch disk — rotates the flat projection (azimuth left/right, tilt up/down) around the hovered point's trajectory.
- Hover the heatmap — traces that exact point's Bloch trajectory live, with the current ⟨Z⟩ readout.
- Train — runs one parameter-shift gradient-descent step roughly every 150 ms; watch the strip chart at the bottom converge.