Skip to content

Commit

Permalink
Fix: warning in #1939 and add documentations (#1939)
Browse files Browse the repository at this point in the history
* 1. fix warning

* 1. update input-main.md
  • Loading branch information
PeizeLin authored Feb 23, 2023
1 parent d59b860 commit ee0f651
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 46 deletions.
110 changes: 89 additions & 21 deletions docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
[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)
- [Exact exchange](#exact-exchange) (Under tests)

[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)
[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)
- [Molecular dynamics](#molecular-dynamics)

[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)
Expand All @@ -48,9 +48,12 @@
- [Variables useful for debugging](#variables-useful-for-debugging)

[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)
- [NAOs](#naos)

[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)
- [DeePKS](#deepks)

[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)
[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)
- [OFDFT: orbital free density functional theory](#ofdft-orbital-free-density-functional-theory)

[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)
Expand Down Expand Up @@ -1101,6 +1104,42 @@ These variables are used to control the calculation of DOS.

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

## NAOs

These variables are used to control the generation of numerical atomic orbitals (NAOs). NAOs is the linear combination of bessel functions.

### bessel_nao_ecut

- **Type**: Real
- **Description**: energy cutoff of bessel functions.
- **Default**: same as ecutwfc

### bessel_nao_tolerence

- **Type**: Real
- **Description**: tolerance when searching for the zeros of bessel functions.
- **Default**: 1.0e-12

### bessel_nao_rcut

- **Type**: Real
- **Description**: cutoff radius of bessel functions.
- **Default**: 6.0

### bessel_nao_smooth

- **Type**: Boolean
- **Description**: whether the bessel functions smooth at radius cutoff.
- **Default**: 1

### bessel_nao_sigma

- **Type**: Real
- **Description**: energy range for smooth. See also `bessel_nao_smooth`.
- **Default**: 0.1

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

## DeePKS

These variables are used to control the usage of DeePKS method (a comprehensive data-driven approach to improve the accuracy of DFT).
Expand All @@ -1119,13 +1158,6 @@ Warning: this function is not robust enough for the current version. Please try
NUMERICAL_DESCRIPTOR
jle.orb
```

NUMERICAL_DESCRIPTOR
jle.orb

```
```
- **Default**: 0

### deepks_scf
Expand All @@ -1146,18 +1178,36 @@ Warning: this function is not robust enough for the current version. Please try
- **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).
- **Default**: 2

### bessel_descriptor_rcut
### bessel_descriptor_ecut

- **Type**: Real
- **Description**: cutoff radius of bessel functions. See also `bessel_descriptor_lmax`.
- **Default**: 6.0
- **Description**: energy cutoff of bessel functions. See also `bessel_descriptor_lmax`.
- **Default**: same as ecutwfc

### bessel_descriptor_tolerence

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

### bessel_descriptor_rcut

- **Type**: Real
- **Description**: cutoff radius of bessel functions. See also `bessel_descriptor_lmax`.
- **Default**: 6.0

### bessel_descriptor_smooth

- **Type**: Boolean
- **Description**: whether the bessel functions smooth at radius cutoff. See also `bessel_descriptor_lmax`.
- **Default**: 1

### bessel_descriptor_sigma

- **Type**: Real
- **Description**: energy range for smooth. See also `bessel_descriptor_smooth`.
- **Default**: 0.1

### deepks_bandgap

- **Type**: Boolean
Expand Down Expand Up @@ -1366,19 +1416,19 @@ These variables are relevant when using hybrid functionals
### exx_hybrid_alpha

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

### exx_hse_omega

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

### exx_separate_loop

- **Type**: Boolean
- **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.
- **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)
- **Default**: 1

### exx_hybrid_step
Expand Down Expand Up @@ -1417,10 +1467,22 @@ These variables are relevant when using hybrid functionals
- **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.
- **Default**: 1E-4

### exx_c_grad_threshold

- **Type**: Real
- **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.
- **Default**: 1E-4

### exx_v_grad_threshold

- **Type**: Real
- **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.
- **Default**: 1E-1

### exx_schwarz_threshold

- **Type**: Real
- **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.
- **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)
- **Default**: 0

### exx_cauchy_threshold
Expand All @@ -1429,22 +1491,28 @@ These variables are relevant when using hybrid functionals
- **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.
- **Default**: 1E-7

### exx_cauchy_grad_threshold

- **Type**: Real
- **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.
- **Default**: 1E-7

### exx_ccp_threshold

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

### exx_ccp_rmesh_times

- **Type**: Real
- **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.
- **Default**: 10
- **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.
- **Default**: 1.5 if dft_functional==hse else 10

### exx_distribute_type

- **Type**: String
- **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.
- **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)
- **Default**: `htime`

### exx_opt_orb_lmax
Expand Down
4 changes: 2 additions & 2 deletions source/module_hamilt_pw/hamilt_pwdft/operator_pw/meta_pw.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class Meta<OperatorPW<FPTYPE, Device>> : public OperatorPW<FPTYPE, Device>
FPTYPE get_tpiba() const {return this->tpiba;}
const int * get_isk() const {return this->isk;}
const FPTYPE* get_vk() const {return this->vk;}
const int get_vk_row() const {return this->vk_row;}
const int get_vk_col() const {return this->vk_col;}
int get_vk_row() const {return this->vk_row;}
int get_vk_col() const {return this->vk_col;}
ModulePW::PW_Basis_K* get_wfcpw() const {return this->wfcpw;}

private:
Expand Down
12 changes: 6 additions & 6 deletions source/module_io/write_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,17 +417,17 @@ ModuleBase::GlobalFunc::OUTP(ofs, "out_bandgap", out_bandgap, "if true, print ou


ofs << "\n#Parameters (21.spherical bessel)" << std::endl;
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_nao_smooth", bessel_nao_smooth, "spherical bessel smooth or not");
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_nao_sigma", bessel_nao_sigma, "spherical bessel smearing_sigma");
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_nao_ecut", bessel_nao_ecut, "energy cutoff for spherical bessel functions(Ry)");
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_nao_rcut", bessel_nao_rcut, "radial cutoff for spherical bessel functions(a.u.)");
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_nao_tolerence",bessel_nao_tolerence, "tolerence for spherical bessel root");
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_nao_rcut", bessel_nao_rcut, "radial cutoff for spherical bessel functions(a.u.)");
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_nao_smooth", bessel_nao_smooth, "spherical bessel smooth or not");
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_nao_sigma", bessel_nao_sigma, "spherical bessel smearing_sigma");
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_lmax", bessel_descriptor_lmax, "lmax used in generating spherical bessel functions");
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_smooth", bessel_descriptor_smooth, "spherical bessel smooth or not");
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_sigma", bessel_descriptor_sigma, "spherical bessel smearing_sigma");
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_ecut", bessel_descriptor_ecut, "energy cutoff for spherical bessel functions(Ry)");
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_rcut", bessel_descriptor_rcut, "radial cutoff for spherical bessel functions(a.u.)");
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_tolerence", bessel_descriptor_tolerence, "tolerence for spherical bessel root");
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_rcut", bessel_descriptor_rcut, "radial cutoff for spherical bessel functions(a.u.)");
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_smooth", bessel_descriptor_smooth, "spherical bessel smooth or not");
ModuleBase::GlobalFunc::OUTP(ofs, "bessel_descriptor_sigma", bessel_descriptor_sigma, "spherical bessel smearing_sigma");

ofs.close();
return;
Expand Down
Loading

0 comments on commit ee0f651

Please sign in to comment.