Phase space, classically and quantum-ly
In classical mechanics a particle's state is a single dot on a phase-space plot of position x against momentum p, and a whole ensemble of particles is a probability cloud you could in principle photograph exactly, since x and p can be measured simultaneously to arbitrary precision. Quantum mechanics forbids that: the Heisenberg uncertainty principle bars a state from ever occupying a point, or even an arbitrarily small blob, in phase space. Eugene Wigner asked in 1932 whether a phase-space picture could still be salvaged, and the answer he found - the Wigner function W(x,p) - is the closest analogue quantum theory has to a joint probability distribution over position and momentum.
Building W(x,p): the Wigner transform
The Wigner function is built from the wavefunction ψ(x) by correlating it with a mirrored, shifted copy of itself and Fourier-transforming the overlap along the shift variable:
W(x,p) = (1 / πħ) ∫ ψ*(x + y) ψ(x - y) e^(2ipy/ħ) dy marginals recover ordinary probabilities: ∫ W(x,p) dp = |ψ(x)|² (position probability density) ∫ W(x,p) dx = |φ(p)|² (momentum probability density)
Those marginals are exactly the ordinary quantum probabilities, which is what makes W(x,p) useful rather than a curiosity: integrate out momentum and you get the textbook position distribution back, integrate out position and you get the textbook momentum distribution back. The catch is the joint object itself. A true probability density is never negative anywhere; W(x,p) can dip below zero. It is real-valued, correctly normalized, and correctly marginalized - it just is not a probability distribution in the classical sense, which is why the field calls it a quasi-probability distribution.
Four states, four pictures
The vacuum state - no photons, the harmonic oscillator ground state - has a Wigner function that is a single Gaussian bump centered at the origin, everywhere non-negative. A coherent state (the closest quantum optics gets to "classical" light, like an ideal laser beam) is the same Gaussian bump simply displaced away from the origin; as the state evolves it circles the origin like a classical point in phase space, just blurred by the minimum uncertainty the Gaussian's width represents.
A Fock state |n⟩ - an exact count of n photons, with zero classical analogue - looks completely different: a ring-shaped distribution built from a Laguerre polynomial, and for n ≥ 1 it dips negative at the center. A Schrödinger cat state, an equal superposition of two well-separated coherent states, shows two Gaussian lobes plus a rippled interference pattern sitting between them - and those ripples swing sharply negative. The fringes are not decoration; they are the direct phase-space signature of quantum superposition, the same interference that would give you fringes on a screen in a double-slit experiment, translated into this coordinate system.
Why negativity matters
Hudson's theorem pins this down precisely: a pure quantum state has an everywhere non-negative Wigner function if and only if it is Gaussian. The vacuum and coherent states are Gaussian and behave; every non-Gaussian pure state - Fock states, cat states, any single-photon-added or photon-subtracted state - must have some region of negative W. Negativity is therefore treated in the quantum-optics and quantum-computing communities as a resource: it is a necessary ingredient for a wide class of quantum advantages, including universal continuous-variable quantum computation, and its volume (the integral of |W| minus 1) is used as a quantitative measure of how "non-classical" a state is.
Reading it off a heatmap, and how it's actually measured
You cannot measure x and p simultaneously to plot W(x,p) directly - that would violate the same uncertainty principle the function is built to respect. Two techniques get around it. Optical homodyne tomography measures the quadrature (a rotated combination of x and p) at many different phase angles and reconstructs W by an inverse Radon transform, the same mathematics used in CT scanning. The direct method (Banaszek and Wódkiewicz) exploits the fact that the value W(0,0) at the phase-space origin is, up to a constant, exactly the expectation value of the photon-number parity operator - measure whether a photon count is even or odd and you have one point of W for free, no tomographic reconstruction needed. Displacing the state before the parity measurement then samples W away from the origin, point by point. On a heatmap, blue-to-red diverging color scales are standard precisely so a negative dip reads instantly as a different color family from the positive bump beside it - the single most information-dense way to show that a state has left the classical world behind.
Frequently asked questions
Is the Wigner function a real probability distribution?
No. It is real-valued and its marginals recover the correct position and momentum probability distributions, but it can go negative, which no true probability density can do. That is why it is called a quasi-probability distribution.
Why can't you measure x and p at the same time to plot W(x,p) directly?
The Heisenberg uncertainty principle forbids a simultaneous sharp measurement of conjugate quadratures. Experiments instead measure many different quadrature angles (optical homodyne tomography) and reconstruct W by inverse Radon transform, or measure the photon-number parity directly, which equals W(0,0) up to a constant.
Which states have a negative Wigner function?
Hudson's theorem says a pure state has an everywhere non-negative Wigner function only if it is Gaussian - the vacuum and coherent states qualify. Fock states with n ≥ 1 and Schrödinger cat superpositions are both non-Gaussian and both show negative regions, which is treated as a hallmark of nonclassical light.
Try it live
Everything above runs in your browser - open Wigner Function and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Wigner Function simulation