Commit be03870
authored
Refactor and Optimize snap_psibeta_half_tddft (#6765)
* Optimize snap_psibeta_half_tddft for better performance
Key optimizations include:
1. Cache Gauss-Legendre Grid: Implemented thread-safe caching for radial integration grid points and weights.
2. Precompute Spherical Harmonics: Precomputed Ylm and A dot r on the Lebedev angular grid to reduce inner loop overhead.
3. Memory Optimization: Lifted vector allocations out of loops and reused buffers to minimize allocation costs.
4. Inline Interpolation: Inlined polynomial interpolation and used precomputed inverse step size to avoid divisions.
5. Common Subexpression Elimination: Extracted invariant factors from the innermost loop to reduce arithmetic operations.
* Refactor snap_psibeta_half_tddft: improved code structure, added comments, and consolidated optimizations
* Fix off-by-one error in radial interpolation boundary check1 parent f1c5f1b commit be03870
1 file changed
+282
-150
lines changed
0 commit comments