Quantum Wavepacket Dispersion & Probability Density in Python

QUANTUM PHYSICS ESSAY • 10 MIN READ • PYTHON & NUMPY

Quantum Wavepacket Dispersion & Probability Density: Solving Schrödinger Equation in Python

Numerical integration of the time-dependent Schrödinger equation, illustrating free-particle dispersion, harmonic potential barriers, and probability density evolution.

wave_quantum_sim.py ● 60 FPS • CRANK-NICOLSON EVOLUTION
iħ ∂ψ/∂t = [-ħ²/(2m) ∇² + V(x)] ψ |ψ(x,t)|² Probability Density

1. The Physics: From de Broglie Waves to Dispersion

In non-relativistic quantum mechanics, a massive particle (such as an electron) is completely described by a complex-valued wave function $\psi(x,t)$. Its time evolution is governed by the Time-Dependent Schrödinger Equation (TDSE):

iħ · (∂ψ/∂t) = Ĥψ = [ – (ħ²/2m) · (∂²ψ/∂x²) + V(x) ] · ψ

Born’s statistical interpretation dictates that $|\psi(x,t)|^2 = \psi^*(x,t)\psi(x,t)$ yields the probability density of finding the particle at coordinate $x$ at time $t$. Total probability is strictly conserved: $\int_{-\infty}^{\infty} |\psi(x,t)|^2 dx = 1$.

Why do wavepackets disperse? A localized Gaussian wavepacket is composed of a continuous superposition of plane waves across a momentum spectrum $\Delta p \sim \hbar / \Delta x$. In free space ($V=0$), the dispersion relation is quadratic:

ω(k) = (ħ k²) / (2m) ==> Phase Velocity v_p = (ħ k)/(2m) != Group Velocity v_g = (ħ k)/m

Because different Fourier frequency components travel at different phase velocities, the wavepacket inevitably widens in physical space over time, illustrating Heisenberg’s uncertainty principle in dynamic action.

2. Numerical Implementation: Unitary Crank-Nicolson Integration

Standard explicit finite differences (Euler method) fail catastrophically for Schrödinger evolution because the time-evolution operator $U(t) = \exp(-iHt/\hbar)$ must be unitary ($U^\dagger U = I$) to conserve probability. An explicit scheme leaks or blows up probability after a few frames.

Instead, our generator utilizes the Crank-Nicolson implicit scheme (Cayley transform), which is unconditionally stable and strictly unitary:

# Unitary Time-Evolution of Quantum Wavepacket in NumPy
import numpy as np

def init_gaussian_wavepacket(x, x0, sigma, k0):
    # ψ(x,0) = (2π σ²)^(-1/4) * exp(-(x - x0)² / (4 σ²)) * exp(i k0 x)
    norm = (2.0 * np.pi * sigma**2)**(-0.25)
    psi = norm * np.exp(-(x - x0)**2 / (4.0 * sigma**2)) * np.exp(1j * k0 * x)
    return psi

def compute_probability_density(psi):
    # P(x,t) = |ψ(x,t)|² = Re(ψ)² + Im(ψ)²
    return np.abs(psi)**2

3. Frame-by-Frame Visual Anatomy

Top Panel: Complex Phase Oscillations

Plots $ ext{Re}(\psi)$ in electric cyan and $ ext{Imag}(\psi)$ in muted violet, illustrating high-frequency spatial carrier waves propagating within the Gaussian envelope.

Bottom Panel: Probability Density $|\psi|^2$

Shaded in luminous gradient saffron. Shows total probability conservation $\int |\psi|^2 dx = 1$ while capturing spatial dispersion as the wavepacket travels forward.

FULL DEVELOPER PACKAGE

Python Scientific Motion Starter Kit (Vol. 1)

Includes the Quantum Wavepacket simulator, Fourier Epicycles engine, and A* Pathfinding code.

$49.00 $19.00
  • ✓ Complete standalone Python scripts (.py) with PEP 8 type hints and Matplotlib animation loops
  • ✓ Pre-rendered 60fps 1080p & 4K MP4 master loops + optimized GIFs for social and blogs
  • ✓ Requirements.txt with one-click setup (NumPy, SciPy, Matplotlib, FFmpeg)
  • ✓ Perpetual commercial license for YouTube essays, SaaS sites, and pitch decks

Need Bespoke Quantum or Wavefield Visualizations?

We program custom finite-difference and spectral solver animations for scientific papers, conference presentations, and deep-tech founders. Tiers start from $45.

Request a Custom Commission (ishrikantbhosale@gmail.com) →

Comments

One response to “Quantum Wavepacket Dispersion & Probability Density in Python”

  1. […] MATHEMATICS Fourier Harmonic Epicycles → 02. QUANTUM MECHANICS Quantum Wavepacket Dispersion → 03. COMPUTER SCIENCE A* Pathfinding Algorithm […]

Leave a Reply

Your email address will not be published. Required fields are marked *