-Add a better parsing to set easly m, l and n.
-Setup the animation.
This repository contains a Python script for calculating and animating the wave function of a hydrogen atom in a plot. It utilizes the numpy
, matplotlib
, and scipy
libraries for calculations and visualization.
The wave function of a quantum system describes its state and provides the probability distribution for observable measurements. For a hydrogen atom, the wave function can be expressed as a product of radial and angular parts:
where
The radial part is given by:
where
The angular part is given by spherical harmonic functions:
where
The compute_wave_function
function calculates the wave function for specified quantum numbers compute_probability_density
function.
The plot_wave_function
function plots the probability density using matplotlib
's imshow
function, creating a 2D image of the probability density. The update
function animates the plot by updating it at each frame with the wave function and probability density for given quantum numbers and a Bohr radius scale factor.
Execute the main
function in a Python environment to run the script. The output is a plot of the wave function and probability density for the specified quantum numbers and Bohr radius scale factor. The plot is animated with a time-dependent wave function.
This script requires the following Python libraries:
numpy
matplotlib
scipy
This project is licensed under the MIT License. See the LICENSE
file for details.
The script includes the Bohr radius value from the physical_constants
module of the scipy
library. The genlaguerre
and lpmv
functions from scipy
are used to calculate associated Laguerre and Legendre polynomials, respectively. The imshow
function from matplotlib
is used to create the 2D image of the 3D probability density.