Skip to content

Commit d65e8b1

Browse files
committed
prepare for PR
2 parents e1d3a77 + 60403f5 commit d65e8b1

File tree

423 files changed

+11143
-6974
lines changed

Some content is hidden

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

423 files changed

+11143
-6974
lines changed

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
env:
2626
OMP_NUM_THREADS: 1
2727
run: |
28-
cmake --build build --target test ARGS="-V --timeout 21600"
28+
cmake --build build --target test ARGS="-V --timeout 21600" || exit 0
2929
- name: Upload Coverage to Codecov
3030
uses: codecov/codecov-action@v4
3131
if: ${{ ! cancelled() }}

.gitmodules

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
[submodule "deps/LibRI"]
2-
path = deps/LibRI
3-
url = https://github.com/abacusmodeling/LibRI.git
4-
branch = master
5-
[submodule "deps/LibComm"]
6-
path = deps/LibComm
7-
url = https://github.com/abacusmodeling/LibComm.git
8-
branch = master
91
[submodule "deps/libpaw_interface"]
102
path = deps/libpaw_interface
113
url = https://github.com/wenfei-li/libpaw_interface

CMakeLists.txt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -538,13 +538,10 @@ endif()
538538
if(ENABLE_LIBRI)
539539
set_if_higher(CMAKE_CXX_STANDARD 14)
540540
if(LIBRI_DIR)
541-
include_directories(${LIBRI_DIR}/include)
542-
elseif(GIT_SUBMODULE)
543-
git_submodule_update()
544-
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/LibRI/include)
545541
else()
546-
message(FATAL_ERROR "Must provide LIBRI_DIR for RI related features.")
542+
find_package(LibRI REQUIRED)
547543
endif()
544+
include_directories(${LIBRI_DIR}/include)
548545
target_link_libraries(${ABACUS_BIN_NAME} ri module_exx_symmetry)
549546
add_compile_definitions(__EXX EXX_DM=3 EXX_H_COMM=2 TEST_EXX_LCAO=0
550547
TEST_EXX_RADIAL=1)
@@ -555,13 +552,10 @@ if(ENABLE_LIBRI OR DEFINED LIBCOMM_DIR)
555552
endif()
556553
if(ENABLE_LIBCOMM)
557554
if(LIBCOMM_DIR)
558-
include_directories(${LIBCOMM_DIR}/include)
559-
elseif(GIT_SUBMODULE)
560-
git_submodule_update()
561-
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/LibComm/include)
562555
else()
563-
message(FATAL_ERROR "Must provide LIBCOMM_DIR for RI related features.")
556+
find_package(LibComm REQUIRED)
564557
endif()
558+
include_directories(${LIBCOMM_DIR}/include)
565559
endif()
566560

567561
if(ENABLE_PAW)

cmake/FindLibComm.cmake

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
###############################################################################
2+
# - Find LibComm
3+
# Find the native LibComm files.
4+
#
5+
# LIBCOMM_FOUND - True if LibComm is found.
6+
# LIBCOMM_DIR - Where to find LibComm files.
7+
8+
find_path(LIBCOMM_DIR
9+
include/Comm/Comm_Tools.h
10+
HINTS ${LIBCOMM_DIR}
11+
HINTS ${LibComm_DIR}
12+
HINTS ${libcomm_DIR}
13+
)
14+
15+
if(NOT LIBCOMM_DIR)
16+
include(FetchContent)
17+
FetchContent_Declare(
18+
LibComm
19+
URL https://github.com/abacusmodeling/LibComm/archive/refs/tags/v0.1.1.tar.gz
20+
)
21+
FetchContent_Populate(LibComm)
22+
set(LIBCOMM_DIR ${libcomm_SOURCE_DIR})
23+
endif()
24+
# Handle the QUIET and REQUIRED arguments and
25+
# set LIBCOMM_FOUND to TRUE if all variables are non-zero.
26+
include(FindPackageHandleStandardArgs)
27+
find_package_handle_standard_args(LibComm DEFAULT_MSG LIBCOMM_DIR)
28+
29+
# Copy the results to the output variables and target.
30+
mark_as_advanced(LIBCOMM_DIR)

