Current parameters θ Shift-rule eval points High cost Low cost
⚠ Couldn't load the 3D engineThree.js failed to load from the CDN. Check your connection and reload.

Parameter-Shift Rule: Training a Quantum Neural Network

A quantum neural network is a parameterized quantum circuit whose rotation angles play the role of weights, trained by gradient descent just like a classical network — except a quantum computer cannot backpropagate. This simulator renders the full 3D cost landscape of a single-qubit QNN, R_z(θ₂)R_y(θ₁)|0⟩ measured in X, and trains it live using the exact parameter-shift rule: at every step the circuit is re-evaluated at each parameter shifted by ±π/2, and the difference of those two runs gives the true gradient. Watch the marker roll downhill toward whatever target expectation value you set, with the four shift-rule evaluation points highlighted at each step, live readouts of the cost, output, both angles and the gradient magnitude, and a fading trail of the optimizer's path across the landscape.