E_{1} = |
E_{2} = |
E_{3} = |
E_{4} = |

Invert
Potential strength = 0 Aspect ratio: |
Green/magenta Red/cyan |

These images show some of the behavior of a quantum particle in two dimensions. The particle is confined inside a square region and is also subject to a potential energy function whose shape and strength you can adjust using the controls. Try adjusting all the controls and watch the images respond.

The plot to the left of the controls shows the potential energy. Each of the four plots across the top shows a wavefunction of definite energy, with the lowest-energy state at the left and the higher-energy states to the right. In general the wavefunctions tend to be larger in magnitude where the potential energy is lower, and smaller in magnitude where the potential energy is higher. However, each successive wavefunction must be different from (orthogonal to) all the ones before it, and this requirement forces the higher-energy wavefunctions to vary over shorter distances, with nodes (lines of zero values) across which the sign changes.

All the plots show positive values in one color (green) and negative values in another (magenta). Brighter areas represent larger magnitudes, while black represents zero. So in the wavefunction plots, the brightest areas represent the most probable locations of the particle.

Underneath each wavefunction plot is displayed the wavefunction’s energy *E*,
measured in natural units in which Planck’s constant ℏ, the particle’s mass,
and the width of the box are all equal to 1. When the particle is merely
trapped in the square area with no other potential energy, its minimum
energy in these units is π^{2} or a little under 10. The potential strength is measured
in these same units.

The wavefunction calculations use a variational-relaxation algorithm on a 50 × 50 grid. As the images change you are seeing the algorithm at work—not an actual dynamical process playing out in simulated time. When two wavefunctions have nearly the same energy the algorithm can sometimes fail, getting them out of order or mixing them together. Sometimes you can fix these problems by clicking/tapping on a wavefunction plot to nudge it slightly, or by clicking the Reset button.

Entanglement in a Box is a more specialized version of
this web app, adapted to model *two* particles in *one* dimension, attracting or
repelling each other.

This is free, open-source software. Use your browser to view the source code and license.