JDFTx  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Exchange-correlation terms

Files

file  ExCorr.h
 
file  ExCorr_internal.h
 
file  ExCorr_internal_GGA.h
 
file  ExCorr_internal_LDA.h
 
file  ExCorr_internal_mGGA.h
 

Classes

class  ExactExchange
 Exact-exchange calculator. More...
 
struct  IncludeTXC
 Which components to include in the results of ExCorr::operator() More...
 
class  ExCorr
 Exchange-Correlation energy calculator. More...
 
class  Functional
 Abstract base class for functionals. More...
 
class  FunctionalGGA
 Common interface to the compute kernels for GGA-like functionals. More...
 
struct  GGA_calc< variant, spinScaling, nCount >
 
struct  GGA_calc< variant, true, nCount >
 Specialization of GGA_calc for spin-scaling functionals (exchange and KE) More...
 
struct  GGA_calc< variant, false, nCount >
 Specialization of GGA_calc for functionals that do not spin-scale (correlation) More...
 
struct  GGA_calc< GGA_X_GLLBsc, true, nCount >
 
struct  GGA_calc< GGA_X_LB94, true, nCount >
 
class  FunctionalLDA
 Common interface to the compute kernels shared by all LDA functionals. More...
 
struct  LDA_calc< variant, nCount >
 
struct  LDA_calc< LDA_KE_TF, nCount >
 Specialization of LDA_calc for Thomas-Fermi kinetic energy (compute directly in n[s]) More...
 
struct  LDA_calc< LDA_X_Slater, nCount >
 Specialization of LDA_calc for Slater exchange (compute directly in n[s]; zeta not required) More...
 
struct  LDA_eval_C_PZ< para >
 
struct  LDA_eval_C_PW< spinID, prec >
 
struct  LDA_eval_C_VWN< spinID >
 
class  FunctionalMGGA
 Common interface to the compute kernels for mGGA-like functionals. More...
 
struct  mGGA_calc< variant, spinScaling, nCount >
 
struct  mGGA_calc< variant, true, nCount >
 Specialization of mGGA_calc for spin-scaling functionals (exchange) More...
 
struct  mGGA_calc< variant, false, nCount >
 
struct  ExCorr_OrbitalDep_GLLBsc
 Orbital-dependent GLLBsc functional. More...
 

Macros

#define SwitchTemplate_spin(SwitchTemplate_functional, variant, nCount, fTemplate, argList)
 
#define SwitchTemplate_GGA(variant, nCount, fTemplate, argList)
 
#define SwitchTemplate_LDA(variant, nCount, fTemplate, argList)
 
#define SwitchTemplate_mGGA(variant, nCount, fTemplate, argList)
 

Enumerations

enum  ExCorrType {
  ExCorrLDA_PZ, ExCorrLDA_PW, ExCorrLDA_PW_prec, ExCorrLDA_VWN,
  ExCorrLDA_Teter, ExCorrGGA_PBE, ExCorrGGA_PBEsol, ExCorrGGA_PW91,
  ExCorrMGGA_TPSS, ExCorrMGGA_revTPSS, ExCorrORB_GLLBsc, ExCorrPOT_LB94,
  ExCorrHYB_PBE0, ExCorrHYB_HSE06, ExCorrHYB_HSE12, ExCorrHYB_HSE12s,
  ExCorrHF
}
 Types of exchange correlation functionals. More...
 
enum  KineticType { KineticNone, KineticTF, KineticVW, KineticPW91 }
 Types of kinetic energy functionals. More...
 
enum  GGA_Variant {
  GGA_X_PBE, GGA_C_PBE, GGA_X_PBEsol, GGA_C_PBEsol,
  GGA_X_PW91, GGA_C_PW91, GGA_X_wPBE_SR, GGA_X_GLLBsc,
  GGA_X_LB94, GGA_KE_VW, GGA_KE_PW91
}
 Available GGA functionals. More...
 
