Spaces:
Sleeping
Sleeping
File size: 698 Bytes
05354e5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | import numpy as np
from .constants import BOHR_RADIUS
# ------------------------------------------------------
# Particle in a Box: ψ_n(x)
# ------------------------------------------------------
def pib_wavefunction(n: int, x: np.ndarray, L: float) -> np.ndarray:
return np.sqrt(2 / L) * np.sin(n * np.pi * x / L)
# ------------------------------------------------------
# Hydrogen ground state approximation (1D radial)
# ψ(r) = (1/√π a₀³) exp(-r / a₀)
# ------------------------------------------------------
def hydrogen_ground_state(r: np.ndarray) -> np.ndarray:
r = np.abs(r)
return (1 / np.sqrt(np.pi * BOHR_RADIUS**3)) * np.exp(-r / BOHR_RADIUS)
|