Skip to content

Feature/robust poisson split2 - #320

Open
Ao-chuba wants to merge 9 commits into
theochem:masterfrom
Ao-chuba:feature/robust-poisson-split2
Open

Feature/robust poisson split2#320
Ao-chuba wants to merge 9 commits into
theochem:masterfrom
Ao-chuba:feature/robust-poisson-split2

Conversation

@Ao-chuba

Copy link
Copy Markdown
Member

This PR implements Split 2 of the Double-Split-Plus-Solve architecture, completing the robust Poisson solver pipeline.

This PR depends on #319 (Split 1) and currently includes its commits as this branch was branched off PR (split1).

While Split 1 (#319) successfully subtracts the extremely sharp promolecular atomic cores, the remaining residual density can still contain sharp multi center features (bonding density/polarization) or negative lobes. This PR implements a second split to analytically fit and extract this remaining density.

By utilizing scipy.optimize.nnls with a geometric progression of Gaussian basis exponents, we perform a nnls fit to capture the multi center bonding density. Because Gaussians have exact analytical potentials, this leaves only a tiny, perfectly smooth numerical residual for the BVP solver to integrate, meaning it converges without any risk of crashing or instability.

once pr(split1) #319 gets updated (if required ) after review and gets merged to master, ill rebase this PR then the git diff (amount of new lines added or deleted ) will reduce accordingly.

@Ao-chuba

Copy link
Copy Markdown
Member Author

@PaulWAyers @marco-2023 , here's the split2 pr . ones split1 pr gets merged this should get merged too as it goes hand in hand. (in this PR approx 100 new lines has been added on top of the #319 PR)
also split1 pr #319 will need to be reviewed and merged first then this.
please look into it whenever you get time.
thank you

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements Split 2 of the robust Poisson (“Double-Split-Plus-Solve”) pipeline by adding an optional NNLS-based Gaussian fit on the post–Split 1 residual density, further smoothing the numerical residual passed to the BVP solver.

Changes:

  • Add solve_poisson_robust(...) implementing Split 1 core subtraction, optional Split 2 NNLS residual fitting, and BVP solve on the final residual.
  • Add comprehensive tests covering correctness against an analytic Gaussian potential, stability for sharp/negative densities, input validation, and Split 2 execution.
  • Export the robust solver from the package top-level grid namespace.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/grid/robust_poisson.py Adds robust Poisson solver with optional Split 2 NNLS Gaussian fit and analytical+numerical potential composition.
src/grid/tests/test_robust_poisson.py Adds tests validating accuracy, stability, error handling, and Split 2 behavior.
src/grid/init.py Re-exports robust_poisson symbols at package top level.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/grid/robust_poisson.py
Comment thread src/grid/robust_poisson.py
Comment thread src/grid/robust_poisson.py
@Ao-chuba

Copy link
Copy Markdown
Member Author

PR has been updated as per taking in valid suggestions from co pilot
@PaulWAyers @marco-2023

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.

2 participants