Skip to content

Commit d7771a8

Browse files
authored
Merge branch 'deepmodeling:develop' into develop
2 parents 15d4fca + d3c9d0f commit d7771a8

File tree

765 files changed

+7423
-637577
lines changed

Some content is hidden

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

765 files changed

+7423
-637577
lines changed

.github/workflows/build_test_cmake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
name: "Build with Intel toolchain"
1818

1919
- tag: gnu
20-
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_MLKEDF=1 -DENABLE_LIBRI=1 -DENABLE_PAW=1"
20+
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_MLKEDF=1 -DENABLE_LIBRI=1"
2121
name: "Build extra components with GNU toolchain"
2222
- tag: intel
2323
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_MLKEDF=1 -DENABLE_LIBRI=1"

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
apt update && apt install -y lcov gpg curl jq ca-certificates
1919
- name: Building
2020
run: |
21-
cmake -B build -DENABLE_COVERAGE=ON -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_PAW=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON
21+
cmake -B build -DENABLE_COVERAGE=ON -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON
2222
cmake --build build -j`nproc`
2323
cmake --install build
2424
- name: Testing

.github/workflows/test.yml

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
3232
- name: Configure
3333
run: |
34-
cmake -B build -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_MLKEDF=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_PAW=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1
34+
cmake -B build -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_MLKEDF=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DENABLE_FLOAT_FFTW=ON
3535
3636
# Temporarily removed because no one maintains this now.
3737
# And it will break the CI test workflow.
@@ -49,13 +49,62 @@ jobs:
4949
cmake --build build -j8
5050
cmake --install build
5151
52-
- name: Integrated Test
52+
- name: Integrated Tests Preparation
5353
env:
5454
GTEST_COLOR: 'yes'
5555
OMP_NUM_THREADS: '2'
5656
run: |
5757
cmake --build build --target test ARGS="-V --timeout 1700 -R integrated_test"
5858
59+
- name: Module_Base Unittests
60+
env:
61+
GTEST_COLOR: 'yes'
62+
OMP_NUM_THREADS: '2'
63+
run: |
64+
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_BASE"
65+
66+
- name: Module_IO Unittests
67+
env:
68+
GTEST_COLOR: 'yes'
69+
OMP_NUM_THREADS: '2'
70+
run: |
71+
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_IO"
72+
73+
- name: Module_HSolver Unittests
74+
env:
75+
GTEST_COLOR: 'yes'
76+
OMP_NUM_THREADS: '2'
77+
run: |
78+
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_HSOLVER"
79+
80+
- name: Module_Cell Unittests
81+
env:
82+
GTEST_COLOR: 'yes'
83+
OMP_NUM_THREADS: '2'
84+
run: |
85+
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_CELL"
86+
87+
- name: Module_MD Unittests
88+
env:
89+
GTEST_COLOR: 'yes'
90+
OMP_NUM_THREADS: '2'
91+
run: |
92+
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_MD"
93+
94+
- name: Module_Psi Unittests
95+
env:
96+
GTEST_COLOR: 'yes'
97+
OMP_NUM_THREADS: '2'
98+
run: |
99+
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_PSI"
100+
101+
- name: Module_RI Unittests
102+
env:
103+
GTEST_COLOR: 'yes'
104+
OMP_NUM_THREADS: '2'
105+
run: |
106+
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_RI"
107+
59108
- name: 01_PW Test
60109
env:
61110
GTEST_COLOR: 'yes'
@@ -126,16 +175,9 @@ jobs:
126175
run: |
127176
cmake --build build --target test ARGS="-V --timeout 1700 -R 10_others"
128177
129-
- name: Module Base Unit Test
130-
env:
131-
GTEST_COLOR: 'yes'
132-
OMP_NUM_THREADS: '2'
133-
run: |
134-
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_BASE"
135-
136-
- name: Unit Test
178+
- name: Other Unittests
137179
env:
138180
GTEST_COLOR: 'yes'
139181
OMP_NUM_THREADS: '2'
140182
run: |
141-
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|16_SDFT_GPU'"
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|MODULE_PSI|MODULE_RI'"

.gitignore

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

CMakeLists.txt

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ option(INFO "Enable gathering math library information" OFF)
3737
option(ENABLE_COVERAGE "Enable coverage build" OFF)
3838
option(GIT_SUBMODULE "Check submodules during build" ON)
3939

40-
option(ENABLE_PAW "Enable PAW method" OFF)
41-
4240
# Do not enable it if generated code will run on different CPUs
4341
option(ENABLE_NATIVE_OPTIMIZATION
4442
"Enable compilation optimization for the native machine's CPU type" OFF)
@@ -271,6 +269,7 @@ if(ENABLE_MPI)
271269
list(APPEND math_libs MPI::MPI_CXX)
272270
endif()
273271

