Skip to content

Commit 9727f59

Browse files
authored
Merge pull request #216 from dyzheng/abacusmodeling
Merge: update to v3.0.1
2 parents 064c977 + 745452e commit 9727f59

File tree

227 files changed

+17987
-13468
lines changed

Some content is hidden

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

227 files changed

+17987
-13468
lines changed

.readthedocs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# Required
66
version: 2
77

8+
formats: all
9+
810
# Build documentation in the docs/ directory with Sphinx
911
sphinx:
1012
configuration: docs/conf.py

CMakeLists.txt

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
########################################
2-
# CMake build system
3-
# This file is part of ABACUS
41
cmake_minimum_required(VERSION 3.16)
5-
########################################
2+
if(POLICY CMP0131) # From CMake 3.24
3+
cmake_policy(SET CMP0135 NEW)
4+
endif()
65

76
project(ABACUS
87
VERSION 3.0.0
@@ -250,6 +249,32 @@ if(ENABLE_LIBXC)
250249
endif()
251250
endif()
252251

252+
if(DEFINED DeePMD_DIR)
253+
add_compile_definitions(
254+
__DPMD
255+
HIGH_PREC
256+
)
257+
add_compile_options(-Wl,--no-as-needed)
258+
find_package(DeePMD REQUIRED)
259+
include_directories(${DeePMD_DIR}/include)
260+
target_link_libraries(${ABACUS_BIN_NAME}
261+
DeePMD::deepmd_cc
262+
DeePMD::deepmd_op
263+
DeePMD::deepmd_op_cuda
264+
DeePMD::tensorflow_cc
265+
)
266+
if(NOT DEFINED TensorFlow_DIR)
267+
message(FATAL_ERROR "Please define TensorFlow_DIR!")
268+
endif()
269+
endif()
270+
271+
if(DEFINED TensorFlow_DIR)
272+
include_directories(${TensorFlow_DIR}/include)
273+
if(NOT DEFINED DeePMD_DIR)
274+
message(FATAL_ERROR "Please define DeePMD_DIR!")
275+
endif()
276+
endif()
277+
253278
add_compile_definitions(
254279
__EXX
255280
__FFTW3
@@ -333,6 +358,7 @@ target_link_libraries(${ABACUS_BIN_NAME}
333358
hamilt
334359
psi
335360
esolver
361+
rpa
336362
)
337363

338364
install(PROGRAMS ${ABACUS_BIN_PATH}

Dockerfile.gnu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ RUN git clone https://github.com/llohse/libnpy.git && \
1313

1414
RUN wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.9.1%2Bcpu.zip \
1515
--no-check-certificate --quiet -O libtorch.zip && \
16-
unzip -q libtorch.zip && rm libtorch.zip && \
17-
cd libtorch && cp -r . /usr/local && \
18-
cd .. && rm -r libtorch
16+
unzip -q libtorch.zip -d /opt && rm libtorch.zip
17+
18+
ENV CMAKE_PREFIX_PATH=/opt/libtorch/share/cmake
1919

2020
RUN git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
2121
cd abacus-develop && \

Dockerfile.intel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ RUN source /opt/intel/oneapi/setvars.sh \
5050

5151
RUN wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.9.1%2Bcpu.zip \
5252
--no-check-certificate --quiet -O libtorch.zip && \
53-
unzip -q libtorch.zip && rm libtorch.zip && \
54-
cd libtorch && cp -r . /usr/local && \
55-
cd .. && rm -r libtorch
53+
unzip -q libtorch.zip -d /opt && rm libtorch.zip
54+
55+
ENV CMAKE_PREFIX_PATH=/opt/libtorch/share/cmake
5656

5757
RUN git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
5858
cd abacus-develop && \

conda/conda_build_config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
channel_sources:
2+
- conda-forge
3+
- defaults
4+
channel_targets:
5+
- deepmodeling
6+
mpi:
7+
- mpich
8+
# - openmpi

conda/meta.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{% set version = os.popen('git describe --tags --abbrev=0').read().strip('\n').lstrip('v').replace('-', '_') %}
2+
3+
package:
4+
name: abacus
5+
version: {{ version }}
6+
7+
# This conda package may be built locally with
8+
# conda build . -c conda-forge
9+
source:
10+
path: ..
11+
# git_url: https://github.com/deepmodeling/abacus-develop.git
12+
# git_rev: v3.0.0
13+
14+
build:
15+
skip: true # [not linux]
16+
script: |
17+
cmake -B conda_build ${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Release
18+
cmake --build conda_build -j`nproc`
19+
cmake --install conda_build
20+
# ${CMAKE_ARGS} applys restrictions for CMake to search libs under conda building env.
21+
# See https://conda-forge.org/docs/maintainer/knowledge_base.html#using-cmake .
22+
string: {{ GIT_BUILD_STR }}
23+
number: {{ GIT_DESCRIBE_NUMBER }}
24+
25+
requirements:
26+
build:
27+
- {{ compiler('cxx') }}
28+
- make
29+
- cmake
30+
31+
host:
32+
- {{ mpi }}
33+
- openblas=*=openmp*
34+
- elpa=*=mpi*
35+
- fftw=*=mpi*
36+
37+
run:
38+
- libopenblas=*=openmp*
39+
- scalapack
40+
- elpa=*=mpi*
41+
- fftw=*=mpi*
42+
43+
test:
44+
commands:
45+
# Dry run ABACUS to verify dynamic libs are present.
46+
- abacus
47+
- mpirun -n 2 abacus
48+
49+
# Run end-to-end tests. This may take long time; disabled by default.
50+
# Unit tests are not built here.
51+
# Hence, some tests(ienvelope) requiring additional validation components are expected to fail.
52+
# Please uncomment the codes below if necessary.
53+
54+
# - cd tests/integrate && bash Autotest.sh
55+
# source_files:
56+
# - tests/integrate
57+
# - tests/PP_ORB
58+
59+
# Locally built package can be installed by
60+
# conda create -n my_abacus_env abacus -c local -c conda-forge
61+
62+
# Feedstock: https://github.com/deepmd-kit-recipes/abacus-feedstock
63+
# Package: https://anaconda.org/deepmodeling/abacus
64+
about:
65+
home: http://abacus.ustc.edu.cn/
66+
doc_url: https://abacus.deepmodeling.com/
67+
dev_url: https://github.com/deepmodeling/abacus-develop
68+
license: LGPL-3.0
69+
license_family: LGPL
70+
license_file: LICENSE
71+
summary: An electronic structure package based on plane wave and numerical atomic basis sets.
72+
description: >
73+
ABACUS (Atomic-orbital Based Ab-initio Computation at UStc) is an open-source package based on density functional theory (DFT).
74+
The package utilizes both plane wave and numerical atomic basis sets with the usage of norm-conserving pseudopotentials
75+
to describe the interactions between nuclear ions and valence electrons. ABACUS supports LDA, GGA, meta-GGA, and hybrid functionals.
76+
Apart from single-point calculations, the package allows geometry optimizations and ab-initio molecular dynamics with various ensembles.
77+
78+
extra:
79+
recipe-maintainers:
80+
- caic99

docs/advanced/input_files/input-main.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
- [Variables related to output information](#variables-related-to-output-information)
3232

33-
[out_force](#out_force) | [out_mul](#out_mul) | [out_freq_elec](#out_freq_elec) | [out_freq_ion](#out_freq_ion) | [out_chg](#out_chg) | [out_pot](#out_pot) | [out_dm](#out_dm) | [out_wfc_pw](#out_wfc_pw) | [out_wfc_r](#out_wfc_r) | [out_wfc_lcao](#out_wfc_lcao) | [out_dos](#out_dos) | [out_band](#out_band) | [out_proj_band](#out_proj_band) | [out_stru](#out_stru) | [out_level](#out_level) | [out_alllog](#out_alllog) | [out_mat_hs](#out_mat_hs) | [out_mat_r](#out_mat_r) | [out_mat_hs2](#out_mat_hs2) | [out_element_info](#out_element_info) | [restart_save](#restart_save) | [restart_load](#restart_load) | [dft_plus_dmft](#dft_plus_dmft)
33+
[out_force](#out_force) | [out_mul](#out_mul) | [out_freq_elec](#out_freq_elec) | [out_freq_ion](#out_freq_ion) | [out_chg](#out_chg) | [out_pot](#out_pot) | [out_dm](#out_dm) | [out_wfc_pw](#out_wfc_pw) | [out_wfc_r](#out_wfc_r) | [out_wfc_lcao](#out_wfc_lcao) | [out_dos](#out_dos) | [out_band](#out_band) | [out_proj_band](#out_proj_band) | [out_stru](#out_stru) | [out_level](#out_level) | [out_alllog](#out_alllog) | [out_mat_hs](#out_mat_hs) | [out_mat_r](#out_mat_r) | [out_mat_hs2](#out_mat_hs2) | [out_element_info](#out_element_info) | [restart_save](#restart_save) | [restart_load](#restart_load) | [dft_plus_dmft](#dft_plus_dmft) | [rpa](#rpa)
3434

3535
- [Density of states](#density-of-states)
3636

@@ -42,7 +42,7 @@
4242

4343
- [Molecular dynamics](#molecular-dynamics)
4444

45-
[md_type](#md_type) | [md_nstep](#md_nstep) | [md_ensolver](#md_ensolver) | [md_restart](#md_restart) | [md_dt](#md_dt) | [md_tfirst, md_tlast](#md_tfirst-md_tlast) | [md_dumpfreq](#md_dumpfreq) | [md_restartfreq](#md_restartfreq) | [md_seed](#md_seed) | [md_tfreq](#md_tfreq) | [md_mnhc](#md_mnhc) | [lj_rcut](#lj_rcut) | [lj_epsilon](#lj_epsilon) | [lj_sigma](#lj_sigma) | [msst_direction](#msst_direction) | [msst_vel](#msst_vel) | [msst_vis](#msst_vis) | [msst_tscale](#msst_tscale) | [msst_qmass](#msst_qmass) | [md_damp](#md_damp)
45+
[md_type](#md_type) | [md_nstep](#md_nstep) | [md_ensolver](#md_ensolver) | [md_restart](#md_restart) | [md_dt](#md_dt) | [md_tfirst, md_tlast](#md_tfirst-md_tlast) | [md_dumpfreq](#md_dumpfreq) | [md_restartfreq](#md_restartfreq) | [md_seed](#md_seed) | [md_tfreq](#md_tfreq) | [md_mnhc](#md_mnhc) | [lj_rcut](#lj_rcut) | [lj_epsilon](#lj_epsilon) | [lj_sigma](#lj_sigma) | [pot_file](#pot_file) | [msst_direction](#msst_direction) | [msst_vel](#msst_vel) | [msst_vis](#msst_vis) | [msst_tscale](#msst_tscale) | [msst_qmass](#msst_qmass) | [md_damp](#md_damp)
4646

4747
- [vdW correction](#vdw-correction)
4848

@@ -78,7 +78,7 @@
7878

7979
- [Electronic conductivities](#electronic-conductivities)
8080

81-
[cal_cond](#cal_cond) | [cond_nche](#cond_nche) | [cond_dw](#cond_dw) | [cond_wcut](#cond_wcut) | [cond_wenlarge](#cond_wenlarge) | [cond_fwhm](#cond_fwhm)
81+
[cal_cond](#cal_cond) | [cond_nche](#cond_nche) | [cond_dw](#cond_dw) | [cond_wcut](#cond_wcut) | [cond_wenlarge](#cond_wenlarge) | [cond_fwhm](#cond_fwhm) | [cond_nonlocal](#cond_nonlocal)
8282

8383
- [Implicit solvation model](#implicit-solvation-model)
8484

@@ -471,7 +471,7 @@ calculations.
471471
### nspin
472472
473473
- **Type**: Integer
474-
- **Description**: Number of spin components of wave functions. There are only two choices now: 1 or 2, meaning non spin or collinear spin.
474+
- **Description**: Number of spin components of wave functions. There are only two choices now: 1 or 2, meaning non spin or collinear spin. For case of [noncollinear polarized](../scf/spin.md#noncollinear-spin-polarized-calculations), nspin will be automatically set to 4 without being specified in user input.
475475
- **Default**: 1
476476
477477
### smearing_method
@@ -967,6 +967,11 @@ Si-p2-orbital-dru.dat Si-s1-orbital-ru.dat" for example.
967967
- **Description**: Whether to generate output to be used in dmft. It seems this functionality is not working anymore.
968968
- **Default**: 0
969969
970+
### rpa
971+
- **Type**: Boolean
972+
- **Description**: Generate output files used in rpa calculation.
973+
- **Default**: 0
974+
970975
[back to top](#full-list-of-input-keywords)
971976
972977
## Density of states
@@ -1375,6 +1380,12 @@ temperature will fluctuate violently; if it is too small, the temperature will t
13751380
- **Description**: The value of sigma for Leonard Jones potential (angstrom).
13761381
- **Default**: 3.405 (for He)
13771382
1383+
### pot_file
1384+
1385+
- **Type**: String
1386+
- **Description**: The filename of potential files for CMD such as DP.
1387+
- **Default**: graph.pb
1388+
13781389
### msst_direction
13791390
13801391
- **Type**: Integer
@@ -1859,6 +1870,12 @@ Thermal conductivities: $\kappa = \lim_{\omega\to 0}\kappa(\omega)$.
18591870
- **Description**: We use gaussian functions to approxiamte $\delta(E)\approx \frac{1}{\sqrt{2\pi}\Delta E}e^{-\frac{E^2}{2{\Delta E}^2}}$. FWHM for conductivities, $FWHM=2*\sqrt{2\ln2}\cdot \Delta E$. The unit is eV.
18601871
- **Default**: 0.3
18611872
1873+
### cond_nonlocal
1874+
1875+
- **Type**: Boolean
1876+
- **Description**: Conductivities need to calculate velocity matrix $\bra{\psi_i}\hat{v}\ket{\psi_j}$ and $m\hat{v}=\hat{p}+\frac{im}{\hbar}[\hat{V}_{NL},\hat{r}]$. If `cond_nonlocal` is false, $m\hat{v}\approx\hat{p}$.
1877+
- **Default**: True
1878+
18621879
[back to top](#full-list-of-input-keywords)
18631880
18641881
## Implicit solvation model

docs/advanced/install.md

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ ABACUS use exchange-correlation functionals by default. However, for some functi
66

77
Dependency: [Libxc](https://tddft.org/programs/libxc/)>=5.1.7 .
88

9-
If Libxc is not installed in standard path (i.e. installed with a custom prefix path), you can set `LIBXC_DIR` to the corresponding directory.
9+
If Libxc is not installed in standard path (i.e. installed with a custom prefix path), you can set `Libxc_DIR` to the corresponding directory.
1010

1111
```bash
12-
cmake -B build -DLIBXC_DIR=~/libxc
12+
cmake -B build -DLibxc_DIR=~/libxc
1313
```
1414

1515
## Build with DeePKS
@@ -26,6 +26,18 @@ If DeePKS feature is requied for [DeePKS-kit](https://github.com/deepmodeling/de
2626
cmake -B build -DENABLE_DEEPKS=1 -DTorch_DIR=~/libtorch/share/cmake/Torch/ -Dlibnpy_INCLUDE_DIR=~/libnpy/include
2727
```
2828

29+
## Build with DeePMD-kit
30+
If the Deep Potential model is employed in Molecule Dynamics calculations, the following prerequisites and steps are needed:
31+
32+
### Extra prerequisites
33+
34+
- [DeePMD-kit](https://github.com/deepmodeling/deepmd-kit)
35+
- [TensorFlow](https://www.tensorflow.org/)
36+
37+
```bash
38+
cmake -B build -DDeePMD_DIR=~/deepmd-kit -DTensorFlow_DIR=~/tensorflow
39+
```
40+
2941
## Build Unit Tests
3042
To build tests for ABACUS, define `BUILD_TESTING` flag. You can also specify path to local installation of [Googletest](https://github.com/google/googletest) by setting `GTEST_DIR` flags. If not found in local, the configuration process will try to download it automatically.
3143

@@ -55,11 +67,15 @@ CC = mpiicpc
5567
# icpc: compile intel serial version
5668
# make: ELPA_DIR, ELPA_INCLUDE_DIR, CEREAL_DIR must also be set.
5769
# make pw: nothing need to be set except LIBXC_DIR
58-
#
70+
#
5971
# mpicxx: compile gnu parallel version
6072
# g++: compile gnu serial version
6173
# make: FFTW_DIR, OPENBLAS_LIB_DIR, SCALAPACK_LIB_DIR, ELPA_DIR, ELPA_INCLUDE_DIR, CEREAL_DIR must also be set.
6274
# make pw: FFTW_DIR, OPENBLAS_LIB_DIR must be set.
75+
76+
# GPU = OFF #We do not support GPU yet
77+
# OFF: do not use GPU
78+
# CUDA: use CUDA
6379
#======================================================================
6480

6581
#------- FOR INTEL COMPILER ------------
@@ -96,6 +112,17 @@ CEREAL_DIR = /public/soft/cereal
96112
# LIBXC_DIR = /public/soft/libxc
97113
# directory of libxc(>5.1.7), which contains include and lib/libxc.a
98114
# add LIBXC_DIR to use libxc to compile ABACUS
115+
116+
# DeePMD_DIR = ${deepmd_root}
117+
# TensorFlow_DIR = ${tensorflow_root}
118+
# add them to use DEEPMD
119+
120+
# NP = 14 # It is not supported. use make -j14 or make -j to parallelly compile
121+
122+
# DEBUG = OFF
123+
# Only for developers
124+
# ON: use gnu compiler and check segmental defaults
125+
# OFF: nothing
99126
#======================================================================
100127
```
101128

@@ -132,7 +159,7 @@ CEREAL_DIR=/public/soft/cereal
132159
```
133160
ABACUS now support full version and pw version. Use `make` or `make abacus` to compile full version which supports LCAO calculations. Use `make pw` to compile pw version which only supports pw calculations. For pw version, `make pw CC=mpiicpc`, you do not need to provide any libs. For `make pw CC=mpicxx`, you need provide `FFTW_DIR` and `OPENBLAS_LIB_DIR`.
134161

135-
Besides, libxc and deepks are optional libs to compile abacus.
162+
Besides, libxc and deepks are optional libs to compile abacus.
136163
They will be used when `LIBXC_DIR` is defined like
137164
```
138165
LIBXC_DIR = /public/soft/libxc
@@ -151,16 +178,24 @@ After the compilation finishes without error messages (except perhaps for some w
151178

152179
The program compiled using the above instructions do not link with LIBXC and use exchange-correlation functionals as written in the ABACUS program. However, for some functionals (such as HSE hybrid functional), LIBXC is required.
153180

154-
To compile ABACUS with LIBXC, you need to define `LIBXC_DIR` in the file `Makefile.vars` or use
181+
To compile ABACUS with LIBXC, you need to define `LIBXC_DIR` in the file `Makefile.vars` or use
155182
```makefile
156183
make LIBXC_DIR=/pulic/soft/libxc
157-
```
184+
```
158185
directly.
159186

160187
### Add DeePKS Support
161188

162-
To compile ABACUS with DEEPKS, you need to define `LIBTORCH_DIR` and `LIBNPY_DIR` in the file `Makefile.vars` or use
189+
To compile ABACUS with DEEPKS, you need to define `LIBTORCH_DIR` and `LIBNPY_DIR` in the file `Makefile.vars` or use
163190
```makefile
164191
make LIBTORCH_DIR=/opt/libtorch/ LIBNPY_DIR=/opt/libnpy/
165-
```
192+
```
166193
directly.
194+
195+
### Add DeePMD-kit Support
196+
197+
To compile ABACUS with DeePMD-kit, you need to define `DeePMD_DIR` and `TensorFlow_DIR` in the file `Makefile.vars` or use
198+
```makefile
199+
make DeePMD_DIR=~/deepmd-kit TensorFlow_DIR=~/tensorflow
200+
```
201+
directly.

docs/advanced/md.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ By setting `calculation` to be `md` or `sto-md`, ABACUS currently provides six d
1313

1414
Furthermore, ABACUS also provides a [list of keywords](./input_files/input-main.md#molecular-dynamics) to control relevant parmeters used in MD simulations.
1515

16+
To employ CMD calculations, `md_ensolver` should be set to be `LJ` or `DP`.
17+
If DP model is selected, the filename of DP model is specified by keyword `pot_file`.
18+
1619
[Examples](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/md/lcao_gammaonly_Sn64) of MD simulations are also provided.
1720
There are six INPUT files corresponding to six different MD evolution methods in the directory.
1821
For examlpe, `INPUT_0` shows how to employ the NVE simulation.

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,6 @@
7575
latex_engine = 'xelatex'
7676
mathjax_path = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.0/es5/tex-mml-chtml.min.js'
7777
#deepmodeling_current_site = 'Tutorials'
78+
latex_elements = {
79+
'extraclassoptions':'openany,oneside'
80+
}

0 commit comments

Comments
 (0)