enum  LDA_Variant {
  LDA_X_Slater, LDA_C_PZ, LDA_C_PW, LDA_C_PW_prec,
  LDA_C_VWN, LDA_XC_Teter, LDA_KE_TF
}
 Available LDA functionals. More...
 
enum  mGGA_Variant { mGGA_X_TPSS, mGGA_C_TPSS, mGGA_X_revTPSS, mGGA_C_revTPSS }
 Available mGGA functionals. More...
 

Functions

__hostanddev__ void loadSpinVector (array< const double *, 4 > x, int i, double &x0, vector3<> &xVec)
 Utility function for converting to/from spin-density matrices to scalar+vector combinations (via Pauli matrices)
 
__hostanddev__ void accumSpinVectorGrad (const double &E_x0, const vector3<> &E_xVec, array< double *, 4 > E_x, int i)
 
__hostanddev__ void spinDiagonalize_calc (int i, array< const double *, 4 > n, array< const double *, 4 > x, array< double *, 2 > xDiag)
 Transform spin-density-matrix-like quantity x into the basis where spin-density-matrix n is diagonal, and store the diagonal components in xDiag (for noncollinear magnetism)
 
__hostanddev__ void spinDiagonalizeGrad_calc (int i, array< const double *, 4 > n, array< const double *, 4 > x, array< const double *, 2 > E_xDiag, array< double *, 4 > E_n, array< double *, 4 > E_x)
 Propagate gradients corresponding to spinDiagonalize_calc(), from E_xDiag and accumulate to E_n and E_x.
 
__hostanddev__ double spinInterpolation (double zeta, double &f_zeta)
 LDA spin interpolation function f(zeta) and its derivative.
 
template<typename Para , typename Ferro >
__hostanddev__ double spinInterpolate (double rs, double zeta, double &e_rs, double &e_zeta, const Para &para, const Ferro &ferro)
 Spin-interpolate an LDA functional given its paramagnetic and ferromagnetic functors.
 
template<typename Para , typename Ferro , typename Stiff >
__hostanddev__ double spinInterpolate (double rs, double zeta, double &e_rs, double &e_zeta, const Para &para, const Ferro &ferro, const Stiff &stiff, const double fDblPrime0=4./(9 *(pow(2., 1./3)-1)))
 
template<GGA_Variant variant>
__hostanddev__ double GGA_eval (double rs, double s2, double &e_rs, double &e_s2)
 
template<GGA_Variant variant>
__hostanddev__ double GGA_eval (double rs, double zeta, double g, double t2, double &e_rs, double &e_zeta, double &e_g, double &e_t2)
 
__hostanddev__ double slaterExchange (double rs, double &e_rs)
 Slater exchange as a function of rs (PER PARTICLE):
 
__hostanddev__ double GGA_PBE_exchange (const double kappa, const double mu, double rs, double s2, double &e_rs, double &e_s2)
 PBE GGA exchange [JP Perdew, K Burke, and M Ernzerhof, Phys. Rev. Lett. 77, 3865 (1996)].
 
template<>
__hostanddev__ double GGA_eval< GGA_X_PBE > (double rs, double s2, double &e_rs, double &e_s2)
 PBE GGA exchange [JP Perdew, K Burke, and M Ernzerhof, Phys. Rev. Lett. 77, 3865 (1996)].
 
template<>
__hostanddev__ double GGA_eval< GGA_X_PBEsol > (double rs, double s2, double &e_rs, double &e_s2)
 PBEsol GGA exchange [JP Perdew et al, Phys. Rev. Lett. 100, 136406 (2008)].
 
__hostanddev__ double GGA_PW91_Enhancement (double s2, double &F_s2, const double P, const double Q, const double R, const double S, const double T, const double U)
 
template<>
__hostanddev__ double GGA_eval< GGA_X_PW91 > (double rs, double s2, double &e_rs, double &e_s2)
 PW91 GGA exchange [JP Perdew et al, Phys. Rev. B 46, 6671 (1992)].
 
template<int n>
__hostanddev__ double integralErfcGaussian (double A, double B, double &result_A, double &result_B)
 Evaluate \( \int_0^\infty dy y^n e^{-Ay^2} \textrm{erfc}{By} \) and its derivatives.
 
template<>
__hostanddev__ double integralErfcGaussian< 1 > (double A, double B, double &result_A, double &result_B)
 
template<>
__hostanddev__ double integralErfcGaussian< 2 > (double A, double B, double &result_A, double &result_B)
 
template<>
__hostanddev__ double integralErfcGaussian< 3 > (double A, double B, double &result_A, double &result_B)
 
template<>
__hostanddev__ double integralErfcGaussian< 5 > (double A, double B, double &result_A, double &result_B)
 
template<>
__hostanddev__ double GGA_eval< GGA_X_wPBE_SR > (double rs, double s2, double &e_rs, double &e_s2)
 
__hostanddev__ double PW91_H0 (const double gamma, double beta, double g3, double t2, double ecUnif, double &H0_beta, double &H0_g3, double &H0_t2, double &H0_ecUnif)
 
__hostanddev__ double GGA_PBE_correlation (const double beta, const double beta_rs, double rs, double zeta, double g, double t2, double &e_rs, double &e_zeta, double &e_g, double &e_t2)
 
template<>
__hostanddev__ double GGA_eval< GGA_C_PBE > (double rs, double zeta, double g, double t2, double &e_rs, double &e_zeta, double &e_g, double &e_t2)
 PBE GGA correlation [JP Perdew, K Burke, and M Ernzerhof, Phys. Rev. Lett. 77, 3865 (1996)].
 
template<>
__hostanddev__ double GGA_eval< GGA_C_PBEsol > (double rs, double zeta, double g, double t2, double &e_rs, double &e_zeta, double &e_g, double &e_t2)
 PBEsol GGA correlation [JP Perdew et al, Phys. Rev. Lett. 100, 136406 (2008)].
 
template<>
__hostanddev__ double GGA_eval< GGA_C_PW91 > (double rs, double zeta, double g, double t2, double &e_rs, double &e_zeta, double &e_g, double &e_t2)
 PW91 GGA correlation [JP Perdew et al, Phys. Rev. B 46, 6671 (1992)].
 
__hostanddev__ double TFKinetic (double rs, double &e_rs)
 Thomas Fermi kinetic energy as a function of rs (PER PARTICLE):
 
template<>
__hostanddev__ double GGA_eval< GGA_KE_VW > (double rs, double s2, double &e_rs, double &e_s2)
 von Weisacker gradient correction to Thomas Fermi LDA kinetic energy (with correct gradient expansion parameter lambda)
 
template<>
__hostanddev__ double GGA_eval< GGA_KE_PW91 > (double rs, double s2, double &e_rs, double &e_s2)
 PW91k GGA kinetic energy [PRB 46, 6671-6687 (1992)] parameterized by Lembarki and Chermette [PRA 50, 5328-5331 (1994)].
 
template<LDA_Variant variant>
__hostanddev__ double LDA_eval (double rs, double zeta, double &e_rs, double &e_zeta)
 
template<>
__hostanddev__ double LDA_eval< LDA_C_PZ > (double rs, double zeta, double &e_rs, double &e_zeta)
 Perdew-Zunger correlation.
 
