Skip to content

Spherical wave expansions: quadratic, gaussians and plane waves.#37

Merged
haakoek merged 5 commits into
mainfrom
spherical_wave_expansions
Apr 30, 2026
Merged

Spherical wave expansions: quadratic, gaussians and plane waves.#37
haakoek merged 5 commits into
mainfrom
spherical_wave_expansions

Conversation

@haakoek
Copy link
Copy Markdown
Collaborator

@haakoek haakoek commented Apr 30, 2026

Add spherical wave expansion functions and examples

This pull request adds three new analytic spherical-harmonic radial-coefficient functions to potentials.py, along with accompanying example scripts.

New functions

  • gaussian_spherical_wave_expansion(r, r0, A, alpha, L_max, M_max)
    Computes $g_{LM}(r) = 4\pi A e^{-\alpha(r^2+R_0^2)} i_L(2\alpha r R_0) Y_{LM}^*(\hat{r}_0)$ using scipy.special.spherical_in.

  • plane_wave_spherical_wave_expansion(r, k, L_max, M_max, sign)
    Computes $f_{LM}(r) = 4\pi(i\sigma)^L j_L(kr),Y_{LM}^*(\hat{k})$ using scipy.special.spherical_jn. Supports $e^{\pm i\mathbf{k}\cdot\mathbf{r}}$ via the sign parameter.

  • quadratic_potential_spherical_wave_expansion(r, r0, omega, L_max, M_max)
    Exact two-term expansion of $\frac{1}{2}\omega^2|\mathbf{r}-\mathbf{r}_0|^2$; only $L=0$ and $L=1$ are non-zero.

All functions follow the existing L_max/M_max/LM_to_I interface and auto-detect real output.

New example scripts

  • examples/gaussian_spherical_wave_expansion.py — single Gaussian and symmetric two-centre superposition (odd $L$ cancellation)
  • examples/plane_wave_spherical_wave_expansion.py$e^{+i\mathbf{k}\cdot\mathbf{r}}$ and $e^{-i\mathbf{k}\cdot\mathbf{r}}$ side by side
  • quadratic_potential_spherical_wave_expansion.py — single and symmetric two-centre superposition

@haakoek haakoek merged commit 251f3a2 into main Apr 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant