1(*
2 Copyright (C) 2017 M.A.L. Marques
3
4 This Source Code Form is subject to the terms of the Mozilla Public
5 License, v. 2.0. If a copy of the MPL was not distributed with this
6 file, You can obtain one at http://mozilla.org/MPL/2.0/.
7*)
8
9(* type: gga_exc *)
10(* prefix:
11  gga_xc_wb97_params *params;
12
13  assert(p->params != NULL);
14  params = (gga_xc_wb97_params * )(p->params);
15*)
16
17$define lda_c_pw_params
18$include "lda_c_pw.mpl"
19
20$include "lda_x_erf.mpl"
21
22$include "b97.mpl"
23
24if evalb(Polarization = "ferr") then
25  wb97_x := (rs, z, xs0, xs1) ->
26    lda_x_erf_spin(rs,  1) * b97_g(0.004, params_a_c_x, xs0):
27else
28  wb97_x := (rs, z, xs0, xs1) ->
29    (1 + z)/2 * lda_x_erf_spin(rs*(2/(1 + z))^(1/3),  1) * b97_g(0.004, params_a_c_x, xs0) +
30    (1 - z)/2 * lda_x_erf_spin(rs*(2/(1 - z))^(1/3),  1) * b97_g(0.004, params_a_c_x, xs1)
31end if:
32
33f := (rs, z, xt, xs0, xs1) ->
34  wb97_x(rs, z, xs0, xs1) +
35  b97_f(f_pw, 0.2, params_a_c_ss, 0.006, params_a_c_ab, rs, z, xs0, xs1):
36
37