|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
#include <pot_grad_xc.h>
Classes | |
| struct | Scratch |
Public Member Functions | |
| PotGradXCLR (const KernelXC &xc_kernel_in, const ModulePW::PW_Basis &rho_basis, const UnitCell &ucell, const int &nrxx, const int nspin, const bool triplet) | |
| ~PotGradXCLR () | |
| virtual void | cal_v_eff (double **rho, const UnitCell &ucell, ModuleBase::matrix &v_eff, const std::vector< int > &ispin_op={ 0, 0 }) const override |
| void | cal_v_eff_openshell (const double *const *const rho1, const UnitCell &ucell, ModuleBase::matrix &v_eff, const int tau) const |
| Open-shell (spin-unrestricted) $v^{(2)}_\tau$. Unlike the closed-shell case this is NOT a per-(sl,sr) block object: the free spin $\tau$ is the output index, but BOTH channels of the transition density enter the same expression, so rho1 must carry rho1[0] and rho1[1] together. $v^{(2)}_\tau = A_\tau - \nabla\cdot\boldsymbol{E}_\tau$ For stabilized LR coefficients this differentiates the actual LR quadratic form: only implicit sigma dependencies carry the preparation Jacobian; explicit gradient factors and local terms remain active. Both transition channels have nrxx entries. | |
| Public Member Functions inherited from LR::PotLRBase | |
| PotLRBase (const ModulePW::PW_Basis &rho_basis, const int &nspin, const int &nrxx, const double &tpiba) | |
| const ModulePW::PW_Basis & | get_rho_basis () const |
Public Attributes | |
| const KernelXC & | xc_kernel_components_ |
| kernel components from PotHxcLR | |
| const bool | triplet_ = false |
| Public Attributes inherited from LR::PotLRBase | |
| const int & | nrxx = nrxx_ |
| const int & | nspin = nspin_ |
Static Private Member Functions | |
| static Scratch & | scratch () |
Additional Inherited Members | |
| Protected Attributes inherited from LR::PotLRBase | |
| const ModulePW::PW_Basis & | rho_basis_ |
| const int | nspin_ = 1 |
| const int | nrxx_ = 1 |
| const double & | tpiba_ |
the "potential" contributing to RHS of Z-vector equation from the derivative of xc kernel
| LR::PotGradXCLR::PotGradXCLR | ( | const KernelXC & | xc_kernel_in, |
| const ModulePW::PW_Basis & | rho_basis, | ||
| const UnitCell & | ucell, | ||
| const int & | nrxx, | ||
| const int | nspin, | ||
| const bool | triplet ) |
constructor for exchange-correlation kernel triplet selects which spin combination of $g^{xc}$ to use. It matters: the triplet kernel $K^T_{xc}=f_{uu}-f_{ud}$ is NOT zero for a local functional.
|
inline |
|
overridevirtual |
$v^{(2)}(r)=\iint dr'dr''\,g^{xc}(r,r',r'')\rho^1(r')\rho^1(r'')$, i.e. the third functional derivative of $E_{xc}$ contracted twice with the transition density $\rho^1$ (no factor 1/2).
All the coefficients and spin sums live in KernelXC::GxcCoef, so this is a plain transcription of the boxed formula and is identical for nspin=1, singlet and triplet.
Worth stating once: for a GGA, $g^{xc}$ is NOT the whole of $v^{(2)}$. Because $\sigma=\nabla\rho\cdot\nabla\rho$ is quadratic in the density it has a non-vanishing second derivative along $\rho^1$, which drags the second-order kernels $f^{\rho\sigma}$ and $f^{\sigma\sigma}$ into the answer (the $a_q$, $\boldsymbol{e}_q$, $c_s$, $c_t$ terms).
Implements LR::PotLRBase.
| void LR::PotGradXCLR::cal_v_eff_openshell | ( | const double *const *const | rho1, |
| const UnitCell & | ucell, | ||
| ModuleBase::matrix & | v_eff, | ||
| const int | tau ) const |
Open-shell (spin-unrestricted) $v^{(2)}_\tau$. Unlike the closed-shell case this is NOT a per-(sl,sr) block object: the free spin $\tau$ is the output index, but BOTH channels of the transition density enter the same expression, so rho1 must carry rho1[0] and rho1[1] together. $v^{(2)}_\tau = A_\tau - \nabla\cdot\boldsymbol{E}_\tau$ For stabilized LR coefficients this differentiates the actual LR quadratic form: only implicit sigma dependencies carry the preparation Jacobian; explicit gradient factors and local terms remain active. Both transition channels have nrxx entries.
$v^{(2)}_\tau=A_\tau-\nabla\cdot\boldsymbol{E}_\tau$ for the open-shell case, contracted straight out of the raw libxc arrays (there is no useful pre-contraction: the free spin $\tau$ stays open, so a GxcCoef-style cache would cost ~117 doubles per grid point against the 35 the third-order arrays already occupy).
With $s_\sigma=\rho^1_\sigma$, $t_{ab}=\nabla\rho_a\cdot\nabla\rho^1_b$ (NOT symmetric) and $q_{ab}=\nabla\rho^1_a\cdot\nabla\rho^1_b$, the $\lambda$-derivatives of libxc's three sigma variables are $S=(2t_{uu},\;t_{ud}+t_{du},\;2t_{dd})$, $Q=(2q_{uu},\;2q_{ud},\;2q_{dd})$, and with $D=\sum_\sigma s_\sigma\partial_{\rho_\sigma}+\sum_a S_a\partial_{\sigma_a}$, $A_\tau = D^2 e^{\rho_\tau} + \sum_a Q_a e^{\rho_\tau\sigma_a}$, $u'_a = D\,e^{\sigma_a}$, $u''_a = D^2 e^{\sigma_a}+\sum_b Q_b e^{\sigma_a\sigma_b}$, $\boldsymbol{E}_\tau=\sum_a\theta^\tau_a \big(u''_a\,\nabla\rho_{c(\tau,a)} + 2u'_a\,\nabla\rho^1_{c(\tau,a)}\big)$. The channel selector $c(\tau,a)$ is what produces the closed-shell $\tilde\theta$: for the triplet $\nabla\rho^1_d=-\nabla\rho^1_u$, which is invisible in any singlet-only test.
|
staticprivate |
| const bool LR::PotGradXCLR::triplet_ = false |