Skip to content

Commit d65fdca

Browse files
authored
Feature: Implement ext-WT KEDF for OFDFT (#7231)
* Feature: Implement ext-WT KEDF * Refactor: Remove useless parameter of_wt_rho0 from KEDF_ExtWT * Doc: Update doc * Test: Add an integrate test 07_OFDFT/34_OF_KE_extWT for ext-WT KEDF * Doc: Update several annotation * Fix: Enhance the code according to the suggestions of copilot * Fix: add `delete this->xwm_;` to kedf_manager.h * Fix: Add check to the denominator.
1 parent 754e7eb commit d65fdca

15 files changed

Lines changed: 770 additions & 16 deletions

File tree

docs/advanced/input_files/input-main.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@
232232
- [of\_vw\_weight](#of_vw_weight)
233233
- [of\_wt\_alpha](#of_wt_alpha)
234234
- [of\_wt\_beta](#of_wt_beta)
235+
- [of\_extwt\_kappa](#of_extwt_kappa)
235236
- [of\_wt\_rho0](#of_wt_rho0)
236237
- [of\_hold\_rho0](#of_hold_rho0)
237238
- [of\_lkt\_a](#of_lkt_a)
@@ -2395,7 +2396,8 @@
23952396
- vw: von Weizsacker (vW) functional
23962397
- tf+: TF + vW functional
23972398
- wt: Wang-Teter (WT) functional
2398-
- xwm: XWM functional
2399+
- ext-wt: Extended Wang-Teter (ext-WT) functional
2400+
- xwm: Xu-Wang-Ma (XWM) functional
23992401
- lkt: Luo-Karasiev-Trickey (LKT) functional
24002402
- ml: Machine learning KEDF
24012403
- mpn: MPN KEDF (automatically sets ml parameters)
@@ -2441,29 +2443,36 @@
24412443
### of_tf_weight
24422444

24432445
- **Type**: Real
2444-
- **Availability**: *OFDFT with of_kinetic=tf, tf+, wt, xwm*
2446+
- **Availability**: *OFDFT with of_kinetic=tf, tf+, wt, ext-wt, xwm*
24452447
- **Description**: Weight of TF KEDF (kinetic energy density functional).
24462448
- **Default**: 1.0
24472449

24482450
### of_vw_weight
24492451

24502452
- **Type**: Real
2451-
- **Availability**: *OFDFT with of_kinetic=vw, tf+, wt, lkt, xwm*
2453+
- **Availability**: *OFDFT with of_kinetic=vw, tf+, wt, ext-wt, lkt, xwm*
24522454
- **Description**: Weight of vW KEDF (kinetic energy density functional).
24532455
- **Default**: 1.0
24542456

24552457
### of_wt_alpha
24562458

24572459
- **Type**: Real
2458-
- **Availability**: *OFDFT with of_kinetic=wt*
2460+
- **Availability**: *OFDFT with of_kinetic=wt, ext-wt*
24592461
- **Description**: Parameter alpha of WT KEDF (kinetic energy density functional).
24602462

24612463
### of_wt_beta
24622464

24632465
- **Type**: Real
2464-
- **Availability**: *OFDFT with of_kinetic=wt*
2466+
- **Availability**: *OFDFT with of_kinetic=wt, ext-wt*
24652467
- **Description**: Parameter beta of WT KEDF (kinetic energy density functional).
24662468

2469+
### of_extwt_kappa
2470+
2471+
- **Type**: Real
2472+
- **Availability**: *OFDFT with of_kinetic=ext-wt*
2473+
- **Description**: Parameter kappa for EXT-WT KEDF.
2474+
- **Default**: $\dfrac{1}{2(4/3)^{1/3}-1} \approx 0.832$
2475+
24672476
### of_wt_rho0
24682477

24692478
- **Type**: Real

source/source_io/module_parameter/input_parameter.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ struct Input_para
196196
double of_vw_weight = 1.0; ///< weight of vW KEDF
197197
double of_wt_alpha = 5. / 6.; ///< parameter alpha of WT KEDF
198198
double of_wt_beta = 5. / 6.; ///< parameter beta of WT KEDF
199+
double of_extwt_kappa = 1.0
200+
/ (2.0 * std::pow(4. / 3., 1. / 3.) - 1.0);
201+
///< parameter kappa of EXT-WT KEDF
199202
double of_wt_rho0 = 0.0; ///< set the average density of system, in Bohr^-3
200203
bool of_hold_rho0 = false; ///< If set to 1, the rho0 will be fixed even if the volume of
201204
///< system has changed, it will be set to 1 automatically if

source/source_io/module_parameter/read_input_item_ofdft.cpp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ void ReadInput::item_ofdft()
2020
* vw: von Weizsacker (vW) functional
2121
* tf+: TF + vW functional
2222
* wt: Wang-Teter (WT) functional
23+
* ext-wt: Extended Wang-Teter functional
2324
* xwm: XWM functional
2425
* lkt: Luo-Karasiev-Trickey (LKT) functional
2526
* ml: Machine learning KEDF
@@ -37,10 +38,11 @@ void ReadInput::item_ofdft()
3738
}
3839
#endif
3940
if (para.input.of_kinetic != "tf" && para.input.of_kinetic != "vw" && para.input.of_kinetic != "wt"
41+
&& para.input.of_kinetic != "ext-wt"
4042
&& para.input.of_kinetic != "xwm" && para.input.of_kinetic != "lkt" && para.input.of_kinetic != "tf+"
4143
&& para.input.of_kinetic != "ml" && para.input.of_kinetic != "mpn" && para.input.of_kinetic != "cpn5")
4244
{
43-
ModuleBase::WARNING_QUIT("ReadInput", "of_kinetic must be tf, vw, tf+, wt, xwm, lkt, ml, mpn, or cpn5");
45+
ModuleBase::WARNING_QUIT("ReadInput", "of_kinetic must be tf, vw, tf+, wt, ext-wt, xwm, lkt, ml, mpn, or cpn5");
4446
}
4547
};
4648
item.reset_value = [](const Input_Item& item, Parameter& para) {
@@ -175,7 +177,7 @@ void ReadInput::item_ofdft()
175177
item.description = "Weight of TF KEDF (kinetic energy density functional).";
176178
item.default_value = "1.0";
177179
item.unit = "";
178-
item.availability = "OFDFT with of_kinetic=tf, tf+, wt, xwm";
180+
item.availability = "OFDFT with of_kinetic=tf, tf+, wt, ext-wt, xwm";
179181
read_sync_double(input.of_tf_weight);
180182
this->add_item(item);
181183
}
@@ -187,7 +189,7 @@ void ReadInput::item_ofdft()
187189
item.description = "Weight of vW KEDF (kinetic energy density functional).";
188190
item.default_value = "1.0";
189191
item.unit = "";
190-
item.availability = "OFDFT with of_kinetic=vw, tf+, wt, lkt, xwm";
192+
item.availability = "OFDFT with of_kinetic=vw, tf+, wt, ext-wt, lkt, xwm";
191193
read_sync_double(input.of_vw_weight);
192194
this->add_item(item);
193195
}
@@ -199,7 +201,7 @@ void ReadInput::item_ofdft()
199201
item.description = "Parameter alpha of WT KEDF (kinetic energy density functional).";
200202
item.default_value = "";
201203
item.unit = "";
202-
item.availability = "OFDFT with of_kinetic=wt";
204+
item.availability = "OFDFT with of_kinetic=wt, ext-wt";
203205
read_sync_double(input.of_wt_alpha);
204206
this->add_item(item);
205207
}
@@ -211,10 +213,22 @@ void ReadInput::item_ofdft()
211213
item.description = "Parameter beta of WT KEDF (kinetic energy density functional).";
212214
item.default_value = "";
213215
item.unit = "";
214-
item.availability = "OFDFT with of_kinetic=wt";
216+
item.availability = "OFDFT with of_kinetic=wt, ext-wt";
215217
read_sync_double(input.of_wt_beta);
216218
this->add_item(item);
217219
}
220+
{
221+
Input_Item item("of_extwt_kappa");
222+
item.annotation = "parameter kappa of EXT-WT KEDF";
223+
item.category = "OFDFT: orbital free density functional theory";
224+
item.type = "Real";
225+
item.description = "Parameter kappa for EXT-WT KEDF.";
226+
item.default_value = "1.0 / (2.0 * std::pow(4./3., 1./3.) - 1.0)";
227+
item.unit = "";
228+
item.availability = "OFDFT with of_kinetic=ext-wt";
229+
read_sync_double(input.of_extwt_kappa);
230+
this->add_item(item);
231+
}
218232
{
219233
Input_Item item("of_wt_rho0");
220234
item.annotation = "the average density of system, used in WT KEDF, in Bohr^-3";

source/source_pw/module_ofdft/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ list(APPEND hamilt_ofdft_srcs
22
kedf_tf.cpp
33
kedf_vw.cpp
44
kedf_wt.cpp
5+
kedf_extwt.cpp
56
kedf_xwm.cpp
67
kedf_lkt.cpp
78
kedf_manager.cpp

0 commit comments

Comments
 (0)