Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Support machine-learning based kinetic energy density functional for OFDFT #5777

Merged
merged 73 commits into from
Jan 6, 2025

Conversation

sunliang98
Copy link
Collaborator

@sunliang98 sunliang98 commented Dec 27, 2024

Reminder

  • Have you linked an issue with this pull request?
  • Have you added adequate unit tests and/or case tests for your pull request?
  • Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

Fix #...

Unit Tests and/or Case Tests for my changes

  • A unit test is added for each new feature or bug fix.

What's changed?

  • Support machine-learning based kinetic energy density functional for OFDFT, under source/module_hamilt_pw/hamilt_ofdft.
  • Provide the training manuscript of ML-based KEDF, under source/module_hamilt_pw/hamilt_ofdft/ml_tools.
  • Add a compile option ENABLE_MLKEDF for CMake and Makefile to turn on the ML-based KEDF.
  • Add two integrate tests: 902_OF_KE_MPN and 902_OF_KE_CPN5.
  • Update the document of input parameters.

This Pr is not complete yet.

  • Update compile and usage documents.
  • Provide default parameters for MPN and CPN5 KEDFs.
  • (Optional) Romove useless input parameters of ML-based KEDF.

Any changes of core modules? (ignore if not applicable)

  • Example: I have added a new virtual function in the esolver base class in order to ...

sunliang98 and others added 30 commits September 15, 2022 17:30
…ut variable 'pseudo_type'.

Now the type of pseudopotential is assigned in STRU, not INPUT, and different type of pseudopotentials can be assigned for different elements in one calculation.
Following are the supported format of STRU:
Al 26.98 Al_ONCV_PBE-1.2.upf
Al 26.98 Al_ONCV_PBE-1.2.upf auto
Al 26.98 Al_ONCV_PBE-1.2.upf upf201
Al 26.98 Al_ONCV_PBE-1.2.upf upf201 # annotations...
If no pseudo_type is assigned in STRU, the default value is 'auto', and ABACUS will recongnize the pp by itself.
… them into STRU.

Add two integrate tests, `101_PW_upf201_blps_pseudopots` and `101_PW_upf201_upf100_pseudopots`, which contain two elements (Mg3Al), and different types of pseudopotentials are specified for different elements.
@mohanchen mohanchen added Features Needed The features are indeed needed, and developers should have sophisticated knowledge Compile & CICD & Docs & Dependencies Issues related to compiling ABACUS labels Dec 28, 2024
@mohanchen mohanchen merged commit 4009f6a into deepmodeling:develop Jan 6, 2025
14 checks passed
kluophysics pushed a commit to kluophysics/abacus-develop that referenced this pull request Jan 10, 2025
…onal for OFDFT (deepmodeling#5777)

* refactor: Remove the global variable 'global_pseudo_type' and the input variable 'pseudo_type'.
Now the type of pseudopotential is assigned in STRU, not INPUT, and different type of pseudopotentials can be assigned for different elements in one calculation.
Following are the supported format of STRU:
Al 26.98 Al_ONCV_PBE-1.2.upf
Al 26.98 Al_ONCV_PBE-1.2.upf auto
Al 26.98 Al_ONCV_PBE-1.2.upf upf201
Al 26.98 Al_ONCV_PBE-1.2.upf upf201 # annotations...
If no pseudo_type is assigned in STRU, the default value is 'auto', and ABACUS will recongnize the pp by itself.

* test: Remove `pseudo_type` from INPUT of all integrate tests, and add them into STRU.
Add two integrate tests, `101_PW_upf201_blps_pseudopots` and `101_PW_upf201_upf100_pseudopots`, which contain two elements (Mg3Al), and different types of pseudopotentials are specified for different elements.

* <Feature> Add input parameters about ML_KE

* <Feature> Add files about ML_KE into module_hamilt_pw/hamilt_ofdft

* <Feature> Link MPN KEDF to ABACUS

* <Test> Add a unittest of MPN KEDF: 902_OF_KE_MPN

* <Feature> Output more detailed information of Energy in KSDFT

* <Test> Update the integrate test 902_OF_KE_MPN

* <Feature> In order to check the validity of MPN KEDF, calculate and output TF KEDF when running MPN KEDF.

* Check the input rho in the localTest of MPN KEDF

* <Feature> Add a new descriptor: r_min = min|r-R| / r0, r0 = (Omega / natom) ** (1/3).

* <Fix> Fix the scaling formula of kernel.

* Correct the defination of img.

* Update parameters

* Feature: Add a compile option ENABLE_MLKEDF to control the ML KEDF module.

* Feature: Simplify the code.

* Support Makefile

* Refactor:
Remove GlobalC::ucell.
Optimize the format of input parameters of ML KEDF.

* Refactor:
1. Update annotation.
2. Remove useless parameters and codes.

* Doc: Update documents.

* Test: Add two integrate tests: 902_OF_KE_MPN and 902_OF_KE_CPN5

* Doc: Update annotations.

* Refactor: Update the CMakeLists.txt of nnof

* Test: Configure compilation test.

* [pre-commit.ci lite] apply automatic fixes

* Replace pow with std::pow

* 1. Rename potential.h (class Potential) as pauli_potential.h (class PauliPotential).
2. Replace si.gga.psp used by 902_OF_KE_CPN5 with si.lda.lps.

* Feature: Provide default parameters for MPN and CPN5 KEDF.

* Doc: Update the document of `of_kinetic`.

* Update the file names of nnof

* Make: Update Makefile, and compile documents.

* Remove useless input parameters: `of_ml_nnode` and `of_ml_nlayer`

* Update the integrate tests of MPN and CPN5 KEDFs

* Add function `get_local_pp_energy` into ElecState to calculatet the energy contributed by local pseudopotential.

* Correct the name of eion_elec to elocal_pp, since the nonlocal part is not considered.
Delet the output of Ekinetic, since it only works for local pp.

* Test: Fix module_elecstate/test/elecstate_energy_test.cpp

* [pre-commit.ci lite] apply automatic fixes

* Remove useless head file parallel_reduce.h from esolver_ks.cpp

* Format ml_tools/data.cpp and ml_tools/grid.cpp

* [pre-commit.ci lite] apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compile & CICD & Docs & Dependencies Issues related to compiling ABACUS Features Needed The features are indeed needed, and developers should have sophisticated knowledge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants