Skip to content

Commit 4b8e214

Browse files
authored
Merge branch 'develop' into refactor/hegvd_op
2 parents 5e7cf0d + 6f277a7 commit 4b8e214

File tree

147 files changed

+3519
-316
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+3519
-316
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ jobs:
132132
run: |
133133
cmake --build build --target test ARGS="-V --timeout 1700 -R 03_NAO_multik"
134134
135-
- name: 04_LJ_DP Test
135+
- name: 04_FF Test
136136
env:
137137
GTEST_COLOR: 'yes'
138138
OMP_NUM_THREADS: '2'
139139
run: |
140-
cmake --build build --target test ARGS="-V --timeout 1700 -R 04_LJ_DP"
140+
cmake --build build --target test ARGS="-V --timeout 1700 -R 04_FF"
141141
142142
- name: 05_rtTDDFT Test
143143
env:
@@ -186,4 +186,4 @@ jobs:
186186
GTEST_COLOR: 'yes'
187187
OMP_NUM_THREADS: '2'
188188
run: |
189-
cmake --build build --target test ARGS="-V --timeout 1700 -E 'integrate_test|01_PW|02_NAO_Gamma|03_NAO_multik|04_LJ_DP|05_rtTDDFT|06_SDFT|07_OFDFT|08_EXX|09_DeePKS|10_others|11_PW_GPU|12_NAO_Gamma_GPU|13_NAO_multik_GPU|15_rtTDDFT_GPU|16_SDFT_GPU|MODULE_BASE|MODULE_IO|MODULE_HSOLVER|MODULE_CELL|MODULE_MD|source_psi|MODULE_RI'"
189+
cmake --build build --target test ARGS="-V --timeout 1700 -E 'integrate_test|01_PW|02_NAO_Gamma|03_NAO_multik|04_FF|05_rtTDDFT|06_SDFT|07_OFDFT|08_EXX|09_DeePKS|10_others|11_PW_GPU|12_NAO_Gamma_GPU|13_NAO_multik_GPU|15_rtTDDFT_GPU|16_SDFT_GPU|MODULE_BASE|MODULE_IO|MODULE_HSOLVER|MODULE_CELL|MODULE_MD|source_psi|MODULE_RI'"

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,15 @@ if(DEFINED DeePMD_DIR)
654654
endif()
655655
endif()
656656

657+
if(DEFINED NEP_DIR)
658+
find_package(NEP REQUIRED)
659+
660+
if(NEP_FOUND)
661+
add_compile_definitions(__NEP)
662+
target_link_libraries(${ABACUS_BIN_NAME} NEP::nep)
663+
endif()
664+
endif()
665+
657666
if(DEFINED TensorFlow_DIR)
658667
find_package(TensorFlow REQUIRED)
659668
include_directories(${TensorFlow_DIR}/include)

cmake/FindNEP.cmake

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
###############################################################################
2+
# - Find NEP
3+
# Finds the NEP header and library.
4+
#
5+
# This module will search for the NEP library, looking for a hint
6+
# from the NEP_DIR environment variable or CMake variable.
7+
#
8+
# This module defines the following variables:
9+
#
10+
# NEP_FOUND - True if the NEP library and headers were found.
11+
# NEP_INCLUDE_DIR - The directory where nep.h is located.
12+
# NEP_LIBRARY - The full path to the NEP library.
13+
#
14+
# It also defines the following imported target:
15+
#
16+
# NEP::nep - The NEP library target.
17+
#
18+
###############################################################################
19+
# Note: Currently only CPU version is supported, Since the NEP interface with GPU support is not available yet.
20+
# In feature, if available, we can use USE_CUDA to switch between CPU and GPU version.
21+
22+
find_path(NEP_INCLUDE_DIR nep.h
23+
HINTS ${NEP_DIR}
24+
PATH_SUFFIXES "include"
25+
)
26+
27+
find_library(NEP_LIBRARY
28+
NAMES nep
29+
HINTS ${NEP_DIR}
30+
PATH_SUFFIXES "lib"
31+
)
32+
33+
include(FindPackageHandleStandardArgs)
34+
find_package_handle_standard_args(NEP
35+
DEFAULT_MSG
36+
NEP_LIBRARY NEP_INCLUDE_DIR)
37+
38+
if(NEP_FOUND)
39+
if(NOT TARGET NEP::nep)
40+
add_library(NEP::nep UNKNOWN IMPORTED)
41+
set_target_properties(NEP::nep PROPERTIES
42+
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
43+
IMPORTED_LOCATION "${NEP_LIBRARY}"
44+
INTERFACE_INCLUDE_DIRECTORIES "${NEP_INCLUDE_DIR}"
45+
)
46+
endif()
47+
endif()
48+
49+
mark_as_advanced(NEP_INCLUDE_DIR NEP_LIBRARY)

