Quantum Visual LabPhysics, made visible
Built by Shoaib Ur Rehman|BS Physics + AI Developer|For Masters in Quantum Technologies

Quantum
Visual Lab

Making Quantum Physics Visual for the Next Generation of Pakistani Students

Three live experiments — interference, the Schrödinger equation and the uncertainty principle — solved with real equations, not canned animations. Built for curious students, open for inspection.

Live experiments
03
In-browser physics
100%
Installs required
0
Specimen 001
Live
ψ (x, t)
3 canvases · real equations
60 fps
The laboratory

Three experiments, solved live

Every canvas below is evaluated from the equations on each card, then drawn at 60 frames per second. Move the controls — the physics responds in real time.

Wave–particle duality

Double Slit Experiment

d sin θ = mλ
governing relation

Fire coherent light through two narrow apertures and watch the fringe pattern rebuild itself as you change the geometry.

Wavefront modelnot to scale
Intensity on screenΔy 0.94 mm
0.35 mm
0.11
550 nm
400700
0.60 m
0.22
Fringe spacing
0.94 mm
Visible orders
±4
Slit width (model)
77 µm
Screen window
±4.0 mm

Fraunhofer model · I(θ) = sinc²(πa sinθ/λ) · cos²(πd sinθ/λ)

In plain English

Each slit acts as a new source of circular wavefronts. Where two crests arrive together the waves reinforce each other; where a crest meets a trough they cancel.

The screen turns that phase difference into bright and dark bands. Increasing the slit separation d packs the fringes closer together, a longer wavelength λ stretches them apart, and moving the screen further away does the same. The slowly varying envelope around the pattern comes from the finite width of each slit.

The pattern is built from probability, not paint: send photons one at a time and the same bands appear dot by dot.

The formulam = 0, ±1, ±2 …
d sin θ = mλ

Condition for constructive interference at order m

Time-dependent Schrödinger equation

Schrödinger Wave Function

iħ ∂ψ/∂t = Ĥψ
governing relation

An exact superposition of infinite-well eigenstates, evolved in real time. The slider changes the energy mixture inside the packet.

p5.js · infinite square welln = 2

Pink marker: the expectation value ⟨x⟩. Higher n means a higher-energy mixture: more nodes and faster phase evolution.

n = 2
1centres the mixture5
0.90 ×
0.22
⟨E⟩
4.62 E₁
Nodes
1 of 2
⟨x⟩ / L
0.500
Time (ħ/E₁)
0.0
k=122%k=255%k=322%k=41%k=50%spectral weights |cₖ|²

Exact evolution ψ(x,t) = Σ cₖ φₖ(x) e−iEₖt, with Eₖ = k² in units of E₁ (ħ = 2m = L = 1).

In plain English

The filled curve is |ψ|², the probability density of finding the particle at a point. The two oscillating traces are the real and imaginary parts of ψ itself.

The well has sharp energy levels Eₙ ∝ n². Each eigenstate rotates at its own rate e^(−iEₙt/ħ); when several are added together the phases drift apart and the packet sloshes back and forth. Higher n means a higher-energy mixture: more nodes, faster phase evolution, and a sharper structure.

A definite energy state is stationary, but a superposition is alive. Measurement turns the smooth distribution into a single detected position.

The formulan = 1 … 5
iħ ∂ψ/∂t = Ĥψ

The wave function carries probability amplitude, not a classical trajectory

Fourier partners

Heisenberg Uncertainty Principle

Δx · Δp ≥ ħ/2
governing relation

Squeeze the position distribution and the momentum distribution must broaden. Explore the boundary Δx·Δp = ħ/2.

Allowed states · drag the pointminimum uncertainty
Position spaceΔx = 1.10
Momentum spaceΔp = 0.45
1.10
0.2squeeze the packet3
0.45
0.45min 0.453
Δx · Δp
0.50 ħ
Lower bound
0.50 ħ
Δp minimum
0.45
Margin
0%

Drag anywhere in the plot · the rose region is forbidden

In plain English

Position and momentum are Fourier partners. A narrow packet in space is built from a wide range of wavelengths, and a wide range of wavelengths is a wide range of momenta.

The curve plots the minimum possible momentum spread for each position spread. Every point on it is a Gaussian minimum-uncertainty state. Points above the curve are allowed; the shaded region below is physically forbidden.

You cannot make both spreads arbitrarily small at once. The limit is a property of waves, not of clumsy instruments.

The formulaħ = 1
Δx · Δp ≥ ħ/2

A lower bound on the product of the two spreads — not a measurement error

Under the glass

The equations behind the pixels

Nothing here is a canned animation. Each frame samples the same closed-form expressions you would meet in a second-year quantum mechanics course, evaluates them across the canvas, and maps the result to colour and height.

Analytic formulas, no lookup tables
DPR-aware Canvas 2D rendering
p5.js instance mode for the wave function
requestAnimationFrame with delta timing
IntersectionObserver to pause off-screen work
prefers-reduced-motion respected
Simpson integration for ⟨x⟩
Static generation, zero runtime dependencies
Read the full research note
InterferenceSI units · λ in nm, d in mm, L in m
I(θ) = cos²(πd sin θ / λ) · sinc²(πa sin θ / λ)

Fraunhofer diffraction from two finite slits. The cosine term sets the fringe spacing and the sinc² envelope comes from the slit width a, which is kept at 22% of d in the model.

Evolutionnatural units · ħ = 2m = L = 1
ψ(x,t) = Σ cₖ φₖ(x) e^(−iEₖt/ħ)

An exact superposition of infinite-square-well eigenstates φₖ = √(2/L) sin(kπx/L), with Eₖ = k²π²ħ²/2mL². Coefficients are Gaussian in k, centred on the chosen level and normalised.

UncertaintyGaussian states sit exactly on the curve
Δx · Δp ≥ ħ/2

The boundary is the minimum-uncertainty hyperbola Δp = ħ/(2Δx). States above it are physical; the shaded region below is excluded for every normalisable wave function.

For students and reviewers. Every simulation is keyboard- and touch-accessible, and every formula is documented in the research note.

v1.0 · built for Erasmus Mundus & DAAD