template<>
__hostanddev__ double LDA_eval< LDA_C_PW > (double rs, double zeta, double &e_rs, double &e_zeta)
 Perdew-Wang correlation (original version, for numerical compatibility with LibXC's PW91)
 
template<>
__hostanddev__ double LDA_eval< LDA_C_PW_prec > (double rs, double zeta, double &e_rs, double &e_zeta)
 Perdew-Wang correlation (extended precision version, for numerical compatibility with LibXC's PBE)
 
template<>
__hostanddev__ double LDA_eval< LDA_C_VWN > (double rs, double zeta, double &e_rs, double &e_zeta)
 Vosko-Wilk-Nusair correlation.
 
template<>
__hostanddev__ double LDA_eval< LDA_XC_Teter > (double rs, double zeta, double &e_rs, double &e_zeta)
 Teter LSD exchange & correlation [Phys. Rev. B 54, 1703 (1996)].
 
template<mGGA_Variant variant>
__hostanddev__ double mGGA_eval (double rs, double s2, double q, double z, double &e_rs, double &e_s2, double &e_q, double &e_z)
 
template<mGGA_Variant variant>
__hostanddev__ double mGGA_eval (double rs, double zeta, double g, double t2, double t2up, double t2dn, double zi2, double z, double &e_rs, double &e_zeta, double &e_g, double &e_t2, double &e_t2up, double &e_t2dn, double &e_zi2, double &e_z)
 
template<bool revised>
__hostanddev__ double mGGA_TPSS_Exchange (double rs, double s2, double q, double z, double &e_rs, double &e_s2, double &e_q, double &e_z)
 
template<>
__hostanddev__ double mGGA_eval< mGGA_X_TPSS > (double rs, double s2, double q, double z, double &e_rs, double &e_s2, double &e_q, double &e_z)
 TPSS Exchange: J.P. Perdew et al, Phys. Rev. Lett. 91, 146401 (2003)
 
template<>
__hostanddev__ double mGGA_eval< mGGA_X_revTPSS > (double rs, double s2, double q, double z, double &e_rs, double &e_s2, double &e_q, double &e_z)
 revTPSS Exchange: J.P. Perdew et al, Phys. Rev. Lett. 103, 026403 (2009)
 
template<bool revised>
__hostanddev__ double betaTPSS (double rs, double &beta_rs)
 Compute beta(rs) for the TPSS/revTPSS correlation functionals.
 
template<bool revised>
__hostanddev__ double mGGA_TPSS_Correlation (double rs, double zeta, double g, double t2, double t2up, double t2dn, double zi2, double z, double &e_rs, double &e_zeta, double &e_g, double &e_t2, double &e_t2up, double &e_t2dn, double &e_zi2, double &e_z)
 
template<>
__hostanddev__ double mGGA_eval< mGGA_C_TPSS > (double rs, double zeta, double g, double t2, double t2up, double t2dn, double zi2, double z, double &e_rs, double &e_zeta, double &e_g, double &e_t2, double &e_t2up, double &e_t2dn, double &e_zi2, double &e_z)
 TPSS Correlation: J.P. Perdew et al, Phys. Rev. Lett. 91, 146401 (2003)
 
template<>
__hostanddev__ double mGGA_eval< mGGA_C_revTPSS > (double rs, double zeta, double g, double t2, double t2up, double t2dn, double zi2, double z, double &e_rs, double &e_zeta, double &e_g, double &e_t2, double &e_t2up, double &e_t2dn, double &e_zi2, double &e_z)
 revTPSS Correlation: J.P. Perdew et al, Phys. Rev. Lett. 103, 026403 (2009)
 

Detailed Description

Macro Definition Documentation

#define SwitchTemplate_GGA (   variant,
  nCount,
  fTemplate,
  argList 
)
Value:
switch(variant) \
{ case GGA_X_PBE: fTemplate< GGA_X_PBE, true, nCount> argList; break; \
case GGA_C_PBE: fTemplate< GGA_C_PBE, false, nCount> argList; break; \
case GGA_X_PBEsol: fTemplate< GGA_X_PBEsol, true, nCount> argList; break; \
case GGA_C_PBEsol: fTemplate< GGA_C_PBEsol, false, nCount> argList; break; \
case GGA_X_PW91: fTemplate< GGA_X_PW91, true, nCount> argList; break; \
case GGA_C_PW91: fTemplate< GGA_C_PW91, false, nCount> argList; break; \
case GGA_X_wPBE_SR: fTemplate< GGA_X_wPBE_SR, true, nCount> argList; break; \
case GGA_X_GLLBsc: fTemplate< GGA_X_GLLBsc, true, nCount> argList; break; \
case GGA_X_LB94: fTemplate< GGA_X_LB94, true, nCount> argList; break; \
case GGA_KE_VW: fTemplate< GGA_KE_VW, true, nCount> argList; break; \
case GGA_KE_PW91: fTemplate< GGA_KE_PW91, true, nCount> argList; break; \
default: break; \
}
Perdew-Burke-Ernzerhof GGA correlation.
Definition: ExCorr_internal_GGA.h:32
van Leeuwen-Baerends asymptotically-correct exchange potential correction (potential-only) ...
Definition: ExCorr_internal_GGA.h:39
Short-ranged part of omega-PBE exchange (used in HSE06 hybrid)
Definition: ExCorr_internal_GGA.h:37
von Weisacker gradient correction to Thomas Fermi LDA kinetic energy
Definition: ExCorr_internal_GGA.h:40
Teter GGA kinetic energy.
Definition: ExCorr_internal_GGA.h:41
Perdew-Burke-Ernzerhof GGA correlation reparametrized for solids.
Definition: ExCorr_internal_GGA.h:34
Perdew-Burke-Ernzerhof GGA exchange reparametrized for solids.
Definition: ExCorr_internal_GGA.h:33
Perdew-Burke-Ernzerhof GGA exchange.
Definition: ExCorr_internal_GGA.h:31
Perdew-Wang 1991 GGA exchange.
Definition: ExCorr_internal_GGA.h:35
Semi-local part of GLLB-sc exchange (potential-only, equal to 2x PBEsol per-particle energy) ...
Definition: ExCorr_internal_GGA.h:38
Perdew-Wang 1991 GGA correlation.
Definition: ExCorr_internal_GGA.h:36

Switch a function fTemplate templated over GGA variant, spin scaling behavior and spin count, over all supported functionals with nCount being a compile-time constant NOTE: The second argument to fTemplate must correspond to the spin-scaling behavior of each functional (Used by the thread and gpu launchers of FunctionalGGA::evaluate) (This is needed to switch from a run-time variant to a compile-time template argument)

#define SwitchTemplate_LDA (   variant,
  nCount,
  fTemplate,
  argList 
)
Value:
switch(variant) \
{ case LDA_X_Slater: fTemplate< LDA_X_Slater, nCount> argList; break; \
case LDA_C_PZ: fTemplate< LDA_C_PZ, nCount> argList; break; \
case LDA_C_PW: fTemplate< LDA_C_PW, nCount> argList; break; \
case LDA_C_PW_prec: fTemplate< LDA_C_PW_prec, nCount> argList; break; \
case LDA_C_VWN: fTemplate< LDA_C_VWN, nCount> argList; break; \
case LDA_XC_Teter: fTemplate< LDA_XC_Teter, nCount> argList; break; \
case LDA_KE_TF: fTemplate< LDA_KE_TF, nCount> argList; break; \
default: break; \
}
Perdew-Zunger LDA correlation.
Definition: ExCorr_internal_LDA.h:32
Perdew-Wang LDA correlation.
Definition: ExCorr_internal_LDA.h:33
Vosko-Wilk-Nusair LDA correlation.
Definition: ExCorr_internal_LDA.h:35
LDA exchange (Slater functional)
Definition: ExCorr_internal_LDA.h:31
Perdew-Wang LDA correlation (with higher precision constants used in PBE)
Definition: ExCorr_internal_LDA.h:34
Thomas-Fermi kinetic energy functional.
Definition: ExCorr_internal_LDA.h:37
Teter LDA exchange and correlation.
Definition: ExCorr_internal_LDA.h:36

