Skip to content

Commit 89f3707

Browse files
authored
Merge branch 'deepmodeling:develop' into refactor
2 parents 3bfc989 + ea3a0dd commit 89f3707

File tree

108 files changed

+5949
-734
lines changed

Some content is hidden

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

108 files changed

+5949
-734
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,17 +711,17 @@ target_link_libraries(
711711
esolver
712712
vdw
713713
device
714-
container)
714+
container
715+
dftu
716+
deltaspin)
715717
if(ENABLE_LCAO)
716718
target_link_libraries(
717719
${ABACUS_BIN_NAME}
718720
hamilt_lcao
719721
tddft
720722
orb
721723
gint
722-
dftu
723724
hcontainer
724-
deltaspin
725725
numerical_atomic_orbitals
726726
lr
727727
rdmft)

docs/advanced/input_files/input-main.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,12 @@ Note: In new angle mixing, you should set `mixing_beta_mag >> mixing_beta`. The
12351235
- **Description**: To determine the number of old iterations' `drho` used in slope calculations.
12361236
- **Default**: `mixing_ndim`
12371237

1238+
### sc_os_ndim
1239+
1240+
- **Type**: int
1241+
- **Description**: To determine the number of old iterations to judge oscillation, it occured, more accurate lambda with DeltaSpin method would be calculated, only for PW base.
1242+
- **Default**: 5
1243+
12381244
### chg_extrap
12391245

12401246
- **Type**: String

