dftlibs / xcfun

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

Irreproducible results #163

Open susilehtola opened 2 years ago

susilehtola commented 2 years ago

XCFun currently relies on compile-time definitions to change functionals' behavior. This means that for instance PBE exchange in two copies of the same version of XCFun may give different results. This is highly undesirable behavior: the output of functionals should not depend on compile-time behavior.

Instead, the variants should be implemented separately, as in Libxc. One should be able to access all implementations without having to reconfigure and recompile in-between.

robertodr commented 2 years ago

Are you referring to these lines? https://github.com/dftlibs/xcfun/blob/master/src/functionals/pbex.hpp#L30-L35

susilehtola commented 2 years ago

Are you referring to these lines? https://github.com/dftlibs/xcfun/blob/master/src/functionals/pbex.hpp#L30-L35

Yes. Other functionals have similar issues, e.g. https://github.com/dftlibs/xcfun/blob/6c82faa0b194d27d8f2fcc023b72df905b22ee9d/src/functionals/p86c.cpp#L31-L35