Skip to content

Optimization: Prune zero weight grid points in horton3 adapter #35

@Ao-chuba

Description

@Ao-chuba

Hello , @tovrstra @FarnazH
While exploring src/denspart/adapters/horton3.py, I noticed a TODO comment on line 122 suggesting the removal of grid points with zero weight.
Analysis: I ran an analysis using the examples/horton3 test case (water molecule) to quantify the number of negligible points.

  • Total Grid Points: 87,300
  • Negligible Points (< 1e-10): ~4,961
  • Impact: Approximately 5.7% of the generated grid points effectively contribute nothing to the integration but consume computational resources during density and property evaluations. For larger systems or different grid settings, this percentage could be higher.

Solution: I propose implementing a filter in _setup_grid to remove points with weights below a threshold (e.g., 1e-15) immediately after grid generation. This will reduce the workload for all subsequent tensor operations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions