Skip to content

Add partial support for Ahrens-Beylkin angular grids#317

Merged
marco-2023 merged 13 commits into
theochem:masterfrom
marco-2023:ab_grid
Jul 3, 2026
Merged

Add partial support for Ahrens-Beylkin angular grids#317
marco-2023 merged 13 commits into
theochem:masterfrom
marco-2023:ab_grid

Conversation

@marco-2023

Copy link
Copy Markdown
Collaborator

This PR adds all Ahrens-Beylkin in https://github.com/wavefunction91/IntegratorXX/tree/master

These are incomplete.

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

This PR extends the angular-grid infrastructure to recognize an additional precomputed grid family (“ahrens_beylkin”) and wires it through AngularGrid/AtomGrid usage and test coverage.

Changes:

  • Added Ahrens–Beylkin degree/size mappings and caching support in AngularGrid.
  • Expanded existing atomic-grid and angular-grid tests to exercise the new method="ahrens_beylkin" option.
  • Updated AtomGrid docstrings to list the newly supported method(s).

Reviewed changes

Copilot reviewed 4 out of 60 changed files in this pull request and generated 7 comments.

File Description
src/grid/angular.py Adds Ahrens–Beylkin mappings/caching and hooks resource loading for the new method.
src/grid/atomgrid.py Updates method option documentation to include maxdet and ahrens_beylkin.
src/grid/tests/test_atomgrid.py Extends AtomGrid test parametrizations to include ahrens_beylkin.
src/grid/tests/test_angular.py Adds/extends integration and orthogonality tests to include ahrens_beylkin.
Comments suppressed due to low confidence (1)

src/grid/tests/test_angular.py:180

  • Spelling: "Concert" should be "Convert".

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

Comment thread src/grid/angular.py
Comment on lines +624 to +626
elif method == "ahrens_beylkin":
dict_degrees, dict_npoints = AHRENS_BEYLKIN_DEGREES, AHRENS_BEYLKIN_NPOINTS
file_path = "grid.data.ahrens_beylkin"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment thread src/grid/angular.py Outdated
Comment thread src/grid/angular.py Outdated
else:
raise ValueError(
f"Method {method} is not supported, choose 'lebedev', 'spherical' or 'maxdet'"
f"Method {method} is not supported, choose 'lebedev', 'spherical', or 'maxdet' or 'ahrens_beylkin'"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment thread src/grid/angular.py Outdated
Comment on lines +491 to +493
Method for constructing the angular grid. Options are "lebedev" (for Lebedev-Laikov),
"spherical" (for symmetric spherical t-design), maxdet (for maximum determinant grids),
and "ahrens_beylkin" (for Ahrens-Beylkin grids).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment thread src/grid/tests/test_atomgrid.py Outdated
from scipy.integrate import trapezoid

from grid.angular import LEBEDEV_DEGREES, SPHERICAL_DEGREES, MAX_DET_DEGREES, AngularGrid
from grid.angular import LEBEDEV_DEGREES, SPHERICAL_DEGREES, MAX_DET_DEGREES, AHRENS_BEYLKIN_DEGREES, AngularGrid

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment on lines +139 to 143
@pytest.mark.parametrize("degree", [5, 10, 100])
@pytest.mark.parametrize("method", ["lebedev", "spherical", "maxdet", "ahrens_beylkin"])
def test_integration_of_spherical_harmonic_up_to_degree(degree, method):
r"""Test integration of spherical harmonic is accurate."""
grid = AngularGrid(degree=degree, method=method)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment thread src/grid/tests/test_angular.py Outdated
degree = 88 * 2
grid = AngularGrid(degree=degree, method="spherical")
grid = AngularGrid(degree=degree, method=method)
# Concert to spherical coordinates from Cartesian.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

@marco-2023 marco-2023 requested a review from PaulWAyers July 2, 2026 19:00

@PaulWAyers PaulWAyers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me. Thanks @marco-2023

@marco-2023 marco-2023 merged commit 408bda1 into theochem:master Jul 3, 2026
10 checks 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.

3 participants