Skip to content

Commit 8419964

Browse files
linpeizePeizeLin
andauthored
remove deprecated INPUT exx parameters (#6317)
* change INPUT exx_ for linear combination of coulomb_param * git revert a145293 * remove deprecated INPUT exx parameters * update read_input_ptest.cpp, read_input_item_test.cpp, integrate_tests/INPUT --------- Co-authored-by: linpz <[email protected]>
1 parent 5f96c22 commit 8419964

File tree

28 files changed

+658
-1016
lines changed

28 files changed

+658
-1016
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 53 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -263,26 +263,25 @@
263263
- [block\_up](#block_up)
264264
- [block\_height](#block_height)
265265
- [Exact Exchange (Common)](#exact-exchange-common)
266-
- [exx\_hybrid\_alpha](#exx_hybrid_alpha)
267-
- [exx\_hse\_omega](#exx_hse_omega)
266+
- [exx\_fock\_alpha](#exx_fock_alpha)
267+
- [exx\_erfc\_alpha](#exx_erfc_alpha)
268+
- [exx\_erfc\_omega](#exx_erfc_omega)
268269
- [exx\_separate\_loop](#exx_separate_loop)
269-
- [Exact Exchange (LCAO/LCAO in PW)](#exact-exchange-lcaolcao-in-pw)
270270
- [exx\_hybrid\_step](#exx_hybrid_step)
271271
- [exx\_mixing\_beta](#exx_mixing_beta)
272-
- [exx\_lambda](#exx_lambda)
272+
- [Exact Exchange (LCAO in PW)](#exact-exchange-lcao-in-pw)
273+
- [exx\_erfc\_lambda](#exx_erfc_lambda)
274+
- [Exact Exchange (LCAO)](#exact-exchange-lcao)
273275
- [exx\_pca\_threshold](#exx_pca_threshold)
274276
- [exx\_c\_threshold](#exx_c_threshold)
275277
- [exx\_v\_threshold](#exx_v_threshold)
276278
- [exx\_dm\_threshold](#exx_dm_threshold)
277279
- [exx\_c\_grad\_threshold](#exx_c_grad_threshold)
278280
- [exx\_v\_grad\_threshold](#exx_v_grad_threshold)
279-
- [exx\_schwarz\_threshold](#exx_schwarz_threshold)
280-
- [exx\_cauchy\_threshold](#exx_cauchy_threshold)
281-
- [exx\_cauchy\_force\_threshold](#exx_cauchy_force_threshold)
282-
- [exx\_cauchy\_stress\_threshold](#exx_cauchy_stress_threshold)
281+
- [exx\_c\_grad\_r\_threshold](#exx_c_grad_r_threshold)
282+
- [exx\_v\_grad\_r\_threshold](#exx_v_grad_r_threshold)
283283
- [exx\_ccp\_threshold](#exx_ccp_threshold)
284284
- [exx\_ccp\_rmesh\_times](#exx_ccp_rmesh_times)
285-
- [exx\_distribute\_type](#exx_distribute_type)
286285
- [exx\_opt\_orb\_lmax](#exx_opt_orb_lmax)
287286
- [exx\_opt\_orb\_ecut](#exx_opt_orb_ecut)
288287
- [exx\_opt\_orb\_tolerence](#exx_opt_orb_tolerence)
@@ -2774,18 +2773,34 @@ The following parameters apply to *[basis_type](#basis_type)==lcao/lcao_in_pw/pw
27742773

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

2777-
### exx_hybrid_alpha
2776+
### exx_fock_alpha
27782777

2779-
- **Type**: Real
2780-
- **Description**: fraction of Fock exchange in hybrid functionals, so that $E_{X}=\alpha E_{X}+(1-\alpha)E_{X,\text{LDA/GGA}}$
2778+
- **Type**: Real \[Real...\](optional)
2779+
- **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}}$
27812780
- **Default**:
27822781
- 1: if *[dft_functional](#dft_functional)==hf*
2783-
- 0.25: else
2782+
- 0.25: if *[dft_functional](#dft_functional)==pbe0*
2783+
- 0.2: if *[dft_functional](#dft_functional)==b3lyp*
2784+
- 0.25: if *[dft_functional](#dft_functional)==scan0*
2785+
- 1: if *[dft_functional](#dft_functional)==muller*
2786+
- 1: if *[dft_functional](#dft_functional)==power*
2787+
- 1: if *[dft_functional](#dft_functional)==wp22*
2788+
- 0: else
27842789

2785-
### exx_hse_omega
2790+
### exx_erfc_alpha
27862791

2787-
- **Type**: Real
2788-
- **Description**: range-separation parameter in HSE functional, such that $1/r=\text{erfc}(\omega r)/r+\text{erf}(\omega r)/r$
2792+
- **Type**: Real \[Real...\](optional)
2793+
- **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}}$
2794+
- **Default**:
2795+
- 0.25: if *[dft_functional](#dft_functional)==hse*
2796+
- 1: if *[dft_functional](#dft_functional)==cwp22*
2797+
- -1: if *[dft_functional](#dft_functional)==wp22*
2798+
- 0: else
2799+
2800+
### exx_erfc_omega
2801+
2802+
- **Type**: Real \[Real...\](optional)
2803+
- **Description**: range-separation parameter in exchange, such that $\frac{1}{r}=\frac{\text{erfc}(\omega r)}{r}+\frac{\text{erf}(\omega r)}{r}$
27892804
- **Default**: 0.11
27902805

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

2799-
## Exact Exchange (LCAO/LCAO in PW)
2800-
2801-
These variables are relevant when using hybrid functionals with *[basis_type](#basis_type)==lcao/lcao_in_pw*.
2802-
28032814
### exx_hybrid_step
28042815

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

2817-
### exx_lambda
2828+
## Exact Exchange (LCAO in PW)
28182829

2819-
- **Type**: Real
2830+
These variables are relevant when using hybrid functionals with *[basis_type](#basis_type)==lcao_in_pw*.
2831+
2832+
### exx_fock_lambda
2833+
2834+
- **Type**: Real \[Real...\](optional)
28202835
- **Availability**: *[basis_type](#basis_type)==lcao_in_pw*
28212836
- **Description**: It is used to compensate for divergence points at G=0 in the evaluation of Fock exchange using *lcao_in_pw* method.
28222837
- **Default**: 0.3
28232838

2839+
## Exact Exchange (LCAO)
2840+
2841+
These variables are relevant when using hybrid functionals with *[basis_type](#basis_type)==lcao*.
2842+
28242843
### exx_pca_threshold
28252844

28262845
- **Type**: Real
2827-
- **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.
2846+
- **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.
28282847
- **Default**: 1E-4
28292848

28302849
### exx_c_threshold
28312850

28322851
- **Type**: Real
2833-
- **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.
2852+
- **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.
28342853
- **Default**: 1E-4
28352854

28362855
### exx_v_threshold
28372856

28382857
- **Type**: Real
2839-
- **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.
2858+
- **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.
28402859
- **Default**: 1E-1
28412860

28422861
### exx_dm_threshold
28432862

28442863
- **Type**: Real
2845-
- **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.
2864+
- **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.
28462865
- **Default**: 1E-4
28472866

28482867
### exx_c_grad_threshold
28492868

28502869
- **Type**: Real
2851-
- **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.
2870+
- **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.
28522871
- **Default**: 1E-4
28532872

28542873
### exx_v_grad_threshold
28552874

28562875
- **Type**: Real
2857-
- **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.
2876+
- **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.
28582877
- **Default**: 1E-1
28592878

2860-
### exx_schwarz_threshold
2861-
2862-
- **Type**: Real
2863-
- **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)
2864-
- **Default**: 0
2865-
2866-
### exx_cauchy_threshold
2867-
2868-
- **Type**: Real
2869-
- **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.
2870-
- **Default**: 1E-7
2871-
2872-
### exx_cauchy_force_threshold
2879+
### exx_c_grad_r_threshold
28732880

28742881
- **Type**: Real
2875-
- **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.
2876-
- **Default**: 1E-7
2882+
- **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.
2883+
- **Default**: 1E-4
28772884

2878-
### exx_cauchy_stress_threshold
2885+
### exx_v_grad_r_threshold
28792886

28802887
- **Type**: Real
2881-
- **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.
2882-
- **Default**: 1E-7
2888+
- **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.
2889+
- **Default**: 1E-1
28832890

28842891
### exx_ccp_threshold
28852892

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

2899-
### exx_distribute_type
2900-
2901-
- **Type**: String
2902-
- **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`.
2903-
- `order`: Atom pairs are simply distributed by their orders.
2904-
- `htime`: The balance in time is achieved on each processor, hence if the memory is sufficient, this is the recommended method.
2905-
- `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)
2906-
- **Default**: `htime`
2907-
29082906
### exx_opt_orb_lmax
29092907

29102908
- **Type**: Integer

source/module_hamilt_general/module_xc/exx_info.h

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ struct Exx_Info
1515
{
1616
bool cal_exx = false;
1717

18-
std::unordered_map<Conv_Coulomb_Pot_K::Coulomb_Method,
19-
std::pair<bool,
20-
std::unordered_map<Conv_Coulomb_Pot_K::Coulomb_Type,
21-
std::vector<std::map<std::string,std::string>>>>> coulomb_settings;
18+
std::unordered_map<Conv_Coulomb_Pot_K::Coulomb_Type, std::vector<std::map<std::string,std::string>>> coulomb_param;
2219
// Fock:
2320
// "alpha": "0"
2421
// "Rcut_type": "limits" / "spencer"
@@ -55,10 +52,7 @@ struct Exx_Info
5552

5653
struct Exx_Info_RI
5754
{
58-
const std::unordered_map<Conv_Coulomb_Pot_K::Coulomb_Method,
59-
std::pair<bool,
60-
std::unordered_map<Conv_Coulomb_Pot_K::Coulomb_Type,
61-
std::vector<std::map<std::string,std::string>>>>> &coulomb_settings;
55+
const std::unordered_map<Conv_Coulomb_Pot_K::Coulomb_Type, std::vector<std::map<std::string,std::string>>> &coulomb_param;
6256

6357
bool real_number = false;
6458

@@ -67,20 +61,17 @@ struct Exx_Info
6761
double C_threshold = 0;
6862
double V_threshold = 0;
6963
double dm_threshold = 0;
70-
double cauchy_threshold = 0;
7164
double C_grad_threshold = 0;
7265
double V_grad_threshold = 0;
7366
double C_grad_R_threshold = 0;
7467
double V_grad_R_threshold = 0;
75-
double cauchy_force_threshold = 0;
76-
double cauchy_stress_threshold = 0;
7768
double ccp_rmesh_times = 10;
7869
double kmesh_times = 4;
7970

8071
int abfs_Lmax = 0; // tmp
8172

8273
Exx_Info_RI(const Exx_Info::Exx_Info_Global& info_global)
83-
: coulomb_settings(info_global.coulomb_settings)
74+
: coulomb_param(info_global.coulomb_param)
8475
{
8576
}
8677
};

source/module_hamilt_general/module_xc/xc_functional_libxc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ const std::vector<double> in_built_xc_func_ext_params(const int id)
170170
GlobalC::exx_info.info_global.hse_omega};
171171
// short-range of B88_X
172172
case XC_GGA_X_ITYH:
173-
return {PARAM.inp.exx_hse_omega};
173+
return {GlobalC::exx_info.info_global.hse_omega};
174174
// short-range of LYP_C
175175
case XC_GGA_C_LYPR:
176176
return {0.04918, 0.132, 0.2533, 0.349,
177-
0.35/2.29, 2.0/2.29, PARAM.inp.exx_hse_omega};
177+
0.35/2.29, 2.0/2.29, GlobalC::exx_info.info_global.hse_omega};
178178
#endif
179179
default:
180180
return std::vector<double>{};

0 commit comments

Comments
 (0)