Switch a function fTemplate templated over LDA variant and spin count, over all supported functionals with nCount being a compile-time constant (Used by the thread and gpu launchers of FunctionalLDA::evaluate) (This is needed to switch from a run-time variant to a compile-time template argument)

#define SwitchTemplate_mGGA (   variant,
  nCount,
  fTemplate,
  argList 
)
Value:
switch(variant) \
{ case mGGA_X_TPSS: fTemplate< mGGA_X_TPSS, true, nCount> argList; break; \
case mGGA_C_TPSS: fTemplate< mGGA_C_TPSS, false, nCount> argList; break; \
case mGGA_X_revTPSS: fTemplate< mGGA_X_revTPSS, true, nCount> argList; break; \
case mGGA_C_revTPSS: fTemplate< mGGA_C_revTPSS, false, nCount> argList; break; \
default: break; \
}
revTPSS mGGA correlation
Definition: ExCorr_internal_mGGA.h:36
revTPSS mGGA exchange
Definition: ExCorr_internal_mGGA.h:35
TPSS mGGA correlation.
Definition: ExCorr_internal_mGGA.h:34
TPSS mGGA exchange.
Definition: ExCorr_internal_mGGA.h:33

Switch a function fTemplate templated over mGGA variant, spin scaling behavior and spin count, over all supported functionals with nCount being a compile-time constant NOTE: The second argument to fTemplate must correspond to the spin-scaling behavior of each functional (Used by the thread and gpu launchers of FunctionalMGGA::evaluate) (This is needed to switch from a run-time variant to a compile-time template argument)

