Skip to content

Commit dae5416

Browse files
Merge with develop
2 parents 54e445f + cd52ac3 commit dae5416

File tree

662 files changed

+23399
-26138
lines changed

Some content is hidden

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

662 files changed

+23399
-26138
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@ jobs:
1717
volumes:
1818
- /tmp/ccache:/github/home/.ccache
1919
steps:
20-
- name: Checkout
20+
- name: Checkout repository
2121
uses: actions/checkout@v5
2222
with:
23-
submodules: recursive
2423
fetch-depth: 0
24+
# We will handle submodules manually after fixing ownership
25+
submodules: 'false'
26+
27+
- name: Take ownership of the workspace and update submodules
28+
run: |
29+
sudo chown -R $(whoami) .
30+
git submodule update --init --recursive
2531
2632
- name: Install CI tools
2733
run: |
@@ -126,12 +132,12 @@ jobs:
126132
run: |
127133
cmake --build build --target test ARGS="-V --timeout 1700 -R 03_NAO_multik"
128134
129-
- name: 04_LJ_DP Test
135+
- name: 04_FF Test
130136
env:
131137
GTEST_COLOR: 'yes'
132138
OMP_NUM_THREADS: '2'
133139
run: |
134-
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"
135141
136142
- name: 05_rtTDDFT Test
137143
env:
@@ -180,4 +186,4 @@ jobs:
180186
GTEST_COLOR: 'yes'
181187
OMP_NUM_THREADS: '2'
182188
run: |
183-
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'"

.github/workflows/version_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
fi
3434
3535
# Verify that the version in version.h matches the tag
36-
if [[ "${{ steps.versions.outputs.current_tag }}" != "v${CODE_VERSION}" ]]; then
36+
if [[ "${{ steps.versions.outputs.current_tag }}" != "${CODE_VERSION}" ]]; then
3737
echo "::error::Version mismatch: tag=${{ steps.versions.outputs.current_tag }} ≠ code=${CODE_VERSION}"
3838
exit 1
3939
fi

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ __pycache__
2323
abacus.json
2424
*.npy
2525
toolchain/install/
26-
toolchain/abacus_env.sh
26+
toolchain/abacus_env.sh
27+
.trae

CMakeLists.txt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,6 @@ if(ENABLE_LCAO)
253253
add_compile_definitions(__PEXSI)
254254
set(CMAKE_CXX_STANDARD 14)
255255
endif()
256-
if(OLD_GINT)
257-
add_compile_definitions(__OLD_GINT)
258-
endif()
259256
else()
260257
set(ENABLE_MLALGO OFF)
261258
set(ENABLE_LIBRI OFF)
@@ -469,7 +466,7 @@ if(MKLROOT)
469466
find_package(MKL REQUIRED)
470467
add_definitions(-D__MKL)
471468
include_directories(${MKL_INCLUDE} ${MKL_INCLUDE}/fftw)
472-
list(APPEND math_libs MKL::MKL MKL::MKL_SCALAPACK)
469+
list(APPEND math_libs MKL::MKL)
473470
if(CMAKE_CXX_COMPILER_ID MATCHES Intel)
474471
list(APPEND math_libs ifcore)
475472
endif()
@@ -481,8 +478,12 @@ else()
481478
find_package(Lapack REQUIRED)
482479
include_directories(${FFTW3_INCLUDE_DIRS})
483480
list(APPEND math_libs FFTW3::FFTW3 LAPACK::LAPACK BLAS::BLAS)
481+
if(USE_DSP)
482+
target_link_libraries(${ABACUS_BIN_NAME} ${SCALAPACK_LIBRARY_DIR})
483+
else()
484484
find_package(ScaLAPACK REQUIRED)
485485
list(APPEND math_libs ScaLAPACK::ScaLAPACK)
486+
endif()
486487
if(USE_OPENMP)
487488
list(APPEND math_libs FFTW3::FFTW3_OMP)
488489
endif()
@@ -650,6 +651,15 @@ if(DEFINED DeePMD_DIR)
650651
endif()
651652
endif()
652653

654+
if(DEFINED NEP_DIR)
655+
find_package(NEP REQUIRED)
656+
657+
if(NEP_FOUND)
658+
add_compile_definitions(__NEP)
659+
target_link_libraries(${ABACUS_BIN_NAME} NEP::nep)
660+
endif()
661+
endif()
662+
653663
if(DEFINED TensorFlow_DIR)
654664
find_package(TensorFlow REQUIRED)
655665
include_directories(${TensorFlow_DIR}/include)

