MSc Quantum Chemistry ยท Numerical Quantum Mechanics
Particle in a Box Numerical Solver
Solve one-dimensional particle-in-a-box states numerically, compare with analytical energy levels, and interpret wavefunction nodes.
Theory
The particle in a box model illustrates quantization from boundary conditions. Numerical finite-difference methods approximate the Hamiltonian matrix and recover eigenvalues and eigenvectors.
Procedure
- Define box length and grid spacing.
- Construct the kinetic-energy finite-difference matrix.
- Diagonalize the Hamiltonian.
- Compare eigenvalues and node counts with analytical results.
Observations
- n = 1 ground state: The first eigenvector has no internal node. Numerical E1 matches the analytical reference within 0.4%. Boundary conditions and grid setup are correct.
- n = 2 state: The second eigenvector changes sign once at the box center. Energy ratio E2/E1 is approximately 4. The numerical result follows n squared scaling.
- n = 3 state: The third eigenvector shows two internal nodes. Energy ratio E3/E1 is approximately 9. Higher eigenstates retain the expected nodal pattern.
- Coarse grid warning: A coarse grid underestimates curvature for high states. Energy error exceeds the tolerance set for the solver. Use a finer grid before trusting excited-state energies.
Interpretation rule
For an infinite box, En is proportional to n squared and wavefunction n has n - 1 internal nodes.
Validation
Grid convergence is checked by decreasing spacing until energy changes are small.
This page runs an interactive simulation of the experiment; enable JavaScript to use it.