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

#include <dfpt_pert.h>

Collaboration diagram for ModuleDFPT::DFPT_Pert:

Public Member Functions

 DFPT_Pert ()
 ~DFPT_Pert ()
void init (UnitCell &ucell, ModulePW::PW_Basis *pw_rho, ModulePW::PW_Basis_K *pw_wfc, Structure_Factor &sf)
ModulePW::PW_Basis_K * get_pw_wfc () const
ModulePW::PW_Basis * get_pw_rho () const
void build_dv (int q_idx, int atom_idx, int dir, DFPT_PW_Data &data)
void apply_dv (int q_idx, int k_idx, const psi::Psi< std::complex< double > > &psi, DFPT_PW_Data &data)
void d2vloc_r (int atom_idx, int da, int db, std::vector< std::complex< double > > &dv2_r) const
void apply_d2vnl (int atom_idx, int da, int db, const ModuleBase::Vector3< double > &q_eff, const psi::Psi< std::complex< double > > &psi, int k_idx, std::vector< std::vector< std::complex< double > > > &d2v_psi) const
void build_vkb (int it, int ia, const std::vector< ModuleBase::Vector3< double > > &gk, std::vector< std::vector< std::complex< double > > > &vkb) const
void build_vkb_dk (int it, int ia, int dir, const std::vector< ModuleBase::Vector3< double > > &gk, std::vector< std::vector< std::complex< double > > > &vkb, std::vector< std::vector< std::complex< double > > > &dvkb) const
double radial_vq (int it, int ib, double g) const
 radial part (4pi/sqrt(Omega)) Integral beta(r) j_l(g r) r dr at g (bohr^-1)
void apply_vr (int q_idx, int k_idx, const std::vector< std::complex< double > > &v_rc, const psi::Psi< std::complex< double > > &psi, const ModuleBase::Vector3< double > &q_cart, std::vector< std::vector< std::complex< double > > > &dv_psi) const
void rho_gvec (int ig, ModuleBase::Vector3< double > &gcar) const
void dVloc_dtau (int atom_idx, int dir, const ModuleBase::Vector3< double > &q, std::vector< std::complex< double > > &dv)
void dVnl_dtau (int atom_idx, int dir, const ModuleBase::Vector3< double > &q, const psi::Psi< std::complex< double > > &psi, int k_idx, std::vector< std::vector< std::complex< double > > > &dv_psi)

Private Member Functions

double vloc_at_g (int it, double g2) const
void atom_index (int atom_idx, int &it, int &ia) const
 linear atom index -> (type, picture) of ucell_.
double real_ylm (int l, int m, const ModuleBase::Vector3< double > &ghat) const
 real spherical harmonic Y_{l,m}(g_hat), orthonormal convention, l<=2.
void grad_real_ylm (int l, int m, const ModuleBase::Vector3< double > &ghat, double grad[3]) const
void real_space_dv (int q_idx, int k_idx, const psi::Psi< std::complex< double > > &psi, DFPT_PW_Data &data, const DFPT_KQ_Basis &kq, std::vector< std::vector< std::complex< double > > > &dv_psi) const
void apply_vr_core (int k_idx, const std::vector< std::complex< double > > &v_rc, const psi::Psi< std::complex< double > > &psi, const DFPT_KQ_Basis &kq, std::vector< std::vector< std::complex< double > > > &dv_psi) const
void build_dv_u (int q_idx, int atom_idx, int dir, DFPT_PW_Data &data)
 first-order Hubbard potential dV_U (U0 reservation, C1 frozen term).

Private Attributes

UnitCell * ucell_ = nullptr
ModulePW::PW_Basis * pw_rho_ = nullptr
ModulePW::PW_Basis_K * pw_wfc_ = nullptr
Structure_Factor * sf_ = nullptr

Constructor & Destructor Documentation

◆ DFPT_Pert()

ModuleDFPT::DFPT_Pert::DFPT_Pert ( )

◆ ~DFPT_Pert()

ModuleDFPT::DFPT_Pert::~DFPT_Pert ( )

Member Function Documentation

◆ apply_d2vnl()

void ModuleDFPT::DFPT_Pert::apply_d2vnl ( int atom_idx,
int da,
int db,
const ModuleBase::Vector3< double > & q_eff,
const psi::Psi< std::complex< double > > & psi,
int k_idx,
std::vector< std::vector< std::complex< double > > > & d2v_psi ) const

