Skip to content

XC functional refactor#778

Merged
baixiaokuang merged 37 commits into
deepmodeling:developfrom
wenfei-li:develop
Mar 11, 2022
Merged

XC functional refactor#778
baixiaokuang merged 37 commits into
deepmodeling:developfrom
wenfei-li:develop

Conversation

@wenfei-li
Copy link
Copy Markdown

@wenfei-li wenfei-li commented Mar 4, 2022

I have done several things in this refactor :

  1. gathered all relevant subroutines into a separate directory, module_xc
  2. unified the realization into a single class, XC_Functional
  3. modified the process of reading dft_functional to allow for support of all LDA, GGA and mGGA functionals in LIBXC
  4. put the subroutines into separate files according to their functionality, and added comment
  5. unified the interface v_xc with and without LIBXC
  6. fixed some bugs in the realization of mGGA for nspin = 2
  7. switched to using gradcorr for calculating stress_gga, instead of gcxc, thus eliminating lots of redundant code
  8. modified some settings for density threshold and constants in functionals so that the results of GGA can now be brought to be consistent with quantum-espresso
    NOTE: as a result of this modification, the numbers produced in integrated tests are now slightly different from the reference value, are we considering changing the results?

wenfei-li added 23 commits February 9, 2022 14:49
not finished yet, but working
    class xc_func by two ID's identifying the type of
    exchange and correlation functional
    which is consistent with LIBXC
LDA functionals (using or not using libxc)
1. add PWLDA functional
2. modify some parameters in pbex and pbec
3. add interface gcxc_libxc
1. add xc_funcs.h for compiling without libxc
2. removed some no longer used subroutines
1. remove input variable vxc_in_h
since it is equivalent to setting dft_functional = "none"
2. switch back to v_xc_libxc since it is faster
to calculate vxc on entire grid, not loop over points
3. move v_xc, v_xc_libxc and v_xc_meta to
xc_functional_vxc.cpp
1. replace id numbers by LIBXC keywords
2. modify v_xc_meta and tau_xc, so that
all mGGA in LIBXC can be used
also fixed bugs in mGGA realization
compiling without USE_LIBXC
@wenfei-li wenfei-li requested a review from dyzheng March 4, 2022 09:20
@wenfei-li wenfei-li force-pushed the develop branch 2 times, most recently from e52d7d4 to 37af449 Compare March 4, 2022 10:17
wenfei-li added 2 commits March 7, 2022 20:44
to check if xc functional from input and pp
is consistent
@mohanchen mohanchen requested review from caic99 and mohanchen March 8, 2022 07:26
@mohanchen mohanchen self-assigned this Mar 8, 2022
@mohanchen
Copy link
Copy Markdown
Collaborator

Recently, the TDDFT branch also made a lot of changes based on the knowledge that we know daye, xinglinag, and tianqi are working on the module_base. Unexepectly, this commit involves changes of many files. Therefore, we need to be careful in merging TDDFT branch and the develop branch.

@mohanchen
Copy link
Copy Markdown
Collaborator

I have done several things in this refactor :

  1. gathered all relevant subroutines into a separate directory, module_xc
  2. unified the realization into a single class, XC_Functional
  3. modified the process of reading dft_functional to allow for support of all LDA, GGA and mGGA functionals in LIBXC
  4. put the subroutines into separate files according to their functionality, and added comment
  5. unified the interface v_xc with and without LIBXC
  6. fixed some bugs in the realization of mGGA for nspin = 2
  7. switched to using gradcorr for calculating stress_gga, instead of gcxc, thus eliminating lots of redundant code
  8. modified some settings for density threshold and constants in functionals so that the results of GGA can now be brought to be consistent with quantum-espresso
    NOTE: as a result of this modification, the numbers produced in integrated tests are now slightly different from the reference value, are we considering changing the results?

I think if the results can better match qe, maybe we should change the results. However, as mentioned before, some parameters in this code was chosen to have better convergence for some special systems. Maybe we should add those systems into integreated tests.

@wenfei-li
Copy link
Copy Markdown
Author

Recently, the TDDFT branch also made a lot of changes based on the knowledge that we know daye, xinglinag, and tianqi are working on the module_base. Unexepectly, this commit involves changes of many files. Therefore, we need to be careful in merging TDDFT branch and the develop branch.

Most of the changes in this pull request involves moving subroutines into different files, and the interface to this module is still v_xc which has not been modified. Hopefully there won't be too many conflicts.

Comment thread source/module_xc/xc_functional.h Outdated
Copy link
Copy Markdown
Collaborator

@mohanchen mohanchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

be careful when merging with the TDDFT branch, 'be careful' means test more

@baixiaokuang baixiaokuang merged commit b3bba62 into deepmodeling:develop Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

threshold for rho and grho in xc functionals myfunc.h and XC functionals

5 participants