Skip to content

Molecular potential sphc#33

Merged
haakoek merged 2 commits into
mainfrom
molecular_potential_sphc
Apr 29, 2026
Merged

Molecular potential sphc#33
haakoek merged 2 commits into
mainfrom
molecular_potential_sphc

Conversation

@haakoek
Copy link
Copy Markdown
Collaborator

@haakoek haakoek commented Apr 29, 2026

Handle zero-position nucleus in clamped_molecular_potential_Poisson

Previously, passing a nucleus at the origin would raise a ValueError from cartesian_to_spherical, since spherical angles are undefined for the zero vector. This change adds an explicit check: if a nuclear position is the zero vector, the analytic Coulomb potential $-Z/r$ is added directly to the $L=0, M=0$ coefficient (as $-Z\sqrt{4\pi}/r$), consistent with the behaviour of clamped_molecular_potential_quadrature.

@haakoek haakoek merged commit 83946d0 into main Apr 29, 2026
2 checks passed
@haakoek haakoek deleted the molecular_potential_sphc branch April 29, 2026 14:52
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