Quantum Pong — Tennis with the Schrödinger Equation
Pong, except the ball is a 2D wavefunction obeying the Schrödinger equation. Paddles are finite potential barriers — partial reflection, partial tunneling. Real physics. Real game.
What this is
A 200×100 grid of complex-valued wavefunction. Two real-valued arrays (Re/Im) updated each frame via Visscher staggered leapfrog. Paddles are potential barriers — the wavefunction partially tunnels through and partially reflects, depending on overlap. Score when probability mass crossing the absorbing boundary on either side passes 30%. W/S for left paddle, ↑/↓ for right, optional CPU opponent. The HUD shows the conserved norm — it stays at 1.000.
Why this is mind-blowing
Most "quantum" games are just particle Pong with a sparkly background. This is Pong where the math is genuinely the math. You can see interference patterns when the packet hits a paddle. You can watch tunneling happen in real time. It's a playable demonstration of one of physics' weirdest results — built in one HTML file from one prompt.
Build Pong where the ball is a 2D wavefunction obeying the Schrödinger
equation, rendered as a probability cloud. The paddles are finite
potential barriers — when the wavefunction hits, it partially tunnels
and partially reflects. Score when probability mass crossing the
opposing scoring line exceeds 30%. The math has to be real — verifiable
conservation of probability, real interference patterns when the
wavepacket hits a paddle. No fake quantum aesthetic.
Paste this into Claude, Cursor, or Copilot. Change one thing that matters to you.
What I learned shipping it
- Visscher's staggered leapfrog scheme is symplectic-like for Schrödinger evolution and conserves the modified norm to machine precision. You don't have to know that — you just have to ask for 'an integrator that conserves probability.'
- Finite potential barriers (V ≈ 0.55 vs wavepacket E ≈ 1.4) make tunneling visible. Setting the numbers right is the difference between 'looks quantum' and 'is quantum.'
- Quadratic absorbing boundary layers drain probability into score counters cleanly, without reflection artifacts that would corrupt the game state.