cmake/FindMKL.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,12 @@ endif()
9191
if(NOT TARGET MKL::MKL_SCALAPACK)
9292
find_library(MKL_SCALAPACK NAMES mkl_scalapack_lp64 HINTS ${MKLROOT}/lib ${MKLROOT}/lib/intel64)
9393
message(STATUS "Found MKL_SCALAPACK: ${MKL_SCALAPACK}")
94-
add_library(MKL::MKL_SCALAPACK OBJECT IMPORTED MKL_SCALAPACK)
94+
if(MKL_SCALAPACK)
95+
# create an IMPORTED target that points to the discovered library file
96+
add_library(MKL::MKL_SCALAPACK UNKNOWN IMPORTED)
97+
set_target_properties(MKL::MKL_SCALAPACK PROPERTIES
98+
IMPORTED_LOCATION "${MKL_SCALAPACK}"
99+
INTERFACE_INCLUDE_DIRECTORIES "${MKL_INCLUDE}"
100+
)
101+
endif()
95102
endif()

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: 49 additions & 16 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)
@@ -256,6 +255,9 @@
256255
- [of\_ml\_chi\_pnl](#of_ml_chi_pnl)
257256
- [of\_ml\_chi\_qnl](#of_ml_chi_qnl)
258257
- [of\_ml\_local\_test](#of_ml_local_test)
258+
- [TD-OFDFT: time dependent orbital free density functional theory](#tdofdft-time-dependent-orbital-free-density-functional-theory)
259+
- [of\_cd](#of_cd)
260+
- [of\_mcd\_alpha](#of_mcd_alpha)
259261
- [Electric Field and Dipole Correction](#electric-field-and-dipole-correction)
260262
- [efield\_flag](#efield_flag)
261263
- [dip\_cor\_flag](#dip_cor_flag)
@@ -528,10 +530,12 @@ These variables are used to control general system parameters.
528530
- **Description**: choose the energy solver.
529531
- ksdft: Kohn-Sham density functional theory
530532
- ofdft: orbital-free density functional theory
533+
- tdofdft: time-dependent orbital-free density functional theory
531534
- sdft: [stochastic density functional theory](#electronic-structure-sdft)
532535
- tddft: real-time time-dependent density functional theory (TDDFT)
533536
- lj: Leonard Jones potential
534537
- dp: DeeP potential, see details in [md.md](../md.md#dpmd)
538+
- nep: Neuroevolution Potential, see details in [md.md](../md.md#nep)
535539
- ks-lr: Kohn-Sham density functional theory + LR-TDDFT (Under Development Feature)
536540
- lr: LR-TDDFT with given KS orbitals (Under Development Feature)
537541
- **Default**: ksdft
@@ -1073,7 +1077,20 @@ calculations.
10731077

10741078
- **Type**: String
10751079
- **Description**: In our package, the XC functional can either be set explicitly using the `dft_functional` keyword in `INPUT` file. If `dft_functional` is not specified, ABACUS will use the xc functional indicated in the pseudopotential file.
1076-
On the other hand, if dft_functional is specified, it will overwrite the functional from pseudopotentials and performs calculation with whichever functional the user prefers. We further offer two ways of supplying exchange-correlation functional. The first is using 'short-hand' names such as 'LDA', 'PBE', 'SCAN'. A complete list of 'short-hand' expressions can be found in [the source code](../../../source/source_hamilt/module_xc/xc_functional.cpp). The other way is only available when ***compiling with LIBXC***, and it allows for supplying exchange-correlation functionals as combinations of LIBXC keywords for functional components, joined by a plus sign, for example, dft_functional='LDA_X_1D_EXPONENTIAL+LDA_C_1D_CSC'. The list of LIBXC keywords can be found on its [website](https://libxc.gitlab.io/functionals/). In this way, **we support all the LDA,GGA and mGGA functionals provided by LIBXC**.
1080+
On the other hand, if dft_functional is specified, it will overwrite the functional from pseudopotentials and performs calculation with whichever functional the user prefers. We further offer two ways of supplying exchange-correlation functional. The first is using 'short-hand' names. A complete list of 'short-hand' expressions can be found in [the source code](../../../source/source_hamilt/module_xc/xc_functional.cpp). Supported density functionals are:
1081+
- LDA functionals
1082+
- LDA (equivalent with PZ and SLAPZNOGXNOGC), PWLDA
1083+
- GGA functionals
1084+
- PBE (equivalent with SLAPWPBXPBC), PBESOL, REVPBE, WC, BLYP, BP(referred to BP86), PW91, HCTH, OLYP, BLYP_LR
1085+
- meta-GGA functionals
1086+
- SCAN (require LIBXC)
1087+
- Hybrid functionals
1088+
- PBE0, HF
1089+
- If LIBXC is avaliale, additional short-hand names of hybrid functionals are supported: HSE(referred to HSE06), B3LYP, LC_PBE, LC_WPBE, LRC_WPBE, LRC_WPBEH, CAM_PBEH, WP22, CWP22, MULLER (equivalent with POWER)
1090+
- Hybrid meta-GGA functionals
1091+
- SCAN0 (require LIBXC)
1092+
1093+
The other way is only available when ***compiling with LIBXC***, and it allows for supplying exchange-correlation functionals as combinations of LIBXC keywords for functional components, joined by a plus sign, for example, dft_functional='LDA_X_1D_EXPONENTIAL+LDA_C_1D_CSC'. The list of LIBXC keywords can be found on its [website](https://libxc.gitlab.io/functionals/). In this way, **we support all the LDA,GGA and mGGA functionals provided by LIBXC**. Some popular functionals and their usage are: RPBE of [Hammer et al.](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.59.7413), set `dft_functional` to 'GGA_X_RPBE+GGA_C_PBE', and [r$^{2}$SCAN](https://pubs.acs.org/doi/10.1021/acs.jpclett.0c02405), set `dft_functional` to 'MGGA_X_R2SCAN+MGGA_C_R2SCAN'.
10771094

10781095
Furthermore, the old INPUT parameter exx_hybrid_type for hybrid functionals has been absorbed into dft_functional. Options are `hf` (pure Hartree-Fock), `pbe0`(PBE0), `hse` (Note: in order to use HSE functional, LIBXC is required). Note also that HSE has been tested while PBE0 has NOT been fully tested yet, and the maximum CPU cores for running exx in parallel is $N(N+1)/2$, with N being the number of atoms.
10791096

@@ -1487,15 +1504,20 @@ These variables are used to control the geometry relaxation.
14871504

14881505
### relax_method
14891506

1490-
- **Type**: String
1507+
- **Type**: Vector of string
14911508
- **Description**: The methods to do geometry optimization.
1509+
the first element:
14921510
- cg: using the conjugate gradient (CG) algorithm. Note that there are two implementations of the conjugate gradient (CG) method, see [relax_new](#relax_new).
1493-
- bfgs: using the Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm.
1494-
- bfgs_trad: using the traditional Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm.
1511+
- bfgs : using the Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm.
1512+
- lbfgs: using the Limited-memory Broyden–Fletcher–Goldfarb–Shanno (LBFGS) algorithm.
14951513
- cg_bfgs: using the CG method for the initial steps, and switching to BFGS method when the force convergence is smaller than [relax_cg_thr](#relax_cg_thr).
14961514
- sd: using the steepest descent (SD) algorithm.
14971515
- fire: the Fast Inertial Relaxation Engine method (FIRE), a kind of molecular-dynamics-based relaxation algorithm, is implemented in the molecular dynamics (MD) module. The algorithm can be used by setting [calculation](#calculation) to `md` and [md_type](#md_type) to `fire`. Also ionic velocities should be set in this case. See [fire](../md.md#fire) for more details.
1498-
- **Default**: cg
1516+
1517+
the second element:
1518+
when the first element is bfgs, if the second parameter is 1, it indicates the use of the new BFGS algorithm; if the second parameter is not 1, it indicates the use of the old BFGS algorithm.
1519+
- **Default**: cg 1
1520+
- **Note**:In the 3.10-LTS version, the type of this parameter is std::string. It can be set to "cg","bfgs","cg_bfgs","bfgs_trad","lbfgs","sd","fire".
14991521

15001522
### relax_new
15011523

@@ -1822,14 +1844,6 @@ These variables are used to control the output of properties.
18221844
- **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.
18231845
- **Default**: False
18241846

1825-
### out_bandgap
1826-
1827-
- **Type**: Boolean
1828-
- **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:
1829-
- [nupdown](#nupdown) > 0: `E_bandgap_up` and `E_bandgap_dw`
1830-
- [nupdown](#nupdown) = 0: `E_bandgap`
1831-
- **Default**: False
1832-
18331847
### out_level
18341848

18351849
- **Type**: String
@@ -2297,7 +2311,7 @@ Warning: this function is not robust enough for the current version. Please try
22972311
- 0: Don't include bandgap label
22982312
- 1: Include target bandgap label (see [deepks\_band\_range](#deepks_band_range) for more details)
22992313
- 2: Include multiple bandgap label (see [deepks\_band\_range](#deepks_band_range) for more details)
2300-
- 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)
23012315
- **Default**: 0
23022316

23032317
### deepks_band_range
@@ -2729,6 +2743,25 @@ Warning: this function is not robust enough for the current version. Please try
27292743

27302744
[back to top](#full-list-of-input-keywords)
27312745

2746+
## TDOFDFT: time dependent orbital free density functional theory
2747+
2748+
### of_cd
2749+
2750+
- **Type**: Boolean
2751+
- **Availability**: TDOFDFT
2752+
- **Type**: Boolean
2753+
- **Description**: Added the current dependent(CD) potential. (https://doi.org/10.1103/PhysRevB.98.144302)
2754+
- True: Added the CD potential.
2755+
- False: Not added the CD potential.
2756+
- **Default**: False
2757+
2758+
### of_mcd_alpha
2759+
2760+
- **Type**: Real
2761+
- **Availability**: TDOFDFT
2762+
- **Description**: The value of the parameter alpha in modified CD potential method. mCDPotenial=alpha*CDPotenial(proposed in paper PhysRevB.98.144302)
2763+
- **Default**: 1.0
2764+
27322765
## Electric field and dipole correction
27332766

27342767
These variables are relevant to electric field and dipole correction
@@ -3295,7 +3328,7 @@ These variables are used to control molecular dynamics calculations. For more in
32953328
### pot_file
32963329

32973330
- **Type**: String
3298-
- **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.
32993332
- **Default**: graph.pb
33003333

33013334
### 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.

0 commit comments

Comments
 (0)