Skip to content

Commit f3ff349

Browse files
authored
Merge branch 'abacusmodeling:develop' into mc
2 parents 6243b19 + 68735ed commit f3ff349

File tree

623 files changed

+19844
-15277
lines changed

Some content is hidden

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

623 files changed

+19844
-15277
lines changed

CMakeLists.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ option(ENABLE_CNPY "Enable cnpy usage." OFF)
4040
option(ENABLE_PEXSI "Enable support for PEXSI." OFF)
4141
option(ENABLE_CUSOLVERMP "Enable cusolvermp." OFF)
4242
option(USE_DSP "Enable DSP usage." OFF)
43+
option(USE_CUDA_ON_DCU "Enable CUDA on DCU" OFF)
4344

4445
# enable json support
4546
if(ENABLE_RAPIDJSON)
@@ -126,6 +127,10 @@ if (USE_DSP)
126127
set(ABACUS_BIN_NAME abacus_dsp)
127128
endif()
128129

130+
if (USE_CUDA_ON_DCU)
131+
add_compile_definitions(__CUDA_ON_DCU)
132+
endif()
133+
129134
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
130135

131136
if(ENABLE_COVERAGE)
@@ -421,10 +426,8 @@ else()
421426
include_directories(${FFTW3_INCLUDE_DIRS})
422427
list(APPEND math_libs FFTW3::FFTW3 LAPACK::LAPACK BLAS::BLAS)
423428

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

429432
if(USE_OPENMP)
430433
list(APPEND math_libs FFTW3::FFTW3_OMP)
@@ -713,17 +716,17 @@ target_link_libraries(
713716
esolver
714717
vdw
715718
device
716-
container)
719+
container
720+
dftu
721+
deltaspin)
717722
if(ENABLE_LCAO)
718723
target_link_libraries(
719724
${ABACUS_BIN_NAME}
720725
hamilt_lcao
721726
tddft
722727
orb
723728
gint
724-
dftu
725729
hcontainer
726-
deltaspin
727730
numerical_atomic_orbitals
728731
lr
729732
rdmft)

