A hybrid quantum classifier
This example is a real recorded session with the IBM Quantum plugin. Asked a plain question, the agent built a small hybrid quantum-classical classifier and a classical baseline, trained both, ran the hybrid on an exact simulator and on a simulated noisy IBM device, and compared the two image by image. Everything ran locally: no IBM account or key was used. You can open the whole session below.
The question
Section titled “The question”The session started from this request, with no tools or steps named:
Build a hybrid quantum-classical classifier for MNIST 0 vs 1, compare it with aclassical baseline, and show me how hardware noise changes itHow it ran
Section titled “How it ran”- The agent loaded the plugin’s hybrid quantum machine learning skill and built a
Python environment for PyTorch and Qiskit in the workspace with CLIO’s own
uv. - Both models share a small classical front end that reduces each 28×28 image to two numbers. The hybrid feeds them to a two-qubit circuit (a ZZ feature map and one layer of trainable rotations) and reads ⟨ZZ⟩; the baseline uses a linear layer instead. Same data, epochs, optimizer and loss.
- It published a live dashboard before training started, and the training script streamed each epoch’s loss and accuracy to it.
- After a first run, it checked the exact simulator’s values against PyTorch, found that the quantum layer had been trained with an unintended 1/64 shot noise, and retrained with exact values.
- It evaluated the trained hybrid on 100 test images as one batched estimator job
on the exact simulator and one on
fake_fez, a noisy simulation that uses the calibration data of IBM’s Fez device.
What it found
Section titled “What it found”| Model | Run on | Test accuracy |
|---|---|---|
| Classical baseline | PyTorch | 100% |
| Hybrid | Exact simulator | 73% |
| Hybrid | fake_fez noisy simulator |
73% |
Noise pulled the hybrid’s outputs toward zero, by about 12% (a fitted slope of 0.88), with a mean shift of 0.052. No image changed class. Five images sit within 0.05 of the decision threshold, so they are the ones a stronger noise level could flip.
The agent stated the limits itself: the two-qubit head underfits, the noisy run used one seed and one calibration snapshot, and the result is not evidence of a quantum advantage.
The per-image comparison
Section titled “The per-image comparison”Asked to show how the noisy results compare with the exact ones for each test image, the agent opened the plugin’s results view: one point per image, exact and noisy side by side, the shape marking the true class and a dashed line the class threshold.
Ask about one image
Section titled “Ask about one image”Clicking a point selects that image, and the agent sees the selection. Here image 6 was selected, the image nearest the threshold, and the question was simply: “Why does this image sit so close to the boundary, and could noise flip it?”
Open the session
Section titled “Open the session”The page is an interactive archive of the actual session. Opening it does not run the agent or contact any service. The plugin’s interactive views run only in a live session, so the results view appears above as captures rather than in the archive.
A real-hardware run of the same evaluation needs an IBM Quantum account; see IBM Quantum for how CLIO asks for the key and checks the time left before it submits.