Quantum Particle in a Box
Visualize energy levels, wavefunctions, and probability densities for an electron in a one-dimensional infinite square well.
By Riano · Published · Updated · Report a correction
Quantum Particle in a Box
An electron confined between impenetrable walls has discrete stationary states. Its spatial wavefunction can be positive or negative; probability density is its nonnegative squared magnitude. The normalized coordinate q = x/L runs from the left wall to the right wall.
For integer n ≥ 1, ψn(x) = √(2/L) sin(nπx/L) and En = h2n2/(8mL2). Each state has n − 1 interior nodes. The energy table shows the first five levels, highlighting the selected state.
The green curve is the dimensionless signed amplitude √L ψ. The purple curve is the density of q, L|ψ|2 = 2 sin2(nπq). Its integral from 0 to 1 is one. The physical density per nanometer is L|ψ|2/L when L is entered in nanometers.
Predict the ground state
Set L = 1 nm, n = 1 and q = 0.5. Use h = 6.62607015 × 10−34 J·s, e = 1.602176634 × 10−19 C, and the adopted electron mass m = 9.1093837 × 10−31 kg.
- Convert width: L = 10−9 m. Then E1 = h2/(8mL2) ≈ 6.024662 × 10−20 J. Dividing by e gives approximately 0.376030162679 eV.
- The dimensionless amplitude is √2 sin(π/2) = √2. The dimensionless density is 2, and the physical density is 2/nm.
- The probability from the left wall to q is P = q − sin(2nπq)/(2nπ). At q = 0.5 this is 0.5. Thus the shaded purple area is half the total area.
Changing n to 2 multiplies energy by four, giving 1.50412065071 eV. At the center the signed amplitude and density are zero, but the cumulative probability remains 0.5. A node is a zero of density, not a statement that the entire left interval has zero probability.
Compare widths, nodes and probability
Open the Quantum Particle in a Box module and use its labeled text controls.
- Set Well width L to 1, Quantum number n to 1 and Probe fraction q to 0.5. Check the ground-state prediction above.
- Set Quantum number n to 2. The highlighted energy becomes 1.50412065071 eV and the central node appears in both curves.
- Set Quantum number n back to 1, Well width L to 2 and Probe fraction q to 0.25. Energy becomes 0.0940075406697 eV, signed amplitude is 1, physical density is 0.5/nm and left probability is approximately 0.0908450569081.
- Try Probe fraction q equal to 0 and then 1. Amplitude and density vanish at both walls; cumulative probability is respectively zero and one.
- Drag the plots to pan and use Reset view to restore their framing. This keeps the entered physical parameters.
Model and numerical boundaries
The walls are infinitely high and the states are individual stationary eigenstates. Finite barriers, tunneling and time-dependent superpositions require a different model. The plots show the spatial state and its density, rather than a classical particle trajectory.
Zero width is invalid, and n = 0 gives the identically zero, non-normalizable function in this family. Invalid text removes dependent results. The adopted mass is rounded, and numerical readouts use twelve significant digits with full working precision before display. Small probabilities near a wall are retained; they decrease proportionally to q cubed in the ground state.
Reference derivation
OpenStax University Physics Volume 3: The Quantum Particle in a Box derives the stationary wavefunctions, normalization, energy eigenvalues and interpretation of probability density. The numeric examples here use the explicitly declared constants and actual module controls.
Experience it interactively
Adjust parameters, observe in real time, and build deep intuition with Riano’s interactive Quantum Particle in a Box module.
Try Quantum Particle in a Box on Riano →