Skip to content

Commit 625d935

Browse files
committed
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into develop
2 parents e717dc8 + 0edf803 commit 625d935

File tree

427 files changed

+140945
-7376
lines changed

Some content is hidden

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

427 files changed

+140945
-7376
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
env:
2222
GTEST_COLOR: 'yes'
2323
run: |
24-
cmake -B build -DBUILD_TESTING=ON
24+
cmake -B build -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON
2525
cmake --build build -j8
2626
cmake --install build
2727
cmake --build build --target test ARGS="-V"

CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,14 @@ else()
167167
message(WARNING "Cannot find the correct library for Fortran.")
168168
endif()
169169
endif()
170-
target_link_libraries(${ABACUS_BIN_NAME} ${math_libs})
171170

172171
if(ENABLE_DEEPKS)
173172
set(CMAKE_CXX_STANDARD 14)
174173
find_package(Torch REQUIRED)
175174
include_directories(${TORCH_INCLUDE_DIRS})
176-
target_link_libraries(${ABACUS_BIN_NAME} ${TORCH_LIBRARIES})
175+
target_link_libraries(${ABACUS_BIN_NAME} deepks)
176+
list(APPEND math_libs ${TORCH_LIBRARIES})
177+
177178
add_compile_options(${TORCH_CXX_FLAGS})
178179

