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

Production adapter of the shifted Sternheimer operator (C7). More...

#include <dfpt_hamilt_shift.h>

Inheritance diagram for ModuleDFPT::DFPT_HamiltShift:
Collaboration diagram for ModuleDFPT::DFPT_HamiltShift:

Public Member Functions

 DFPT_HamiltShift (const UnitCell &ucell, ModulePW::PW_Basis *pw_rho, ModulePW::PW_Basis_K *pw_wfc, const std::vector< double > &veff_r, const DFPT_Pert *pert)
 ~DFPT_HamiltShift ()
 DFPT_HamiltShift (const DFPT_HamiltShift &)=delete
DFPT_HamiltShift & operator= (const DFPT_HamiltShift &)=delete
void set_context (const ModuleBase::Vector3< double > &q_cart, int k_idx)
void set_shift (double shift)
int dimension () const override
const DFPT_KQ_Basis & basis () const
void apply (const std::complex< double > *x, std::complex< double > *y) const override
double debug_t_vnl (const std::vector< std::complex< double > > &x) const
double debug_v_wfc (const std::vector< std::complex< double > > &x) const
Public Member Functions inherited from ModuleDFPT::DFPT_Stern::LinearOperator
virtual ~LinearOperator ()=default

Private Attributes

const UnitCell * ucell_ = nullptr
ModulePW::PW_Basis * pw_rho_ = nullptr
ModulePW::PW_Basis_K * pw_wfc_ = nullptr
const DFPT_Pert * pert_ = nullptr
std::vector< double > veff_r_
double tpiba2_ = 0.0
int nrxx_ = 0
DFPT_KQ_Basis kq_
double shift_ = 0.0
std::vector< int > kq2rho_
 projector bookkeeping per type (mu -> (beta index, m channel))
std::vector< std::vector< int > > mu_ib_
std::vector< std::vector< int > > mu_m_
 cached beta projectors per atom on the k+q list
std::vector< std::vector< std::vector< std::complex< double > > > > vkb_cache_
 apply-time scratch (apply is const)
std::vector< std::complex< double > > x_recip_
std::vector< std::complex< double > > x_r_
std::vector< std::complex< double > > becp_
std::vector< std::complex< double > > dbecp_
int ik_cache_ = 0

Detailed Description

Production adapter of the shifted Sternheimer operator (C7).

Applies y = (H(k+q) - eps_n) x on the k+q plane-wave basis, with the ground-state Hamiltonian assembled from module_dfpt primitives instead of the GS operator chain (which is index-bound to the GS k list):

  • kinetic tpiba^2 |G+k+q|^2 (diagonal, DFPT_KQ_Basis)
  • local V_eff FFT convolution with the real-space effective potential injected by the esolver after the GS SCF (veff_smooth row, shared FFT grid)
  • nonlocal V_nl separable projectors from DFPT_Pert::build_vkb at the k+q center, cached per (k,q) context
  • shift -eps_n fixed before each solve All transforms are phase-free on the shared FFT grid (the same convention as DFPT_Pert::real_space_dv), and the k+q scatter/gather goes through the (ix,iy,iz) FFT-cell reverse map (C1 finding: the rho and wfc stick encodings are not interchangeable).

Constructor & Destructor Documentation

◆ DFPT_HamiltShift() [1/2]

ModuleDFPT::DFPT_HamiltShift::DFPT_HamiltShift ( const UnitCell & ucell,
ModulePW::PW_Basis * pw_rho,
ModulePW::PW_Basis_K * pw_wfc,
const std::vector< double > & veff_r,
const DFPT_Pert * pert )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~DFPT_HamiltShift()

ModuleDFPT::DFPT_HamiltShift::~DFPT_HamiltShift ( )

◆ DFPT_HamiltShift() [2/2]

ModuleDFPT::DFPT_HamiltShift::DFPT_HamiltShift ( const DFPT_HamiltShift & )
delete
Here is the call graph for this function:

Member Function Documentation

◆ apply()

void ModuleDFPT::DFPT_HamiltShift::apply ( const std::complex< double > * x,
std::complex< double > * y ) const
overridevirtual

