This repository provides a Python-based visualization of the quantum harmonic oscillator (QHO). The QHO is a fundamental system in quantum mechanics, describing particles bound in a parabolic potential well. This project models wavefunctions, and probability densities for the QHO using Hermite polynomials.
- Introduction
- Mathematical Framework
- Code Features
- Setup Instructions
- Results and Visualizations
- Conclusion
The quantum harmonic oscillator is a cornerstone in quantum mechanics, describing systems ranging from molecular vibrations to quantum fields. This project focuses on:
- Visualizing the first few wavefunctions and their probability densities.
- Computing and displaying energy levels.
Key components include:
- Hermite polynomials for wavefunctions.
- Normalization factors for physical accuracy.
- Adjustable parameters (quantum state).
The wavefunctions of the QHO are expressed as:
The energy of the nth quantum state is:
The probability density is given by:
-
Wavefunction Generation:
- Computes
$\psi_n(X)$ for given n and X.
- Computes
-
Probability Density:
- Calculates
$P(x)=\psi^*(x)\psi(x)$ .
- Calculates
-
Energy levels:
- Computes
$E_n$ for given value of n.
- Computes
- Dimensionless position (X): Position of the particle
- Quantum state (n): Energy level for the given nth position.
To run this project on your local machine, ensure that you have the necessary dependencies installed. The following steps outline how to set up the project:
- Clone this repository:
git clone https://github.com/LINSANITY03/Quantum-Harmonic-Oscillation
- Create a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install the required dependencies:
pip install -r requirements.txt
- Usage After installing the dependencies, go to notebooks folder:
cd notebooks
then, open the main.ipynb file.
The script will generate visualizations of the wavefunction for various quantum states, including energy levels and probability distributions.
You can modify the parameters in the script from config.yml to observe how the wavefunction changes with different particle energies level.
Plot of the wavefunctions and probability density for the first four quantum states.
This project offers a detailed exploration of the quantum harmonic oscillator, a foundational concept in quantum mechanics. The following key insights were gained:
-
Wavefunctions and Probability Densities:
- Wavefunctions exhibit characteristic shapes defined by Hermite polynomials.
- Probability densities highlight regions of high likelihood for particle localization, with increasing nodes as quantum number increases.
-
Energy Levels:
- The energy levels are evenly spaced, a hallmark of the harmonic oscillator potential.
- The spacing between energy levels is directly proportional to the angular frequency (omega).
This visualization provides a robust foundation for understanding quantum oscillatory systems. It bridges theoretical concepts with computational insights, paving the way for future projects such as time evolution studies or comparisons with classical harmonic oscillators.
Feel free to use this codebase for your projects. If you want to talk more about this project or have found bugs, create a pull request or contact me on pujantamang92@gmail.com.