Add partial support for Ahrens-Beylkin angular grids#317
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
AtomGriddocstrings 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 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" |
| 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'" |
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). |
| 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 |
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) |
| degree = 88 * 2 | ||
| grid = AngularGrid(degree=degree, method="spherical") | ||
| grid = AngularGrid(degree=degree, method=method) | ||
| # Concert to spherical coordinates from Cartesian. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
PaulWAyers
approved these changes
Jul 3, 2026
PaulWAyers
left a comment
Member
There was a problem hiding this comment.
Looks good to me. Thanks @marco-2023
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.
This PR adds all Ahrens-Beylkin in https://github.com/wavefunction91/IntegratorXX/tree/master
These are incomplete.