[PR-8] fix: tighten libcint ERI tolerance and use improved implementation (#208)#242
Closed
San1357 wants to merge 13 commits intotheochem:masterfrom
Closed
[PR-8] fix: tighten libcint ERI tolerance and use improved implementation (#208)#242San1357 wants to merge 13 commits intotheochem:masterfrom
San1357 wants to merge 13 commits intotheochem:masterfrom
Conversation
This was referenced Mar 11, 2026
Contributor
|
Superseeded by #245 |
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.
Summary
1e-4)electron_repulsion_integral(old, buggy algorithm) withelectron_repulsion_integral_improved(OS+HGP) intest_libcint.pyatol=rtol=1e-4toatol=rtol=1e-6for all integralsatol=1e-4, rtol=1e-5(rtol 10x tighter)What Changed
tests/test_libcint.pyelectron_repulsion_integral_improved, tightenatol=rtol=1e-6, ERI specificatol=1e-4, rtol=1e-5Why ERI has different tolerance?
ERI with
cc-pVDZbasis (d-orbitals) produces near-zero integrals where relative error is large but absolute error is small (~1e-5).atol=1e-4handles these near-zero values, whilertol=1e-5ensures non-zero values are accurate to 10x better than before.How To Test
python3 -m pytest tests/test_libcint.py -v # Expected: 240 passed, 32 skippedProof That It Works
- All 240 libcint tests passing with tightened tolerance
First Checklist
Scope Of this PR
tests/test_libcint.pymodifiedSecond Checklist
Type of Changes