dftlibs / xcfun

XCFun: A library of exchange-correlation functionals with arbitrary-order derivatives
https://dftlibs.org/xcfun/
Mozilla Public License 2.0
58 stars 32 forks source link

P86C is incorrect #161

Closed susilehtola closed 2 years ago

susilehtola commented 2 years ago

I am looking into the issue reported in Brakestad et al

we later realized that the BP86 versions in ORCA and MRChem are not identical, implying that a comparison of GTO to MW at the BP86 level would be affected by differences in the implementation of the functional, which our tests indicated could amount to several kcal/mol, when approaching the CBS limit.

by comparing Libxc and XCFun for this functional. The value of ftilde is one difference; using gga_c_p86_ft in Libxc yields much closer agreement with XCFun but I am still seeing a 2.9e-8 Eh difference at fixed density for the nitrogen atom.

My working assumption is that the difference is caused by the hack in xcfun

https://github.com/dftlibs/xcfun/blob/ff498cde6ed29339f006cdd21bffa7a911915acb/src/functionals/p86c.cpp#L29

At variance, in Libxc the gradient is forced to be at least 1e-40. Maybe the fudge parameter could be made smaller.

susilehtola commented 2 years ago

Note that fudge >> eps so the correction will be measureable even for unit gradient!