ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
XC_Functional Class Reference

#include <xc_functional.h>

Collaboration diagram for XC_Functional:

Classes

class  ScopedType

Public Member Functions

 XC_Functional ()
 ~XC_Functional ()

Static Public Member Functions

static std::tuple< double, double, ModuleBase::matrix > v_xc (const int &nrxx, const Charge *const chr, const UnitCell *ucell, const int nspin, const bool domag, const bool domag_z, const int gga_grad, const double hybrid_alpha, const double hse_omega)
static std::tuple< double, double, ModuleBase::matrix > v_xc (const int &nrxx, const Charge *const chr, const UnitCell *ucell, const int nspin, const bool domag, const bool domag_z, const int gga_grad, const double hybrid_alpha, const double hse_omega, const bool use_gpu)
static int get_func_type ()
static void set_func_type (const int func_type_in)
 Set the functional class directly. set_xc_type() derives this from a functional name and is what production code uses; this is for callers that need to select a branch without configuring libxc.
static void set_xc_type (const std::string xc_func_in)
static void set_hybrid_alpha (const double alpha_in)
static double get_hybrid_alpha ()
static void set_hse_omega (const double omega_in)
static void set_runtime_parameters (const XCFunctionalParameters &parameters)
static const XCFunctionalParameters & get_runtime_parameters ()
static double get_hse_omega ()
static bool get_ked_flag ()
static void set_ked_flag (const bool ked_flag_in)
 Set whether the functional needs the kinetic energy density.
static bool get_need_laplacian ()
static void set_xc_first_loop (const UnitCell &ucell)
 Usually in exx caculation, the first SCF loop should be converged with PBE.
static std::string output_info ()
static std::vector< int > get_func_id ()
static double get_weight (const int id)
static void xc (const double &rho, double &exc, double &vxc)
static void xc_spin (const double &rho, const double &zeta, double &exc, double &vxcup, double &vxcdw)
static void gcxc (const double &rho, const double &grho, double &sxc, double &v1xc, double &v2xc)
static void gcx_spin (double rhoup, double rhodw, double grhoup2, double grhodw2, double &sx, double &v1xup, double &v1xdw, double &v2xup, double &v2xdw)
static void gcc_spin (double rho, double &zeta, double grho, double &sc, double &v1cup, double &v1cdw, double &v2c)
static void gradcorr (double &etxc, double &vtxc, ModuleBase::matrix &v, const Charge *const chr, ModulePW::PW_Basis *rhopw, const UnitCell *ucell, std::vector< double > &stress_gga, const bool is_stress, const int nspin, const bool domag, const bool domag_z, const int gga_grad, const double hybrid_alpha, const double hse_omega)
template<typename T, typename Device, typename Real = typename GetTypeReal<T>::type>
static void grad_wfc (const int ik, const Real tpiba, const ModulePW::PW_Basis_K *wfc_basis, const T *rhog, T *grad)
template<typename T, typename Device, typename Real = typename GetTypeReal<T>::type>
static void grad_wfc (const int ik, const Real tpiba, const ModulePW::PW_Basis_K *wfc_basis, const Real *gcar, const Real *kvec_c, const T *rhog, T *grad)
static void grad_rho (const std::complex< double > *rhog, ModuleBase::Vector3< double > *gdr, const ModulePW::PW_Basis *rho_basis, const double tpiba)
static void grad_dot (const ModuleBase::Vector3< double > *h, double *dh, const ModulePW::PW_Basis *rho_basis, const double tpiba)
static void laplacian_rho (const std::complex< double > *rhog, double *lapl, const ModulePW::PW_Basis *rho_basis, const double tpiba)
static void noncolin_rho (double *rhoout1, double *rhoout2, double *seg, const double *const *const rho, const int nrxx, const double *ux_, const bool lsign_)
static void slater (const double &rs, double &ex, double &vx)
static void slater1 (const double &rs, double &ex, double &vx)
static void slater_rxc (const double &rs, double &ex, double &vx)
static void slater_spin (const double &rho, const double &zeta, double &ex, double &vxup, double &vxdw)
static void slater1_spin (const double &rho, const double &zeta, double &ex, double &vxup, double &vxdw)
static void slater_rxc_spin (const double &rho, const double &z, double &ex, double &vxup, double &vxdw)
static void pw (const double &rs, const int &iflag, double &ec, double &vc)
static void pz (const double &rs, const int &iflag, double &ec, double &vc)
static void lyp (const double &rs, double &ec, double &vc)
static void vwn (const double &rs, double &ec, double &vc)
static void wigner (const double &rs, double &ec, double &vc)
static void hl (const double &rs, double &ec, double &vc)
static void gl (const double &rs, double &ec, double &vc)
static void pw_spin (const double &rs, const double &zeta, double &ec, double &vcup, double &vcdw)
static void pz_spin (const double &rs, const double &zeta, double &ec, double &vcup, double &vcdw)
static void pz_polarized (const double &rs, double &ec, double &vc)
static void becke88 (const double &rho, const double &grho, double &sx, double &v1x, double &v2x)
static void ggax (const double &rho, const double &grho, double &sx, double &v1x, double &v2x)
static void pbex (const double &rho, const double &grho, const int &iflag, double &sx, double &v1x, double &v2x)
static void optx (const double rho, const double grho, double &sx, double &v1x, double &v2x)
static void wcx (const double &rho, const double &grho, double &sx, double &v1x, double &v2x)
static void becke88_spin (double rho, double grho, double &sx, double &v1x, double &v2x)
static void perdew86 (const double rho, const double grho, double &sc, double &v1c, double &v2c)
static void ggac (const double &rho, const double &grho, double &sc, double &v1c, double &v2c)
static void pbec (const double &rho, const double &grho, const int &flag, double &sc, double &v1c, double &v2c)
static void glyp (const double &rho, const double &grho, double &sc, double &v1c, double &v2c)
static void perdew86_spin (double rho, double zeta, double grho, double &sc, double &v1cup, double &v1cdw, double &v2c)
static void pbec_spin (double rho, double zeta, double grho, const int &flag, double &sc, double &v1cup, double &v1cdw, double &v2c)
static void hcth (const double rho, const double grho, double &sx, double &v1x, double &v2x)
static void pwcorr (const double r, const double c[], double &g, double &dg)

