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: mgga_exc *)
10
11$define lda_c_pw_params
12$include "lda_c_pw.mpl"
13
14$define lda_x_params
15$include "lda_x.mpl"
16
17b98_gamma_x  := 0.11:
18b98_gamma_ss := 1.6:
19b98_gamma_ab := 0.14:
20
21params_a_c_x  := [0.8085,  0.6682, 0.1420]:
22params_a_c_ss := [0.2606, -0.9608, 0.9023]:
23params_a_c_ab := [1.2033, -2.2717, 0.9596]:
24
25b98_q := (x, u, t) -> 1 - (t - x^2/8 - u/4)/K_FACTOR_C:
26
27b98_g := (gamma, cc, q) -> add(cc[i]*(gamma*q/sqrt(1 + gamma^2*q^2))^(i-1), i=1..3):
28
29if evalb(Polarization = "ferr") then
30  b98_f := (rs, z, xs0, xs1, us0, us1, ts0, ts1) ->
31    + f_lda_x(rs, 1)
32      * b98_g( b98_gamma_x,  params_a_c_x, b98_q(xs0, us0, ts0))
33    + f_pw(rs, 1)
34      * b98_g(b98_gamma_ss, params_a_c_ss, b98_q(xs0, us0, ts0)) * Fermi_D(xs0, ts0):
35else
36  b98_f := (rs, z, xs0, xs1, us0, us1, ts0, ts1) ->
37    + lda_x_spin(rs,  z)
38      * b98_g( b98_gamma_x, params_a_c_x, b98_q(xs0, us0, ts0))
39    + lda_x_spin(rs, -z)
40      * b98_g( b98_gamma_x, params_a_c_x, b98_q(xs1, us1, ts1))
41    + lda_stoll_par(f_pw, rs,  z,  1)
42      * b98_g(b98_gamma_ss, params_a_c_ss, b98_q(xs0, us0, ts0)) * Fermi_D(xs0, ts0)
43    + lda_stoll_par(f_pw, rs, -z, -1)
44      * b98_g(b98_gamma_ss, params_a_c_ss, b98_q(xs1, us1, ts1)) * Fermi_D(xs1, ts1)
45    + lda_stoll_perp(f_pw, rs, z)
46      * b98_g(b98_gamma_ab, params_a_c_ab, (b98_q(xs0, us0, ts0) + b98_q(xs1, us1, ts1))/2):
47end if:
48
49f := (rs, z, xt, xs0, xs1, us0, us1, ts0, ts1) ->
50  b98_f(rs, z, xs0, xs1, us0, us1, ts0, ts1):