#define SwitchTemplate_spin (   SwitchTemplate_functional,
  variant,
  nCount,
  fTemplate,
  argList 
)
Value:
switch(nCount) \
{ case 1: { SwitchTemplate_functional(variant,1, fTemplate,argList) break; } \
case 2: { SwitchTemplate_functional(variant,2, fTemplate,argList) break; } \
default: break; \
}

Switch a function fTemplate templated over a functional variant and spin count SwitchTemplate_functional is a macro such as SwitchTemplate_LDA (This is needed to switch from a run-time nCount to a compile-time template argument)

Enumeration Type Documentation

enum ExCorrType

Types of exchange correlation functionals.

Enumerator
ExCorrLDA_PZ 

Perdew-Zunger LDA.

ExCorrLDA_PW 

Perdew-Wang LDA (original version used in PW91)

ExCorrLDA_PW_prec 

Perdew-Wang LDA with higher precision constants used in PBE.

ExCorrLDA_VWN 

Vosko-Wilk-Nusair LDA.

ExCorrLDA_Teter 

Teter93 LSDA functional.

ExCorrGGA_PBE 

PBE GGA functional.

ExCorrGGA_PBEsol 

PBE GGA functional reparametrized for solids.

ExCorrGGA_PW91 

PW91 GGA functional.

ExCorrMGGA_TPSS 

TPSS meta-GGA functional.

ExCorrMGGA_revTPSS 

revised meta-GGA functional

ExCorrORB_GLLBsc 

GLLB-sc orbital-dependent potential (no total energy)

ExCorrPOT_LB94 

Leeuwen-Baerends potentialfunctional (no total energy)

ExCorrHYB_PBE0 

PBE0 Hybrid GGA functional.

ExCorrHYB_HSE06 

HSE06 Screened Hybrid GGA functional.

ExCorrHYB_HSE12s 

Reparametrized screened exchange functional for accuracy.

ExCorrHF 

Reparametrized screened exchange functional for minimum screening length.

Hartree-Fock

Available GGA functionals.

Enumerator
GGA_X_PBE 

Perdew-Burke-Ernzerhof GGA exchange.

GGA_C_PBE 

Perdew-Burke-Ernzerhof GGA correlation.

GGA_X_PBEsol 

Perdew-Burke-Ernzerhof GGA exchange reparametrized for solids.

GGA_C_PBEsol 

Perdew-Burke-Ernzerhof GGA correlation reparametrized for solids.

