Skip to content

Commit 658855f

Browse files
authored
Merge branch 'develop' into gpu-psiinit-1
2 parents 8d926f7 + c9c0189 commit 658855f

File tree

258 files changed

+9381
-2656
lines changed

Some content is hidden

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

258 files changed

+9381
-2656
lines changed

CMakeLists.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,8 @@ else()
421421
include_directories(${FFTW3_INCLUDE_DIRS})
422422
list(APPEND math_libs FFTW3::FFTW3 LAPACK::LAPACK BLAS::BLAS)
423423

424-
if(ENABLE_LCAO)
425-
find_package(ScaLAPACK REQUIRED)
426-
list(APPEND math_libs ScaLAPACK::ScaLAPACK)
427-
endif()
424+
find_package(ScaLAPACK REQUIRED)
425+
list(APPEND math_libs ScaLAPACK::ScaLAPACK)
428426

429427
if(USE_OPENMP)
430428
list(APPEND math_libs FFTW3::FFTW3_OMP)
@@ -713,17 +711,17 @@ target_link_libraries(
713711
esolver
714712
vdw
715713
device
716-
container)
714+
container
715+
dftu
716+
deltaspin)
717717
if(ENABLE_LCAO)
718718
target_link_libraries(
719719
${ABACUS_BIN_NAME}
720720
hamilt_lcao
721721
tddft
722722
orb
723723
gint
724-
dftu
725724
hcontainer
726-
deltaspin
727725
numerical_atomic_orbitals
728726
lr
729727
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

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_dav_subspace.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ class PyDiagoDavSubspace
101101

102102
int diag(
103103
std::function<py::array_t<std::complex<double>>(py::array_t<std::complex<double>>)> mm_op,
104-
std::vector<double> precond_vec,
104+
std::vector<double>& precond_vec,
105105
int dav_ndim,
106106
double tol,
107107
int max_iter,
108108
bool need_subspace,
109-
std::vector<double> diag_ethr,
109+
std::vector<double>& diag_ethr,
110110
bool scf_type,
111111
hsolver::diag_comm_info comm_info
112112
) {
@@ -141,7 +141,7 @@ class PyDiagoDavSubspace
141141
comm_info
142142
);
143143

144-
return obj->diag(hpsi_func, psi, nbasis, eigenvalue, diag_ethr.data(), scf_type);
144+
return obj->diag(hpsi_func, psi, nbasis, eigenvalue, diag_ethr, scf_type);
145145
}
146146

147147
private:

python/pyabacus/src/hsolver/py_diago_david.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,10 @@ class PyDiagoDavid
101101

102102
int diag(
103103
std::function<py::array_t<std::complex<double>>(py::array_t<std::complex<double>>)> mm_op,
104-
std::vector<double> precond_vec,
104+
std::vector<double>& precond_vec,
105105
int dav_ndim,
106106
double tol,
107+
std::vector<double>& diag_ethr,
107108
int max_iter,
108109
bool use_paw,
109110
hsolver::diag_comm_info comm_info
@@ -146,7 +147,7 @@ class PyDiagoDavid
146147
comm_info
147148
);
148149

149-
return obj->diag(hpsi_func, spsi_func, nbasis, psi, eigenvalue, tol, max_iter);
150+
return obj->diag(hpsi_func, spsi_func, nbasis, psi, eigenvalue, diag_ethr, max_iter);
150151
}
151152

152153
private:

python/pyabacus/src/hsolver/py_hsolver.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ void bind_hsolver(py::module& m)
121121
eigenvectors to be calculated.
122122
tol : double
123123
The tolerance for the convergence.
124+
diag_ethr: np.ndarray
125+
The tolerance vector.
124126
max_iter : int
125127
The maximum number of iterations.
126128
use_paw : bool
@@ -130,6 +132,7 @@ void bind_hsolver(py::module& m)
130132
"precond_vec"_a,
131133
"dav_ndim"_a,
132134
"tol"_a,
135+
"diag_ethr"_a,
133136
"max_iter"_a,
134137
"use_paw"_a,
135138
"comm_info"_a)

0 commit comments

Comments
 (0)