Skip to content

Commit 5d7624c

Browse files
committed
update the name of parameters and polish the note in docs
1 parent 6a4357f commit 5d7624c

File tree

5 files changed

+37
-33
lines changed

5 files changed

+37
-33
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
- [nupdown](#nupdown)
6666
- [dft\_functional](#dft_functional)
6767
- [xc\_temperature](#xc_temperature)
68-
- [xc\_exch\_ext\_param](#xc_exch_ext_param)
69-
- [xc\_corr\_ext\_param](#xc_corr_ext_param)
68+
- [xc\_exch\_ext](#xc_exch_ext)
69+
- [xc\_corr\_ext](#xc_corr_ext)
7070
- [pseudo\_rcut](#pseudo_rcut)
7171
- [pseudo\_mesh](#pseudo_mesh)
7272
- [nspin](#nspin)
@@ -1062,19 +1062,23 @@ calculations.
10621062
- **Default**: 0.0
10631063
- **Unit**: Ry
10641064

1065-
### xc_exch_ext_param
1065+
### xc_exch_ext
10661066

10671067
- **Type**: Integer Real ...
10681068
- **Description**: Customized parameterization on the exchange part of XC functional. The first value should be the LibXC ID of the original functional, and latter values are extended parameters. Default values are those of Perdew-Burke-Ernzerhof (PBE) functional. For more information on LibXC ID of functionals, please refer to [LibXC](https://libxc.gitlab.io/functionals/). For parameters of functionals of interest, please refer to the source code of LibXC, such as PBE functional interface in LibXC: [gga_x_pbe.c](https://gitlab.com/libxc/libxc/-/blob/7.0.0/src/gga_x_pbe.c).
10691069
- **Default**: 101 0.8040 0.2195149727645171
1070-
- **Note**: Solely setting this keyword will take no effect on XC functionals. One should also set `dft_functional` to corresponding functional to apply the customized parameterization. For example, if you want to use the PBE functional with customized parameters, you should set `dft_functional` to `GGA_X_PBE+GGA_C_PBE` and `xc_exch_ext_param` to `101 0.8040 0.2195149727645171`.
1070+
- **Note**:
1071+
1. Solely setting this keyword will take no effect on XC functionals. One should also set `dft_functional` to corresponding functional to apply the customized parameterization. For example, if you want to use the PBE functional with customized parameters, you should set `dft_functional` to `GGA_X_PBE+GGA_C_PBE` and `xc_exch_ext` to `101 0.8040 0.2195149727645171`.
1072+
2. For functionals that do not have separate exchange and correlation parts, such as HSE06 whose corresponding LibXC notation is `HYB_GGA_XC_HSE06` and LibXC id is 428, you can set either `xc_exch_ext` or `xc_corr_ext` to `428 0.25 0.11 0.11` (which means 25% Hartree-Fock fraction, 0.11 as range-seperation) and leave the other one unset.
10711073

1072-
### xc_corr_ext_param
1074+
### xc_corr_ext
10731075

10741076
- **Type**: Integer Real ...
10751077
- **Description**: Customized parameterization on the correlation part of XC functional. The first value should be the LibXC ID of the original functional, and latter values are extended parameters. Default values are those of Perdew-Burke-Ernzerhof (PBE) functional. For more information on LibXC ID of functionals, please refer to [LibXC](https://libxc.gitlab.io/functionals/). For parameters of functionals of interest, please refer to the source code of LibXC, such as PBE functional interface in LibXC: [gga_c_pbe.c](https://gitlab.com/libxc/libxc/-/blob/7.0.0/src/gga_c_pbe.c).
10761078
- **Default**: 130 0.06672455060314922 0.031090690869654895034 1.0
1077-
- **Note**: Solely setting this keyword will take no effect on XC functionals. One should also set `dft_functional` to corresponding functional to apply the customized parameterization. For example, if you want to use the PBE functional with customized parameters, you should set `dft_functional` to `GGA_X_PBE+GGA_C_PBE` and `xc_corr_ext_param` to `130 0.06672455060314922 0.031090690869654895034 1.0`.
1079+
- **Note**:
1080+
1. Solely setting this keyword will take no effect on XC functionals. One should also set `dft_functional` to corresponding functional to apply the customized parameterization. For example, if you want to use the PBE functional with customized parameters, you should set `dft_functional` to `GGA_X_PBE+GGA_C_PBE` and `xc_corr_ext` to `130 0.06672455060314922 0.031090690869654895034 1.0`.
1081+
2. For functionals that do not have separate exchange and correlation parts, such as HSE06 whose corresponding LibXC notation is `HYB_GGA_XC_HSE06` and LibXC id is 428, you can set either `xc_exch_ext` or `xc_corr_ext` to `428 0.25 0.11 0.11` (which means 25% Hartree-Fock fraction, 0.11 as range-seperation) and leave the other one unset.
10781082

10791083
### pseudo_rcut
10801084

source/module_hamilt_general/module_xc/xc_functional_libxc.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,14 @@ const std::vector<double> external_xc_func_ext_params(const int id)
176176
{
177177
const std::map<int, std::vector<double>> mymap = {
178178
{
179-
PARAM.inp.xc_exch_ext_param[0],
180-
std::vector<double>(PARAM.inp.xc_exch_ext_param.begin()+1,
181-
PARAM.inp.xc_exch_ext_param.end())
179+
PARAM.inp.xc_exch_ext[0],
180+
std::vector<double>(PARAM.inp.xc_exch_ext.begin()+1,
181+
PARAM.inp.xc_exch_ext.end())
182182
},
183183
{
184-
PARAM.inp.xc_corr_ext_param[0],
185-
std::vector<double>(PARAM.inp.xc_corr_ext_param.begin()+1,
186-
PARAM.inp.xc_corr_ext_param.end())
184+
PARAM.inp.xc_corr_ext[0],
185+
std::vector<double>(PARAM.inp.xc_corr_ext.begin()+1,
186+
PARAM.inp.xc_corr_ext.end())
187187
}
188188
};
189189
auto it = mymap.find(id);

source/module_hamilt_general/module_xc/xc_functional_libxc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ namespace XC_Functional_Libxc
3939
* parameters are pre-defined in the code, which herein we call those are
4040
* "in-built" parameters. If the same functional ID is found in both in-built
4141
* and external parameters, the external parameters will overwrite the in-built ones.
42-
* The external parameters can be passed here by keywords xc_exch_ext_param and
43-
* xc_corr_ext_param in the input file. The expected format would be an XC ID
42+
* The external parameters can be passed here by keywords xc_exch_ext and
43+
* xc_corr_ext in the input file. The expected format would be an XC ID
4444
* followed by a list of parameters.
4545
*/
4646
extern std::vector<xc_func_type> init_func(const std::vector<int> &func_id,

source/module_io/read_input_item_elec_stru.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -256,22 +256,22 @@ void ReadInput::item_elec_stru()
256256
this->add_item(item);
257257
}
258258
{
259-
Input_Item item("xc_exch_ext_param");
259+
Input_Item item("xc_exch_ext");
260260
item.annotation = "placeholder for xcpnet exchange functional";
261261
item.read_value = [](const Input_Item& item, Parameter& para) {
262-
para.input.xc_exch_ext_param.resize(item.get_size());
262+
para.input.xc_exch_ext.resize(item.get_size());
263263
std::transform(item.str_values.begin(), item.str_values.end(),
264-
para.input.xc_exch_ext_param.begin(),
264+
para.input.xc_exch_ext.begin(),
265265
[](const std::string& str) { return std::stod(str); });
266266
};
267267
item.check_value = [](const Input_Item& item, const Parameter& para) {
268268
// at least one value should be set
269-
if (para.input.xc_exch_ext_param.empty())
269+
if (para.input.xc_exch_ext.empty())
270270
{
271-
ModuleBase::WARNING_QUIT("ReadInput", "xc_exch_ext_param should not be empty.");
271+
ModuleBase::WARNING_QUIT("ReadInput", "xc_exch_ext should not be empty.");
272272
}
273273
// the first value is actually an integer, not a double
274-
const double libxc_id_dbl = para.input.xc_exch_ext_param[0];
274+
const double libxc_id_dbl = para.input.xc_exch_ext[0];
275275
if (std::abs(libxc_id_dbl - std::round(libxc_id_dbl)) > 1.0e-6)
276276
{
277277
ModuleBase::WARNING_QUIT("ReadInput",
@@ -284,28 +284,28 @@ void ReadInput::item_elec_stru()
284284
"The first parameter (libxc id) should be a positive integer");
285285
}
286286
};
287-
sync_doublevec(input.xc_exch_ext_param,
288-
para.input.xc_exch_ext_param.size(),
287+
sync_doublevec(input.xc_exch_ext,
288+
para.input.xc_exch_ext.size(),
289289
0.0);
290290
this->add_item(item);
291291
}
292292
{
293-
Input_Item item("xc_corr_ext_param");
293+
Input_Item item("xc_corr_ext");
294294
item.annotation = "placeholder for xcpnet exchange functional";
295295
item.read_value = [](const Input_Item& item, Parameter& para) {
296-
para.input.xc_corr_ext_param.resize(item.get_size());
296+
para.input.xc_corr_ext.resize(item.get_size());
297297
std::transform(item.str_values.begin(), item.str_values.end(),
298-
para.input.xc_corr_ext_param.begin(),
298+
para.input.xc_corr_ext.begin(),
299299
[](const std::string& str) { return std::stod(str); });
300300
};
301301
item.check_value = [](const Input_Item& item, const Parameter& para) {
302302
// at least one value should be set
303-
if (para.input.xc_corr_ext_param.empty())
303+
if (para.input.xc_corr_ext.empty())
304304
{
305-
ModuleBase::WARNING_QUIT("ReadInput", "xc_corr_ext_param should not be empty.");
305+
ModuleBase::WARNING_QUIT("ReadInput", "xc_corr_ext should not be empty.");
306306
}
307307
// the first value is actually an integer, not a double
308-
const double libxc_id_dbl = para.input.xc_corr_ext_param[0];
308+
const double libxc_id_dbl = para.input.xc_corr_ext[0];
309309
if (std::abs(libxc_id_dbl - std::round(libxc_id_dbl)) > 1.0e-6)
310310
{
311311
ModuleBase::WARNING_QUIT("ReadInput",
@@ -318,8 +318,8 @@ void ReadInput::item_elec_stru()
318318
"The first parameter (libxc id) should be a positive integer");
319319
}
320320
};
321-
sync_doublevec(input.xc_corr_ext_param,
322-
para.input.xc_corr_ext_param.size(),
321+
sync_doublevec(input.xc_corr_ext,
322+
para.input.xc_corr_ext.size(),
323323
0.0);
324324
this->add_item(item);
325325
}

source/module_parameter/input_parameter.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -671,17 +671,17 @@ struct Input_para
671671
* src/maple2c/mgga_exc/mgga_x_m06l.c.
672672
*
673673
* There are 18 parameters for the exchange part, so the whole length of
674-
* the xc_exch_ext_param should be 19. (MGGA_X_M06L, id = 203)
674+
* the xc_exch_ext should be 19. (MGGA_X_M06L, id = 203)
675675
*
676676
* Likewise, the correlation part can be found in corresponding files.
677677
*
678678
* PBE functional is used as the default functional for XCPNet.
679679
*/
680680
// src/gga_x_pbe.c
681-
std::vector<double> xc_exch_ext_param = {
681+
std::vector<double> xc_exch_ext = {
682682
101, 0.8040, 0.2195149727645171};
683683
// src/gga_c_pbe.c
684-
std::vector<double> xc_corr_ext_param = {
684+
std::vector<double> xc_corr_ext = {
685685
130, 0.06672455060314922, 0.031090690869654895034, 1.00000};
686686
};
687687
#endif

0 commit comments

Comments
 (0)