cmake/FindLibRI.cmake

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
###############################################################################
2+
# - Find LibRI
3+
# Find the native LibRI files.
4+
#
5+
# LIBRI_FOUND - True if LibRI is found.
6+
# LIBRI_DIR - Where to find LibRI files.
7+
8+
find_path(LIBRI_DIR
9+
include/RI/version.h
10+
HINTS ${LIBRI_DIR}
11+
HINTS ${LibRI_DIR}
12+
HINTS ${libri_DIR}
13+
)
14+
15+
if(NOT LIBRI_DIR)
16+
include(FetchContent)
17+
FetchContent_Declare(
18+
LibRI
19+
URL https://github.com/abacusmodeling/LibRI/archive/refs/tags/v0.2.1.1.tar.gz
20+
)
21+
FetchContent_Populate(LibRI)
22+
set(LIBRI_DIR ${libri_SOURCE_DIR})
23+
endif()
24+
# Handle the QUIET and REQUIRED arguments and
25+
# set LIBRI_FOUND to TRUE if all variables are non-zero.
26+
include(FindPackageHandleStandardArgs)
27+
find_package_handle_standard_args(LibRI DEFAULT_MSG LIBRI_DIR)
28+
29+
# Copy the results to the output variables and target.
30+
mark_as_advanced(LIBRI_DIR)

deps/LibComm

Lines changed: 0 additions & 1 deletion
This file was deleted.

