Skip to content

Commit ee0f651

Browse files
authored
Fix: warning in #1939 and add documentations (#1939)
* 1. fix warning * 1. update input-main.md
1 parent d59b860 commit ee0f651

File tree

5 files changed

+114
-46
lines changed

5 files changed

+114
-46
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 89 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
[dos_edelta_ev](#dos_edelta_ev) | [dos_sigma](#dos_sigma) | [dos_scale](#dos_scale) | [dos_emin_ev](#dos_emin_ev) | [dos_emax_ev](#dos_emax_ev) | [dos_nche](#dos_nche)
3030
- [Exact exchange](#exact-exchange) (Under tests)
3131

32-
[exx_hybrid_alpha](#exx_hybrid_alpha) | [exx_hse_omega](#exx_hse_omega) | [exx_separate_loop](#exx_separate_loop) | [exx_hybrid_step](#exx_hybrid_step) | [exx_lambda](#exx_lambda) | [exx_pca_threshold](#exx_pca_threshold) | [exx_c_threshold](#exx_c_threshold) | [exx_v_threshold](#exx_v_threshold) | [exx_dm_threshold](#exx_dm_threshold) | [exx_schwarz_threshold](#exx_schwarz_threshold) | [exx_cauchy_threshold](#exx_cauchy_threshold) | [exx_ccp_threshold](#exx_ccp_threshold) | [exx_ccp_rmesh_times](#exx_ccp_rmesh_times) | [exx_distribute_type](#exx_distribute_type) | [exx_opt_orb_lmax](#exx_opt_orb_lmax) | [exx_opt_orb_ecut](#exx_opt_orb_ecut) | [exx_opt_orb_tolerence](#exx_opt_orb_tolerence)
32+
[exx_hybrid_alpha](#exx_hybrid_alpha) | [exx_hse_omega](#exx_hse_omega) | [exx_separate_loop](#exx_separate_loop) | [exx_hybrid_step](#exx_hybrid_step) | [exx_lambda](#exx_lambda) | [exx_pca_threshold](#exx_pca_threshold) | [exx_c_threshold](#exx_c_threshold) | [exx_v_threshold](#exx_v_threshold) | [exx_c_grad_threshold](#exx_c_grad_threshold) | [exx_v_grad_threshold](#exx_v_grad_threshold) | [exx_dm_threshold](#exx_dm_threshold) | [exx_schwarz_threshold](#exx_schwarz_threshold) | [exx_cauchy_threshold](#exx_cauchy_threshold) | [exx_cauchy_grad_threshold](#exx_cauchy_grad_threshold) | [exx_ccp_threshold](#exx_ccp_threshold) | [exx_ccp_rmesh_times](#exx_ccp_rmesh_times) | [exx_distribute_type](#exx_distribute_type) | [exx_opt_orb_lmax](#exx_opt_orb_lmax) | [exx_opt_orb_ecut](#exx_opt_orb_ecut) | [exx_opt_orb_tolerence](#exx_opt_orb_tolerence) | [exx_real_number](#exx_real_number)
3333
- [Molecular dynamics](#molecular-dynamics)
3434

3535
[md_type](#md_type) | [md_thermostat](#md_thermostat) | [md_nstep](#md_nstep) | [md_restart](#md_restart) | [md_dt](#md_dt) | [md_tfirst, md_tlast](#md_tfirst-md_tlast) | [md_dumpfreq](#md_dumpfreq) | [md_restartfreq](#md_restartfreq) | [md_seed](#md_seed) | [md_tfreq](#md_tfreq) | [md_tchain](#md_tchain) | [md_pmode](#md_pmode) | [md_pcouple](#md_pcouple) | [md_pfirst, md_plast](#md_pfirst-md_plast) | [md_pfreq](#md_pfreq) | [md_pchain](#md_pchain) | [lj_rcut](#lj_rcut) | [lj_epsilon](#lj_epsilon) | [lj_sigma](#lj_sigma) | [pot_file](#pot_file) | [msst_direction](#msst_direction) | [msst_vel](#msst_vel) | [msst_vis](#msst_vis) | [msst_tscale](#msst_tscale) | [msst_qmass](#msst_qmass) | [md_damp](#md_damp) | [md_tolerance](#md_tolerance) | [md_nraise](#md_nraise)
@@ -48,9 +48,12 @@
4848
- [Variables useful for debugging](#variables-useful-for-debugging)
4949

5050
[nurse](#nurse) | [t_in_h](#t_in_h) | [vl_in_h](#vl_in_h) | [vnl_in_h](#vnl_in_h) | [vh_in_h](#vh_in_h) | [vion_in_h](#vion_in_h) | [test_force](#test_force) | [test_stress](#test_stress) | [colour](#colour) | [test_skip_ewald](#test_skip_ewald)
51+
- [NAOs](#naos)
52+
53+
[bessel_nao_ecut](#bessel_nao_ecut) | [bessel_nao_tolerence](#bessel_nao_tolerence) | [bessel_nao_rcut](#bessel_nao_rcut) | [bessel_nao_smooth](#bessel_nao_smooth) | [bessel_nao_sigma](#bessel_nao_sigma)
5154
- [DeePKS](#deepks)
5255

53-
[deepks_out_labels](#deepks_out_labels) | [deepks_scf](#deepks_scf) | [deepks_model](#deepks_model) | [bessel_descriptor_lmax](#bessel_descriptor_lmax) | [bessel_descriptor_rcut](#bessel_descriptor_rcut) | [bessel_descriptor_tolerence](#bessel_descriptor_tolerence) | [deepks_bandgap](#deepks_bandgap) | [deepks_out_unittest](#deepks_out_unittest)
56+
[deepks_out_labels](#deepks_out_labels) | [deepks_scf](#deepks_scf) | [deepks_model](#deepks_model) | [bessel_descriptor_lmax](#bessel_descriptor_lmax) | [bessel_descriptor_ecut](#bessel_descriptor_ecut) | [bessel_descriptor_tolerence](#bessel_descriptor_tolerence) | [bessel_descriptor_rcut](#bessel_descriptor_rcut) | [bessel_descriptor_smooth](#bessel_descriptor_smooth) | [bessel_descriptor_sigma](#bessel_descriptor_sigma) | [deepks_bandgap](#deepks_bandgap) | [deepks_out_unittest](#deepks_out_unittest)
5457
- [OFDFT: orbital free density functional theory](#ofdft-orbital-free-density-functional-theory)
5558

5659
[of_kinetic](#of_kinetic) | [of_method](#of_method) | [of_conv](#of_conv) | [of_tole](#of_tole) | [of_tolp](#of_tolp) | [of_tf_weight](#of_tf_weight) | [of_vw_weight](#of_vw_weight) | [of_wt_alpha](#of_wt_alpha) | [of_wt_beta](#of_wt_beta) | [of_wt_rho0](#of_wt_rho0) | [of_hold_rho0](#of_hold_rho0) | [of_read_kernel](#of_read_kernel) | [of_kernel_file](#of_kernel_file) | [of_full_pw](#of_full_pw) | [of_full_pw_dim](#of_full_pw_dim)
@@ -1101,6 +1104,42 @@ These variables are used to control the calculation of DOS.
11011104

11021105
[back to top](#full-list-of-input-keywords)
11031106

1107+
## NAOs
1108+
1109+
These variables are used to control the generation of numerical atomic orbitals (NAOs). NAOs is the linear combination of bessel functions.
1110+
1111+
### bessel_nao_ecut
1112+
1113+
- **Type**: Real
1114+
- **Description**: energy cutoff of bessel functions.
1115+
- **Default**: same as ecutwfc
1116+
1117+
### bessel_nao_tolerence
1118+
1119+
- **Type**: Real
1120+
- **Description**: tolerance when searching for the zeros of bessel functions.
1121+
- **Default**: 1.0e-12
1122+
1123+
### bessel_nao_rcut
1124+
1125+
- **Type**: Real
1126+
- **Description**: cutoff radius of bessel functions.
1127+
- **Default**: 6.0
1128+
1129+
### bessel_nao_smooth
1130+
1131+
- **Type**: Boolean
1132+
- **Description**: whether the bessel functions smooth at radius cutoff.
1133+
- **Default**: 1
1134+
1135+
### bessel_nao_sigma
1136+
1137+
- **Type**: Real
1138+
- **Description**: energy range for smooth. See also `bessel_nao_smooth`.
1139+
- **Default**: 0.1
1140+
1141+
[back to top](#full-list-of-input-keywords)
1142+
11041143
## DeePKS
11051144

11061145
These variables are used to control the usage of DeePKS method (a comprehensive data-driven approach to improve the accuracy of DFT).
@@ -1119,13 +1158,6 @@ Warning: this function is not robust enough for the current version. Please try
11191158
NUMERICAL_DESCRIPTOR
11201159
jle.orb
11211160
```
1122-
1123-
NUMERICAL_DESCRIPTOR
1124-
jle.orb
1125-
1126-
```
1127-
1128-
```
11291161
- **Default**: 0
11301162

11311163
### deepks_scf
@@ -1146,18 +1178,36 @@ Warning: this function is not robust enough for the current version. Please try
11461178
- **Description**: the projectors used in DeePKS are bessel functions. To generate such projectors, set calculation type to `gen_bessel` and run ABACUS. The lmax of Bessel functions is specified using bessel_descriptor_lmax. See also [calculation](#calculation).
11471179
- **Default**: 2
11481180

1149-
### bessel_descriptor_rcut
1181+
### bessel_descriptor_ecut
11501182

11511183
- **Type**: Real
1152-
- **Description**: cutoff radius of bessel functions. See also `bessel_descriptor_lmax`.
1153-
- **Default**: 6.0
1184+
- **Description**: energy cutoff of bessel functions. See also `bessel_descriptor_lmax`.
1185+
- **Default**: same as ecutwfc
11541186

11551187
### bessel_descriptor_tolerence
11561188

11571189
- **Type**: Real
11581190
- **Description**: tolerance when searching for the zeros of bessel functions. See also `bessel_descriptor_lmax`.
11591191
- **Default**: 1.0e-12
11601192

1193+
### bessel_descriptor_rcut
1194+
1195+
- **Type**: Real
1196+
- **Description**: cutoff radius of bessel functions. See also `bessel_descriptor_lmax`.
1197+
- **Default**: 6.0
1198+
1199+
### bessel_descriptor_smooth
1200+
1201+
- **Type**: Boolean
1202+
- **Description**: whether the bessel functions smooth at radius cutoff. See also `bessel_descriptor_lmax`.
1203+
- **Default**: 1
1204+
1205+
### bessel_descriptor_sigma
1206+
1207+
- **Type**: Real
1208+
- **Description**: energy range for smooth. See also `bessel_descriptor_smooth`.
1209+
- **Default**: 0.1
1210+
11611211
### deepks_bandgap
11621212

11631213
- **Type**: Boolean
@@ -1366,19 +1416,19 @@ These variables are relevant when using hybrid functionals
13661416
### exx_hybrid_alpha
13671417

13681418
- **Type**: Real
1369-
- **Description**: fraction of Fock exchange in hybrid functionals, so that $E_{X}=\alpha F_{X}+(1-\alpha)E_{X,LDA/GGA}$
1370-
- **Default**: 0.25
1419+
- **Description**: fraction of Fock exchange in hybrid functionals, so that $E_{X}=\alpha E_{X}+(1-\alpha)E_{X,\text{LDA/GGA}}$
1420+
- **Default**: 1 if dft_functional==hf else 0.25
13711421

13721422
### exx_hse_omega
13731423

13741424
- **Type**: Real
1375-
- **Description**: range-separation parameter in HSE functional, such that $1/r=erfc(\omega r)/r+erf(\omega r)/r$.
1425+
- **Description**: range-separation parameter in HSE functional, such that $1/r=\text{erfc}(\omega r)/r+\text{erf}(\omega r)/r$.
13761426
- **Default**: 0.11
13771427

13781428
### exx_separate_loop
13791429

13801430
- **Type**: Boolean
1381-
- **Description**: There are two types of iterative approaches provided by ABACUS to evaluate Fock exchange. If this parameter is set to 0, it will start with a GGA-Loop, and then Hybrid-Loop, in which EXX Hamiltonian $H_{exx}$ is updated with electronic iterations. If this parameter is set to 1, a two-step method is employed, i.e. in the inner iterations, density matrix is updated, while in the outer iterations, $H_{exx}$ is calculated based on density matrix that converges in the inner iteration.
1431+
- **Description**: There are two types of iterative approaches provided by ABACUS to evaluate Fock exchange. If this parameter is set to 0, it will start with a GGA-Loop, and then Hybrid-Loop, in which EXX Hamiltonian $H_{exx}$ is updated with electronic iterations. If this parameter is set to 1, a two-step method is employed, i.e. in the inner iterations, density matrix is updated, while in the outer iterations, $H_{exx}$ is calculated based on density matrix that converges in the inner iteration. (Currently not used)
13821432
- **Default**: 1
13831433

13841434
### exx_hybrid_step
@@ -1417,10 +1467,22 @@ These variables are relevant when using hybrid functionals
14171467
- **Description**: The Fock exchange can be expressed as $\Sigma_{k,l}(ik|jl)D_{kl}$ where D is the density matrix. Smaller values of the density matrix can be truncated to accelerate calculation. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 1e-4.
14181468
- **Default**: 1E-4
14191469

1470+
### exx_c_grad_threshold
1471+
1472+
- **Type**: Real
1473+
- **Description**: See also the entry [exx_pca_threshold](#exx_pca_threshold). $\nabla C^{k}_{ij}$ is used in force and stress. Smaller components (less than exx_c_grad_threshold) of the $\nabla C^{k}_{ij}$ matrix are neglected to accelerate calculation. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 1e-4.
1474+
- **Default**: 1E-4
1475+
1476+
### exx_v_grad_threshold
1477+
1478+
- **Type**: Real
1479+
- **Description**: See also the entry [exx_pca_threshold](#exx_pca_threshold). With the approximation $\Phi_{i}\Phi_{j}\sim C^{k}_{ij}P_{k}$, the four-center integral in Fock exchange is expressed as $(ik|jl)=\Sigma_{a,b}C^{a}_{ij}V_{ab}C^{b}_{kl}$, where $V_{ab}=(P_{a}|P_{b})$ is a double-center integral. $\nabla V_{ab}$ is used in force and stress. Smaller values of the V matrix can be truncated to accelerate calculation. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 0, i.e. no truncation.
1480+
- **Default**: 1E-1
1481+
14201482
### exx_schwarz_threshold
14211483

14221484
- **Type**: Real
1423-
- **Description**: In practice the four-center integrals are sparse, and using Cauchy-Schwartz inequality, we can find an upper bound of each integral before carrying out explicit evaluations. Those that are smaller than exx_schwarz_threshold will be truncated. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 1e-5.
1485+
- **Description**: In practice the four-center integrals are sparse, and using Cauchy-Schwartz inequality, we can find an upper bound of each integral before carrying out explicit evaluations. Those that are smaller than exx_schwarz_threshold will be truncated. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 1e-5. (Currently not used)
14241486
- **Default**: 0
14251487

14261488
### exx_cauchy_threshold
@@ -1429,22 +1491,28 @@ These variables are relevant when using hybrid functionals
14291491
- **Description**: In practice the Fock exchange matrix is sparse, and using Cauchy-Schwartz inequality, we can find an upper bound of each matrix element before carrying out explicit evaluations. Those that are smaller than exx_cauchy_threshold will be truncated. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 1e-7.
14301492
- **Default**: 1E-7
14311493

1494+
### exx_cauchy_grad_threshold
1495+
1496+
- **Type**: Real
1497+
- **Description**: In practice the Fock exchange matrix in force and stress is sparse, and using Cauchy-Schwartz inequality, we can find an upper bound of each matrix element before carrying out explicit evaluations. Those that are smaller than exx_cauchy_grad_threshold will be truncated. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 1e-7.
1498+
- **Default**: 1E-7
1499+
14321500
### exx_ccp_threshold
14331501

14341502
- **Type**: Real
1435-
- **Description**: It is related to the cutoff of on-site Coulomb potentials, currently not used.
1503+
- **Description**: It is related to the cutoff of on-site Coulomb potentials. (Currently not used)
14361504
- **Default**: 1e-8
14371505

14381506
### exx_ccp_rmesh_times
14391507

14401508
- **Type**: Real
1441-
- **Description**: This parameter determines how many times larger the radial mesh required for calculating Columb potential is to that of atomic orbitals. For HSE1, setting it to 1 is enough. But for PBE0, a much larger number must be used.
1442-
- **Default**: 10
1509+
- **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.
1510+
- **Default**: 1.5 if dft_functional==hse else 10
14431511

14441512
### exx_distribute_type
14451513

14461514
- **Type**: String
1447-
- **Description**: When running in parallel, the evaluation of Fock exchange is done by distributing atom pairs on different threads, then gather the results. exx_distribute_type governs the mechanism of distribution. Available options are `htime`, `order`, `kmean1` and `kmeans2`. `order` is where atom pairs are simply distributed by their orders. `hmeans` is a distribution where the balance in time is achieved on each processor, hence if the memory is sufficient, this is the recommended method. `kmeans1` and `kmeans2` are two methods where the k-means clustering method is used to reduce memory requirement. They might be necessary for very large systems.
1515+
- **Description**: When running in parallel, the evaluation of Fock exchange is done by distributing atom pairs on different threads, then gather the results. exx_distribute_type governs the mechanism of distribution. Available options are `htime`, `order`, `kmean1` and `kmeans2`. `order` is where atom pairs are simply distributed by their orders. `hmeans` is a distribution where the balance in time is achieved on each processor, hence if the memory is sufficient, this is the recommended method. `kmeans1` and `kmeans2` are two methods where the k-means clustering method is used to reduce memory requirement. They might be necessary for very large systems. (Currently not used)
14481516
- **Default**: `htime`
14491517

14501518
### exx_opt_orb_lmax

source/module_hamilt_pw/hamilt_pwdft/operator_pw/meta_pw.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class Meta<OperatorPW<FPTYPE, Device>> : public OperatorPW<FPTYPE, Device>
4141
FPTYPE get_tpiba() const {return this->tpiba;}
4242
const int * get_isk() const {return this->isk;}
4343
const FPTYPE* get_vk() const {return this->vk;}
44-
const int get_vk_row() const {return this->vk_row;}
45-
const int get_vk_col() const {return this->vk_col;}
44+
int get_vk_row() const {return this->vk_row;}
45+
int get_vk_col() const {return this->vk_col;}
4646
ModulePW::PW_Basis_K* get_wfcpw() const {return this->wfcpw;}
4747

4848
private:

source/module_io/write_input.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -417,17 +417,17 @@ ModuleBase::GlobalFunc::OUTP(ofs, "out_bandgap", out_bandgap, "if true, print ou
417417

418418

419419
ofs << "\n#Parameters (21.spherical bessel)" << std::endl;
420-
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_nao_smooth", bessel_nao_smooth, "spherical bessel smooth or not");
421-
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_nao_sigma", bessel_nao_sigma, "spherical bessel smearing_sigma");
422420
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_nao_ecut", bessel_nao_ecut, "energy cutoff for spherical bessel functions(Ry)");
423-
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_nao_rcut", bessel_nao_rcut, "radial cutoff for spherical bessel functions(a.u.)");
424421
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_nao_tolerence",bessel_nao_tolerence, "tolerence for spherical bessel root");
422+
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_nao_rcut", bessel_nao_rcut, "radial cutoff for spherical bessel functions(a.u.)");
423+
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_nao_smooth", bessel_nao_smooth, "spherical bessel smooth or not");
424+
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_nao_sigma", bessel_nao_sigma, "spherical bessel smearing_sigma");
425425
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_lmax", bessel_descriptor_lmax, "lmax used in generating spherical bessel functions");
426-
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_smooth", bessel_descriptor_smooth, "spherical bessel smooth or not");
427-
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_sigma", bessel_descriptor_sigma, "spherical bessel smearing_sigma");
428426
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_ecut", bessel_descriptor_ecut, "energy cutoff for spherical bessel functions(Ry)");
429-
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_rcut", bessel_descriptor_rcut, "radial cutoff for spherical bessel functions(a.u.)");
430427
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_tolerence", bessel_descriptor_tolerence, "tolerence for spherical bessel root");
428+
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_rcut", bessel_descriptor_rcut, "radial cutoff for spherical bessel functions(a.u.)");
429+
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_smooth", bessel_descriptor_smooth, "spherical bessel smooth or not");
430+
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_sigma", bessel_descriptor_sigma, "spherical bessel smearing_sigma");
431431

432432
ofs.close();
433433
return;

0 commit comments

Comments
 (0)