Skip to content

Commit 835a190

Browse files
authored
Merge pull request #859 from wenfei-li/develop
modify documentation, comment, and HSE input
2 parents c2b87a1 + 52aa186 commit 835a190

File tree

3 files changed

+45
-46
lines changed

3 files changed

+45
-46
lines changed

docs/input-main.md

Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -210,40 +210,33 @@ This part of variables are used to control general system parameters.
210210
#### dft_functional
211211

212212
- **Type**: String
213-
- **Description**: In our package, the XC functional can either be set explicitly using the dft_functional keyword as explained below, or set implicitly according to the XC functional information read from pseudopotential file. The user should ensure that the XC functional set in the INPUT file and the pseudopotential file are consistent. If more than one element is present in the system, make sure all of pseudopotentials have the same XC functional. **Currently only LDA and GGA are supported.**
214-
215-
To be specific, we briefly explain the format of the pseudopotential file and the key information it contains. There are a few lines in Si`s GGA pseudopotential file Si_ONCV_PBE-1.0.upf:
216-
217-
```
218-
...
219-
<PP_HEADER
220-
generated="Generated using ONCVPSP code by D. R. Hamann"
221-
author="Martin Schlipf and Francois Gygi"
222-
date="150105"
223-
comment=""
224-
element="Si"
225-
pseudo_type="NC"
226-
relativistic="scalar"
227-
is_ultrasoft="F"
228-
is_paw="F"
229-
is_coulomb="F"
230-
has_so="F"
231-
has_wfc="F"
232-
has_gipaw="F"
233-
core_correction="F"
234-
functional="PBE"
235-
z_valence=" 4.00"
236-
total_psenergy=" -3.74274958433E+00"
237-
rho_cutoff=" 6.01000000000E+00"
238-
```
239-
240-
Possible values of this variable are:
241-
- none: the functional is specified implicity by the input pseudopotential file
242-
- lda: Perdew-Zunger local density approximation
243-
- pbe: Perdew-Burke-Ernzerhof general gradient approximation
244-
245-
If the functional specified by the user is not consistent with the pseudopotential file, the program will stop with an error message.
246-
- **Default**: none
213+
- **Description**: type of exchange-correlation functional used in calculation. If dft_functional is not set, the program will adopt the functional used to generate pseudopotential files, provided all of them are generated using the same functional. For example, we present a few lines in Si’s GGA pseudopotential file Si_ONCV_PBE-1.0.upf:
214+
```
215+
...
216+
<PP_HEADER
217+
generated="Generated using ONCVPSP code by D. R. Hamann"
218+
author="Martin Schlipf and Francois Gygi"
219+
date="150105"
220+
comment=""
221+
element="Si"
222+
pseudo_type="NC"
223+
relativistic="scalar"
224+
is_ultrasoft="F"
225+
is_paw="F"
226+
is_coulomb="F"
227+
has_so="F"
228+
has_wfc="F"
229+
has_gipaw="F"
230+
core_correction="F"
231+
functional="PBE"
232+
z_valence=" 4.00"
233+
total_psenergy=" -3.74274958433E+00"
234+
rho_cutoff=" 6.01000000000E+00"
235+
```
236+
According to the information above, this pseudopotential is generated using PBE functional.
237+
On the other hand, if dft_functional is specified, it will overwrite the functional from pseudopotentials and performs calculation with whichever functional the user prefers. We further offer two ways of supplying exchange-correlation functional. The first is using 'short-hand' names such as 'LDA', 'PBE', 'SCAN'. A complete list of 'short-hand' expressions can be found in [source code](../source/module_xc/xc_functional.cpp). The other way is only available when ***compiling with LIBXC***, and it allows for supplying exchange-correlation functionals as combinations of LIBXC keywords for functional components, joined by plus sign, for example, 'dft_functional='LDA_X_1D_EXPONENTIAL+LDA_C_1D_CSC'. The list of LIBXC keywords can be found on its [website](https://www.tddft.org/programs/libxc/functionals/). In this way, **we support all the LDA,GGA and mGGA functionals provided by LIBXC**.
238+
We also provides (under test) two hybrid functionals: PBE0 and HSE. For more information about hybrid functionals, refer to the [section](#exact-exchange) on its input variables.
239+
- **Default**: same as UPF file.
247240

248241
#### pseudo_type
249242

@@ -975,6 +968,8 @@ This part of variables are used to control the molecular dynamics calculations.
975968
- 2: NVT ensemble with Langevin method;
976969
- 3: NVT ensemble with Anderson thermostat;
977970
- 4: MSST method;
971+
972+
***Note: when md_type is set to 1, md_tfreq is required to stablize temperature. It is an empirical parameter whose value is system-dependent, ranging from 1/(40\*md_dt) to 1/(100\*md_dt). An improper choice of its value might lead to failure of job.***
978973
- **Default**: 1
979974
980975
#### md_nstep

examples/hse-Si-example/INPUT

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ smearing_method smearing_method
1313
mixing_type pulay
1414

1515
dft_functional hse
16-
exx_separate_loop 0
17-
exx_pca_threshold 1E-3
18-
exx_ccp_rmesh_times 10
19-
exx_c_threshold 1E-4
20-
exx_dm_threshold 1E-3
21-
exx_schwarz_threshold 1E-4
22-
exx_cauchy_threshold 1E-6
23-
16+
exx_separate_loop 1
17+
exx_pca_threshold 1e-4
18+
exx_c_threshold 1e-4
19+
exx_dm_threshold 1e-4
20+
exx_schwarz_threshold 1e-5
21+
exx_cauchy_threshold 1e-7
22+
exx_ccp_rmesh_times 10

source/module_xc/xc_functional.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@ int XC_Functional::get_func_type()
1919
// for detail, refer to https://www.tddft.org/programs/libxc/functionals/
2020
void XC_Functional::set_xc_type(const std::string xc_func_in)
2121
{
22+
//Note : due to the separation of gcx_spin and gcc_spin,
23+
//when you are adding new GGA functionals,
24+
//please put exchange first, followed by correlation,
25+
//such as for PBE we have:
26+
// func_id.push_back(XC_GGA_X_PBE);
27+
// func_id.push_back(XC_GGA_C_PBE);
28+
2229
func_id.clear();
2330
std::string xc_func = xc_func_in;
2431
std::transform(xc_func.begin(), xc_func.end(), xc_func.begin(), (::toupper));
2532
if( xc_func == "LDA" || xc_func == "PZ" || xc_func == "SLAPZNOGXNOGC") //SLA+PZ
2633
{
27-
// I should use XC_LDA_X and XC_LDA_C_PZ here,
28-
// but since we are not compiling with libxc as default,
29-
// I chose to set it manually instead.
30-
// Same for the rest.
3134
func_id.push_back(XC_LDA_X);
3235
func_id.push_back(XC_LDA_C_PZ);
3336
func_type = 1;
@@ -102,6 +105,7 @@ void XC_Functional::set_xc_type(const std::string xc_func_in)
102105
func_id.push_back(XC_MGGA_X_SCAN);
103106
func_id.push_back(XC_MGGA_C_SCAN);
104107
func_type = 3;
108+
use_libxc = true;
105109
}
106110
#endif
107111
else if( xc_func == "PBE0")
@@ -128,6 +132,7 @@ void XC_Functional::set_xc_type(const std::string xc_func_in)
128132
#ifdef USE_LIBXC
129133
//see if it matches libxc functionals
130134
set_xc_type_libxc(xc_func);
135+
use_libxc = true;
131136
#else
132137
std::cout << "functional name not recognized!" << std::endl;
133138
#endif

0 commit comments

Comments
 (0)