Please post the results of conda list, so we know which program you’re using to get the dispersion correction. The logic involving dispersion programs changed towards the end of the 1.7 development cycle, and this bug is likely a consequence of that…
There are, to my knowledge, at least 2 versions for wB97X-D4. One for the original wB97X plus added D4 and one where the V in wB97X-V is replaced by D4. Which one was your target?
The one that gives a lower overall error on the GMTKN55 data set, which in my understanding is the latter. Like the “wB97X-D3BJ” definition in psi4 , that returns
wB97X-V - vdW_DFT + D3BJ
So to be consistent with that definition, one might assume that “wB97X-D4BJ” is doing the same computation with D3BJ replaced by D4BJ?
Unfortunately psi4 automatically combines the old wB97X with added D4. Grimme made parameters for it. I added Goerigk’s -D3 versions for the (w)B97X/M-V functionals manually but not yet the -D4 variants. It requires manually definition like so:
Btw, I could not reproduce your error with my development version.
# molecule name is "s4di" in this example
gradD4, wfn1 = gradient('wB97X-D4BJ', return_wfn=True, dertype='gradient',molecule=s4di)
grad, wfn2 = gradient('wB97X', return_wfn=True, dertype='gradient',molecule=s4di)
E, G = s4di.run_dftd4('wB97X', 'd4bj')
d_grad=grad.np-gradD4.np
compare_values(-G, d_grad, 8, 'D4 grad test1')
To put things into a somewhat broader perspective:
Our statistical analysis revealed, that ORCA:wB97X-D4, ORCA:wB97X-D3BJ and PSI4:wB97X-D3BJ all give very similar results for the gradient vectors, but PSI4:wB97X-D4 does not, so the latter gradient vector is always a clear outlier in the overall set. The source of this is now sufficiently explained with the above comments.
I also assume from the above that ORCA has implemented some kind of consistent D4 model in combination with wB97X-V that can be directly used (and trusted), even if there is no published version by Grimme yet.
For current users, that do not perform (or do not want to perform) quantitative inter-QC-code comparison and just simply type the respective keywords the discussed inconsistency might be a source of systematic error in their results.
Afaik, Goerigk is ORCA developer and put his D3/D4 versions into ORCA first. So that’s the reference for those functionals. We are catching up with the implementations.
I am not sure how ORCA implements D4 but i do expect it links Grimme’s code with a library rather than a re-implementation. That should agree with what we do (using a python API to the library).
That 2 different functional names have different parameters of the functional and/or dispersion correction is not the first time
Not sure what the solution on psi4’s side could be. Goerigk’s version is preferred i think and will get into psi4.
I see your point of certainly having some ambiguity here with respect to the proper naming/selection of the DFT functional and the corresponding D3/D4 dispersion model.