GGA_X_PW91 

Perdew-Wang 1991 GGA exchange.

GGA_C_PW91 

Perdew-Wang 1991 GGA correlation.

GGA_X_wPBE_SR 

Short-ranged part of omega-PBE exchange (used in HSE06 hybrid)

GGA_X_GLLBsc 

Semi-local part of GLLB-sc exchange (potential-only, equal to 2x PBEsol per-particle energy)

GGA_X_LB94 

van Leeuwen-Baerends asymptotically-correct exchange potential correction (potential-only)

GGA_KE_VW 

von Weisacker gradient correction to Thomas Fermi LDA kinetic energy

GGA_KE_PW91 

Teter GGA kinetic energy.

Types of kinetic energy functionals.

Enumerator
KineticNone 

No kinetic energy (default)

KineticTF 

Thomas-Fermi LDA kinetic energy.

KineticVW 

von Weisacker GGA kinetic energy

KineticPW91 

PW91 GGA kinetic energy.

Available LDA functionals.

Enumerator
LDA_X_Slater 

LDA exchange (Slater functional)

LDA_C_PZ 

Perdew-Zunger LDA correlation.

LDA_C_PW 

Perdew-Wang LDA correlation.

LDA_C_PW_prec 

Perdew-Wang LDA correlation (with higher precision constants used in PBE)

LDA_C_VWN 

Vosko-Wilk-Nusair LDA correlation.

LDA_XC_Teter 

Teter LDA exchange and correlation.

LDA_KE_TF 

Thomas-Fermi kinetic energy functional.

Available mGGA functionals.

Enumerator
mGGA_X_TPSS 

TPSS mGGA exchange.

mGGA_C_TPSS 

TPSS mGGA correlation.

mGGA_X_revTPSS 

revTPSS mGGA exchange

mGGA_C_revTPSS 

revTPSS mGGA correlation

Function Documentation

template<GGA_Variant variant>
__hostanddev__ double GGA_eval ( double  rs,
double  s2,
double &  e_rs,
double &  e_s2 
)

GGA interface inner layer for spin-scaling functionals (specialized for each such functional): Return energy density given rs and dimensionless gradient squared s2, and set gradients w.r.t rs and s2

template<GGA_Variant variant>
__hostanddev__ double GGA_eval ( double  rs,
double  zeta,
double  g,
double  t2,
double &  e_rs,
double &  e_zeta,
double &  e_g,
double &  e_t2 
)

GGA interface inner layer for functionals that do not spin-scale (specialized for each such functional): Return energy density given rs, zeta, g(zeta) and dimensionless gradient squared t2, and set gradients w.r.t rs, zeta, g(zeta) and t2 (see PW91 ref for definitions)

template<>
__hostanddev__ double GGA_eval< GGA_X_wPBE_SR > ( double  rs,
double  s2,
double &  e_rs,
double &  e_s2 
)

Short-ranged omega-PBE GGA exchange - used in the HSE06 hybrid functional [J Heyd, G E Scuseria, and M Ernzerhof, J. Chem. Phys. 118, 3865 (2003)]

__hostanddev__ double GGA_PBE_correlation ( const double  beta,
const double  beta_rs,
double  rs,
double  zeta,
double  g,
double  t2,
double &  e_rs,
double &  e_zeta,
double &  e_g,
double &  e_t2 
)

PBE GGA correlation [JP Perdew, K Burke, and M Ernzerhof, Phys. Rev. Lett. 77, 3865 (1996)] If beta depends on rs (as in revTPSS), beta_rs (=dbeta/drs) is propagated to e_rs

__hostanddev__ double GGA_PW91_Enhancement ( double  s2,
double &  F_s2,
const double  P,
const double  Q,
const double  R,
const double  S,
const double  T,
const double  U 
)