docs/advanced/interface/Wannier90.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
[Wannier90](http://www.wannier.org/) is a useful package to generating the maximally-localized Wannier functions (MLWFs), which can be used to compute advanced electronic properties. Some post-processing tools (such as WannierTools, etc.) will use MLWFs for further analysis and calculations.
44

5-
Currently ABACUS provides an interface to Wannier90 package. The users are assumed to be familiar with the use of Wannier90. The ABACUS-Wannier90 interface is only suitable for nspin=1 or 2, not for nspin=4 or spin-orbit coupling (SOC).
5+
Currently ABACUS provides an interface to Wannier90 package. The users are assumed to be familiar with the use of Wannier90. The ABACUS-Wannier90 interface is suitable for nspin=1, 2, 4 (including lspinorb=1).
66

77
To construct the MLWFs using the wave functions of ABACUS generally requires four steps. Here we use the diamond as an example which can be found in [examples/interface_wannier90/](https://github.com/abacusmodeling/abacus-develop/tree/develop/examples/interface_wannier90).
88

9-
1. Enter the `ABACUS_towannier90/` folder, prepare a Wannier90 input file `diamond.win`, which is the main input file for Wannier90. Then To generate `diamond.nnkp` file by running Wannier90, which ABACUS will read later:
9+
1. Enter the `ABACUS_towannier90_pw/` folder, prepare a Wannier90 input file `diamond.win`, which is the main input file for Wannier90. Then To generate `diamond.nnkp` file by running Wannier90, which ABACUS will read later:
1010

1111
```
1212
wannier90 -pp diamond.win
@@ -73,17 +73,22 @@ To construct the MLWFs using the wave functions of ABACUS generally requires fou
7373
```
7474
INPUT_PARAMETERS
7575
76+
pseudo_dir ../../../tests/PP_ORB
77+
orbital_dir ../../../tests/PP_ORB
7678
ntype 1
7779
ecutwfc 50
7880
nbands 4
81+
smearing_method fixed
7982
calculation nscf
8083
scf_nmax 50
8184
pw_diag_thr 1.0e-12
82-
scf_thr 1.0e-15
85+
scf_thr 1.0e-13
8386
init_chg file
84-
symmetry 0
87+
symmetry -1
8588
towannier90 1
8689
nnkpfile diamond.nnkp
90+
basis_type pw
91+
out_wannier_unk 0
8792
```
8893
8994
There are seven interface-related parameters in the `INPUT` file:
@@ -97,7 +102,7 @@ To construct the MLWFs using the wave functions of ABACUS generally requires fou
97102
- [out_wannier_unk](../input_files/input-main.md#out_wannier_unk): control whether to output the "UNK.*" file.
98103
- [out_wannier_wvfn_formatted](../input_files/input-main.md#out_wannier_wvfn_formatted): control what format of the Wannier function file to output, `true`: output the formatted text file; `false`: output the binary file. Note that the `wvfn_formatted` option in `*.win` file (input file of Wannier90) has to be set accordingly with this option.
99104
100-
Note: You need to turn off the symmetry during the entire nscf calculation.
105+
**Note: You need to turn off the symmetry during the entire nscf calculation.**
101106
102107
To setup the `KPT` file according to the `diamond.win` file, which is similar to "begin kpoints ..." in the `diamond.win` file:
103108

docs/quick_start/easy_install.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# Easy Installation
22

3-
This guide helps you install ABACUS with basic features. **For DeePKS, DeePMD and Libxc support, or building with `make`, please refer to [the advanced installation guide](../advanced/install.md)** after going through this page. We recommend building ABACUS with `cmake` to avoid dependency issues. We recommend compiling ABACUS(and possibly its requirements) from the source code using the latest compiler for the best performace. You can also deploy ABACUS **without building** by [Docker](#container-deployment) or [conda](#install-by-conda). Please note that ABACUS only supports Linux; for Windows users, please consider using [WSL](https://learn.microsoft.com/en-us/windows/wsl/) or docker.
3+
This guide helps you install ABACUS with basic features. **For DeePKS, DeePMD and Libxc support, or building with `make`, please refer to [the advanced installation guide](../advanced/install.md)** after going through this page. We recommend building ABACUS with `cmake` to avoid dependency issues. We recommend compiling ABACUS(and possibly its requirements) from the source code using the latest compiler for the best performace. You can try [toolchain](#install-requirements-by-toolchain) to install ABACUS and dependencies in a source-code compilation way with convience. You can also deploy ABACUS **without building** by [Docker](#container-deployment) or [conda](#install-by-conda). Please note that ABACUS only supports Linux; for Windows users, please consider using [WSL](https://learn.microsoft.com/en-us/windows/wsl/) or docker.
4+
5+
## Get ABACUS source code
6+
7+
ABACUS source code can be obtained via one of the following choices:
8+
9+
- Clone the whole repo with git: `git clone https://github.com/deepmodeling/abacus-develop.git`
10+
- Clone the minimum required part of repo: `git clone https://github.com/deepmodeling/abacus-develop.git --depth=1`
11+
- Download the latest source code without git: `wget https://github.com/deepmodeling/abacus-develop/archive/refs/heads/develop.zip`
12+
- Get the source code of a stable version [here](https://github.com/deepmodeling/abacus-develop/releases)
13+
- If you have connection issues accessing GitHub, please try out our official [Gitee repo](https://gitee.com/deepmodeling/abacus-develop/): e.g. `git clone https://gitee.com/deepmodeling/abacus-develop.git`. This Gitee repo is updated synchronously with GitHub.
14+
415

516
## Prerequisites
617

@@ -43,32 +54,22 @@ Please refer to our [guide](https://github.com/deepmodeling/abacus-develop/wiki/
4354

4455
We offer a set of [toolchain](https://github.com/deepmodeling/abacus-develop/tree/develop/toolchain)
4556
scripts to compile and install all the requirements
46-
automatically and suitable for machine characteristic in an online or offline way.
47-
The toolchain can be downloaded with ABACUS repo, which is easily used and can
48-
have a convenient installation under HPC environment in both `GNU` or `Intel-oneAPI` toolchain.
49-
Sometimes, ABACUS by toolchain installation may have highly efficient performance.
50-
A Tutorial for using this toolchain can be accessed in [bohrium-notebook](https://nb.bohrium.dp.tech/detail/5215742477)
51-
52-
> Notice: the toolchain is under development, please let me know if you encounter any problem in using this toolchain.
57+
automatically and suitable for machine characteristic in an online or offline way.
58+
The toolchain can be downloaded with ABACUS repo, and users can easily compile the requirements by running *toolchain_[gnu,intel].sh* and ABACUS itself by running *build_abacus_[gnu,intel].sh* script in the toolchain directory in both `GNU` and `Intel-oneAPI` toolchain.
59+
Sometimes, ABACUS by toolchain installation may have better efficient performance due to the suitable compiled dependencies.
5360

61+
Users should read the README in toolchain directory for most of the information before use, and a tutorial for using this toolchain can be accessed in [bohrium-notebook](https://nb.bohrium.dp.tech/detail/5215742477) as reference.
5462

55-
## Get ABACUS source code
56-
57-
Of course a copy of ABACUS source code is required, which can be obtained via one of the following choices:
63+
> Notice: the toolchain is under development, please let we know if you encounter any problem in using this toolchain by raising issue or contacting us.
5864
59-
- Clone the whole repo with git: `git clone https://github.com/deepmodeling/abacus-develop.git`
60-
- Clone the minimum required part of repo: `git clone https://github.com/deepmodeling/abacus-develop.git --depth=1`
61-
- Download the latest source code without git: `wget https://github.com/deepmodeling/abacus-develop/archive/refs/heads/develop.zip`
62-
- Get the source code of a stable version [here](https://github.com/deepmodeling/abacus-develop/releases)
63-
- If you have connection issues accessing GitHub, please try out our official [Gitee repo](https://gitee.com/deepmodeling/abacus-develop/): e.g. `git clone https://gitee.com/deepmodeling/abacus-develop.git`
6465

65-
### Update to latest release
66+
## Update to latest release by git
6667

6768
Please check the [release page](https://github.com/deepmodeling/abacus-develop/releases) for the release note of a new version.
6869

6970
It is OK to download the new source code from beginning following the previous step.
7071

71-
To update your cloned git repo in-place:
72+
You can update your cloned git repo (from Github or Gitee) in-place with the following commands:
7273

7374
```bash
7475
git remote -v
@@ -78,7 +79,7 @@ git remote -v
7879

7980
# Replace "origin" with "upstream" or the remote name corresponding to deepmodeling/abacus-develop if necessary
8081
git fetch origin
81-
git checkout v3.2.0 # Replace the tag with the latest version
82+
git checkout v3.8.4 # Replace the tag with the latest version
8283
git describe --tags # Verify if the tag has been successfully checked out
8384
```
8485

@@ -158,6 +159,12 @@ If ABACUS is installed into a custom directory using `CMAKE_INSTALL_PREFIX`, ple
158159
export PATH=/my-install-dir/:$PATH
159160
```
160161

162+
If ABACUS is installed by toolchain, there will be an environment script in the toolchain directory named as *abacus_env.sh*. You can source it to set the environment variables.
163+
164+
```bash
165+
source /path/to/abacus/toolchain/abacus_env.sh
166+
```
167+
161168
Please set OpenMP threads by setting environment variable:
162169

163170
```bash

examples/interface_wannier90/ABACUS_towannier90_lcao/INPUT-nscf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ scf_nmax 50
1010
pw_diag_thr 1.0e-12
1111
scf_thr 1.0e-13
1212
init_chg file
13-
symmetry 0
13+
symmetry -1
1414
towannier90 1
1515
nnkpfile diamond.nnkp
16-
basis_type lcao
16+
basis_type lcao
1717
wannier_method 2
1818
out_wannier_unk 0

examples/interface_wannier90/ABACUS_towannier90_lcao_in_pw/INPUT-nscf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ scf_nmax 50
1010
pw_diag_thr 1.0e-12
1111
scf_thr 1.0e-13
1212
init_chg file
13-
symmetry 0
13+
symmetry -1
1414
towannier90 1
1515
nnkpfile diamond.nnkp
1616
basis_type lcao

examples/interface_wannier90/ABACUS_towannier90_pw/INPUT-nscf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ scf_nmax 50
1111
pw_diag_thr 1.0e-12
1212
scf_thr 1.0e-13
1313
init_chg file
14-
symmetry 0
14+
symmetry -1
1515
towannier90 1
1616
nnkpfile diamond.nnkp
17-
basis_type pw
17+
basis_type pw
1818
out_wannier_unk 0

python/pyabacus/src/ModuleNAO/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ list(APPEND _naos
1212
${NAO_PATH}/two_center_bundle.cpp
1313
${NAO_PATH}/two_center_integrator.cpp
1414
${NAO_PATH}/two_center_table.cpp
15-
${NAO_PATH}/projgen.cpp
1615
# dependency
1716
${ABACUS_SOURCE_DIR}/module_base/kernels/math_op.cpp
1817
# ${ABACUS_SOURCE_DIR}/module_psi/kernels/psi_memory_op.cpp

python/pyabacus/src/hsolver/py_diago_cg.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ class PyDiagoCG
114114
);
115115
}
116116

117-
void diag(
118-
std::function<py::array_t<std::complex<double>>(py::array_t<std::complex<double>>)> mm_op,
119-
int diag_ndim,
120-
double tol,
121-
bool need_subspace,
122-
bool scf_type,
123-
int nproc_in_pool = 1
117+
void diag(std::function<py::array_t<std::complex<double>>(py::array_t<std::complex<double>>)> mm_op,
118+
int diag_ndim,
119+
double tol,
120+
const std::vector<double>& diag_ethr,
121+
bool need_subspace,
122+
bool scf_type,
123+
int nproc_in_pool = 1
124124
) {
125125
const std::string basis_type = "pw";
126126
const std::string calculation = scf_type ? "scf" : "nscf";
@@ -171,7 +171,7 @@ class PyDiagoCG
171171
nproc_in_pool
172172
);
173173

174-
cg->diag(hpsi_func, spsi_func, *psi, *eig, *prec);
174+
cg->diag(hpsi_func, spsi_func, *psi, *eig, diag_ethr, *prec);
175175
}
176176

177177
private:

python/pyabacus/src/hsolver/py_hsolver.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ void bind_hsolver(py::module& m)
158158
for invoking this class is a function defined in _hsolver.py,
159159
which uses this class to perform the calculations.
160160
)pbdoc")
161-
.def("diag", &py_hsolver::PyDiagoCG::diag, R"pbdoc(
161+
.def("diag",
162+
&py_hsolver::PyDiagoCG::diag,
163+
R"pbdoc(
162164
Diagonalize the linear operator using the Conjugate Gradient Method.
163165
164166
Parameters
@@ -179,6 +181,7 @@ void bind_hsolver(py::module& m)
179181
"mm_op"_a,
180182
"max_iter"_a,
181183
"tol"_a,
184+
"diag_ethr"_a,
182185
"need_subspace"_a,
183186
"scf_type"_a,
184187
"nproc_in_pool"_a)

0 commit comments

Comments
 (0)