Static Private Attributes

static std::vector< int > func_id
static int func_type = 1
static bool ked_flag = false
static bool need_laplacian = false
static bool use_libxc = true
static double hybrid_alpha = 0.25
static double hse_omega = 0.0
static XCFunctionalParameters runtime_parameters
static std::map< int, double > scaling_factor_xc = {{1, 1.0}}

Constructor & Destructor Documentation

◆ XC_Functional()

XC_Functional::XC_Functional ( )
Here is the caller graph for this function:

◆ ~XC_Functional()

XC_Functional::~XC_Functional ( )

Member Function Documentation

◆ becke88()

void XC_Functional::becke88 ( const double & rho,
const double & grho,
double & sx,
double & v1x,
double & v2x )
static
Here is the caller graph for this function:

◆ becke88_spin()

void XC_Functional::becke88_spin ( double rho,
double grho,
double & sx,
double & v1x,
double & v2x )
static
Here is the caller graph for this function:

◆ gcc_spin()

void XC_Functional::gcc_spin ( double rho,
double & zeta,
double grho,
double & sc,
double & v1cup,
double & v1cdw,
double & v2c )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gcx_spin()

void XC_Functional::gcx_spin ( double rhoup,
double rhodw,
double grhoup2,
double grhodw2,
double & sx,
double & v1xup,
double & v1xdw,
double & v2xup,
double & v2xdw )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gcxc()

void XC_Functional::gcxc ( const double & rho,
const double & grho,
double & sxc,
double & v1xc,
double & v2xc )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_func_id()

std::vector< int > XC_Functional::get_func_id ( )
inlinestatic
Here is the caller graph for this function:

◆ get_func_type()

int XC_Functional::get_func_type ( )
inlinestatic
Here is the caller graph for this function:

◆ get_hse_omega()

double XC_Functional::get_hse_omega ( )
inlinestatic
Here is the caller graph for this function:

◆ get_hybrid_alpha()

double XC_Functional::get_hybrid_alpha ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_ked_flag()

bool XC_Functional::get_ked_flag ( )
inlinestatic
Here is the caller graph for this function:

◆ get_need_laplacian()

bool XC_Functional::get_need_laplacian ( )
inlinestatic
Here is the caller graph for this function:

◆ get_runtime_parameters()

const XCFunctionalParameters & XC_Functional::get_runtime_parameters ( )
inlinestatic
Here is the caller graph for this function:

◆ get_weight()

double XC_Functional::get_weight ( const int id)
inlinestatic

signed combination weight of a functional component id (1.0 when the functional is not in the scaling table), e.g. BLYP_LR subtracts its short-range components

Here is the caller graph for this function:

◆ ggac()

void XC_Functional::ggac ( const double & rho,
const double & grho,
double & sc,
double & v1c,
double & v2c )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ggax()

void XC_Functional::ggax ( const double & rho,
const double & grho,
double & sx,
double & v1x,
double & v2x )
static
Here is the caller graph for this function:

◆ gl()