272+
274273
if (USE_DSP)
275274
add_compile_definitions(__DSP)
276275
target_link_libraries(${ABACUS_BIN_NAME} ${OMPI_LIBRARY1})
@@ -611,18 +610,7 @@ if(ENABLE_LIBCOMM)
611610
include_directories(${LIBCOMM_DIR}/include)
612611
endif()
613612

614-
if(ENABLE_PAW)
615-
if(LIBPAW_DIR)
616-
add_subdirectory(${LIBPAW_DIR})
617-
elseif(GIT_SUBMODULE)
618-
git_submodule_update()
619-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deps/libpaw_interface)
620-
else()
621-
message(FATAL_ERROR "Must provide LIBPAW_DIR for PAW related features.")
622-
endif()
623-
target_link_libraries(${ABACUS_BIN_NAME} paw)
624-
add_compile_definitions(USE_PAW)
625-
endif()
613+
626614

627615
list(APPEND math_libs m)
628616
target_link_libraries(${ABACUS_BIN_NAME} ${math_libs})

docs/advanced/elec_properties/band.md

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,40 @@
11
# Extracting Band Structure
22

3-
ABACUS can calculate the energy band structure, and the examples can be found in [examples/band](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/band).
4-
Similar to the [DOS case](https://abacus-rtd.readthedocs.io/en/latest/advanced/elec_properties/dos.html), we first, do a ground-state energy calculation ***with one additional keyword "[out_chg](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-chg)" in the INPUT file***:
3+
In ABACUS, in order to obtain the eigenvalues of Hamiltonian, or generally called band structure, examples can be found in [examples/band](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/band).
4+
Similar to the [DOS case](https://abacus-rtd.readthedocs.io/en/latest/advanced/elec_properties/dos.html), one first needs to perform a ground-state energy calculation ***with one additional keyword "[out_chg](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-chg)" in the INPUT file***:
55

66
```
7-
out_chg 1
7+
out_chg 1
88
```
99

10-
This will produce the converged charge density, which is contained in the file SPIN1_CHG.cube.
11-
Then, use the same `STRU` file, pseudopotential file and atomic orbital file (and the local density matrix file onsite.dm if DFT+U is used) to do a non-self-consistent calculation. In this example, the potential is constructed from the ground-state charge density from the proceeding calculation. Now the INPUT file is like:
10+
With this input parameter, the converged charge density will be output in the files such as `chgs1.cube`, `chgs2.cube`, etc.
11+
Then, one can use the same `STRU` file, pseudopotential files and atomic orbital files (and the local density matrix file onsite.dm if DFT+U is used) to do a non-self-consistent (NSCF) calculation. In this example, the potential is constructed from the ground-state charge density from the proceeding calculation. Now the INPUT file is like:
1212

1313
```
1414
INPUT_PARAMETERS
1515
#Parameters (General)
16-
ntype 1
17-
nbands 8
18-
calculation nscf
19-
basis_type lcao
20-
read_file_dir ./
16+
nbands 8
17+
calculation nscf
18+
basis_type lcao
19+
read_file_dir ./
2120
2221
#Parameters (Accuracy)
23-
ecutwfc 60
24-
scf_nmax 50
25-
scf_thr 1.0e-9
26-
pw_diag_thr 1.0e-7
22+
ecutwfc 60
23+
scf_nmax 50
24+
scf_thr 1.0e-9
25+
pw_diag_thr 1.0e-7
2726
2827
#Parameters (File)
29-
init_chg file
30-
out_band 1
28+
init_chg file
29+
out_band 1
3130
out_proj_band 1
3231
3332
#Parameters (Smearing)
3433
smearing_method gaussian
35-
smearing_sigma 0.02
34+
smearing_sigma 0.02
3635
```
3736

38-
Here the the relevant k-point file KPT looks like,
37+
Here is a relevant k-point file KPT (in LINE mode):
3938

4039
```
4140
K_POINTS # keyword for start
@@ -49,16 +48,16 @@ Line # line-mode
4948
0.0 0.0 0.0 1 # G
5049
```
5150

52-
This means we are using:
51+
This means we are using the following k-points:
5352

54-
- 6 number of k points, here means 6 k points:
53+
- 6 k points, here means 6 k points:
5554
(0.5, 0.0, 0.5) (0.0, 0.0, 0.0) (0.5, 0.5, 0.5) (0.5, 0.25, 0.75) (0.375, 0.375, 0.75) (0.0, 0.0,
5655
0.0)
5756
- 20/1 number of k points along the segment line, which is constructed by two adjacent k
5857
points.
5958

60-
Run the program, and you will see a file named BANDS_1.dat in the output directory. Plot it
61-
to get energy band structure.
59+
Next, run ABACUS and you will see a file named `eigs1.txt` in the output directory.
60+
Plot it and you will obtain the energy band structure!
6261

6362
If "out_proj_band" set 1, it will also produce the projected band structure in a file called PBAND_1 in xml format.
6463

@@ -77,8 +76,8 @@ The rest of the files arranged in sections, each section with a header such as b
7776

7877
```
7978
<orbital
80-
index=" 1"
81-
atom_index=" 1"
79+
index=" 1"
80+
atom_index=" 1"
8281
species="Si"
8382
l=" 0"
8483
m=" 0"

docs/advanced/elec_properties/hs_matrix.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ and
1212

1313
## out_mat_hs
1414

15-
Users may set the keyword [out_mat_hs](../input_files/input-main.md#out_mat_hs) to true for outputting the upper triangular part of the Hamiltonian matrices and overlap matrices for each k point into files in the directory `OUT.${suffix}`. It is available for both gamma_only and multi-k calculations.
15+
Users can set the keyword [out_mat_hs](../input_files/input-main.md#out_mat_hs) to true for outputting the upper triangular part of the Hamiltonian matrices and overlap matrices for each k point into files in the directory `OUT.${suffix}`. It is available for both gamma_only and multi-k calculations.
1616

1717
The files are named `data-$k-H` and `data-$k-S`, where `$k` is a composite index consisting of the k point index as well as the spin index. The corresponding sequence of the orbitals can be seen in [Basis Set](../pp_orb.md#basis-set).
1818

@@ -35,7 +35,7 @@ The rest of the file contains the upper triangular part of the specified matrice
3535

3636
The output of R-space matrices is controlled by the keyword [out_mat_hs2](../input_files/input-main.md#out_mat_hs2). This functionality is not available for gamma_only calculations. To generate such matrices for gamma only calculations, users should turn off [gamma_only](../input_files/input-main.md#gamma_only), and explicitly specify that gamma point is the only k point in the KPT file.
3737

38-
For single-point SCF calculations, if nspin = 1 or nspin = 4, two files `data-HR-sparse_SPIN0.csr` and `data-SR-sparse_SPIN0.csr` are generated, which contain the Hamiltonian matrix $H(R)$ and overlap matrix $S(R)$ respectively. For nspin = 2, three files `data-HR-sparse_SPIN0.csr` and `data-HR-sparse_SPIN1.csr` and `data-SR-sparse_SPIN0.csr` are created, where the first two contain $H(R)$ for spin up and spin down, respectively.
38+
For single-point SCF calculations, if nspin = 1 or nspin = 4, two files `hrs1_nao.csr` and `sr_nao.csr` are generated, which contain the Hamiltonian matrix $H(R)$ and overlap matrix $S(R)$ respectively. For nspin = 2, three files `hrs1_nao.csr` and `hrs2_nao.csr` and `sr_nao.csr` are created, where the first two files correspodn to $H(R)$ for spin up and spin down, respectively.
3939

4040
As for molecular dynamics calculations, the format is controlled by [out_interval](../input_files/input-main.md#out_interval) and [out_app_flag](../input_files/input-main.md#out_app_flag) in the same manner as the position matrix as detailed in [out_mat_r](../input_files/input-main.md#out_mat_r).
4141

@@ -74,4 +74,4 @@ We provide [examples](https://github.com/deepmodeling/abacus-develop/tree/develo
7474
- out_hs_multik : writing H(k) and S(k) for multi-k calculation
7575
- out_s_multik : running get_S for multi-k calculation
7676

77-
Reference output files are provided in each directory.
77+
Reference output files are provided in each directory.

docs/advanced/elec_properties/wfc.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ In the LCAO basis case, several `WFC_NAO_K${k}.dat` files will be output in mult
99

1010
## wave function in real space
1111

12-
One can also choose to output real-space wave function in PW basis calculation with the key word ***[out_wfc_r](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out_wfc_r)***.
13-
14-
After calculation, an additional directory named `wfc_realspace` will appear in the `OUT.${system}` directory.
12+
One can also choose to output real-space wave function in PW basis calculation with the key word ***[out_wfc_norm](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-wfc-norm)***.
1513

1614
Notice: when the ***[basis_type](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#basis_type)*** is `lcao`, only `get_wf` ***[calculation](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#calculation)*** is effective. An example is [examples/wfc/lcao_ienvelope_Si2](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/wfc/lcao_ienvelope_Si2).

0 commit comments

Comments
 (0)