Functional form of the PW91 Exchange Enhancement factor (also used in some KE functionals) Implements equation (8) in [JP Perdew et al, Phys. Rev. B 46, 6671 (1992)] and its gradients P,Q,R,S,T,U are the parameters in order of appearance in that equation

template<LDA_Variant variant>
__hostanddev__ double LDA_eval ( double  rs,
double  zeta,
double &  e_rs,
double &  e_zeta 
)

LDA interface inner layer (specialize for each functional): Return energy density given rs and zeta and set gradients w.r.t rs and zeta

template<mGGA_Variant variant>
__hostanddev__ double mGGA_eval ( double  rs,
double  s2,
double  q,
double  z,
double &  e_rs,
double &  e_s2,
double &  e_q,
double &  e_z 
)

GGA interface inner layer for spin-scaling functionals (specialized for each such functional): Return energy density given dimensionless quantities rs, s2, q and z, and set gradients w.r.t them See the PBE / TPSS refs for definitions of these quantities

template<mGGA_Variant variant>
__hostanddev__ double mGGA_eval ( double  rs,
double  zeta,
double  g,
double  t2,
double  t2up,
double  t2dn,
double  zi2,
double  z,
double &  e_rs,
double &  e_zeta,
double &  e_g,
double &  e_t2,
double &  e_t2up,
double &  e_t2dn,
double &  e_zi2,
double &  e_z 
)

GGA interface inner layer for functionals that do not spin-scale (specialized for each such functional): Return energy density given rs, zeta, g, t2 (see PW91 ref for definitions of these), t2up, t2dn (the individual spin versions of t2) zi2 (the dimensionless grad zeta squared term) and z = tauW/tau (totals, not spin resolved) and set gradients w.r.t them

template<bool revised>
__hostanddev__ double mGGA_TPSS_Correlation ( double  rs,
double  zeta,
double  g,
double  t2,
double  t2up,
double  t2dn,
double  zi2,
double  z,
double &  e_rs,
double &  e_zeta,
double &  e_g,
double &  e_t2,
double &  e_t2up,
double &  e_t2dn,
double &  e_zi2,
double &  e_z 
)

TPSS or revTPSS Correlation depending on revised = false/true J.P. Perdew et al, Phys. Rev. Lett. 91, 146401 (2003) [TPSS] J.P. Perdew et al, Phys. Rev. Lett. 103, 026403 (2009) [revTPSS]

template<bool revised>
__hostanddev__ double mGGA_TPSS_Exchange ( double  rs,
double  s2,
double  q,
double  z,
double &  e_rs,
double &  e_s2,
double &  e_q,
double &  e_z 
)

TPSS or revTPSS Exchange depending on revised = false/true J.P. Perdew et al, Phys. Rev. Lett. 91, 146401 (2003) [TPSS] J.P. Perdew et al, Phys. Rev. Lett. 103, 026403 (2009) [revTPSS]

__hostanddev__ double PW91_H0 ( const double  gamma,
double  beta,
double  g3,
double  t2,
double  ecUnif,
double &  H0_beta,
double &  H0_g3,
double &  H0_t2,
double &  H0_ecUnif 
)

The H0 function (equations 13,14) of PW91 and its derivatives. Also the H fuunction (equations 7,8) of PBE. The notation is a mixture, picking the shortest of both references: using g from PW91 (phi in PBE) and gamma from PBE (beta^2/(2*alpha) in PW91).

template<typename Para , typename Ferro , typename Stiff >
__hostanddev__ double spinInterpolate ( double  rs,
double  zeta,
double &  e_rs,
double &  e_zeta,
const Para &  para,
const Ferro &  ferro,
const Stiff &  stiff,
const double  fDblPrime0 = 4./(9*(pow(2., 1./3)-1)) 
)

Spin-interpolate an LDA functional given its paramagnetic, ferromagnetic and spin-stiffness functors (This is the spin-inteprolation technique used in the VWN and PW correlation functionals) (For numerical compatibility with the original PW routine, the f"(0) scale factor may be over-ridden)