HomeQuantum PhysicsWigner Function Visualiser: Quantum Phase-Space Heatmap

🗺️ Wigner Function Visualiser: Quantum Phase-Space Heatmap

Explore the Wigner quasi-probability distribution W(x,p) for vacuum, coherent, Fock and Schrödinger cat states. Watch quantum negativity appear live on a phase-space heatmap.

Quantum Physics2DAdvanced60 FPS
wigner-function ↗ Open standalone

About the Wigner Function

The Wigner function W(x,p) is the quantum-mechanical stand-in for a classical probability distribution over phase space. Given a quantum state, it tells you the "density" of that state at every combination of position x and momentum p. It behaves like a probability distribution in many respects — integrating over p gives the position probability density, and integrating over x gives the momentum probability density — but it is allowed to dip below zero. That negativity has no classical analogue and is treated by physicists as direct evidence of quantum interference within the state itself.

This simulation samples W(x,p) on a 100×100 grid across x,p ∈ [−4, 4] for four standard states: the Gaussian vacuum, a displaceable coherent state, the single-photon Fock state, and a Schrödinger cat superposition of two coherent states. The colour heatmap runs blue for negative values through white at zero to red/orange for positive values, and the "negative volume" readout is computed live by numerically summing the negative part of the grid, Σ min(W,0)·Δx·Δp — the same style of calculation used in real quantum optics laboratories when reconstructing a measured state via homodyne tomography.

Frequently Asked Questions

Why can the Wigner function be negative if it represents a probability?

W(x,p) is a "quasi-probability" distribution, not a true probability distribution. It correctly reproduces the measurable position and momentum probabilities when you integrate it, but position and momentum cannot be measured simultaneously in quantum mechanics, so nothing forbids the joint quantity from dipping negative. Wherever it does, it signals that the state has no classical phase-space counterpart.

Which states in this simulation actually go negative?

The vacuum and coherent states are pure Gaussians and stay positive everywhere — they behave like classical noisy blobs. The Fock n=1 single-photon state dips clearly negative right at the origin, and the Schrödinger cat state develops an oscillating fringe pattern between its two lobes that swings between positive and negative, both unmistakable quantum signatures.

What do the α_re, α_im and α sliders control?

For the coherent state, α_re and α_im are the real and imaginary parts of the complex amplitude α, which displace the Gaussian blob to (√2·α_re, √2·α_im) in phase space. For the Schrödinger cat state, the single α slider sets how far apart the two superposed coherent-state lobes sit along the x-axis — larger α means a "more macroscopically distinct" cat and finer interference fringes.

How is the negative volume actually calculated?

The simulation samples W(x,p) at every point of the 100×100 grid, keeps only the cells where W is negative, and sums W·Δx·Δp over those cells — a genuine discrete double integral, recomputed from scratch every time you change a control or switch states, not a pre-stored value.

Who invented the Wigner function and why?

Eugene Wigner introduced it in 1932 as a mathematical bridge between quantum mechanics and classical statistical mechanics, hoping to find quantum corrections to thermodynamic quantities. It later became a cornerstone tool of quantum optics and quantum information, used whenever physicists need a full "picture" of a quantum state rather than just a single measured number.

Is the Wigner function used outside of theory, in real experiments?

Yes. Quantum optics labs reconstruct the Wigner function of a light pulse using balanced homodyne detection combined with an inversion algorithm, a process called quantum state tomography. A measured negative Wigner function is considered strong, direct experimental evidence that the light source is producing genuinely non-classical states, such as single photons or squeezed light.

Why does the Fock n=1 state have a "hole" at the origin?

The formula W = (1/π)(2(x²+p²)−1)·exp(−(x²+p²)) is exactly zero on the circle x²+p² = 1/2 and strictly negative inside it. Physically this reflects the fact that a single photon has zero probability of being found "at rest" at the phase-space origin — its quantum uncertainty forces the distribution to curve below zero right where a classical particle would most expect to sit.

What causes the fringes in the Schrödinger cat state?

The cat state is a coherent superposition, not a mixture, of two coherent states at +α and −α. The Wigner function of a superposition always contains a cross term describing quantum interference between the two components; here that term is 2·exp(−x²−p²)·cos(2√2·αp), which oscillates in p between the two lobes and is exactly what makes the state distinguishable from a classical 50/50 mixture.

Does a bigger negative volume mean "more quantum"?

Roughly, yes. The total negative volume of the Wigner function is used by researchers as one practical "quantumness" measure: it is exactly zero for every classical-like Gaussian state (vacuum, coherent, thermal, squeezed), and grows in magnitude for states with sharper, more delicate quantum structure, which is why the Fock and cat states here show a clearly negative readout while vacuum and coherent stay pinned near zero.

⚙ Under the hood

Explore the Wigner quasi-probability distribution W(x,p) for vacuum, coherent, Fock and Schrödinger cat states. Watch quantum negativity appear live on a phase-space heatmap.

Quantum MechanicsPhase SpaceHeatmapCanvas 2DQuantum Optics

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)