Inspiration

Quantum computing is taught as a wall of math. Teachers covering quantum in class have no lab to point to — the first time most students "see" superposition is a formula on a slide. We wanted the opposite: an experiment you can touch. And since this event is called QuantumHacks, we took the name literally.

What it does

Spooky is a quantum playground in the browser — three acts, three clicks, zero formulas:

  1. The Coin — one qubit in superposition. Click to measure: it collapses to heads or tails. Run it 100 times and watch the statistics converge to 50/50.
  2. The Pair — two entangled coins. Measure one, the other snaps that same instant, every time. Einstein called it "spooky action at a distance."
  3. The Proof — the Bell test (CHSH), the experiment behind the 2022 Nobel Prize in Physics. Classical physics caps the S value at 2.0. Our in-browser simulator pushes the needle to ~2.8 — and a real IBM quantum computer measured S = 2.486 (ibm_fez, 1024 shots, job da5lrus3jnrc73aheur0). The job ID is on screen and publicly verifiable on the IBM Quantum Platform.

Every result is labeled Browser simulator (cyan) or IBM QPU + job ID + timestamp (gold). Nothing simulated is ever claimed as hardware.

How we built it

  • Hand-rolled quantum engine, no framework: 2 qubits = 4 complex amplitudes, gates as matrices, pure functions in src/quantum/ — 11 unit tests including the Tsirelson bound (quantum's own ceiling of 2√2 ≈ 2.83).
  • Real hardware evidence: scripts/run_chsh_ibm.py (Python, qiskit-ibm-runtime, IBM Open Plan) submitted the CHSH job as the very first step, so the queue worked while we built. The result JSON (backend, job ID, timestamp, shots, all four correlation values, S) is committed to the repo: https://github.com/fiya-chris-and-AI/spooky/blob/main/public/results/chsh_ibm.json
  • Frontend: Vite + React + TypeScript, pure client app — no backend, so the demo cannot die server-side. SVG/CSS animations, probability bars instead of Bloch spheres.

Architecture (one glance):

Browser (React SPA)
 ├─ src/quantum/engine.ts   ← 2-qubit statevector, gates, measurement, CHSH (11 tests)
 ├─ src/experiments/        ← Act I coin · Act II pair · Act III S-gauge
 └─ public/results/chsh_ibm.json  ← measured on IBM QPU before the demo, never claimed live
        ▲
scripts/run_chsh_ibm.py ── IBM Quantum Platform (ibm_fez) — job da5lrus3jnrc73aheur0

Challenges we ran into

  • Making measurement felt instead of explained — "measurement collapses the state" is the hardest quantum concept to teach; our answer is that the collapse is the very first click of the page, before any text.
  • Honesty under demo pressure: it is tempting to show a "live" quantum run. We refused — the hardware run is cached, labeled with its job ID and timestamp, and the UI never claims otherwise. If the hardware file is missing or broken, the page says so in one honest sentence instead of a stack trace.
  • A hardware race against the clock: QPU queues are unpredictable, so the job went in at minute one of the build; S = 2.486 came back with hours to spare.

Accomplishments that we're proud of

  • A real quantum computer signed our homework: S = 2.486 > 2.0 on ibm_fez, violating the CHSH inequality — publicly verifiable by job ID.
  • The complete core flow — superposition → entanglement → Bell violation — runs in under 90 seconds with zero onboarding and zero formulas on the demo path.
  • A hand-written, unit-tested quantum engine (no quantum library in the browser) small enough to read in one sitting.

What we learned

  • The CHSH math is checked against the original 1969 paper (Clauser–Horne–Shimony–Holt, Phys. Rev. Lett. 23, 880) and the classical bound |S| ≤ 2; quantum tops out at Tsirelson's 2√2 — our simulator and hardware numbers both respect it, which is exactly what you want to see.
  • Real hardware is noisy: the QPU lands at 2.486 while the noiseless simulator reaches ~2.8. That gap isn't a bug — it's the most honest thing on the screen, and we label it.
  • For beginners, probability bars beat Bloch spheres. Every explanation on the page is one sentence, attached to an interaction.

What's next

More experiments (quantum teleportation, Grover's search as a game), a teacher mode with guided worksheets, more languages. The three-act structure is built to grow.

Built With

Share this project:

Updates