🤖 AI Summary
Existing implementations of spherical harmonics (SH) in electronic structure calculations suffer from low computational efficiency, code complexity, and error-proneness. To address these issues, this work introduces an explicit analytical formulation of real-valued SHs based on normalized Cartesian coordinates. The method eliminates recursion and complex arithmetic, yielding closed-form expressions that significantly reduce computational complexity. On CPUs, our implementation achieves over 10× speedup versus state-of-the-art SH libraries (e.g., LibCint, LIBINT) while preserving double-precision accuracy. Furthermore, a CUDA-accelerated GPU version delivers an additional 1–2 orders-of-magnitude performance improvement. The open-source implementation features a minimal, intuitive API and integrates seamlessly with major quantum chemistry and first-principles software packages. This work establishes a new paradigm for SH evaluation—characterized by high accuracy, high throughput, and cross-platform portability—enabling scalable and robust electronic structure simulations.
📝 Abstract
The authors present SHarmonic, a new implementation of the spherical harmonics targeted for electronic-structure calculations. Their approach is to use explicit formulas for the harmonics written in terms of normalized Cartesian coordinates. This approach results in a code that is as precise as other implementations while being at least one order of magnitude more computationally efficient. The library can run on graphics processing units (GPUs) as well, achieving an additional order of magnitude in execution speed. This new implementation is simple to use and is provided under an open source license, it can be readily used by other codes to avoid the error-prone and cumbersome implementation of the spherical harmonics.