deps/LibRI

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/advanced/input_files/input-main.md

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@
8888
- [scf\_thr](#scf_thr)
8989
- [scf\_ene\_thr](#scf_ene_thr)
9090
- [scf\_thr\_type](#scf_thr_type)
91+
- [scf\_os\_stop](#scf_os_stop)
92+
- [scf\_os\_thr](#scf_os_thr)
93+
- [scf\_os\_ndim](#scf_os_ndim)
9194
- [chg\_extrap](#chg_extrap)
9295
- [lspinorb](#lspinorb)
9396
- [noncolin](#noncolin)
@@ -243,8 +246,8 @@
243246
- [exx\_opt\_orb\_ecut](#exx_opt_orb_ecut)
244247
- [exx\_opt\_orb\_tolerence](#exx_opt_orb_tolerence)
245248
- [exx\_real\_number](#exx_real_number)
246-
- [exx\_symmetry\_realspace](#exx_symmetry_realspace)
247249
- [rpa\_ccp\_rmesh\_times](#rpa_ccp_rmesh_times)
250+
- [exx\_symmetry\_realspace](#exx_symmetry_realspace)
248251
- [out\_ri\_cv](#out_ri_cv)
249252
- [Molecular dynamics](#molecular-dynamics)
250253
- [md\_type](#md_type)
@@ -273,6 +276,9 @@
273276
- [lj\_epsilon](#lj_epsilon)
274277
- [lj\_sigma](#lj_sigma)
275278
- [pot\_file](#pot_file)
279+
- [dp\_rescaling](#dp_rescaling)
280+
- [dp\_fparam](#dp_fparam)
281+
- [dp\_aparam](#dp_aparam)
276282
- [msst\_direction](#msst_direction)
277283
- [msst\_vel](#msst_vel)
278284
- [msst\_vis](#msst_vis)
@@ -422,11 +428,12 @@
422428
- [nocc](#nocc)
423429
- [nvirt](#nvirt)
424430
- [lr\_nstates](#lr_nstates)
431+
- [lr\_unrestricted](#lr_unrestricted)
425432
- [abs\_wavelen\_range](#abs_wavelen_range)
426433
- [out\_wfc\_lr](#out_wfc_lr)
427434
- [abs\_broadening](#abs_broadening)
428435
- [ri\_hartree\_benchmark](#ri_hartree_benchmark)
429-
- [aims_nbasis](#aims_nbasis)
436+
- [aims\_nbasis](#aims_nbasis)
430437
- [Reduced Density Matrix Functional Theory](#Reduced-Density-Matrix-Functional-Theory)
431438
- [rdmft](#rdmft)
432439
- [rdmft\_power\_alpha](#rdmft_power_alpha)
@@ -1172,7 +1179,7 @@ Note: In new angle mixing, you should set `mixing_beta_mag >> mixing_beta`. The
11721179

11731180
- **Type**: Integer
11741181
- **Description**: Print out energy for each band for every printe step
1175-
- **Default**: 100
1182+
- **Default**: `scf_nmax`
11761183

11771184
### scf_nmax
11781185

@@ -1204,6 +1211,29 @@ Note: In new angle mixing, you should set `mixing_beta_mag >> mixing_beta`. The
12041211

12051212
- **Default**: 1 (plane-wave basis), or 2 (localized atomic orbital basis).
12061213

1214+
### scf_os_stop
1215+
1216+
- **Type**: bool
1217+
- **Description**: For systems that are difficult to converge, the SCF process may exhibit oscillations in charge density, preventing further progress toward the specified convergence criteria and resulting in continuous oscillation until the maximum number of steps is reached; this greatly wastes computational resources. To address this issue, this function allows ABACUS to terminate the SCF process early upon detecting oscillations, thus reducing subsequent meaningless calculations. The detection of oscillations is based on the slope of the logarithm of historical drho values.. To this end, Least Squares Method is used to calculate the slope of the logarithmically taken drho for the previous `scf_os_ndim` iterations. If the calculated slope is larger than `scf_os_thr`, stop the SCF.
1218+
1219+
- **0**: The SCF will continue to run regardless of whether there is oscillation or not.
1220+
- **1**: If the calculated slope is larger than `scf_os_thr`, stop the SCF.
1221+
1222+
- **Default**: false
1223+
1224+
### scf_os_thr
1225+
1226+
- **Type**: double
1227+
- **Description**: The slope threshold to determine if the SCF is stuck in a charge density oscillation. If the calculated slope is larger than `scf_os_thr`, stop the SCF.
1228+
1229+
- **Default**: -0.01
1230+
1231+
### scf_os_ndim
1232+
1233+
- **Type**: int
1234+
- **Description**: To determine the number of old iterations' `drho` used in slope calculations.
1235+
- **Default**: `mixing_ndim`
1236+
12071237
### chg_extrap
12081238

12091239
- **Type**: String
@@ -2911,46 +2941,38 @@ These variables are used to control vdW-corrected related parameters.
29112941
- **Type**: String
29122942
- **Description**: Specifies the method used for Van der Waals (VdW) correction. Available options are:
29132943
- `d2`: [Grimme's D2](https://onlinelibrary.wiley.com/doi/abs/10.1002/jcc.20495) dispersion correction method
2914-
- `d3_0`: [Grimme's DFT-D3(0)](https://aip.scitation.org/doi/10.1063/1.3382344) dispersion correction method
2915-
- `d3_bj`: [Grimme's DFTD3(BJ)](https://onlinelibrary.wiley.com/doi/abs/10.1002/jcc.21759) dispersion correction method
2944+
- `d3_0`: [Grimme's DFT-D3(0)](https://aip.scitation.org/doi/10.1063/1.3382344) dispersion correction method (zero-damping)
2945+
- `d3_bj`: [Grimme's DFTD3(BJ)](https://onlinelibrary.wiley.com/doi/abs/10.1002/jcc.21759) dispersion correction method (BJ-damping)
29162946
- `none`: no vdW correction
29172947
- **Default**: none
2948+
- **Note**: ABACUS supports automatic setting on DFT-D3 parameters for common functionals after version 3.8.3 (and several develop versions earlier). To benefit from this feature, please specify the parameter `dft_functional` explicitly (for more details on this parameter, please see [dft_functional](#dft_functional)), otherwise the autoset procedure will crash with error message like `cannot find DFT-D3 parameter for XC(***)`. If not satisfied with those in-built parameters, any manually setting on `vdw_s6`, `vdw_s8`, `vdw_a1` and `vdw_a2` will overwrite.
2949+
- **Special**: There are special cases for functional family wB97 (Omega-B97): if want to use the functional wB97X-D3BJ, one needs to specify the `dft_functional` as `HYB_GGA_WB97X_V` and `vdw_method` as `d3_bj`. If want to use the functional wB97X-D3, specify `dft_functional` as `HYB_GGA_WB97X_D3` and `vdw_method` as `d3_0`.
29182950

29192951
### vdw_s6
29202952

29212953
- **Type**: Real
29222954
- **Availability**: `vdw_method` is set to `d2`, `d3_0`, or `d3_bj`
2923-
- **Description**: This scale factor is used to optimize the interaction energy deviations in van der Waals (vdW) corrected calculations. The recommended values of this parameter are dependent on the chosen vdW correction method and the DFT functional being used. For DFT-D2, the recommended values are 0.75 (PBE), 1.2 (BLYP), 1.05 (B-P86), 1.0 (TPSS), and 1.05 (B3LYP). For DFT-D3, recommended values with different DFT functionals can be found on the [here](https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3/dft-d3). The default value of this parameter in ABACUS is set to be the recommended value for PBE.
2955+
- **Description**: This scale factor is used to optimize the interaction energy deviations in van der Waals (vdW) corrected calculations. The recommended values of this parameter are dependent on the chosen vdW correction method and the DFT functional being used. For DFT-D2, the recommended values are 0.75 (PBE), 1.2 (BLYP), 1.05 (B-P86), 1.0 (TPSS), and 1.05 (B3LYP). If not set, will use values of PBE functional. For DFT-D3, recommended values with different DFT functionals can be found on the [here](https://github.com/dftd3/simple-dftd3/blob/main/assets/parameters.toml). If not set, will search in ABACUS built-in dataset based on the `dft_functional` keywords. User set value will overwrite the searched value.
29242956
- **Default**:
29252957
- 0.75: if `vdw_method` is set to `d2`
2926-
- 1.0: if `vdw_method` is set to `d3_0` or `d3_bj`
29272958

29282959
### vdw_s8
29292960

29302961
- **Type**: Real
29312962
- **Availability**: `vdw_method` is set to `d3_0` or `d3_bj`
2932-
- **Description**: This scale factor is relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the [webpage](https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3/dft-d3). The default value of this parameter in ABACUS is set to be the recommended value for PBE.
2933-
- **Default**:
2934-
- 0.722: if `vdw_method` is set to `d3_0`
2935-
- 0.7875: if `vdw_method` is set to `d3_bj`
2963+
- **Description**: This scale factor is relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the [webpage](https://github.com/dftd3/simple-dftd3/blob/main/assets/parameters.toml). If not set, will search in ABACUS built-in dataset based on the `dft_functional` keywords. User set value will overwrite the searched value.
29362964

29372965
### vdw_a1
29382966

29392967
- **Type**: Real
29402968
- **Availability**: `vdw_method` is set to `d3_0` or `d3_bj`
2941-
- **Description**: This damping function parameter is relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the [webpage](https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3/dft-d3). The default value of this parameter in ABACUS is set to be the recommended value for PBE.
2942-
- **Default**:
2943-
- 1.217: if `vdw_method` is set to `d3_0`
2944-
- 0.4289: if `vdw_method` is set to `d3_bj`
2969+
- **Description**: This damping function parameter is relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the [webpage](https://github.com/dftd3/simple-dftd3/blob/main/assets/parameters.toml). If not set, will search in ABACUS built-in dataset based on the `dft_functional` keywords. User set value will overwrite the searched value.
29452970

29462971
### vdw_a2
29472972

29482973
- **Type**: Real
29492974
- **Availability**: `vdw_method` is set to `d3_0` or `d3_bj`
2950-
- **Description**: This damping function parameter is only relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the [webpage](https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3/dft-d3). The default value of this parameter in ABACUS is set to be the recommended value for PBE.
2951-
- **Default**:
2952-
- 1.0: if `vdw_method` is set to `d3_0`
2953-
- 4.4407: if `vdw_method` is set to `d3_bj`
2975+
- **Description**: This damping function parameter is only relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the [webpage](https://github.com/dftd3/simple-dftd3/blob/main/assets/parameters.toml). If not set, will search in ABACUS built-in dataset based on the `dft_functional` keywords. User set value will overwrite the searched value.
29542976

29552977
### vdw_d
29562978

examples/band/lcao_Si2/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ if [[ ! -f scf.output ]] ||
1919
[[ ! ( "$(tail -1 OUT.ABACUS/running_scf.log)" == " Total Time :"* ) ]] ||
2020
[[ ! ( "$(tail -1 OUT.ABACUS/running_nscf.log)" == " Total Time :"* ) ]]
2121
then
22-
echo "job is failed!"
22+
echo "job failed!"
2323
exit 1
2424
else
25-
echo "job is successed!"
25+
echo "job succeeded!"
2626
exit 0
2727
fi
2828

examples/band/pw_Al/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ if [[ ! -f scf.output ]] ||
1919
[[ ! ( "$(tail -1 OUT.ABACUS/running_scf.log)" == " Total Time :"* ) ]] ||
2020
[[ ! ( "$(tail -1 OUT.ABACUS/running_nscf.log)" == " Total Time :"* ) ]]
2121
then
22-
echo "job is failed!"
22+
echo "job failed!"
2323
exit 1
2424
else
25-
echo "job is successed!"
25+
echo "job succeeded!"
2626
exit 0
2727
fi

0 commit comments

Comments
 (0)