C5: same-atom second-order NONLOCAL potential acting on psi, chi_n(G'') = (d^2 Vnl / d tau_{da} d tau_{db}) |psi_n> on the q_eff-shifted basis (q_eff = q when q is itself a reciprocal vector, otherwise 2q: the second-order potential carries wavevector 2q; normal-conserving separable case). The terms come from the phase derivatives of the out (q_eff-shifted) and in (k+G') projectors of the SAME displaced atom; they reduce to zero for a uniform translation at q=0 (acoustic consistency).

Here is the call graph for this function:

◆ apply_dv()

void ModuleDFPT::DFPT_Pert::apply_dv ( int q_idx,
int k_idx,
const psi::Psi< std::complex< double > > & psi,
DFPT_PW_Data & data )
Here is the call graph for this function:

◆ apply_vr()

void ModuleDFPT::DFPT_Pert::apply_vr ( int q_idx,
int k_idx,
const std::vector< std::complex< double > > & v_rc,
const psi::Psi< std::complex< double > > & psi,
const ModuleBase::Vector3< double > & q_cart,
std::vector< std::vector< std::complex< double > > > & dv_psi ) const

C7: apply a complex real-space potential on the shared FFT grid to every band of psi (k basis), delivering |v psi> on the k+q basis. The potential is the q-shifted complex periodic amplitude (the same convention as dv_rc); the DFPT self-consistent loop uses it for the screened response potential (Hartree + XC) of the mixed density.

Here is the call graph for this function:

◆ apply_vr_core()

void ModuleDFPT::DFPT_Pert::apply_vr_core ( int k_idx,
const std::vector< std::complex< double > > & v_rc,
const psi::Psi< std::complex< double > > & psi,
const DFPT_KQ_Basis & kq,
std::vector< std::vector< std::complex< double > > > & dv_psi ) const
private

shared core of real_space_dv / apply_vr: phase-free cyclic convolution of v_rc with every band of psi, scattered/gathered between the k+q list and the rho grid through the FFT-cell triple.

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

◆ atom_index()

void ModuleDFPT::DFPT_Pert::atom_index ( int atom_idx,
int & it,
int & ia ) const
private

linear atom index -> (type, picture) of ucell_.

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

◆ build_dv()

void ModuleDFPT::DFPT_Pert::build_dv ( int q_idx,
int atom_idx,
int dir,
DFPT_PW_Data & data )
Here is the call graph for this function:

◆ build_dv_u()

void ModuleDFPT::DFPT_Pert::build_dv_u ( int q_idx,
int atom_idx,
int dir,
DFPT_PW_Data & data )
private

first-order Hubbard potential dV_U (U0 reservation, C1 frozen term).

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

◆ build_vkb()

void ModuleDFPT::DFPT_Pert::build_vkb ( int it,
int ia,
const std::vector< ModuleBase::Vector3< double > > & gk,
std::vector< std::vector< std::complex< double > > > & vkb ) const

Build the beta-projector array (in the ABACUS vkb convention) for a single atom on an arbitrary k-shifted reciprocal vector list: vkb[mu][ielem] = (-i)^l * Ylm(Ghat) * (4pi/sqrt(Omega) * integral beta(r) j_l(g r) r dr) * exp(i G.tau) with G in 2*pi/lat0 units, g = |G| * tpiba (bohr^-1), tau in bohr. Usable for both the incoming k basis (G = k+G') and the outgoing DFPT k+q basis (G = k+q+G''), so the atomic phase is correct on either side. Public since C6: DFPT_Q0 reuses it for the velocity operator.

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

◆ build_vkb_dk()

void ModuleDFPT::DFPT_Pert::build_vkb_dk ( int it,
int ia,
int dir,
const std::vector< ModuleBase::Vector3< double > > & gk,
std::vector< std::vector< std::complex< double > > > & vkb,
std::vector< std::vector< std::complex< double > > > & dvkb ) const

C6: analytic derivative of the beta projector with respect to the list shift k_dir (the same shift build_vkb is evaluated at), three terms: the atomic phase (i 2pi tau_dir), the radial chain rule (vq'(g) * tpiba * Ghat_dir, central finite difference of radial_vq) and the real-harmonic direction derivative (grad_real_ylm chain (e_dir - ghat ghat_dir)/|G|). Feeds the dV_nl/dk part of the velocity operator in DFPT_Q0::pos_matrix.

< empirical parameter: |G| floor (2*pi/lat0) for the angular terms

Here is the call graph for this function:

◆ d2vloc_r()

void ModuleDFPT::DFPT_Pert::d2vloc_r ( int atom_idx,
int da,
int db,
std::vector< std::complex< double > > & dv2_r ) const

C5: real-space kernel of the same-atom second-order LOCAL potential d2V_loc(r) = d^2 V_loc / d tau_{da} d tau_{db} (both displacement dressings e^{i q.R} multiply on the SAME atom, so the cell sum collapses to G = 2q mod integers: the kernel is nonzero only when 2q is reciprocal, in which case every integer G survives with its own phase and the kernel equals the plain q=0 one, -w_da w_db Vloc(|w|) exp(i w.tau)). The caller gates on 2q reciprocal and skips otherwise. Returned on the shared real-space grid; its expectation value with |u(r)|^2 enters the electronic dynamical matrix (anharmonic term).

< empirical parameter: |G|^2 zero-shell guard (2*pi/lat0 units)

Here is the call graph for this function:

◆ dVloc_dtau()

void ModuleDFPT::DFPT_Pert::dVloc_dtau ( int atom_idx,
int dir,
const ModuleBase::Vector3< double > & q,
std::vector< std::complex< double > > & dv )

First-order asymmetric-part local potential on the rho grid: dVloc_dtau(Delta) = -i (Delta+q).direction * Vloc(|Delta+q|)

  • exp(-i (Delta+q).tau_atom) * ... (GS structure-factor convention exp(-2pi g.tau); the sign/coefficient is the exact derivative of the local potential with respect to the atomic displacement). Stateless building block validated by the serial analytic tests against a finite difference of the displaced potential.

< empirical parameter: |Delta+q|^2 zero-shell guard (2*pi/lat0 units)

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

◆ dVnl_dtau()

void ModuleDFPT::DFPT_Pert::dVnl_dtau ( int atom_idx,
int dir,
const ModuleBase::Vector3< double > & q,
const psi::Psi< std::complex< double > > & psi,
int k_idx,
std::vector< std::vector< std::complex< double > > > & dv_psi )

C1: first-order NONLOCAL potential acting on psi (normal-conserving separable case), for one displaced atom in direction dir. Uses the identity (GS exp(-2pi gk.tau) projector convention) dVnl/dtau_a |psi> = -i (k+q+G'')_a * (Vnl |psi>)

  • Vnl[ i (k+G')_a |psi> ] so only two applications of the ground-state nonlocal operator on the DFPT k+q outgoing basis are needed (dsVnl contribution per pair is i (q+G''-G')_a times the zero-order matrix element). USPP/ultrasoft and spin-orbit projectors are rejected for now. Stateless building block validated by the serial analytic tests against an operator finite difference.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_pw_rho()

ModulePW::PW_Basis * ModuleDFPT::DFPT_Pert::get_pw_rho ( ) const
inline

◆ get_pw_wfc()

ModulePW::PW_Basis_K * ModuleDFPT::DFPT_Pert::get_pw_wfc ( ) const
inline

C5: read access to the ground-state wfc basis for the dynamical-matrix contractions in DFPT_Phon::accumulate_electron.

◆ grad_real_ylm()

void ModuleDFPT::DFPT_Pert::grad_real_ylm ( int l,
int m,
const ModuleBase::Vector3< double > & ghat,
double grad[3] ) const
private

gradient of real_ylm with respect to the unit vector ghat, l<=2 (dY/dghat returned per cartesian component).

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

◆ init()

void ModuleDFPT::DFPT_Pert::init ( UnitCell & ucell,
ModulePW::PW_Basis * pw_rho,
ModulePW::PW_Basis_K * pw_wfc,
Structure_Factor & sf )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ radial_vq()

double ModuleDFPT::DFPT_Pert::radial_vq ( int it,
int ib,
double g ) const

radial part (4pi/sqrt(Omega)) Integral beta(r) j_l(g r) r dr at g (bohr^-1)

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

◆ real_space_dv()

void ModuleDFPT::DFPT_Pert::real_space_dv ( int q_idx,
int k_idx,
const psi::Psi< std::complex< double > > & psi,
DFPT_PW_Data & data,
const DFPT_KQ_Basis & kq,
std::vector< std::vector< std::complex< double > > > & dv_psi ) const
private

General (nonlocal and local) part of apply_dv for the compartments that live in real space (local potential); the |psi> product requires the shared real-space grid of pw_rho_/pw_wfc_.

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

◆ real_ylm()

double ModuleDFPT::DFPT_Pert::real_ylm ( int l,
int m,
const ModuleBase::Vector3< double > & ghat ) const
private

real spherical harmonic Y_{l,m}(g_hat), orthonormal convention, l<=2.

< empirical parameter: |ghat| floor for the zero-direction limit

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

◆ rho_gvec()

void ModuleDFPT::DFPT_Pert::rho_gvec ( int ig,
ModuleBase::Vector3< double > & gcar ) const

Grid helper: reconstruct the cartesian reciprocal vector (in 2*pi/lat0 units) of rho-grid index ig from the shared FFT-grid (ix,iy,iz) mapping. A stateless building block exposed publicly so the serial analytic tests can validate the rho-grid G layout directly.

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

◆ vloc_at_g()

double ModuleDFPT::DFPT_Pert::vloc_at_g ( int it,
double g2 ) const
private

C1: first-order LOCAL potential dVloc_dtau (per displaced atom). The local pseudopotential Vloc(g^2) at an arbitrary magnitude: Coulomb atoms use the analytic form, numeric pseudopotentials reuse the radial-mesh Fourier transform of vl_pw.cpp::vloc_of_g at |g| themselves.

< empirical parameter: |G| floor (bohr^-1) for the G=0 radial integral

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

Member Data Documentation

◆ pw_rho_

ModulePW::PW_Basis* ModuleDFPT::DFPT_Pert::pw_rho_ = nullptr
private

◆ pw_wfc_

ModulePW::PW_Basis_K* ModuleDFPT::DFPT_Pert::pw_wfc_ = nullptr
private

◆ sf_

Structure_Factor* ModuleDFPT::DFPT_Pert::sf_ = nullptr
private

◆ ucell_

UnitCell* ModuleDFPT::DFPT_Pert::ucell_ = nullptr
private

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