void XC_Functional::gl ( const double & rs,
double & ec,
double & vc )
static
Here is the caller graph for this function:

◆ glyp()

void XC_Functional::glyp ( const double & rho,
const double & grho,
double & sc,
double & v1c,
double & v2c )
static
Here is the caller graph for this function:

◆ grad_dot()

void XC_Functional::grad_dot ( const ModuleBase::Vector3< double > * h,
double * dh,
const ModulePW::PW_Basis * rho_basis,
const double tpiba )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ grad_rho()

void XC_Functional::grad_rho ( const std::complex< double > * rhog,
ModuleBase::Vector3< double > * gdr,
const ModulePW::PW_Basis * rho_basis,
const double tpiba )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ grad_wfc() [1/2]

template<typename T, typename Device, typename Real>
void XC_Functional::grad_wfc ( const int ik,
const Real tpiba,
const ModulePW::PW_Basis_K * wfc_basis,
const Real * gcar,
const Real * kvec_c,
const T * rhog,
T * grad )
static
Here is the call graph for this function:

◆ grad_wfc() [2/2]

template<typename T, typename Device, typename Real>
void XC_Functional::grad_wfc ( const int ik,
const Real tpiba,
const ModulePW::PW_Basis_K * wfc_basis,
const T * rhog,
T * grad )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gradcorr()

void XC_Functional::gradcorr ( double & etxc,
double & vtxc,
ModuleBase::matrix & v,
const Charge *const chr,
ModulePW::PW_Basis * rhopw,
const UnitCell * ucell,
std::vector< double > & stress_gga,
const bool is_stress,
const int nspin,
const bool domag,
const bool domag_z,
const int gga_grad,
const double hybrid_alpha,
const double hse_omega )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hcth()

void XC_Functional::hcth ( const double rho,
const double grho,
double & sx,
double & v1x,
double & v2x )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hl()

void XC_Functional::hl ( const double & rs,
double & ec,
double & vc )
static
Here is the caller graph for this function:

◆ laplacian_rho()

void XC_Functional::laplacian_rho ( const std::complex< double > * rhog,
double * lapl,
const ModulePW::PW_Basis * rho_basis,
const double tpiba )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lyp()

void XC_Functional::lyp ( const double & rs,
double & ec,
double & vc )
static
Here is the caller graph for this function:

◆ noncolin_rho()

void XC_Functional::noncolin_rho ( double * rhoout1,
double * rhoout2,
double * seg,
const double *const *const rho,
const int nrxx,
const double * ux_,
const bool lsign_ )
static
Here is the caller graph for this function:

◆ optx()

void XC_Functional::optx ( const double rho,
const double grho,
double & sx,
double & v1x,
double & v2x )
static
Here is the caller graph for this function:

◆ output_info()

std::string XC_Functional::output_info ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pbec()

void XC_Functional::pbec ( const double & rho,
const double & grho,
const int & flag,
double & sc,
double & v1c,
double & v2c )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pbec_spin()

void XC_Functional::pbec_spin ( double rho,
double zeta,
double grho,
const int & flag,
double & sc,
double & v1cup,
double & v1cdw,
double & v2c )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pbex()

void XC_Functional::pbex ( const double & rho,
const double & grho,
const int & iflag,
double & sx,
double & v1x,
double & v2x )
static
Here is the caller graph for this function:

◆ perdew86()

void XC_Functional::perdew86 ( const double rho,
const double grho,
double & sc,
double & v1c,
double & v2c )
static
Here is the caller graph for this function:

◆ perdew86_spin()

void XC_Functional::perdew86_spin ( double rho,
double zeta,
double grho,
double & sc,
double & v1cup,
double & v1cdw,
double & v2c )
static
Here is the caller graph for this function:

◆ pw()

void XC_Functional::pw ( const double & rs,
const int & iflag,
double & ec,
double & vc )
static
Here is the caller graph for this function:

◆ pw_spin()

void XC_Functional::pw_spin ( const double & rs,
const double & zeta,
double & ec,
double & vcup,
double & vcdw )
static
Here is the caller graph for this function:

◆ pwcorr()

void XC_Functional::pwcorr ( const double r,
const double c[],
double & g,
double & dg )
static
Here is the caller graph for this function:

◆ pz()

void XC_Functional::pz ( const double & rs,
const int & iflag,
double & ec,
double & vc )
static
Here is the caller graph for this function:

◆ pz_polarized()

void XC_Functional::pz_polarized ( const double & rs,
double & ec,
double & vc )
static
Here is the caller graph for this function:

◆ pz_spin()

void XC_Functional::pz_spin ( const double & rs,
const double & zeta,
double & ec,
double & vcup,
double & vcdw )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_func_type()

