A Python-based computational physics project that visualizes the quantum mechanical wavefunctions of a particle confined in a 3D infinite potential well (the “particle in a box” problem).
The program evaluates analytical eigenfunctions on a 3D spatial grid, computes the probability density, verifies normalization numerically, calculates the corresponding energy levels, and generates clear visualizations with colorbars for easy physical interpretation.
This project demonstrates how analytical quantum mechanics solutions can be explored and understood using numerical computation and scientific visualization.
- Analytical 3D infinite potential well wavefunction
- Probability density calculation ( |\psi|^2 )
- Numerical normalization check
[ \int |\psi|^2 dV \approx 1 ] - Analytical energy level computation
- 3D surface visualization of:
- the wavefunction ( \psi )
- the probability density ( |\psi|^2 )
- 2D contour (top view) of probability density
- Colorbars for quantitative interpretation of values
For a rectangular box of sizes (L_x, L_y, L_z), the stationary state solutions of the Schrödinger equation are
[ \psi_{n_x,n_y,n_z}(x,y,z) = \sqrt{\frac{2}{L_x}}\sin!\left(\frac{n_x \pi x}{L_x}\right) \sqrt{\frac{2}{L_y}}\sin!\left(\frac{n_y \pi y}{L_y}\right) \sqrt{\frac{2}{L_z}}\sin!\left(\frac{n_z \pi z}{L_z}\right) ]
where (n_x,n_y,n_z = 1,2,3,\dots)
The corresponding energy levels (in units where (\hbar^2/2m = 1)) are
[ E = \frac{\pi^2}{2}\left[ \left(\frac{n_x}{L_x}\right)^2 + \left(\frac{n_y}{L_y}\right)^2 + \left(\frac{n_z}{L_z}\right)^2 \right] ]
Nodes (zero-probability planes) appear whenever any quantum number is greater than 1.
- Python 3.x
- numpy
- matplotlib
Install dependencies with:
pip install -r requirements.txt