Skip to content

Clamped molecular potentials in spherical coordinates#31

Merged
haakoek merged 6 commits intomainfrom
molecular_potential_sphc
Apr 16, 2026
Merged

Clamped molecular potentials in spherical coordinates#31
haakoek merged 6 commits intomainfrom
molecular_potential_sphc

Conversation

@haakoek
Copy link
Copy Markdown
Collaborator

@haakoek haakoek commented Apr 16, 2026

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 z axis.

Implementation

  • Add shared spherical-harmonic utilities in grid_lib.spherical_coordinates.utils.
  • Add cartesian_to_spherical for converting Cartesian nuclear positions to spherical coordinates.
  • Add clamped_molecular_potential_quadrature to compute V_LM(r) from the analytic kernel r_<^L / r_>^(L+1) for general 3D nuclear positions.
  • Add clamped_molecular_potential_Poisson to compute V_LM(r) from a precomputed Poisson-based radial Coulomb tensor W.
  • In the Poisson-based helper, use the nearest radial grid point when a nuclear radius is off-grid and issue a warning in that case.
  • Export the new helpers from grid_lib.spherical_coordinates and top-level grid_lib.
  • Remove redundant imports/comments in the spherical angular-momentum module.

Testing

  • Add tests for cartesian_to_spherical.
  • Add tests for clamped_molecular_potential_quadrature for centered and displaced nuclei.
  • Add tests for clamped_molecular_potential_Poisson covering assembly from W and warning/nearest-grid behavior.
  • Verify the new example script compiles and runs.

Example

  • Add examples/clamped_molecular_potential_quadrature_vs_poisson.py, which compares quadrature and Poisson radial components for a diatomic potential on the z axis using a FEMDVR grid.

@haakoek haakoek merged commit 53a5e8f into main Apr 16, 2026
2 checks passed
@haakoek haakoek deleted the molecular_potential_sphc branch April 16, 2026 13:38
@haakoek haakoek restored the molecular_potential_sphc branch April 16, 2026 13:40
haakoek added a commit that referenced this pull request Apr 16, 2026
Merge pull request #31 from HyQD/molecular_potential_sphc
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