void XC_Functional::set_func_type ( const int func_type_in)
inlinestatic

Set the functional class directly. set_xc_type() derives this from a functional name and is what production code uses; this is for callers that need to select a branch without configuring libxc.

Here is the caller graph for this function:

◆ set_hse_omega()

void XC_Functional::set_hse_omega ( const double omega_in)
static
Here is the caller graph for this function:

◆ set_hybrid_alpha()

void XC_Functional::set_hybrid_alpha ( const double alpha_in)
static
Here is the caller graph for this function:

◆ set_ked_flag()

void XC_Functional::set_ked_flag ( const bool ked_flag_in)
inlinestatic

Set whether the functional needs the kinetic energy density.

Here is the caller graph for this function:

◆ set_runtime_parameters()

void XC_Functional::set_runtime_parameters ( const XCFunctionalParameters & parameters)
static
Here is the caller graph for this function:

◆ set_xc_first_loop()

void XC_Functional::set_xc_first_loop ( const UnitCell & ucell)
static

Usually in exx caculation, the first SCF loop should be converged with PBE.

In the special "two-level" calculation case, the first scf iteration only calculate the functional without exact exchange. but in "nscf" calculation, there is no need of "two-level" method.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_xc_type()

void XC_Functional::set_xc_type ( const std::string xc_func_in)
static

◆ slater()

void XC_Functional::slater ( const double & rs,
double & ex,
double & vx )
static
Here is the caller graph for this function:

◆ slater1()

void XC_Functional::slater1 ( const double & rs,
double & ex,
double & vx )
static
Here is the caller graph for this function:

◆ slater1_spin()

void XC_Functional::slater1_spin ( const double & rho,
const double & zeta,
double & ex,
double & vxup,
double & vxdw )
static
Here is the caller graph for this function:

◆ slater_rxc()

void XC_Functional::slater_rxc ( const double & rs,
double & ex,
double & vx )
static
Here is the caller graph for this function:

◆ slater_rxc_spin()

void XC_Functional::slater_rxc_spin ( const double & rho,
const double & z,
double & ex,
double & vxup,
double & vxdw )
static
Here is the caller graph for this function:

◆ slater_spin()

void XC_Functional::slater_spin ( const double & rho,
const double & zeta,
double & ex,
double & vxup,
double & vxdw )
static
Here is the caller graph for this function:

◆ v_xc() [1/2]

std::tuple< double, double, ModuleBase::matrix > XC_Functional::v_xc ( const int & nrxx,
const Charge *const chr,
const UnitCell * ucell,
const int nspin,
const bool domag,
const bool domag_z,
const int gga_grad,
const double hybrid_alpha,
const double hse_omega )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ v_xc() [2/2]

std::tuple< double, double, ModuleBase::matrix > XC_Functional::v_xc ( const int & nrxx,
const Charge *const chr,
const UnitCell * ucell,
const int nspin,
const bool domag,
const bool domag_z,
const int gga_grad,
const double hybrid_alpha,
const double hse_omega,
const bool use_gpu )
static
Here is the call graph for this function:

◆ vwn()

void XC_Functional::vwn ( const double & rs,
double & ec,
double & vc )
static
Here is the caller graph for this function:

◆ wcx()

void XC_Functional::wcx ( const double & rho,
const double & grho,
double & sx,
double & v1x,
double & v2x )
static
Here is the caller graph for this function:

◆ wigner()

void XC_Functional::wigner ( const double & rs,
double & ec,
double & vc )
static
Here is the caller graph for this function:

◆ xc()

void XC_Functional::xc ( const double & rho,
double & exc,
double & vxc )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xc_spin()

void XC_Functional::xc_spin ( const double & rho,
const double & zeta,
double & exc,
double & vxcup,
double & vxcdw )
static
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ func_id

std::vector< int > XC_Functional::func_id
staticprivate

◆ func_type

int XC_Functional::func_type = 1
staticprivate

◆ hse_omega

double XC_Functional::hse_omega = 0.0
staticprivate

◆ hybrid_alpha

double XC_Functional::hybrid_alpha = 0.25
staticprivate

◆ ked_flag

bool XC_Functional::ked_flag = false
staticprivate

◆ need_laplacian

bool XC_Functional::need_laplacian = false
staticprivate

◆ runtime_parameters

XCFunctionalParameters XC_Functional::runtime_parameters
staticprivate

◆ scaling_factor_xc

std::map< int, double > XC_Functional::scaling_factor_xc = {{1, 1.0}}
staticprivate

◆ use_libxc

bool XC_Functional::use_libxc = true
staticprivate

The documentation for this class was generated from the following files: