Skip to content

Commit 3f71d01

Browse files
authored
Merge pull request #166 from deepmodeling/develop
v2.3.1
2 parents b3287b2 + 0905df9 commit 3f71d01

File tree

345 files changed

+7610
-1743
lines changed

Some content is hidden

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

345 files changed

+7610
-1743
lines changed

.github/workflows/static.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: |
2323
git diff -U0 HEAD^ | clang-tidy-diff -p1 -path build -export-fixes fixes.yml
2424
- name: Pull request comments from clang-tidy reports
25-
uses: platisd/clang-tidy-pr-comments@1.1.6
25+
uses: platisd/clang-tidy-pr-comments@master
2626
with:
2727
# The GitHub token (or a personal access token)
2828
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -35,3 +35,4 @@ jobs:
3535
# to avoid GitHub API timeouts for heavily loaded
3636
# pull requests
3737
suggestions_per_comment: 10
38+
repo_path_prefix: /__w

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ jobs:
2222
- name: Test
2323
env:
2424
GTEST_COLOR: 'yes'
25+
OMP_NUM_THREADS: '2'
2526
run: |
2627
cmake --build build --target test ARGS="-V"

CMakeLists.txt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,25 @@ include_directories(${ABACUS_SOURCE_DIR})
3030
add_executable(${ABACUS_BIN_NAME} source/main.cpp)
3131
set(CMAKE_CXX_STANDARD 11)
3232
set(CMAKE_CXX_STANDARD_REQUIRED ON)
33-
add_compile_options(-O2 -g)
3433
add_compile_options(-Wno-write-strings)
34+
set(FETCHCONTENT_QUIET FALSE) # Notify user when cloning git repo
35+
36+
find_program(CCACHE ccache)
37+
if (CCACHE)
38+
set (CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE} ${CMAKE_CXX_COMPILER_LAUNCHER})
39+
set (CMAKE_C_COMPILER_LAUNCHER ${CCACHE} ${CMAKE_C_COMPILER_LAUNCHER})
40+
endif()
41+
42+
# Select 'Release' configuration for best performance;
43+
# this will disable all assertions.
44+
# Other default configurations are also available, see:
45+
# https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#default-and-custom-configurations
46+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
47+
add_compile_options(-O2 -g) # default flag
48+
endif()
3549

3650
find_package(Cereal REQUIRED)
37-
include_directories(${Cereal_INCLUDE_DIR})
51+
include_directories(${CEREAL_INCLUDE_DIR})
3852
add_compile_definitions(USE_CEREAL_SERIALIZATION)
3953

4054
find_package(ELPA REQUIRED)

Dockerfile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
# To build this Dockerfile, run `docker build -t abacus - < Dockerfile`.
22
# Pull image with `docker pull ghcr.io/deepmodeling/abacus:latest`.
3-
FROM ubuntu:latest
4-
RUN apt update && apt install -y --no-install-recommends libopenblas-dev liblapack-dev libscalapack-mpi-dev libelpa-dev libfftw3-dev libcereal-dev libxc-dev g++ make cmake bc time sudo vim git
3+
FROM ubuntu:22.04
4+
RUN apt update && apt install -y --no-install-recommends \
5+
libopenblas-dev liblapack-dev libscalapack-mpi-dev libelpa-dev libfftw3-dev libcereal-dev libxc-dev \
6+
g++ make cmake bc time sudo vim git
57
# If you wish to use the LLVM compiler, replace 'g++' above with 'clang libomp-dev'.
6-
RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && cd abacus-develop && cmake -B build && cmake --build build -j`nproc` && cmake --install build && cd .. && rm -rf abacus-develop
8+
9+
ENV GIT_SSL_NO_VERIFY=true TERM=xterm-256color \
10+
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 OMPI_MCA_btl_vader_single_copy_mechanism=none
11+
RUN git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
12+
cd abacus-develop && \
13+
cmake -B build && \
14+
cmake --build build -j`nproc` && \
15+
cmake --install build && \
16+
cd .. && rm -rf abacus-develop
717
# If you have trouble cloning repo, replace "github.com" with "gitee.com".
8-
ENV OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 OMPI_MCA_btl_vader_single_copy_mechanism=none
918
CMD mpirun --use-hwthread-cpus abacus
1019

1120
# To run ABACUS built by this image with all available threads, execute `docker run -v <host>:<wd> -w <wd/input> abacus`.

Dockerfile.gnu

