ψQuantum Playground

Machine Learning Lab

Train a variational quantum classifier live in your browser: data points become rotation angles, a small trainable circuit processes them, and measuring qubit 0 votes for a class.

How it learns: each point (x, y) is encoded as RY rotations, then CNOTs entangle the wires and trainable RY/RZ rotations steer the state. P(qubit 0 = |1⟩) is the model’s confidence in class B. Gradients come from the parameter-shift rule — the circuit is run twice per parameter with the angle shifted by ±π/2, which gives the exact derivative. That’s how real quantum hardware trains too.

Epoch
0
Train accuracy
Test accuracy
Test loss
Data & decision boundary
Class A Class Bsolid = train · hollow = test
Hover the plot to query the classifier at any point.
Training curves
Press ▶ Train to watch the loss fall and accuracy climb.
Trained parameters
One dial per angle — Ry, Rz. Watch them settle as the loss flattens.
Layer 1
Ryq0
Ryq1
Rzq0
Rzq1
Layer 2
Ryq0
Ryq1
Rzq0
Rzq1
Layer 3
Ryq0
Ryq1
Rzq0
Rzq1
Open this circuit in the simulator →