This java applet is a quantum mechanics simulation that shows the behavior of a particle in a two dimensional rectangular square well ("particle in a box").

At the top of the screen, you will see a cross section of the potential well, with the energy levels indicated as gray lines. The red line is the expectation value for energy.

In the center of the applet, you will see a plot of the wave function. The brightness indicates the magnitude and the color indicates the phase. The red lines indicate the expectation value for the X and Y coordinates.

At the bottom of the screen is a set of phasors showing the magnitude and phase of some of the possible states.

You may select a single state by picking one of the phasors at the bottom and double-clicking on it. Or, you may click on the phasor and drag its value to modify the magnitude and phase. In this way, you can create a combination of states. When you move the mouse over a state, it is highlighted in yellow, and other states with the same energy are also highlighted.

Between each graph is a horizontal line which may be dragged up and down to adjust the size of each graph.

The Mouse Popup determines what happens when the mouse is clicked. The choices are:

• Set Eigenstate: if you click on the energy, position, or momentum graph, then the particle will be put in an eigenstate of that observable. So if you click on the energy graph, the particle will be placed in a stationary state. If you click on the position graph, the particle will be localized at that point (but will quickly spread out). If you click on the momentum graph, the particle will have the selected momentum.

Clicking on the position graph will cause the particle to be localized as much as possible, which will often give unsatisfactory results because the momentum spectrum will be so spread out. To localize the particle with a little more uncertainty, use Create Gaussian to create a more spread-out distribution.

• Create Gaussian: this allows you to create a gaussian distribution on either the position or momentum graph. Click on the graph to locate the center of the gaussian. After clicking, drag the mouse to select the size of the distribution.
• Gaussian w/ Momentum: this allows you to create a gaussian distribution on the position graph, with some initial momentum. Click on the graph to locate the center of the gaussian. The size of the gaussian will be the same size as the last time you used Create Gaussian. After clicking, drag the mouse to select the initial momentum. Note that if you drag too far, the gaussian may not be formed properly.
• Create Square: this allows you to create a square on the position graph.
• Create Circle: this allows you to create a circle (actually an oval) on the position graph.

The Clear button clears out all states.

The Normalize button normalizes the set of particle states. (By default, the states are not shown normalized because the interface is easier to use if they are not. They are normalized internally when calculating the wave functions, however.)

The Maximize button changes the magnitude of the particle states so that they are all as large as possible. This makes them easier to see. (It won't change the wave function at all because the states are normalized internally.)

The Ground State button selects the ground state wave function.

The Stopped checkbox stops the evolution of the wave function.

The Alternate Rendering checkbox is used to speed up rendering, but it actually slows things down on some machines. (Internally, it uses the MemoryImageSource class instead of drawing a bunch of rectangles.) It should be set to the proper setting by default, but try selecting or unselecting it to see if it speeds things up.

The Simulation Speed slider changes the speed of the wave function evolution.

The Brightness slider controls the brightness, just like on a TV set.

The Resolution slider changes the resolution of the applet.

The Momentum Zoom slider allows you to zoom in on the momentum graph to get a better view of the central portion.

The Phasor Count slider allows you to select how many state phasors to display.

The Aspect Ratio slider will adjust the width of the box. By default, the box is square.

The View Menu has the following items:

• Energy: show the energy/potential graph (on by default)
• Position: show the position graph (can't be turned off)
• Momentum: show the momentum graph
• State Phasors: show the set of state phasors (on by default)
• Expectation Values: show expectation values as red lines
• Uncertainties: show uncertainties as blue lines to the left and right of the expectation value. The distance from the blue lines to the red line is the uncertainty.
• Wave Function: display the wave function in one of three ways: as a probability (magnitude squared), as a probability with the phase shown using colors, or as a magnitude with the phase shown using colors.

The Measure Menu has the following item:

• Measure Energy: take a measurement of the energy by picking a random set of states with the same energy (using the state coefficients to determine probability) and putting the particle in those states.

The Options Menu has the following items:

• Always Normalize: always normalize the state coefficients.
• Always Maximize: always maximize the state coefficients.

If neither one of these items is selected, then the applet will maximize the state coefficients whenever major changes are made, and leave them alone otherwise.

On the right side of the phasor panel, you will see a phasor all by itself. This phasor tells you when the fractional revivals are coming. This phasor is only present if the aspect ratio is square.

If you like this applet you may be interested in the book Visual Quantum Mechanics.