Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 53 additions & 55 deletions docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,26 +263,25 @@
- [block\_up](#block_up)
- [block\_height](#block_height)
- [Exact Exchange (Common)](#exact-exchange-common)
- [exx\_hybrid\_alpha](#exx_hybrid_alpha)
- [exx\_hse\_omega](#exx_hse_omega)
- [exx\_fock\_alpha](#exx_fock_alpha)
- [exx\_erfc\_alpha](#exx_erfc_alpha)
- [exx\_erfc\_omega](#exx_erfc_omega)
- [exx\_separate\_loop](#exx_separate_loop)
- [Exact Exchange (LCAO/LCAO in PW)](#exact-exchange-lcaolcao-in-pw)
- [exx\_hybrid\_step](#exx_hybrid_step)
- [exx\_mixing\_beta](#exx_mixing_beta)
- [exx\_lambda](#exx_lambda)
- [Exact Exchange (LCAO in PW)](#exact-exchange-lcao-in-pw)
- [exx\_erfc\_lambda](#exx_erfc_lambda)
- [Exact Exchange (LCAO)](#exact-exchange-lcao)
- [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\_c\_grad\_threshold](#exx_c_grad_threshold)
- [exx\_v\_grad\_threshold](#exx_v_grad_threshold)
- [exx\_schwarz\_threshold](#exx_schwarz_threshold)
- [exx\_cauchy\_threshold](#exx_cauchy_threshold)
- [exx\_cauchy\_force\_threshold](#exx_cauchy_force_threshold)
- [exx\_cauchy\_stress\_threshold](#exx_cauchy_stress_threshold)
- [exx\_c\_grad\_r\_threshold](#exx_c_grad_r_threshold)
- [exx\_v\_grad\_r\_threshold](#exx_v_grad_r_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)
Expand Down Expand Up @@ -2774,18 +2773,34 @@ The following parameters apply to *[basis_type](#basis_type)==lcao/lcao_in_pw/pw

**Availablity**: *[dft_functional](#dft_functional)==hse/hf/pbe0/scan0/opt_orb* or *[rpa](#rpa)==True*.

### exx_hybrid_alpha
### exx_fock_alpha

- **Type**: Real
- **Description**: fraction of Fock exchange in hybrid functionals, so that $E_{X}=\alpha E_{X}+(1-\alpha)E_{X,\text{LDA/GGA}}$
- **Type**: Real \[Real...\](optional)
- **Description**: fraction of Fock exchange $\frac{1}{r}$ in hybrid functionals, so that $E_{X} = \alpha E_{X} + (1-\alpha)E_{X,\text{LDA/GGA}}$
- **Default**:
- 1: if *[dft_functional](#dft_functional)==hf*
- 0.25: else
- 0.25: if *[dft_functional](#dft_functional)==pbe0*
- 0.2: if *[dft_functional](#dft_functional)==b3lyp*
- 0.25: if *[dft_functional](#dft_functional)==scan0*
- 1: if *[dft_functional](#dft_functional)==muller*
- 1: if *[dft_functional](#dft_functional)==power*
- 1: if *[dft_functional](#dft_functional)==wp22*
- 0: else

### exx_hse_omega
### exx_erfc_alpha

- **Type**: Real
- **Description**: range-separation parameter in HSE functional, such that $1/r=\text{erfc}(\omega r)/r+\text{erf}(\omega r)/r$
- **Type**: Real \[Real...\](optional)
- **Description**: fraction of exchange $\frac{\text{erfc}(\omega r)}{r}$ in hybrid functionals, so that $E_{X} = \alpha E_{X}^{\text{SR}} + (1-\alpha)E_{X,\text{LDA/GGA}}^{\text{SR}} + E_{X,\text{LDA/GGA}}^{\text{LR}}$
- **Default**:
- 0.25: if *[dft_functional](#dft_functional)==hse*
- 1: if *[dft_functional](#dft_functional)==cwp22*
- -1: if *[dft_functional](#dft_functional)==wp22*
- 0: else

### exx_erfc_omega

- **Type**: Real \[Real...\](optional)
- **Description**: range-separation parameter in exchange, such that $\frac{1}{r}=\frac{\text{erfc}(\omega r)}{r}+\frac{\text{erf}(\omega r)}{r}$
- **Default**: 0.11

### exx_separate_loop
Expand All @@ -2796,10 +2811,6 @@ The following parameters apply to *[basis_type](#basis_type)==lcao/lcao_in_pw/pw
- True: 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.
- **Default**: True

## Exact Exchange (LCAO/LCAO in PW)

These variables are relevant when using hybrid functionals with *[basis_type](#basis_type)==lcao/lcao_in_pw*.

### exx_hybrid_step

- **Type**: Integer
Expand All @@ -2814,72 +2825,68 @@ These variables are relevant when using hybrid functionals with *[basis_type](#b
- **Description**: mixing_beta for densty matrix in each iteration of the outer-loop
- **Default**: 1.0

### exx_lambda
## Exact Exchange (LCAO in PW)

- **Type**: Real
These variables are relevant when using hybrid functionals with *[basis_type](#basis_type)==lcao_in_pw*.

### exx_fock_lambda

- **Type**: Real \[Real...\](optional)
- **Availability**: *[basis_type](#basis_type)==lcao_in_pw*
- **Description**: It is used to compensate for divergence points at G=0 in the evaluation of Fock exchange using *lcao_in_pw* method.
- **Default**: 0.3

## Exact Exchange (LCAO)

These variables are relevant when using hybrid functionals with *[basis_type](#basis_type)==lcao*.

### exx_pca_threshold

- **Type**: Real
- **Description**: To accelerate the evaluation of four-center integrals ($ik|jl$), the product of atomic orbitals are expanded in the basis of auxiliary basis functions (ABF): $\Phi_{i}\Phi_{j}\sim C^{k}_{ij}P_{k}$. The size of the ABF (i.e. number of $P_{k}$) is reduced using principal component analysis. When a large PCA threshold is used, the number of ABF will be reduced, hence the calculation becomes faster. However, this comes at the cost of computational accuracy. A relatively safe choice of the value is 1e-4.
- **Description**: To accelerate the evaluation of four-center integrals ($ik|jl$), the product of atomic orbitals are expanded in the basis of auxiliary basis functions (ABF): $\Phi_{i}\Phi_{k}\sim \sum_{a} C^{a}_{ik}P_{a}$. The size of the ABF (i.e. number of $P_{a}$) is reduced using principal component analysis. When a large PCA threshold is used, the number of ABF will be reduced, hence the calculation becomes faster. However, this comes at the cost of computational accuracy. A relatively safe choice of the value is 1e-4.
- **Default**: 1E-4

### exx_c_threshold

- **Type**: Real
- **Description**: See also the entry [exx_pca_threshold](#exx_pca_threshold). Smaller components (less than exx_c_threshold) of the $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.
- **Description**: See also the entry [exx_pca_threshold](#exx_pca_threshold). Smaller components (less than exx_c_threshold) of the $C^{a}_{ik}$ 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_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. 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.
- **Description**: See also the entry [exx_pca_threshold](#exx_pca_threshold). With the approximation $\Phi_{i}\Phi_{k}\sim \sum_{a} C^{a}_{ik}P_{a}$, the four-center integral in Fock exchange is expressed as $(ik|jl)=\sum_{a,b}C^{a}_{ik}V_{ab}C^{b}_{jl}$, where $V_{ab}=(P_{a}|P_{b})$ is a double-center integral. 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_dm_threshold

- **Type**: Real
- **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.
- **Description**: The Fock exchange can be expressed as $\sum_{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.
- **Description**: See also the entry [exx_pca_threshold](#exx_pca_threshold). $\nabla C^{a}_{ik}$ is used in force. Smaller components (less than exx_c_grad_threshold) of the $\nabla C^{a}_{ik}$ 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.
- **Description**: See also the entry [exx_pca_threshold](#exx_pca_threshold). With the approximation $\Phi_{i}\Phi_{k}\sim C^{a}_{ik}P_{a}$, the four-center integral in Fock exchange is expressed as $(ik|jl)=\sum_{a,b}C^{a}_{ik}V_{ab}C^{b}_{jl}$, where $V_{ab}=(P_{a}|P_{b})$ is a double-center integral. $\nabla V_{ab}$ is used in force. 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. (Currently not used)
- **Default**: 0

### exx_cauchy_threshold

- **Type**: Real
- **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_force_threshold
### exx_c_grad_r_threshold

- **Type**: Real
- **Description**: In practice the Fock exchange matrix in force 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_force_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
- **Description**: See also the entry [exx_pca_threshold](#exx_pca_threshold). $\nabla C^{a}_{ik} * R_{ik}$ is used in stress. Smaller components (less than exx_c_grad_r_threshold) of the $\nabla C^{a}_{ik} * R_{ik}$ 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_cauchy_stress_threshold
### exx_v_grad_r_threshold

- **Type**: Real
- **Description**: In practice the Fock exchange matrix in 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_stress_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
- **Description**: See also the entry [exx_pca_threshold](#exx_pca_threshold). With the approximation $\Phi_{i}\Phi_{k}\sim C^{a}_{ik}P_{a}$, the four-center integral in Fock exchange is expressed as $(ik|jl)=\sum_{a,b}C^{a}_{ik}V_{ab}C^{b}_{jl}$, where $V_{ab}=(P_{a}|P_{b})$ is a double-center integral. $\nabla V_{ab} *R_{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_ccp_threshold

Expand All @@ -2896,15 +2903,6 @@ These variables are relevant when using hybrid functionals with *[basis_type](#b
- 1.5: if *[dft_functional](#dft_functional)==hse/cwp22*
- 1: else

### exx_distribute_type

- **Type**: String
- **Description**: When running in parallel, the evaluation of Fock exchange is done by distributing atom pairs on different processes, then gather the results. exx_distribute_type governs the mechanism of distribution. Available options are `htime`, `order`, `kmean1` and `kmeans2`.
- `order`: Atom pairs are simply distributed by their orders.
- `htime`: The balance in time is achieved on each processor, hence if the memory is sufficient, this is the recommended method.
- `kmeans1` , `kmeans2`: 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

- **Type**: Integer
Expand Down
15 changes: 3 additions & 12 deletions source/module_hamilt_general/module_xc/exx_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ struct Exx_Info
{
bool cal_exx = false;

std::unordered_map<Conv_Coulomb_Pot_K::Coulomb_Method,
std::pair<bool,
std::unordered_map<Conv_Coulomb_Pot_K::Coulomb_Type,
std::vector<std::map<std::string,std::string>>>>> coulomb_settings;
std::unordered_map<Conv_Coulomb_Pot_K::Coulomb_Type, std::vector<std::map<std::string,std::string>>> coulomb_param;
// Fock:
// "alpha": "0"
// "Rcut_type": "limits" / "spencer"
Expand Down Expand Up @@ -55,10 +52,7 @@ struct Exx_Info

struct Exx_Info_RI
{
const std::unordered_map<Conv_Coulomb_Pot_K::Coulomb_Method,
std::pair<bool,
std::unordered_map<Conv_Coulomb_Pot_K::Coulomb_Type,
std::vector<std::map<std::string,std::string>>>>> &coulomb_settings;
const std::unordered_map<Conv_Coulomb_Pot_K::Coulomb_Type, std::vector<std::map<std::string,std::string>>> &coulomb_param;

bool real_number = false;

Expand All @@ -67,20 +61,17 @@ struct Exx_Info
double C_threshold = 0;
double V_threshold = 0;
double dm_threshold = 0;
double cauchy_threshold = 0;
double C_grad_threshold = 0;
double V_grad_threshold = 0;
double C_grad_R_threshold = 0;
double V_grad_R_threshold = 0;
double cauchy_force_threshold = 0;
double cauchy_stress_threshold = 0;
double ccp_rmesh_times = 10;
double kmesh_times = 4;

int abfs_Lmax = 0; // tmp

Exx_Info_RI(const Exx_Info::Exx_Info_Global& info_global)
: coulomb_settings(info_global.coulomb_settings)
: coulomb_param(info_global.coulomb_param)
{
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ const std::vector<double> in_built_xc_func_ext_params(const int id)
GlobalC::exx_info.info_global.hse_omega};
// short-range of B88_X
case XC_GGA_X_ITYH:
return {PARAM.inp.exx_hse_omega};
return {GlobalC::exx_info.info_global.hse_omega};
// short-range of LYP_C
case XC_GGA_C_LYPR:
return {0.04918, 0.132, 0.2533, 0.349,
0.35/2.29, 2.0/2.29, PARAM.inp.exx_hse_omega};
0.35/2.29, 2.0/2.29, GlobalC::exx_info.info_global.hse_omega};
#endif
default:
return std::vector<double>{};
Expand Down
Loading
Loading