MRChemSoft / mrchem

MultiResolution Chemistry
GNU Lesser General Public License v3.0
27 stars 21 forks source link

Use dynamic thrs in initial SCRF #429

Closed stigrj closed 1 year ago

stigrj commented 1 year ago

Turned out to be a comically simple fix. By initializing the MO residual to 1.0 instead of -1.0 we trigger the dynamic threshold also for the 0th iteration. For cases when we want to compute the total energy accurately on the initial guess, use dynamic_thrs = false.

@Gabrielgerez please try this version on some real-world cases.

Closes #426

stigrj commented 1 year ago

Also added a warning if SCRF doesn't converge

codecov[bot] commented 1 year ago

Codecov Report

Base: 68.40% // Head: 68.40% // Increases project coverage by +0.00% :tada:

Coverage data is based on head (bac2d02) compared to base (85db5f0). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #429 +/- ## ======================================= Coverage 68.40% 68.40% ======================================= Files 183 183 Lines 15477 15478 +1 ======================================= + Hits 10587 10588 +1 Misses 4890 4890 ``` | [Impacted Files](https://codecov.io/gh/MRChemSoft/mrchem/pull/429?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=MRChemSoft) | Coverage Δ | | |---|---|---| | [src/environment/SCRF.cpp](https://codecov.io/gh/MRChemSoft/mrchem/pull/429/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=MRChemSoft#diff-c3JjL2Vudmlyb25tZW50L1NDUkYuY3Bw) | `92.57% <100.00%> (+0.03%)` | :arrow_up: | | [tests/solventeffect/reaction\_operator.cpp](https://codecov.io/gh/MRChemSoft/mrchem/pull/429/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=MRChemSoft#diff-dGVzdHMvc29sdmVudGVmZmVjdC9yZWFjdGlvbl9vcGVyYXRvci5jcHA=) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=MRChemSoft). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=MRChemSoft)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.