Implements ModuleDFPT::DFPT_Stern::LinearOperator.

Here is the call graph for this function:

◆ basis()

const DFPT_KQ_Basis & ModuleDFPT::DFPT_HamiltShift::basis ( ) const
inline

the k+q basis cached by the last set_context (the nscf path reads it for the kinetic preconditioner)

◆ debug_t_vnl()

double ModuleDFPT::DFPT_HamiltShift::debug_t_vnl ( const std::vector< std::complex< double > > & x) const

debug: <x|T + Vnl|x> without the veff convolution (design-phase validation diagnostics)

Here is the call graph for this function:

◆ debug_v_wfc()

double ModuleDFPT::DFPT_HamiltShift::debug_v_wfc ( const std::vector< std::complex< double > > & x) const

debug: <x|V|x> through the ground-state wfc-basis k-indexed FFT path (validation of the rho-grid scatter/gather convolution)

Here is the call graph for this function:

◆ dimension()

int ModuleDFPT::DFPT_HamiltShift::dimension ( ) const
overridevirtual

Implements ModuleDFPT::DFPT_Stern::LinearOperator.

Here is the call graph for this function:

◆ operator=()

DFPT_HamiltShift & ModuleDFPT::DFPT_HamiltShift::operator= ( const DFPT_HamiltShift & )
delete
Here is the call graph for this function:

◆ set_context()

void ModuleDFPT::DFPT_HamiltShift::set_context ( const ModuleBase::Vector3< double > & q_cart,
int k_idx )

Fix the (k, q) context and cache the k+q projector set; the eigenvalue shift (Ry) is set per solve through set_shift.

Here is the call graph for this function:

◆ set_shift()

void ModuleDFPT::DFPT_HamiltShift::set_shift ( double shift)
Here is the call graph for this function:

Member Data Documentation

◆ becp_

std::vector<std::complex<double> > ModuleDFPT::DFPT_HamiltShift::becp_
mutableprivate

◆ dbecp_

std::vector<std::complex<double> > ModuleDFPT::DFPT_HamiltShift::dbecp_
mutableprivate

◆ ik_cache_

int ModuleDFPT::DFPT_HamiltShift::ik_cache_ = 0
private

◆ kq2rho_

std::vector<int> ModuleDFPT::DFPT_HamiltShift::kq2rho_
private

projector bookkeeping per type (mu -> (beta index, m channel))

◆ kq_

DFPT_KQ_Basis ModuleDFPT::DFPT_HamiltShift::kq_
private

◆ mu_ib_

std::vector<std::vector<int> > ModuleDFPT::DFPT_HamiltShift::mu_ib_
private

◆ mu_m_

std::vector<std::vector<int> > ModuleDFPT::DFPT_HamiltShift::mu_m_
private

cached beta projectors per atom on the k+q list

◆ nrxx_

int ModuleDFPT::DFPT_HamiltShift::nrxx_ = 0
private

◆ pert_

const DFPT_Pert* ModuleDFPT::DFPT_HamiltShift::pert_ = nullptr
private

◆ pw_rho_

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

◆ pw_wfc_

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

◆ shift_

double ModuleDFPT::DFPT_HamiltShift::shift_ = 0.0
private

k+q list index -> rho-grid ig (-1 when the cell position carries no rho G; cannot happen with ecutrho >= 4 ecutwfc but kept defensive)

◆ tpiba2_

double ModuleDFPT::DFPT_HamiltShift::tpiba2_ = 0.0
private

◆ ucell_

const UnitCell* ModuleDFPT::DFPT_HamiltShift::ucell_ = nullptr
private

◆ veff_r_

std::vector<double> ModuleDFPT::DFPT_HamiltShift::veff_r_
private

◆ vkb_cache_

std::vector<std::vector<std::vector<std::complex<double> > > > ModuleDFPT::DFPT_HamiltShift::vkb_cache_
private

apply-time scratch (apply is const)

◆ x_r_

std::vector<std::complex<double> > ModuleDFPT::DFPT_HamiltShift::x_r_
mutableprivate

◆ x_recip_

std::vector<std::complex<double> > ModuleDFPT::DFPT_HamiltShift::x_recip_
mutableprivate

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