179180
find_path(libnpy_SOURCE_DIR
@@ -192,6 +193,8 @@ if(ENABLE_DEEPKS)
192193
add_compile_definitions(__DEEPKS)
193194
endif()
194195

196+
target_link_libraries(${ABACUS_BIN_NAME} ${math_libs})
197+
195198
if(DEFINED Libxc_DIR)
196199
set(ENABLE_LIBXC ON)
197200
endif()
@@ -260,7 +263,6 @@ target_link_libraries(${ABACUS_BIN_NAME}
260263
cell
261264
symmetry
262265
md
263-
symmetry
264266
neighbor
265267
orb
266268
io
@@ -272,6 +274,7 @@ target_link_libraries(${ABACUS_BIN_NAME}
272274
pw
273275
ri
274276
driver
277+
xc
275278
-lm
276279
)
277280

Dockerfile.intel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ RUN source /opt/intel/oneapi/setvars.sh \
3838
&& wget https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/2021.05.002/elpa-2021.05.002.tar.gz \
3939
&& tar xzf elpa-2021.05.002.tar.gz && rm elpa-2021.05.002.tar.gz \
4040
&& cd elpa-2021.05.002 && mkdir build && cd build \
41-
&& ../configure FCFLAGS="-mkl=cluster" \
41+
&& ../configure FCFLAGS="-qmkl=cluster" \
4242
&& make -j8 \
4343
&& make PREFIX=/usr/local install \
4444
&& ln -s /usr/local/include/elpa-2021.05.002/elpa /usr/local/include/ \

doc/developers.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ To add a unit test:
4646
AddTest(
4747
TARGET <module_name>_<test_name> # this is the executable file name of the test
4848
SOURCES <test_name>.cpp
49+
50+
# OPTIONAL: if this test requires external libraries, add them with "LIBS" statement.
51+
LIBS math_libs # `math_libs` includes all math libraries in ABACUS.
4952
)
5053
```
5154

doc/input-main.md

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
- [Density of states](#density-of-states)
3333

3434
[dos_edelta_ev](#dos-edelta-ev) | [dos_sigma](#dos-sigma) | [dos_scale](#dos-scale)
35-
36-
- [Electric field](#electric-field)
37-
38-
[efield](#efield) | [edir](#edir) | [emaxpos](#emaxpos) | [eopreg](#eopreg) | [eamp](#eamp)
3935

4036
- [Exact exchange](#exact-exchange) (under tests)
4137

@@ -66,7 +62,7 @@
6662
[nurse](#nurse) | [t_in_h](#t-in-h) | [vl_in_h](#vl-in-h) | [vnl_in_h](#vnl-in-h) | [test_force](#test-force) | [test_stress](#test-stress) | [colour](#colour) | [new_dm](#new-dm) | [test_just_neighbor](#test-just-neighbor)
6763
- [DeePKS](#deepks)
6864

69-
[out_descriptor](#out-descriptor) | [lmax_descriptor](#lmax-descriptor) | [deepks_scf](#deepks-scf) | [model_file](#model-file)
65+
[deepks_out_labels](#out-descriptor) | [deepks_descriptor_lmax](#lmax-descriptor) | [deepks_scf](#deepks-scf) | [deepks_model](#model-file)
7066

7167
[back to main page](../README.md)
7268

@@ -912,49 +908,12 @@ This part of variables are used to control the calculation of DOS.
912908
913909
[back to top](#input-file)
914910
915-
### Electric field
916-
This part of variables are used to control the addition of an external electric field. It is achieved by adding a saw-like potential to the local ionic potential.
917-
918-
- efield<a id="efield"></a>
919-
- *Type*: Boolean
920-
- *Description*: Controls whether to add the external electric field. When set to 1, the electric field is turned on. When set to 0, there is no electric field.
921-
- *Default*: 0.
922-
923-
[back to top](#input-file)
924-
925-
- edir<a id="edir"></a>
926-
- *Type*: Integer
927-
- *Description*: Tells which reciprocal lattice vector the external electric field aligns with. Allowed values are 1,2, and 3, corresponding to the three reciprocal lattice vectors respectively.
928-
- *Default*: 1
929-
930-
[back to top](#input-file)
931-
932-
- emaxpos<a id="emaxpos"></a>
933-
- *Type*: Real
934-
- *Description*: Position of the maximum of the saw-like potential along the reciprocal lattice vector specified by edir, 0 < emaxpos < 1.
935-
- *Default*: 0.5
936-
937-
[back to top](#input-file)
938-
939-
- eopreg<a id="eopreg"></a>
940-
- *Type*: Real
941-
- *Description*: The saw-like potential increases in the region from `(emaxpos+eopreg-1)` to `(emaxpos)`, then decreases to 0 until (emaxpos+eopreg), in units of the crystal vector `edir`. Important: the change of slope of this potential must be located in the empty region, or else unphysical forces will result.
942-
- *Default*: 0.1
943-
944-
[back to top](#input-file)
945-
946-
- eamp<a id="eamp"></a>
947-
- *Type*: Real
948-
- *Description*: Amplitude of the electric field, in atomic unit: 1 a.u. = 51.4220632*10^10 V/m.
949-
- *Default*: 0.001
950-
951-
[back to top](#input-file)
952911
953912
### DeePKS
954913
This part of variables are used to control the usage of DeePKS method (a comprehensive data-driven approach to improve accuracy of DFT).
955914
Warning: this function is not robust enough for version 2.2.0. Please try these variables in https://github.com/deepmodeling/abacus-develop/tree/deepks .
956915
957-
- out_descriptor<a id="out-descriptor"></a>
916+
- deepks_out_labels<a id="out-descriptor"></a>
958917
- *Type*: Boolean
959918
- *Description*: when set to 1, ABACUS will calculate and output descriptor for DeePKS training. In `LCAO` calculation, a path of *.orb file is needed to be specified under `NUMERICAL_DESCRIPTOR`in `STRU`file. For example:
960919
```
@@ -968,7 +927,7 @@ Warning: this function is not robust enough for version 2.2.0. Please try these
968927
- *Default*: 0
969928
970929
[back to top](#input-file)
971-
- lmax_descriptor<a id="lmax-descriptor"></a>
930+
- deepks_descriptor_lmax<a id="lmax-descriptor"></a>
972931
- *Type*: Integer
973932
- *Description*: control the max angular momentum of descriptor basis.
974933
- *Default*: 0
@@ -980,7 +939,7 @@ Warning: this function is not robust enough for version 2.2.0. Please try these
980939
- *Default*: 0
981940
982941
[back to top](#input-file)
983-
- model_file<a id="model-file"></a>
942+
- deepks_model<a id="model-file"></a>
984943
- *Type*: String
985944
- *Description*: the path of the trained, traced NN model file (generated by deepks-kit). used when deepks_scf is set to 1.
986945
- *Default*: None

examples/H2O-deepks-lcao/INPUT

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ mixing_beta 0.4
2626
#Parameters (6.Deepks)
2727
force 1
2828
test_force 1
29-
out_descriptor 1
30-
lmax_descriptor 2
29+
deepks_out_labels 1
30+
deepks_descriptor_lmax 2
3131
newdm 1
3232
deepks_scf 1
33-
model_file model.ptg
33+
deepks_model model.ptg

examples/H2O-deepks-pw/INPUT

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ mixing_beta 0.4
2525

2626
#Parameters (6.File)
2727
out_band 0
28-
out_descriptor 1
29-
lmax_descriptor 2
28+
deepks_out_labels 1
29+
deepks_descriptor_lmax 2

source/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ add_subdirectory(module_neighbor)
55
add_subdirectory(module_orbital)
66
add_subdirectory(module_md)
77
add_subdirectory(module_deepks)
8+
add_subdirectory(module_xc)
89
add_subdirectory(src_io)
910
add_subdirectory(src_ions)
1011
add_subdirectory(src_lcao)

source/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ VPATH=./src_global\
1515
:./module_base\
1616
:./module_md\
1717
:./module_deepks\
18+
:./module_xc\
1819
:./src_pw\
1920
:./src_lcao\
2021
:./src_ions\

source/Makefile.Objects

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ input_conv.o\
1919
run_pw.o\
2020
run_lcao.o\
2121

22-
OBJS_PW=xc_type.o \
23-
xc_functional.o\
22+
OBJS_PW=xc_functional.o\
2423
xc_3.o \
2524
vdwd2.o\
2625
vdwd2_parameters.o\
@@ -160,6 +159,7 @@ LCAO_diago.o\
160159
LCAO_evolve.o\
161160
LCAO_deepks.o\
162161
LCAO_deepks_fdelta.o\
162+
LCAO_deepks_odelta.o\
163163
LCAO_deepks_io.o\
164164
LCAO_deepks_mpi.o\
165165
LCAO_deepks_pdm.o\
@@ -265,7 +265,6 @@ write_HS.o\
265265
write_HS_R.o\
266266
write_dm.o\
267267
write_wfc_realspace.o\
268-
potential_libxc.o \
269268
potential_libxc_meta.o \
270269
efield.o \
271270
magnetism.o\

0 commit comments

Comments
 (0)