Skip to content

Conversation

tutou2356
Copy link

Adds the AdaptiveUniformGrid wrapper class to provide recursive subdivision of a uniform grid.

Adds the AdaptiveUniformGrid wrapper class to provide
recursive subdivision of a uniform grid.
… added test cases

- Revised the `_estimate_error` function
- Adjusted the weight calculation method to more efficiently update based on new errors
- Added test cases for other functions
@Ali-Tehrani Ali-Tehrani self-requested a review August 14, 2025 16:22
Copy link
Collaborator

@Ali-Tehrani Ali-Tehrani left a comment

Choose a reason for hiding this comment

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

Hi @tutou2356, these are my initial changes for the adaptive grid. Let me know if you have any questions/problems.

tutou2356 and others added 8 commits August 19, 2025 23:46
…nement

- Use finite difference gradient for error estimation
- Include diagonal elements in 3^D subdivision
- Update weight calculation method for volume conservation
- Fixed so that now works over any general axes
- Vectorized it to make it faster
- Gradient didn't help with integration unfortunately
- This quadrature error scheme looks at the contribution
  from the center point to its subdivision as the error
- Removed the hash-map storage, and
now efficiently stores points and their previous function values
@Ali-Tehrani
Copy link
Collaborator

Ali-Tehrani commented Aug 21, 2025

Hi Emily,

Thanks for your work, bug fixes that you found, and the requested changes! I tried it out with the gradient error measure and was disappointed with the integration improvement. Due to the time limit, I have made the following changes:

  • Added a quadrature error measure that improves the integration error.
  • The subdivision scheme now works over any axes, and vectorize it to make it faster
  • Added an option to only do refinement if the integrand is higher than some threshold. This speeds up the refinement process.
  • I removed the hash-map way of storing previous evaluated points. Any refinement that occurs should store the new points, their functional evaluations and weights automatically. This should speed things up (but I used hstack which can slow things).

I tried this out with some of your test-cases, and it improved the error measure. I would ignore the gentle_wide test cases, because symmetry places an important role in these functions. Additionally, I tried it out on the electron density, and it significantly improved the results. Therefore, I would recommend for your presentation to include electron density results, tutorials and various plots that you can think of.

Hope this helps you with your final evaluation.

@tutou2356
Copy link
Author

Hi, Ali,
Thank you so much for the detailed updates and the new code. This is incredibly helpful.I'll be going through it in detail.
Thanks again for your guidance and support.

-Modified the weighting method setting when creating the grid
@Ali-Tehrani Ali-Tehrani changed the title feat: Implement adaptive uniformgrid refinement GSOC 2025: Implement adaptive uniformgrid refinement #264 Sep 3, 2025
@Ali-Tehrani Ali-Tehrani changed the title GSOC 2025: Implement adaptive uniformgrid refinement #264 GSOC 2025: Implement adaptive uniformgrid refinement Sep 3, 2025
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