docs/advanced/input_files/input-main.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
- [ndx, ndy, ndz](#ndx-ndy-ndz)
3838
- [pw\_seed](#pw_seed)
3939
- [pw\_diag\_thr](#pw_diag_thr)
40+
- [diago\_smooth\_ethr](#diago_smooth_ethr)
4041
- [pw\_diag\_nmax](#pw_diag_nmax)
4142
- [pw\_diag\_ndim](#pw_diag_ndim)
4243
- [erf\_ecut](#erf_ecut)
@@ -777,6 +778,12 @@ These variables are used to control the plane wave related parameters.
777778
- **Description**: Only used when you use `ks_solver = cg/dav/dav_subspace/bpcg`. It indicates the threshold for the first electronic iteration, from the second iteration the pw_diag_thr will be updated automatically. **For nscf calculations with planewave basis set, pw_diag_thr should be <= 1e-3.**
778779
- **Default**: 0.01
779780

781+
### diago_smooth_ethr
782+
783+
- **Type**: bool
784+
- **Description**: If `TRUE`, the smooth threshold strategy, which applies a larger threshold (10e-5) for the empty states, will be implemented in the diagonalization methods. (This strategy should not affect total energy, forces, and other ground-state properties, but computational efficiency will be improved.) If `FALSE`, the smooth threshold strategy will not be applied.
785+
- **Default**: false
786+
780787
### pw_diag_nmax
781788

782789
- **Type**: Integer
@@ -1235,6 +1242,12 @@ Note: In new angle mixing, you should set `mixing_beta_mag >> mixing_beta`. The
12351242
- **Description**: To determine the number of old iterations' `drho` used in slope calculations.
12361243
- **Default**: `mixing_ndim`
12371244

1245+
### sc_os_ndim
1246+
1247+
- **Type**: int
1248+
- **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.
1249+
- **Default**: 5
1250+
12381251
### chg_extrap
12391252

12401253
- **Type**: String
@@ -1369,6 +1382,7 @@ These variables are used to control the geometry relaxation.
13691382
- **Description**: The methods to do geometry optimization.
13701383
- cg: using the conjugate gradient (CG) algorithm. Note that there are two implementations of the conjugate gradient (CG) method, see [relax_new](#relax_new).
13711384
- bfgs: using the Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm.
1385+
- bfgs_trad: using the traditional Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm.
13721386
- cg_bfgs: using the CG method for the initial steps, and switching to BFGS method when the force convergence is smaller than [relax_cg_thr](#relax_cg_thr).
13731387
- sd: using the steepest descent (SD) algorithm.
13741388
- fire: the Fast Inertial Relaxation Engine method (FIRE), a kind of molecular-dynamics-based relaxation algorithm, is implemented in the molecular dynamics (MD) module. The algorithm can be used by setting [calculation](#calculation) to `md` and [md_type](#md_type) to `fire`. Also ionic velocities should be set in this case. See [fire](../md.md#fire) for more details.
@@ -2046,7 +2060,7 @@ Warning: this function is not robust enough for the current version. Please try
20462060
- **Type**: int
20472061
- **Availability**: numerical atomic orbital basis
20482062
- **Description**: Include V_delta label for DeePKS training. When `deepks_out_labels` is true and `deepks_v_delta` > 0, ABACUS will output h_base.npy, v_delta.npy and h_tot.npy(h_tot=h_base+v_delta).
2049-
Meanwhile, when `deepks_v_delta` equals 1, ABACUS will also output v_delta_precalc.npy, which is used to calculate V_delta during DeePKS training. However, when the number of atoms grows, the size of v_delta_precalc.npy will be very large. In this case, it's recommended to set `deepks_v_delta` as 2, and ABACUS will output psialpha.npy and grad_evdm.npy but not v_delta_precalc.npy. These two files are small and can be used to calculate v_delta_precalc in the procedure of training DeePKS.
2063+
Meanwhile, when `deepks_v_delta` equals 1, ABACUS will also output v_delta_precalc.npy, which is used to calculate V_delta during DeePKS training. However, when the number of atoms grows, the size of v_delta_precalc.npy will be very large. In this case, it's recommended to set `deepks_v_delta` as 2, and ABACUS will output phialpha.npy and grad_evdm.npy but not v_delta_precalc.npy. These two files are small and can be used to calculate v_delta_precalc in the procedure of training DeePKS.
20502064
- **Default**: 0
20512065

20522066
### deepks_out_unittest
@@ -2432,10 +2446,11 @@ These variables are relevant when using hybrid functionals.
24322446
### exx_ccp_rmesh_times
24332447

24342448
- **Type**: Real
2435-
- **Description**: This parameter determines how many times larger the radial mesh required for calculating Columb potential is to that of atomic orbitals. For HSE, setting it to 1 is enough. But for PBE0, a much larger number must be used.
2449+
- **Description**: This parameter determines how many times larger the radial mesh required for calculating Columb potential is to that of atomic orbitals. The value should be at least 1. Reducing this value can effectively increase the speed of self-consistent calculations using hybrid functionals.
24362450
- **Default**:
2437-
- 1.5: if *[dft_functional](#dft_functional)==hse*
2438-
- 5: else
2451+
- 5: if *[dft_functional](#dft_functional)==hf/pbe0/scan0/muller/power/wp22*
2452+
- 1.5: if *[dft_functional](#dft_functional)==hse/cwp22*
2453+
- 1: else
24392454

24402455
### exx_distribute_type
24412456

@@ -2474,6 +2489,7 @@ These variables are relevant when using hybrid functionals.
24742489
- **Description**:
24752490
- True: Enforce LibRI to use `double` data type.
24762491
- False: Enforce LibRI to use `complex` data type.
2492+
Setting it to True can effectively improve the speed of self-consistent calculations with hybrid functionals.
24772493
- **Default**: depends on the [gamma_only](#gamma_only) option
24782494
- True: if gamma_only
24792495
- False: else

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/advanced/opt.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ In the nested procedure mentioned above, we used CG method to perform cell relax
2222

2323
The [BFGS method](https://en.wikipedia.org/wiki/Broyden%E2%80%93Fletcher%E2%80%93Goldfarb%E2%80%93Shanno_algorithm) is a quasi-Newton method for solving nonlinear optimization problem. It belongs to the class of quasi-Newton method where the Hessian matrix is approximated during the optimization process. If the initial point is not far from the extrema, BFGS tends to work better than gradient-based methods.
2424

25-
In ABACUS, we implemented the BFGS method for doing fixed-cell structural relaxation.
25+
There is an alternative traditional BFGS method, which can be called by using the keyword 'bfgs_trad'. The bfgs_trad method is a quasi-Newton method that substitute an approximate matrix B for the Hessian matrix. The main difference between 'bfgs' and 'bfgs_trad' is that 'bfgs' updates the inverse of matrix B while 'bfgs_trad' updates matrix B and obtains the inverse of B by solving the matrix eigenvalues and taking the reciprocal of the eigenvalues. Both methods are mathematically equivalent, but in some cases, 'bfgs_trad' performs better.
26+
27+
In ABACUS, we implemented the BFGS method for doing fixed-cell structural relaxation. Users can choose which implementation of BFGS to call by adding the 'bfgs_trad' or 'bfgs' parameter.
2628

2729
### SD method
2830

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

examples/lr-tddft/lcao_H2O/INPUT

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ orbital_dir ../../../tests/PP_ORB
66
calculation scf
77
nbands 23
88
symmetry -1
9+
nspin 2
910

1011
#Parameters (2.Iteration)
1112
ecutwfc 60 ###Energy cutoff needs to be tested to ensure your calculation is reliable.[1]
@@ -30,6 +31,7 @@ xc_kernel lda
3031
lr_solver dav
3132
lr_thr 1e-2
3233
pw_diag_ndim 2
34+
# lr_unrestricted 1 ### use this to do TDUKS calculation for closeshell systems (openshell system will force TDUKS)
3335

3436
esolver_type ks-lr
3537
out_alllog 1
@@ -39,6 +41,7 @@ out_alllog 1
3941
nvirt 19
4042
abs_wavelen_range 40 180
4143
abs_broadening 0.01
44+
abs_gauge length
4245

4346
### [1] Energy cutoff determines the quality of numerical quadratures in your calculations.
4447
### So it is strongly recommended to test whether your result (such as converged SCF energies) is

examples/lr-tddft/lcao_Si2/INPUT

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ pseudo_dir ../../../tests/PP_ORB
55
orbital_dir ../../../tests/PP_ORB
66
calculation scf
77
nbands 23
8-
symmetry 0
8+
symmetry -1
9+
nspin 2
910

1011
#Parameters (2.Iteration)
1112
ecutwfc 60 ###Energy cutoff needs to be tested to ensure your calculation is reliable.[1]
@@ -37,6 +38,8 @@ out_alllog 1
3738

3839
nvirt 19
3940
abs_wavelen_range 100 175
41+
abs_broadening 0.01 # in Ry
42+
abs_gauge velocity ### velocity gauge is recommended for periodic systems
4043

4144

4245
### [1] Energy cutoff determines the quality of numerical quadratures in your calculations.

0 commit comments

Comments
 (0)