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.
This PR is an answer to issue #1116 and a follow-up to PR #1140, which respectively reported and tried to address a bug in GAPW with meta-GGA functionals. I was not able to find the exact issue in the code. Instead, I rewrote from scratch the 2 main steps involved, namely evaluating tau on the atomic grids and integrating the derived potential. The new code is slightly more brute force, as everything is explicitly put on the grid and no corner is cut.
Testing involved debug runs for the forces, on all combination of 6-311G** and def2-DZVP basis sets, TPSS and M06_L functionals and H2O, CO and C2H4 molecules. Most errors are at 0.01% or less (max error at 0.07%). Moreover, the OT method was used in combination with the CG minimzer and 3PNT LINESEARCH and the total energy was systematically decreasing at each CG step of the SCF procedure, which is sound behaviour.