An interactive simulation tool for exploring the discrete energy levels and wavefunctions of quantum particles in potential wells. By solving the Schrödinger equation numerically, this project highlights the effects of confinement, tunneling, and boundary conditions on wavefunction behavior.
The project numerically solves the time-independent Schrödinger equation for bound states in user-defined potentials. This reveals how eigenstates (wavefunctions) and eigenvalues (energies) shift when changing parameters like well depth, confinement length, or potential shape.
The solver is implemented in Python using NumPy for matrix operations and SciPy for advanced routines. Users can define the potential profile via a Python function or by loading a mesh from a file. Matplotlib is leveraged for real-time plotting of wavefunctions and energy spectra.
numpy.linalg or scipy.sparse
A finite-difference method approximates the second derivative term
in the Schrödinger equation. After assembling the Hamiltonian matrix
from kinetic and potential energy contributions, numpy.linalg.eig
or scipy.sparse.linalg.eigs diagonalizes it to extract
eigenvalues (energies) and eigenvectors (wavefunctions).
# Brief excerpt illustrating Hamiltonian construction & diagonalization
# potential_energy_matrix[i, i] = V(positions[i])
# kinetic_energy_matrix -> finite difference approximation
hamiltonian = kinetic_energy_matrix + potential_energy_matrix
# Solve eigenvalue problem
eigenvalues, eigenvectors = np.linalg.eig(hamiltonian)
# Sort and pick lowest energies
idx_sorted = np.argsort(eigenvalues)
lowest_indices = idx_sorted[:5]
energies = eigenvalues[lowest_indices]
wavefunctions = eigenvectors[:, lowest_indices]
Users can define various potentials, from simple infinite wells to piecewise polynomials or even loaded data from external files. Each potential shape drastically alters the spacing of energy eigenvalues and the shape of wavefunctions, illustrating core principles of quantum confinement and tunneling.
The visualizer serves as a hands-on educational tool for undergraduate quantum mechanics, letting students experiment with boundary conditions, barrier heights, and well depths to see real-time changes in the energy spectrum and wavefunction shapes. This direct manipulation builds intuition on key quantum phenomena, including tunneling and quantized energy levels.
By adjusting parameters interactively (e.g., in a Jupyter Notebook), users see how wavefunction nodes appear/disappear and how energy levels shift, thereby reinforcing theoretical concepts with practical, visual evidence.