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

Plane-wave basis at the perturbation wavevector k+q. More...

#include <dfpt_kq_basis.h>

Collaboration diagram for ModuleDFPT::DFPT_KQ_Basis:

Public Member Functions

 DFPT_KQ_Basis ()
 ~DFPT_KQ_Basis ()
void init (const ModulePW::PW_Basis_K *pw_wfc, const ModulePW::PW_Basis *pw_rho, const ModuleBase::Vector3< double > &q_cart, int ik)
 Enumerate the local (per-processor) k+q plane-wave basis.
void clear ()
bool is_valid () const
 number of k+q plane waves on this processor
int get_npwk () const
int get_ig_rho (int igl) const
 G in Cartesian coordinates.
ModuleBase::Vector3< double > get_gcar (int igl) const
 G + (k+q) in Cartesian coordinates.
ModuleBase::Vector3< double > get_gpluskq (int igl) const
 |G + (k+q)|^2 in units of 1/lat0^2
double get_gk2 (int igl) const
 k+q wavevector in Cartesian coordinates
ModuleBase::Vector3< double > get_kplusq () const
const std::vector< double > & get_gk2_all () const
const std::vector< ModuleBase::Vector3< double > > & get_gcar_all () const

Private Attributes

const ModulePW::PW_Basis_K * pw_wfc_ = nullptr
 ground-state k-basis
ModuleBase::Vector3< double > kplusq_c_
 k+q in Cartesian coordinates
int npwk_ = 0
 number of k+q plane waves
std::vector< int > ig_rho_
 k+q index -> charge-grid G index
std::vector< double > gk2_
 |G + (k+q)|^2
std::vector< ModuleBase::Vector3< double > > gcar_
 G in Cartesian coordinates.

Detailed Description

Plane-wave basis at the perturbation wavevector k+q.

C0: for every (ik, q) pair the first-order response (the Sternheimer solution dpsi) lives in the k+q plane-wave basis. Rather than building a full PW_Basis_K (new FFT grids, MP redistribution) per q, this helper enumerates the k+q ball directly on the shared ground-state FFT grid: every integer G with |G + (k+q)|^2 <= gk_ecut is kept, carried by the single FFT cell that the half-space wrap assigns to it. The scan is exact (cell-to-G is bijective), so the ball layout of neither ground-state grid can silently drop members; a member whose cell lacks a charge-grid G quits with an explicit diagnostic instead (the veff convolution would otherwise zero its coefficient).

Preconditions:

  • The ground-state k-basis must be complex (gamma_only=false): DFPT couples k and k+q symmetrically and the q-perturbation breaks the gamma-only half-space reduction.
  • Both bases must share the same FFT grid dimensions (the k+q G vectors are exchanged between them through the shared FFT cell position).
  • ecutrho >= 4 ecutwfc: the charge ball (radius 2*sqrt(gk_ecut)) then carries every k+q ball member for q inside the first Brillouin zone.

Constructor & Destructor Documentation

◆ DFPT_KQ_Basis()

ModuleDFPT::DFPT_KQ_Basis::DFPT_KQ_Basis ( )

◆ ~DFPT_KQ_Basis()

ModuleDFPT::DFPT_KQ_Basis::~DFPT_KQ_Basis ( )

Member Function Documentation

◆ clear()

void ModuleDFPT::DFPT_KQ_Basis::clear ( )
Here is the call graph for this function:

◆ get_gcar()

ModuleBase::Vector3< double > ModuleDFPT::DFPT_KQ_Basis::get_gcar ( int igl) const
inline

G + (k+q) in Cartesian coordinates.

Here is the caller graph for this function:

◆ get_gcar_all()

const std::vector< ModuleBase::Vector3< double > > & ModuleDFPT::DFPT_KQ_Basis::get_gcar_all ( ) const
inline

◆ get_gk2()

double ModuleDFPT::DFPT_KQ_Basis::get_gk2 ( int igl) const
inline

k+q wavevector in Cartesian coordinates

Here is the caller graph for this function:

◆ get_gk2_all()

const std::vector< double > & ModuleDFPT::DFPT_KQ_Basis::get_gk2_all ( ) const
inline

◆ get_gpluskq()

ModuleBase::Vector3< double > ModuleDFPT::DFPT_KQ_Basis::get_gpluskq ( int igl) const
inline

|G + (k+q)|^2 in units of 1/lat0^2

Here is the caller graph for this function:

◆ get_ig_rho()

int ModuleDFPT::DFPT_KQ_Basis::get_ig_rho ( int igl) const
inline

G in Cartesian coordinates.

Here is the caller graph for this function:

◆ get_kplusq()

ModuleBase::Vector3< double > ModuleDFPT::DFPT_KQ_Basis::get_kplusq ( ) const
inline

◆ get_npwk()

int ModuleDFPT::DFPT_KQ_Basis::get_npwk ( ) const
inline

index of the G vector in the charge-density basis (-1 if the shared FFT cell position carries no local rho-grid G)

Here is the caller graph for this function:

◆ init()

void ModuleDFPT::DFPT_KQ_Basis::init ( const ModulePW::PW_Basis_K * pw_wfc,
const ModulePW::PW_Basis * pw_rho,
const ModuleBase::Vector3< double > & q_cart,
int ik )

Enumerate the local (per-processor) k+q plane-wave basis.

Parameters
pw_wfcground-state k-dependent plane-wave basis (complex)
pw_rhoground-state charge-density plane-wave basis
q_cartperturbation wavevector in Cartesian coordinates
ikindex of the ground-state k point
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_valid()

bool ModuleDFPT::DFPT_KQ_Basis::is_valid ( ) const
inline

number of k+q plane waves on this processor

Member Data Documentation

◆ gcar_

std::vector<ModuleBase::Vector3<double> > ModuleDFPT::DFPT_KQ_Basis::gcar_
private

G in Cartesian coordinates.

◆ gk2_

std::vector<double> ModuleDFPT::DFPT_KQ_Basis::gk2_
private

|G + (k+q)|^2

◆ ig_rho_

std::vector<int> ModuleDFPT::DFPT_KQ_Basis::ig_rho_
private

k+q index -> charge-grid G index

◆ kplusq_c_

ModuleBase::Vector3<double> ModuleDFPT::DFPT_KQ_Basis::kplusq_c_
private

k+q in Cartesian coordinates

◆ npwk_

int ModuleDFPT::DFPT_KQ_Basis::npwk_ = 0
private

number of k+q plane waves

◆ pw_wfc_

const ModulePW::PW_Basis_K* ModuleDFPT::DFPT_KQ_Basis::pw_wfc_ = nullptr
private

ground-state k-basis


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