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

Adding non-collinear functionals #169

Open sunqm opened 1 year ago

sunqm commented 1 year ago

Multi-collinear functional method (https://doi.org/10.1103/PhysRevResearch.5.013036) can produce non-collinear functionals based on regular collinear functionals. I think this is a useful feature for XC functional libraries to support non-collinear DFT calculations.

A python based implementation of this method has been developed in https://github.com/Multi-collinear/MCfun . That Python implementation has an API tightly coupled to the PySCF DFT framework, not convenient for C++ or Fortran programs. We are planning to develop better APIs that are close to the Xcfun APIs.

Roughly, the idea is to extend the XC_VAR mode, to include a four-slot density vector (total density, mx, my, mz). mx, my, mz are the three components of the magnetization density. If the input functional Id turns out to be a non-collinear functional, the multi-collinear wrapper can be executed which calls the XC functional derivatives in Xcfun and transform results to the high-order derivatives of non-collinear functionals. As a result, in the C++ or Fortran programs, non-collinear functionals can be handled in the same way as the regular collinear functionals.

If this feature sounds useful for Xcfun library, we will implement the code based on the Xcfun framework and create a pull request.

robertodr commented 1 year ago

Hello! It does sound like a very useful feature to offer with XCFun. Thanks for offering to work on this!