Clamped molecular potentials in spherical coordinates#31
Merged
Conversation
haakoek
added a commit
that referenced
this pull request
Apr 16, 2026
Merge pull request #31 from HyQD/molecular_potential_sphc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adds support for constructing clamped molecular potentials in spherical coordinates using both an analytic quadrature-based multipole expansion and a Poisson-based radial construction. It also includes the supporting spherical-coordinate utilities introduced yesterday, along with tests and an example comparing the two constructions for a diatomic potential on the
zaxis.Implementation
grid_lib.spherical_coordinates.utils.cartesian_to_sphericalfor converting Cartesian nuclear positions to spherical coordinates.clamped_molecular_potential_quadratureto computeV_LM(r)from the analytic kernelr_<^L / r_>^(L+1)for general 3D nuclear positions.clamped_molecular_potential_Poissonto computeV_LM(r)from a precomputed Poisson-based radial Coulomb tensorW.grid_lib.spherical_coordinatesand top-levelgrid_lib.Testing
cartesian_to_spherical.clamped_molecular_potential_quadraturefor centered and displaced nuclei.clamped_molecular_potential_Poissoncovering assembly fromWand warning/nearest-grid behavior.Example
examples/clamped_molecular_potential_quadrature_vs_poisson.py, which compares quadrature and Poisson radial components for a diatomic potential on thezaxis using a FEMDVR grid.