ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
xc_kernel.h
Go to the documentation of this file.
1#pragma once
6#define CREF(x) const std::vector<double>& x = x##_;
7#define CREF3(x) const std::vector<ModuleBase::Vector3<double>>& x = x##_;
8namespace LR
9{
12 {
13 using Tvec = std::vector<double>;
14 using Tvec3 = std::vector<ModuleBase::Vector3<double>>;
15 public:
16 KernelXC(const ModulePW::PW_Basis& rho_basis,
17 const UnitCell& ucell,
18 const Charge& chg_gs,
19 const Parallel_Grid& pgrid,
20 const int& nspin,
21 const std::string& kernel_name,
22 const std::vector<std::string>& lr_init_xc_kernel,
23 const bool openshell = false);
25
26 // const references
27 CREF(vrho);CREF(vsigma); CREF(v2rho2); CREF(v2rhosigma); CREF(v2sigma2);
28 CREF3(v2rhosigma_2drho); CREF3(v2sigma2_4drho);
29 CREF3(v2rhosigma_drho_singlet); CREF3(v2rhosigma_drho_triplet); CREF3(v2sigma2_drho_singlet);CREF3(v2sigma2_drho_triplet);
30 CREF3(v2rhosigma_drho_uu); CREF3(v2rhosigma_drho_ud); CREF3(v2rhosigma_drho_du); CREF3(v2rhosigma_drho_dd);
31 CREF3(v2sigma2_drho_uu_u); CREF3(v2sigma2_drho_uu_d); CREF3(v2sigma2_drho_ud_u); CREF3(v2sigma2_drho_ud_d);
32 CREF3(v2sigma2_drho_du_u); CREF3(v2sigma2_drho_du_d); CREF3(v2sigma2_drho_dd_u); CREF3(v2sigma2_drho_dd_d);
33 const std::vector<std::vector<ModuleBase::Vector3<double>>>& drho_gs = drho_gs_;
34 private:
35#ifdef USE_LIBXC
37 void f_xc_libxc(const int& nspin, const double& omega, const double& tpiba, const double* const* const rho_gs, const double* const rho_core = nullptr);
38#endif
39 // See https://libxc.gitlab.io/manual/libxc-5.1.x/ for the naming convention of the following members.
40 // std::map<std::string, std::vector<double>> kernel_set_; // [kernel_type][nrxx][nspin]
41 std::vector<double> vrho_;
42 std::vector<double> vsigma_;
43 std::vector<double> v2rho2_;
44 std::vector<double> v2rhosigma_;
45 std::vector<double> v2sigma2_;
46 // std::map<std::string, std::vector<ModuleBase::Vector3<double>>> grad_kernel_set_;// [kernel_type][nrxx][nspin], intermediate terms for GGA
47 // for nspin=1, gga
48 std::vector<std::vector<ModuleBase::Vector3<double>>> drho_gs_;
49 std::vector<ModuleBase::Vector3<double>> v2rhosigma_2drho_;
50 std::vector<ModuleBase::Vector3<double>> v2sigma2_4drho_;
51
52 // for nspin=2 (close-shell), gga kernels
57
58 // for nspin=2 (open shell), gga kernels
72 const bool openshell_ = false;
73 };
74}
75
Definition charge.h:20
Calculate the exchange-correlation (XC) kernel ($f_{xc}=\delta^2E_xc/\delta\rho^2$) and store its com...
Definition xc_kernel.h:12
std::vector< double > Tvec
Definition xc_kernel.h:13
Tvec3 v2sigma2_drho_ud_d_
$2f^{\sigma_{uu}\sigma_{ud}}\nabla\rho_u+f^{\sigma_{ud}\sigma_{ud}}\nabla\rho_d$
Definition xc_kernel.h:66
CREF3(v2rhosigma_drho_singlet)
Tvec3 v2rhosigma_drho_dd_
$f^{\rho_d\sigma_{ud}}\nabla\rho_u+2f^{\rho_d\sigma_{dd}}\nabla\rho_d$
Definition xc_kernel.h:62
~KernelXC()
Definition xc_kernel.h:24
CREF3(v2sigma2_drho_uu_u)
Tvec3 v2rhosigma_drho_singlet_
$2(f^{\rho_u\sigma_{uu}}+f^{\rho_u\sigma_{ud}}+f^{\rho_u\sigma_{dd}})*\nabla\rho)$
Definition xc_kernel.h:53
std::vector< double > v2rho2_
Definition xc_kernel.h:43
CREF3(v2sigma2_drho_du_u)
Tvec3 v2sigma2_drho_du_d_
$4f^{\sigma_{uu}\sigma_{dd}}\nabla\rho_d+2f^{\sigma_{uu}\sigma_{ud}\nabla\rho_u$
Definition xc_kernel.h:68
CREF3(v2rhosigma_2drho)
std::vector< double > v2rhosigma_
Definition xc_kernel.h:44
Tvec3 v2sigma2_drho_triplet_
< $(4f^{\sigma_{uu}\sigma_{uu}}+6f^{\sigma_{uu}\sigma_{ud}}+4f^{\sigma_{uu}\sigma_{dd}}+2f^{\sigma_{u...
Definition xc_kernel.h:56
const std::vector< std::vector< ModuleBase::Vector3< double > > > & drho_gs
Definition xc_kernel.h:33
Tvec3 v2sigma2_drho_dd_d_
$2f^{\sigma_{ud}\sigma_{dd}}\nabla\rho_d+f^{\sigma_{ud}\sigma_{ud}}\nabla\rho_u$
Definition xc_kernel.h:70
Tvec3 v2sigma2_drho_uu_u_
Definition xc_kernel.h:63
Tvec3 v2rhosigma_drho_uu_
< $(4f^{\sigma_{uu}\sigma_{uu}}+2f^{\sigma_{uu}\sigma_{ud}}-4f^{\sigma_{uu}\sigma_{dd}}-2f^{\sigma_{u...
Definition xc_kernel.h:59
std::vector< ModuleBase::Vector3< double > > Tvec3
Definition xc_kernel.h:14
std::vector< double > vrho_
Definition xc_kernel.h:41
CREF3(v2rhosigma_drho_uu)
Tvec3 v2rhosigma_drho_triplet_
$2(f^{\rho_u\sigma_{uu}}-f^{\rho_u\sigma_{ud}})*\nabla\rho)$
Definition xc_kernel.h:54
Tvec3 v2sigma2_drho_du_u_
$4f^{\sigma_{uu}\sigma_{dd}}\nabla\rho_u+2f^{\sigma_{ud}\sigma_{dd}\nabla\rho_d$
Definition xc_kernel.h:67
std::vector< ModuleBase::Vector3< double > > v2rhosigma_2drho_
$f^{\rho\sigma}*\nabla\rho *2$
Definition xc_kernel.h:49
std::vector< std::vector< ModuleBase::Vector3< double > > > drho_gs_
$\nabla\rho$ of the ground state, size: nspin*nrxx
Definition xc_kernel.h:48
Tvec3 v2sigma2_drho_uu_d_
$4f^{\sigma_{uu}\sigma_{uu}}\nabla\rho_u+2f^{\sigma_{uu}\sigma_{ud}\nabla\rho_d$
Definition xc_kernel.h:64
Tvec3 v2sigma2_drho_dd_u_
$2f^{\sigma_{ud}\sigma_{dd}}\nabla\rho_d+f^{\sigma_{ud}\sigma_{ud}}\nabla\rho_u$
Definition xc_kernel.h:69
std::vector< ModuleBase::Vector3< double > > v2sigma2_4drho_
$f^{\sigma\sigma}*\nabla\rho *4$
Definition xc_kernel.h:50
std::vector< double > v2sigma2_
Definition xc_kernel.h:45
Tvec3 v2sigma2_drho_ud_u_
$2f^{\sigma_{uu}\sigma_{ud}}\nabla\rho_u+f^{\sigma_{ud}\sigma_{ud}}\nabla\rho_d$
Definition xc_kernel.h:65
std::vector< double > vsigma_
Definition xc_kernel.h:42
Tvec3 v2sigma2_drho_singlet_
Definition xc_kernel.h:55
const ModulePW::PW_Basis & rho_basis_
$4f^{\sigma_{dd}\sigma_{dd}}\nabla\rho_d+2f^{\sigma_{ud}\sigma_{dd}\nabla\rho_u$
Definition xc_kernel.h:71
const bool openshell_
Definition xc_kernel.h:72
Tvec3 v2rhosigma_drho_ud_
$f^{\rho_u\sigma_{ud}}\nabla\rho_u+2f^{\rho_u\sigma_{dd}}\nabla\rho_d$
Definition xc_kernel.h:60
Tvec3 v2rhosigma_drho_du_
$2f^{\rho_d\sigma_{uu}}\nabla\rho_u+f^{\rho_d\sigma_{ud}}\nabla\rho_d$
Definition xc_kernel.h:61
A class which can convert a function of "r" to the corresponding linear superposition of plane waves ...
Definition pw_basis.h:56
Definition parallel_grid.h:8
Definition unitcell.h:16
Definition esolver_ks_lcao.h:37