Open source · Python · MIT licensed · v0.3.0
Simulations from pendulums to the double slit, in one Python package. Every solver is checked against an exact answer.

Live in the repo · qplay animate double-slit
A 2D Schrödinger simulation with absorbing edges. The dark fringes land where the path difference is half a wavelength, and the test suite checks that they do.
iℏ ∂ψ/∂t = −(ℏ²/2m) ∇²ψ + V ψ
Each picture is one command. Change a parameter, run it again. Click any figure for full size.

qplay run hydrogen
qplay run double-slit
qplay run ising
qplay run phase-portrait
qplay run mandelbrot
qplay run domain-coloring
qplay run bifurcation
qplay run coherent-state
qplay run decay-chain
qplay run double-pendulum
qplay run fourier
qplay run heat
qplay run laplace
qplay run linear-map
qplay run lorenz
qplay run maxwell-boltzmann
qplay run orbits
qplay run pendulum
qplay run pendulum-phase-space
qplay run projectile
qplay run rlc-resonance
qplay run tise
qplay run wave
qplay run wavepacket
qplay run zeemanRendered fresh by qplay animate each time the site is built.

qplay animate double-pendulum
qplay animate double-slit
qplay animate figure-eight
qplay animate gas
qplay animate ising
qplay animate wavepacketqplay animate wavepacket
Accuracy
Every function is tested against an analytic result, a conservation law or a limiting case. Never against its own output.
10−12
Probability conserved
In tunnelling, transmitted plus reflected equals one to twelve digits.
10−8
Hydrogen, exactly
Radial functions normalised, and ⟨r⟩ = a₀(3n² − l(l+1))/2, to eight decimal places.
±0.01
Onsager, by Monte Carlo
Ising magnetisation at T = 1.5 against the exact 1944 result.
Six experiments run live in your browser: the pendulum, tunnelling, the double slit, Kepler orbits, the Lorenz attractor and the Ising model. Each one sits next to the exact result it should reproduce.
Open the explorerGuided lessons with exam-style questions and worked solutions. Follow a route below: each lesson lists what it builds on. Nothing to install: each one runs in your browser on Google Colab.
For: A-level Physics (for example AQA 3.6.1.2 to 3.6.1.4, OCR A 5.3, Edexcel Topic 13) and IB Physics (C.1, with resonance from C.4). Check your own specification for the exact wording.
A starting pointRun it in ColabFor: A-level Physics (for example AQA 3.4.1.4, OCR A 3.1.3, Edexcel Topic 2) and IB Physics (A.1). Check your own specification for the exact wording.
A starting pointRun it in ColabFor: A-level Physics (for example AQA 3.6.1.1 and 3.7.2, OCR A 5.2 and 5.4, Edexcel Topics 6 and 12) and IB Physics (A.2 circular motion and D.1 gravitational fields). Check your own specification for the exact wording.
Builds on lesson 2Run it in ColabFor: A-level Physics (for example AQA 3.3.1.3, OCR A 4.4.4, Edexcel Topic 5) and IB Physics (C.4 standing waves and resonance). Check your own specification for the exact wording.
Builds on lesson 1Run it in ColabFor: A-level Physics (for example AQA 3.7.1 and 3.7.3, OCR A 6.2, Edexcel Topic 7) and IB Physics (D.2 electric and magnetic fields). Check your own specification for the exact wording.
Builds on lesson 3Run it in ColabFor: A-level Physics (for example AQA 3.7.3.2 and 3.7.5.2, OCR A 6.2 and 6.3, Edexcel Topic 7) and IB Physics (D.3 motion in electromagnetic fields). Check your own specification for the exact wording.
Builds on lessons 2, 3, 5Run it in ColabFor: A-level Physics (for example AQA 3.2.2 and 3.3.2.1, OCR A 4.4.3 and 4.5, Edexcel Topic 5) and IB Physics (C.3 wave phenomena and E.2 quantum physics). Check your own specification for the exact wording.
Builds on lessons 4, 5Run it in ColabFor: IB Physics (A.5 Galilean and special relativity, HL) and the AQA A-level option 3.12.3 (Turning points: special relativity). Check your own specification for the exact wording.
Builds on lessons 2, 5Run it in ColabFor: A-level Physics (for example AQA 3.6.2.2 to 3.6.2.4, OCR A 5.1.4, Edexcel Topic 9) and IB Physics (B.3 gas laws). Check your own specification for the exact wording.
Builds on lesson 3Run it in ColabFor: A-level Physics (for example AQA 3.8.1.3, OCR A 6.4.4, Edexcel Topic 11) and IB Physics (E.3 radioactive decay). Check your own specification for the exact wording.
Builds on lesson 1Run it in ColabFor: A-level Physics (for example AQA 3.7.4, OCR A 6.1, Edexcel Topic 7) and IB Physics (HL capacitance and RC circuits). Check your own specification for the exact wording.
Builds on lessons 5, 10Run it in ColabRebuilt from scratch on every push, so the outputs always match the code.
Newton's second law for a pendulum of length $L$ gives
Run it in ColabEverything here uses natural units, $\hbar = m = 1$. The time-independent Schrödinger equation is
Run it in ColabNumerical methods, Fourier series and a tour of chaos.
Run it in ColabNew modules in this notebook: `quantum` (orbitals, 2D dynamics), `statmech`, `hamiltonian`, `dynamics`, `complexplane` and `linalg`.
Run it in ColabPython 3.10 or newer. NumPy, SciPy, SymPy and Matplotlib come with it.
git clone https://github.com/StativeSh/quantum-playground cd quantum-playground && make install .venv/bin/qplay run double-slit