Lines changed: 18 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,18 @@
1-
FROM debian:bullseye-slim
2-
3-
RUN apt-get update && apt-get install -y --no-install-recommends libopenblas-dev liblapack-dev libscalapack-mpi-dev git g++ gfortran libssl-dev make cmake vim wget bc unzip python3-numpy
4-
ENV OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 OMPI_MCA_btl_vader_single_copy_mechanism=none
5-
6-
ENV GIT_SSL_NO_VERIFY=1 TERM=xterm-256color
7-
8-
RUN cd /tmp \
9-
&& git clone https://github.com/USCiLab/cereal.git \
10-
&& cp -r cereal/include /usr/local \
11-
&& rm -rf cereal
12-
13-
RUN cd /tmp \
14-
&& wget https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/2021.05.002/elpa-2021.05.002.tar.gz --no-check-certificate --quiet \
15-
&& tar xzf elpa-2021.05.002.tar.gz && rm elpa-2021.05.002.tar.gz \
16-
&& cd elpa-2021.05.002 && mkdir build && cd build \
17-
&& ../configure CFLAGS="-O3 -march=native -funsafe-loop-optimizations -funsafe-math-optimizations -ftree-vect-loop-version -ftree-vectorize" \
18-
FCFLAGS="-O2 -mavx" --disable-avx512 \
19-
&& make -j8 && make PREFIX=/usr/local install \
20-
&& ln -s /usr/local/include/elpa-2021.05.002/elpa /usr/local/include/ \
21-
&& cd /tmp && rm -rf elpa-2021.05.002
22-
23-
RUN cd /tmp \
24-
&& wget http://www.fftw.org/fftw-3.3.9.tar.gz --no-check-certificate --quiet \
25-
&& tar zxvf fftw-3.3.9.tar.gz \
26-
&& cd fftw-3.3.9 \
27-
&& ./configure --enable-mpi-fortran --enable-orterun-prefix-by-default FC=gfortran \
28-
&& make -j8 && make PREFIX=/usr/local install \
29-
&& cd /tmp && rm -rf fftw-3.3.9 && rm fftw-3.3.9.tar.gz
30-
31-
RUN cd /tmp \
32-
&& wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.9.1%2Bcpu.zip --no-check-certificate --quiet \
33-
&& unzip libtorch-cxx11-abi-shared-with-deps-1.9.1+cpu.zip \
34-
&& cp -r libtorch/include /usr/local \
35-
&& cp -r libtorch/lib /usr/local \
36-
&& cp -r libtorch/share /usr/local \
37-
&& rm -rf libtorch
38-
39-
RUN cd /tmp \
40-
&& wget https://gitlab.com/libxc/libxc/-/archive/5.1.5/libxc-5.1.5.tar.gz --no-check-certificate --quiet \
41-
&& tar xzf libxc-5.1.5.tar.gz \
42-
&& cd libxc-5.1.5 \
43-
&& mkdir build \
44-
&& cmake -B build -DBUILD_TESTING=OFF \
45-
&& cmake --build build \
46-
&& cmake --install build \
47-
&& cd /tmp \
48-
&& rm -rf libxc-5.1.5 \
49-
&& rm libxc-5.1.5.tar.gz
50-
51-
RUN cd /tmp \
52-
&& git clone https://github.com/llohse/libnpy.git \
53-
&& cp libnpy/include/npy.hpp /usr/local/include \
54-
&& rm -rf libnpy
55-
56-
RUN cd /tmp \
57-
&& git clone https://github.com/google/googletest.git \
58-
&& cd googletest && cmake . && make install \
59-
&& rm -rf googletest
1+
FROM ubuntu:22.04
2+
RUN apt update && apt install -y --no-install-recommends \
3+
libopenblas-dev liblapack-dev libscalapack-mpi-dev libelpa-dev libfftw3-dev libcereal-dev \
4+
libxc-dev libgtest-dev libgmock-dev python3-numpy \
5+
bc cmake git g++ make bc time sudo unzip vim wget
6+
7+
ENV GIT_SSL_NO_VERIFY=true TERM=xterm-256color \
8+
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 OMPI_MCA_btl_vader_single_copy_mechanism=none
9+
10+
RUN git clone https://github.com/llohse/libnpy.git && \
11+
cp libnpy/include/npy.hpp /usr/local/include && \
12+
rm -r libnpy
13+
14+
RUN wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.9.1%2Bcpu.zip \
15+
--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

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ ABACUS is an electronic structure package based on density functional theory(DFT
1717
Please refer to our [GitHub repository](https://github.com/deepmodeling/abacus-develop) for more information and support.
1818
# Table of contents
1919

20+
- [Table of contents](#table-of-contents)
2021
- [Features](#features)
2122
- [Download and install](#download-and-install)
2223
- [Quickstart guide](#quickstart-guide)
@@ -27,6 +28,7 @@ Please refer to our [GitHub repository](https://github.com/deepmodeling/abacus-d
2728
- [Citations](#citations)
2829
- [Development team](#development-team)
2930
- [Communicating and making contributions](#communicating-and-making-contributions)
31+
- [Miscellaneous](#miscellaneous)
3032

3133
# Features
3234

@@ -139,7 +141,7 @@ The following provides basic sample jobs in ABACUS. More can be found in the dir
139141
- [Basic electronic structure calculation with PW basis set](docs/examples/basic-pw.md)
140142
- [Basic electronic structure calculation with LCAO basis set](docs/examples/basic-lcao.md)
141143
- [DFT + dispersion calculations](docs/examples/dispersion.md)
142-
- [DOS, wave functions](docs/examples/dos.md)
144+
- [Density of states](docs/examples/dos.md)
143145
- [Band structure](docs/examples/band-struc.md)
144146
- [Magnetic properties](docs/examples/magnetic.md)
145147
- [Force calculation and structure relaxation](docs/examples/force.md)
@@ -153,6 +155,8 @@ The following provides basic sample jobs in ABACUS. More can be found in the dir
153155
- [Hybrid functional](docs/examples/hybrid.md)
154156
- [Electric field and dipole correction](docs/examples/electric_dipole.md)
155157
- [Stochastic DFT and mix stochastic-deterministic DFT](docs/examples/stochastic.md)
158+
- [Wave functions](docs/examples/wavefunction.md)
159+
- [BSSE for molecular formation energy](docs/examples/BSSE.md)
156160

157161
[back to top](#readme-top)
158162

docs/examples/BSSE.md

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# BSSE
2+
3+
[back to main page](../../README.md)
4+
5+
An empty atom is defined in the `STRU` file when an element name contains the "empty" suffix, such as "H_empty" in the following example: calculating the molecular formation energy of H$_2$O by using the BSSE (Basis Set Superposition Errors) method.
6+
7+
$$
8+
\Delta E(\text{H}_2\text{O}) = E(\text{H}_2\text{O}) - E(\text{O}) - E(\text{H}^1) - E(\text{H}^2)
9+
$$
10+
11+
## $E(\text{H}_2\text{O})$
12+
13+
```
14+
ntype 2
15+
```
16+
```
17+
ATOMIC_SPECIES
18+
H 1.008 H_ONCV_PBE-1.0.upf
19+
O 15.9994 O_ONCV_PBE-1.0.upf
20+
21+
NUMERICAL_ORBITAL
22+
H_gga_8au_60Ry_2s1p.orb
23+
O_gga_6au_60Ry_2s2p1d.orb
24+
25+
LATTICE_CONSTANT
26+
1.889725989
27+
28+
LATTICE_VECTORS
29+
20 0 0
30+
0 20 0
31+
0 0 20
32+
33+
ATOMIC_POSITIONS
34+
Cartesian # Cartesian(Unit is LATTICE_CONSTANT)
35+
36+
H
37+
0.5
38+
2
39+
0.9584 0.0000 0.0000 0 0 0
40+
-0.2392 0.9281 0.0000 0 0 0
41+
42+
O
43+
0.5
44+
1
45+
0.0000 0.0000 0.0000 0 0 0
46+
```
47+
48+
## $E(\text{O})$
49+
50+
```
51+
ntype 2
52+
```
53+
```
54+
ATOMIC_SPECIES
55+
H_empty 1.008 H_ONCV_PBE-1.0.upf
56+
O 15.9994 O_ONCV_PBE-1.0.upf
57+
58+
NUMERICAL_ORBITAL
59+
H_gga_8au_60Ry_2s1p.orb
60+
O_gga_6au_60Ry_2s2p1d.orb
61+
62+
LATTICE_CONSTANT
63+
1.889725989
64+
65+
LATTICE_VECTORS
66+
20 0 0
67+
0 20 0
68+
0 0 20
69+
70+
ATOMIC_POSITIONS
71+
Cartesian # Cartesian(Unit is LATTICE_CONSTANT)
72+
73+
H_empty
74+
0.5
75+
2
76+
0.9584 0.0000 0.0000 0 0 0
77+
-0.2392 0.9281 0.0000 0 0 0
78+
79+
O
80+
0.5
81+
1
82+
0.0000 0.0000 0.0000 0 0 0
83+
```
84+
85+
## $E(\text{H}^1)$
86+
87+
```
88+
ntype 3
89+
```
90+
```
91+
ATOMIC_SPECIES
92+
H 1.008 H_ONCV_PBE-1.0.upf
93+
H_empty_2 1.008 H_ONCV_PBE-1.0.upf
94+
O_empty 15.9994 O_ONCV_PBE-1.0.upf
95+
96+
NUMERICAL_ORBITAL
97+
H_gga_8au_60Ry_2s1p.orb
98+
H_gga_8au_60Ry_2s1p.orb
99+
O_gga_6au_60Ry_2s2p1d.orb
100+
101+
LATTICE_CONSTANT
102+
1.889725989
103+
104+
LATTICE_VECTORS
105+
20 0 0
106+
0 20 0
107+
0 0 20
108+
109+
ATOMIC_POSITIONS
110+
Cartesian # Cartesian(Unit is LATTICE_CONSTANT)
111+
112+
H
113+
0.5
114+
1
115+
0.9584 0.0000 0.0000 0 0 0
116+
117+
H_empty_2
118+
0.5
119+
1
120+
-0.2392 0.9281 0.0000 0 0 0
121+
122+
O_empty
123+
0.5
124+
1
125+
0.0000 0.0000 0.0000 0 0 0
126+
```
127+
128+
## $E(\text{H}^2)$
129+
130+
```
131+
ntype 3
132+
```
133+
```
134+
ATOMIC_SPECIES
135+
H_empty_1 1.008 H_ONCV_PBE-1.0.upf
136+
H 1.008 H_ONCV_PBE-1.0.upf
137+
O_empty 15.9994 O_ONCV_PBE-1.0.upf
138+
139+
NUMERICAL_ORBITAL
140+
H_gga_8au_60Ry_2s1p.orb
141+
H_gga_8au_60Ry_2s1p.orb
142+
O_gga_6au_60Ry_2s2p1d.orb
143+
144+
LATTICE_CONSTANT
145+
1.889725989
146+
147+
LATTICE_VECTORS
148+
20 0 0
149+
0 20 0
150+
0 0 20
151+
152+
ATOMIC_POSITIONS
153+
Cartesian # Cartesian(Unit is LATTICE_CONSTANT)
154+
155+
H_empty_1
156+
0.5
157+
1
158+
0.9584 0.0000 0.0000 0 0 0
159+
160+
H
161+
0.5
162+
1
163+
-0.2392 0.9281 0.0000 0 0 0
164+
165+
O_empty
166+
0.5
167+
1
168+
0.0000 0.0000 0.0000 0 0 0
169+
```
170+
171+
[back to top](#BSSE)

docs/examples/dos.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# DOS, wave functions
1+
# Density_of_states
22

33
[back to main page](../../README.md)
44

5-
The main task of this example is to calculate the density of states (DOS) of the system. At first, do a ground-state energy calculation as in [this example](#basic-lcao.md) ***with one additional keyword in the INPUT file***:
5+
# DOS
6+
7+
The main task of this example is to calculate the density of states (DOS) of the system. At first, do a ground-state energy calculation ***with one additional keyword in the INPUT file***:
68

79
```
810
out_chg 1
@@ -72,6 +74,8 @@ Gamma
7274
```
7375
Run the program, and you will see a file named DOS1_smearing.dat in the output directory. The first two columns in the file are the energy and DOS, respectively.Plot file DOS1_smearing.dat with graphing software, and you’ll get the DOS.
7476

77+
# PDOS
78+
7579
Along with the DOS1_smearing.dat file, we also produce the projected density of states (PDOS) in a file called PDOS.
7680

7781
The PDOS file starts with number of atomic orbitals in the system, then a list of energy values, such as:
@@ -102,4 +106,4 @@ The rest of the fileis arranged in sections, each section with a header such as
102106
```
103107
which tells the atom and symmetry of the current atomic orbital, and followed by the PDOS values. The values can thus be plotted against the energies.
104108

105-
[back to top](#dos,-wave-functions)
109+
[back to top](#Density_of_states)

0 commit comments

Comments
 (0)