docs/advanced/input_files/input-main.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@
147147
- [out\_band](#out_band)
148148
- [out\_proj\_band](#out_proj_band)
149149
- [out\_stru](#out_stru)
150-
- [out\_bandgap](#out_bandgap)
151150
- [out\_level](#out_level)
152151
- [out\_alllog](#out_alllog)
153152
- [out\_mat\_hs](#out_mat_hs)
@@ -536,6 +535,7 @@ These variables are used to control general system parameters.
536535
- tddft: real-time time-dependent density functional theory (TDDFT)
537536
- lj: Leonard Jones potential
538537
- dp: DeeP potential, see details in [md.md](../md.md#dpmd)
538+
- nep: Neuroevolution Potential, see details in [md.md](../md.md#nep)
539539
- ks-lr: Kohn-Sham density functional theory + LR-TDDFT (Under Development Feature)
540540
- lr: LR-TDDFT with given KS orbitals (Under Development Feature)
541541
- **Default**: ksdft
@@ -1844,14 +1844,6 @@ These variables are used to control the output of properties.
18441844
- **Description**: Whether to output structure files per ionic step in geometry relaxation calculations into `OUT.${suffix}/STRU_ION${istep}_D`, where `${istep}` is the ionic step.
18451845
- **Default**: False
18461846

1847-
### out_bandgap
1848-
1849-
- **Type**: Boolean
1850-
- **Description**: Whether to print the bandgap per electronic iteration into `OUT.${suffix}/running_${calculation}.log`. The value of bandgaps can be obtained by searching for the keyword:
1851-
- [nupdown](#nupdown) > 0: `E_bandgap_up` and `E_bandgap_dw`
1852-
- [nupdown](#nupdown) = 0: `E_bandgap`
1853-
- **Default**: False
1854-
18551847
### out_level
18561848

18571849
- **Type**: String
@@ -2319,7 +2311,7 @@ Warning: this function is not robust enough for the current version. Please try
23192311
- 0: Don't include bandgap label
23202312
- 1: Include target bandgap label (see [deepks\_band\_range](#deepks_band_range) for more details)
23212313
- 2: Include multiple bandgap label (see [deepks\_band\_range](#deepks_band_range) for more details)
2322-
- 3: For systems containing H atoms only, HOMO is defined as the max occupation expect H atoms and the bandgap label is the energy between HOMO and (HOMO + 1)
2314+
- 3: Used for systems containing H atoms. Here HOMO is defined as the max occupation except H atoms and the bandgap label is the energy between HOMO and (HOMO + 1)
23232315
- **Default**: 0
23242316

23252317
### deepks_band_range
@@ -3336,7 +3328,7 @@ These variables are used to control molecular dynamics calculations. For more in
33363328
### pot_file
33373329

33383330
- **Type**: String
3339-
- **Description**: The filename of DP potential files, see [md.md](../md.md#dpmd) in detail.
3331+
- **Description**: The filename of DP/NEP potential files, see [md.md](../md.md#dpmd) in detail.
33403332
- **Default**: graph.pb
33413333

33423334
### dp_rescaling

docs/advanced/install.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ Similarly, DeePMD-kit supports PyTorch backend but its libraries are placed at a
5555
cmake -B build -DDeePMD_DIR=/dir_to_deepmd-kit -DTorch_DIR=/dir_to_pytorch
5656
```
5757

58+
## Build with NEP
59+
This interface enables running MD simulations with the NEP model. It requires the [NEP_CPU](https://github.com/brucefan1983/NEP_CPU) library, which can be easily installed using toolchain as shown below:
60+
```bash
61+
./install_abacus_toolchain.sh --with-nep=install
62+
```
63+
64+
To build ABACUS:
65+
```bash
66+
cmake -B build -DNEP_DIR=/path/to/nep_cpu
67+
```
68+
5869
## Build with LibRI and LibComm
5970

6071
The new EXX implementation depends on two external libraries:

docs/advanced/interface/TB2J.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ out_mul 1
6666
#Parameters (4.Relaxation)
6767
ks_solver genelpa
6868
scf_nmax 200
69-
out_bandgap 0
7069
7170
#Parameters (5.LCAO)
7271
basis_type lcao

docs/advanced/md.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,8 @@ ABACUS performs the [Multi-Scale Shock Technique (MSST) integration](https://jou
8787
Compiling ABACUS with [DeePMD-kit](https://github.com/deepmodeling/deepmd-kit), MD calculations based on machine learning DP model is enabled.
8888

8989
To employ DPMD calculations, [esolver_type](./input_files/input-main.md#esolver_type) should be set to `dp`.
90-
And the filename of DP model is specified by keyword [pot_file](./input_files/input-main.md#pot_file).
90+
And the filename of DP model is specified by keyword [pot_file](./input_files/input-main.md#pot_file).
91+
92+
## NEP
93+
94+
If ABACUS is compiled with the Neuroevolution Potential ([NEP](https://gpumd.org/potentials/nep.html)), MD simulations using NEP models are enabled. To use this feature, set [esolver_type](./input_files/input-main.md#esolver_type) to `nep` and specify the potential file path with the [pot_file](./input_files/input-main.md#pot_file) keyword in your INPUT file.

examples/03_spin_polarized/ATOM/INPUT

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ cal_force 1
4646
cal_stress 1
4747
out_stru 1 # print STRU in OUT
4848
out_chg 0 # print CHG or not
49-
out_bandgap 1 # if bandgap and mul out, chg will out
5049
out_mul 1 # print Mulliken charge and mag of atom in mulliken.txt
5150
# out_wfc_lcao 1
5251
# out_interval 1

examples/19_dftu/NiO/INPUT

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ dft_plus_u 1
2828
orbital_corr 2 2 -1
2929
hubbard_u 5.0 5.0 0.0
3030

31-
out_bandgap 1
3231
out_chg 1
3332
out_mul 1
3433

examples/relax/pw_output/INPUT

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ out_dos 1 # dos.txt g
3737
out_elf 1 # elf.txt
3838
out_band 1 # eig.txt
3939
out_stru 1 # g
40-
out_bandgap 1
4140

4241
out_app_flag 0
4342

0 commit comments

Comments
 (0)