|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Calculate the exchange-correlation (XC) kernel ($f_{xc}=\delta^2E_xc/\delta\rho^2$) and store its components. More...
#include <xc_kernel.h>
Classes | |
| struct | ClosedShellGga |
| struct | GxcCoef |
| The coefficients of $v^{(2)}(r)=\iint dr'dr''\,g^{xc}(r,r',r'')\rho^1(r')\rho^1(r'')$ for ONE spin combination, stored exactly as they appear in the final formula: $v^{(2)} = a_{s^2}s^2 + a_{st}\,s\,t + a_{t^2}t^2 + a_q\,q. More... | |
Public Types | |
| enum | GxcSpin { NoGxc = 0 , Singlet = 1 , Triplet = 2 , BothSpins = 3 } |
| Which spin combinations of the $g^{xc}$ coefficient set (GxcCoef) to build. More... | |
| enum class | Purpose { LinearResponse , GroundStateResponse } |
| GS response starts from raw sigma; non-finite HSE coefficients trigger a reported fallback. More... | |
Public Member Functions | |
| KernelXC (const ModulePW::PW_Basis &rho_basis, const UnitCell &ucell, const Charge &chg_gs, const Parallel_Grid &pgrid, const int &nspin, const std::string &kernel_name, const std::vector< std::string > &lr_init_xc_kernel, const bool openshell=false, const int gxc_spin=GxcSpin::NoGxc) | |
| KernelXC (Purpose purpose, const ModulePW::PW_Basis &rho_basis, const UnitCell &ucell, const Charge &chg_gs, const Parallel_Grid &pgrid, const int &nspin, const std::string &kernel_name, const std::vector< std::string > &lr_init_xc_kernel, bool openshell, int gxc_spin) | |
| ~KernelXC () | |
| int | nspin () const |
| Metadata belongs to this coefficient set, independent of later global XC changes. | |
| int | functional_type () const |
| const std::string & | name () const |
| bool | gs_sigma_fallback_used () const |
| CREF (vrho) | |
| CREF (vsigma) | |
| CREF (v2rho2) | |
| CREF (v2rhosigma) | |
| CREF (v2sigma2) | |
| CREF (v3rho3) | |
| CREF (v3rho2sigma) | |
| CREF (v3rhosigma2) | |
| CREF (v3sigma3) | |
| const ClosedShellGga & | closed_shell_gga (const bool triplet) const |
| const GxcCoef & | gxc (const bool triplet) const |
| const Tvec & | sigma_jacobian () const |
| bool | is_gga () const |
Public Attributes | |
| const bool & | openshell = openshell_ |
| const std::vector< std::vector< ModuleBase::Vector3< double > > > & | drho_gs = drho_gs_ |
Private Types | |
| using | Tvec = std::vector<double> |
Private Member Functions | |
| void | build_gxc_coef (GxcCoef &dst, const bool triplet, const int &nspin, const bool &is_gga) |
| Fill dst for one spin combination. All the spin algebralives here, driven by the weight vectors that distinguish singlet from triplet – the two differ only in those weights. | |
Private Attributes | |
| std::vector< double > | vrho_ |
| std::vector< double > | vsigma_ |
| std::vector< double > | v2rho2_ |
| std::vector< double > | v2rhosigma_ |
| std::vector< double > | v2sigma2_ |
| std::vector< std::vector< ModuleBase::Vector3< double > > > | drho_gs_ |
| $\nabla\rho$ of the ground state, size: nspin*nrxx | |
| ClosedShellGga | closed_shell_gga_s_ |
| ClosedShellGga | closed_shell_gga_t_ |
| Tvec | v3rho3_ |
| Tvec | v3rho2sigma_ |
| Tvec | v3rhosigma2_ |
| Tvec | v3sigma3_ |
| GxcCoef | gxc_s_ |
| GxcCoef | gxc_t_ |
| const int | nspin_ |
| const std::string | kernel_name_ |
| int | functional_type_ = 0 |
| const int | gxc_spin_ = GxcSpin::NoGxc |
| which GxcCoef sets to build, see GxcSpin | |
| const Purpose | purpose_ |
| Tvec | sigma_jacobian_ |
| bool | gs_sigma_fallback_used_ = false |
| const ModulePW::PW_Basis & | rho_basis_ |
| const bool | openshell_ = false |
Calculate the exchange-correlation (XC) kernel ($f_{xc}=\delta^2E_xc/\delta\rho^2$) and store its components.
|
private |
Which spin combinations of the $g^{xc}$ coefficient set (GxcCoef) to build.
| Enumerator | |
|---|---|
| NoGxc | |
| Singlet | |
| Triplet | |
| BothSpins | |
|
strong |
| LR::KernelXC::KernelXC | ( | const ModulePW::PW_Basis & | rho_basis, |
| const UnitCell & | ucell, | ||
| const Charge & | chg_gs, | ||
| const Parallel_Grid & | pgrid, | ||
| const int & | nspin, | ||
| const std::string & | kernel_name, | ||
| const std::vector< std::string > & | lr_init_xc_kernel, | ||
| const bool | openshell = false, | ||
| const int | gxc_spin = GxcSpin::NoGxc ) |
| LR::KernelXC::KernelXC | ( | Purpose | purpose, |
| const ModulePW::PW_Basis & | rho_basis, | ||
| const UnitCell & | ucell, | ||
| const Charge & | chg_gs, | ||
| const Parallel_Grid & | pgrid, | ||
| const int & | nspin, | ||
| const std::string & | kernel_name, | ||
| const std::vector< std::string > & | lr_init_xc_kernel, | ||
| bool | openshell, | ||
| int | gxc_spin ) |
Explicit response role; GS response requests only second derivatives. Density and grid are borrowed and never modified; their spin layouts must agree.
|
inline |
|
private |
Fill dst for one spin combination. All the spin algebralives here, driven by the weight vectors that distinguish singlet from triplet – the two differ only in those weights.
|
inline |
| LR::KernelXC::CREF | ( | v2rho2 | ) |
| LR::KernelXC::CREF | ( | v2rhosigma | ) |
| LR::KernelXC::CREF | ( | v2sigma2 | ) |
| LR::KernelXC::CREF | ( | v3rho2sigma | ) |
| LR::KernelXC::CREF | ( | v3rho3 | ) |
| LR::KernelXC::CREF | ( | v3rhosigma2 | ) |
| LR::KernelXC::CREF | ( | v3sigma3 | ) |
| LR::KernelXC::CREF | ( | vrho | ) |
| LR::KernelXC::CREF | ( | vsigma | ) |
|
inline |
|
inline |
Construction metadata: true only after a collective HSE GS-response fallback. This flags an approximate orbital Hessian; the SCF potential is unchanged.
|
inline |
nspin=1 has no singlet/triplet distinction, so it always returns the one set that is built. Throws instead of handing back an empty set when the requested combination was not requested at construction – silently returning zeros would look like a physics bug.
|
inline |
Whether THIS kernel (built for its own functional name, which may differ from the ground state's dft_functional in a cross-functional run such as TDLDA@PBE) needs the GGA gradient terms. drho_gs_ is only ever filled when this kernel's own is_gga was true at construction (see f_xc_libxc), so its emptiness is a reliable per-kernel proxy – unlike the global XC_Functional::get_func_type(), which reflects the ground state's functional and disagrees with this kernel whenever the two differ.
|
inline |
|
inline |
Metadata belongs to this coefficient set, independent of later global XC changes.
|
inline |
Componentwise derivative of prepared sigma; empty means identity. Borrowed for the kernel lifetime, point-major: one component at nspin=1, or (uu, ud, dd) at nspin=2. Only implicit coefficient derivatives use it.
|
private |
|
private |
| const std::vector<std::vector<ModuleBase::Vector3<double> > >& LR::KernelXC::drho_gs = drho_gs_ |
|
private |
$\nabla\rho$ of the ground state, size: nspin*nrxx
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| const bool& LR::KernelXC::openshell = openshell_ |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |