1 /*
2 * XCFun, an arbitrary order exchange-correlation library
3 * Copyright (C) 2020 Ulf Ekström and contributors.
4 *
5 * This file is part of XCFun.
6 *
7 * This Source Code Form is subject to the terms of the Mozilla Public
8 * License, v. 2.0. If a copy of the MPL was not distributed with this
9 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 *
11 * For information on the complete list of contributors to the
12 * XCFun library, see: <https://xcfun.readthedocs.io/>
13 */
14
15 #include "SCAN_like_eps.hpp"
16 #include "constants.hpp"
17 #include "functional.hpp"
18
r4SCANX(const densvars<num> & d)19 template <class num> static num r4SCANX(const densvars<num> & d) {
20 num Fx_a;
21 num Fx_b;
22 Fx_a = SCAN_eps::get_SCAN_Fx(2.0 * d.a, 4.0 * d.gaa, 2.0 * d.taua, 2, 1, 2);
23 num epsxunif_a = SCAN_eps::fx_unif(2 * d.a);
24 Fx_b = SCAN_eps::get_SCAN_Fx(2.0 * d.b, 4.0 * d.gbb, 2.0 * d.taub, 2, 1, 2);
25 num epsxunif_b = SCAN_eps::fx_unif(2 * d.b);
26
27 return 0.5 * (Fx_a * epsxunif_a + Fx_b * epsxunif_b);
28 }
29
30 FUNCTIONAL(XC_R4SCANX) = {"r4SCAN exchange functional",
31 "r4SCAN exchange functional.\n"
32 "Restored-Regularised fourth order SCAN functional\n"
33 "J Furness, in preparation"
34 "Implemented by James Furness (@JFurness1)\n",
35 XC_DENSITY | XC_GRADIENT | XC_KINETIC,
36 ENERGY_FUNCTION(r4SCANX) XC_A_B_GAA_GAB_GBB_TAUA_TAUB,
37 XC_PARTIAL_DERIVATIVES,
38 1,
39 1e-11,
40 {0.217, 0.0632, 0.191, 0.0535, 0.015, 0.267, 0.0328},
41 {-1.62076202198e-01,
42 -8.60008367983e-01,
43 -5.57023311096e-01,
44 -3.79265181913e-02,
45 0.00000000000e+00,
46 -1.04606093722e-01,
47 5.89149583569e-02,
48 5.50319523444e-02}};
49