QMCPACK
LRHandlerBase Struct Referenceabstract

base class for LRHandlerTemp<FUNC,BASIS> and DummyLRHanlder<typename Func> More...

+ Inheritance diagram for LRHandlerBase:
+ Collaboration diagram for LRHandlerBase:

Public Member Functions

virtual mRealType evaluate_vlr_k (mRealType k) const =0
 
 LRHandlerBase (mRealType kc)
 
virtual ~LRHandlerBase ()=default
 
mRealType get_rc () const
 
mRealType get_kc () const
 
mRealType evaluate_w_sk (const std::vector< int > &kshell, const pRealType *restrict sk) const
 
mRealType evaluate (const std::vector< int > &kshell, const pRealType *restrict rk1_r, const pRealType *restrict rk1_i, const pRealType *restrict rk2_r, const pRealType *restrict rk2_i) const
 evaluate $\sum_k F_{k} \rho^1_{-{\bf k}} \rho^2_{\bf k}$ More...
 
virtual mRealType evaluate_slab (pRealType z, const std::vector< int > &kshell, const pRealType *restrict rk1_r, const pRealType *restrict rk1_i, const pRealType *restrict rk2_r, const pRealType *restrict rk2_i) const
 Evaluate the long-range potential with the open BC for the D-1 direction. More...
 
void evaluateGrad (const ParticleSet &A, const ParticleSet &B, int specB, std::vector< pRealType > &Zat, std::vector< TinyVector< pRealType, OHMMS_DIM >> &grad1) const
 evaluate $\sum_k F_{k} \rho^1_{-{\bf k}} \rho^2_{\bf k}$ and $\sum_k F_{k} \rho^1_{-{\bf k}} \rho^2_{\bf k}$ More...
 
SymTensor< pRealType, OHMMS_DIMevaluateStress (const std::vector< int > &kshell, const pRealType *rhokA_r, const pRealType *rhokA_i, const pRealType *rhokB_r, const pRealType *rhokB_i) const
 FIX_PRECISION. More...
 
virtual mRealType evaluateSR_k0 () const
 evaluate $ v_{s}(k=0) = \frac{4\pi}{V}\int_0^{r_c} r^2 v_s(r) dr $ More...
 
virtual mRealType evaluateLR_r0 () const
 evaluate $ v_s(r=0) $ for the self-interaction term More...
 
virtual SymTensor< mRealType, OHMMS_DIMevaluateLR_r0_dstrain () const
 These functions return the strain derivatives of all corresponding quantities in total energy. More...
 
virtual SymTensor< mRealType, OHMMS_DIMevaluateSR_k0_dstrain () const
 
virtual SymTensor< mRealType, OHMMS_DIMevaluateLR_dstrain (TinyVector< pRealType, OHMMS_DIM > k, pRealType kmag) const
 
virtual SymTensor< mRealType, OHMMS_DIMevaluateSR_dstrain (TinyVector< pRealType, OHMMS_DIM > r, pRealType rmag) const
 
virtual void initBreakup (ParticleSet &ref)=0
 
virtual void Breakup (ParticleSet &ref, mRealType rs_in)=0
 
virtual void resetTargetParticleSet (ParticleSet &ref)=0
 
virtual mRealType evaluate (mRealType r, mRealType rinv) const =0
 
virtual mRealType evaluateLR (mRealType r) const =0
 
virtual mRealType srDf (mRealType r, mRealType rinv) const =0
 
virtual mRealType lrDf (mRealType r) const
 
virtual LRHandlerBasemakeClone (ParticleSet &ref) const =0
 make clone More...
 

Public Attributes

DECLARE_COULOMB_TYPES int MaxKshell
 Maxkimum Kshell for the given Kc. More...
 
mRealType LR_kc
 Maximum k cutoff. More...
 
mRealType LR_rc
 Maximum r cutoff. More...
 
Vector< mRealTypeFk
 Fourier component for all the k-point. More...
 
Vector< mRealTypeFkg
 Fourier component of the LR part, fit to optimize the gradients. More...
 
std::vector< SymTensor< mRealType, OHMMS_DIM > > dFk_dstrain
 Fourier component of the LR part of strain tensor, by optimized breakup. More...
 
Vector< mRealTypeFkgstrain
 Vector of df_k/dk, fit as to optimize strains. More...
 
Vector< mRealTypeFk_symm
 Fourier component for each k-shell. More...
 
std::vector< mRealTypecoefs
 Fourier component for each k-shell Coefficient. More...
 
std::vector< mRealTypegcoefs
 Coefficient for gradient fit. More...
 
std::vector< mRealTypegstraincoefs
 Coefficient for strain fit. More...
 

Protected Attributes

std::string ClassName
 

Detailed Description

base class for LRHandlerTemp<FUNC,BASIS> and DummyLRHanlder<typename Func>

Definition at line 30 of file LRHandlerBase.h.

Constructor & Destructor Documentation

◆ LRHandlerBase()

LRHandlerBase ( mRealType  kc)
inlineexplicit

Definition at line 63 of file LRHandlerBase.h.

63 : MaxKshell(0), LR_kc(kc), LR_rc(0), ClassName("LRHandlerBase") {}
mRealType LR_kc
Maximum k cutoff.
Definition: LRHandlerBase.h:37
DECLARE_COULOMB_TYPES int MaxKshell
Maxkimum Kshell for the given Kc.
Definition: LRHandlerBase.h:35
mRealType LR_rc
Maximum r cutoff.
Definition: LRHandlerBase.h:39

◆ ~LRHandlerBase()

virtual ~LRHandlerBase ( )
virtualdefault

Member Function Documentation

◆ Breakup()

◆ evaluate() [1/2]

mRealType evaluate ( const std::vector< int > &  kshell,
const pRealType *restrict  rk1_r,
const pRealType *restrict  rk1_i,
const pRealType *restrict  rk2_r,
const pRealType *restrict  rk2_i 
) const
inline

evaluate $\sum_k F_{k} \rho^1_{-{\bf k}} \rho^2_{\bf k}$

Parameters
kshelldegeneracies of the vectors
rk1_r/istarting address of $\rho^1_{{\bf k}}$
rk2_r/istarting address of $\rho^2_{{\bf k}}$

Valid for the strictly ordered k and $F_{k}$.

Definition at line 93 of file LRHandlerBase.h.

References LRHandlerBase::Fk_symm, and LRHandlerBase::MaxKshell.

Referenced by qmcplusplus::createSpline4RbyVs_temp(), qmcplusplus::createSpline4RbyVsDeriv_temp(), ShortRangePartAdapter< T >::f(), BackflowBuilder::makeShortRange_twoBody(), and ShortRangePartAdapter< T >::setRmax().

98  {
99  mRealType vk = 0.0;
100  for (int ks = 0, ki = 0; ks < MaxKshell; ks++)
101  {
102  mRealType u = 0;
103  for (; ki < kshell[ks + 1]; ki++)
104  u += ((*rk1_r++) * (*rk2_r++) + (*rk1_i++) * (*rk2_i++));
105  vk += Fk_symm[ks] * u;
106  }
107  return vk;
108  }
DECLARE_COULOMB_TYPES int MaxKshell
Maxkimum Kshell for the given Kc.
Definition: LRHandlerBase.h:35
EwaldHandler3D::mRealType mRealType
Vector< mRealType > Fk_symm
Fourier component for each k-shell.
Definition: LRHandlerBase.h:49

◆ evaluate() [2/2]

◆ evaluate_slab()

virtual mRealType evaluate_slab ( pRealType  z,
const std::vector< int > &  kshell,
const pRealType *restrict  rk1_r,
const pRealType *restrict  rk1_i,
const pRealType *restrict  rk2_r,
const pRealType *restrict  rk2_i 
) const
inlinevirtual

Evaluate the long-range potential with the open BC for the D-1 direction.

Reimplemented in EwaldHandlerQuasi2D.

Definition at line 111 of file LRHandlerBase.h.

117  {
118  return 0.0;
119  }

◆ evaluate_vlr_k()

◆ evaluate_w_sk()

mRealType evaluate_w_sk ( const std::vector< int > &  kshell,
const pRealType *restrict  sk 
) const
inline

Definition at line 73 of file LRHandlerBase.h.

References LRHandlerBase::Fk_symm, and LRHandlerBase::MaxKshell.

74  {
75  mRealType vk = 0.0;
76  for (int ks = 0, ki = 0; ks < MaxKshell; ks++)
77  {
78  mRealType u = 0;
79  for (; ki < kshell[ks + 1]; ki++)
80  u += (*sk++);
81  vk += Fk_symm[ks] * u;
82  }
83  return vk;
84  }
DECLARE_COULOMB_TYPES int MaxKshell
Maxkimum Kshell for the given Kc.
Definition: LRHandlerBase.h:35
EwaldHandler3D::mRealType mRealType
Vector< mRealType > Fk_symm
Fourier component for each k-shell.
Definition: LRHandlerBase.h:49

◆ evaluateGrad()

void evaluateGrad ( const ParticleSet A,
const ParticleSet B,
int  specB,
std::vector< pRealType > &  Zat,
std::vector< TinyVector< pRealType, OHMMS_DIM >> &  grad1 
) const
inline

evaluate $\sum_k F_{k} \rho^1_{-{\bf k}} \rho^2_{\bf k}$ and $\sum_k F_{k} \rho^1_{-{\bf k}} \rho^2_{\bf k}$

Parameters
kshelldegeneracies of the vectors
rk1starting address of $\rho^1_{{\bf k}}$
rk2starting address of $\rho^2_{{\bf k}}$

Valid for the strictly ordered k and $F_{k}$.

Definition at line 129 of file LRHandlerBase.h.

References qmcplusplus::Units::distance::A, B(), LRHandlerBase::Fk, LRHandlerBase::Fkg, and Vector< T, Alloc >::size().

134  {
135  const Matrix<pRealType>& e2ikrA_r = A.getSK().eikr_r;
136  const Matrix<pRealType>& e2ikrA_i = A.getSK().eikr_i;
137  const pRealType* rhokB_r = B.getSK().rhok_r[specB];
138  const pRealType* rhokB_i = B.getSK().rhok_i[specB];
139  const std::vector<PosType>& kpts = A.getSimulationCell().getKLists().kpts_cart;
140  for (int ki = 0; ki < Fk.size(); ki++)
141  {
142  PosType k = kpts[ki];
143  for (int iat = 0; iat < Zat.size(); iat++)
144  {
145  grad1[iat] -= Zat[iat] * k * Fkg[ki] * (e2ikrA_r(iat, ki) * rhokB_i[ki] - e2ikrA_i(iat, ki) * rhokB_r[ki]);
146  }
147  }
148  }
QMCTraits::PosType PosType
size_type size() const
return the current size
Definition: OhmmsVector.h:162
qmcplusplus::LRHandlerBase::pRealType pRealType
Vector< mRealType > Fkg
Fourier component of the LR part, fit to optimize the gradients.
Definition: LRHandlerBase.h:43
Vector< mRealType > Fk
Fourier component for all the k-point.
Definition: LRHandlerBase.h:41
double B(double x, int k, int i, const std::vector< double > &t)

◆ evaluateLR()

◆ evaluateLR_dstrain()

virtual SymTensor<mRealType, OHMMS_DIM> evaluateLR_dstrain ( TinyVector< pRealType, OHMMS_DIM k,
pRealType  kmag 
) const
inlinevirtual

Reimplemented in LRHandlerSRCoulomb< Func, BreakupBasis >, and EwaldHandler3D.

Definition at line 177 of file LRHandlerBase.h.

178  {
179  return 0;
180  };

◆ evaluateLR_r0()

virtual mRealType evaluateLR_r0 ( ) const
inlinevirtual

evaluate $ v_s(r=0) $ for the self-interaction term

Reimplemented in LRHandlerTemp< Func, BreakupBasis >, LRHandlerSRCoulomb< Func, BreakupBasis >, EwaldHandler3D, EwaldHandler2D, and EwaldHandlerQuasi2D.

Definition at line 171 of file LRHandlerBase.h.

171 { return 0.0; }

◆ evaluateLR_r0_dstrain()

virtual SymTensor<mRealType, OHMMS_DIM> evaluateLR_r0_dstrain ( ) const
inlinevirtual

These functions return the strain derivatives of all corresponding quantities in total energy.

See documentation (forthcoming).

Reimplemented in LRHandlerSRCoulomb< Func, BreakupBasis >, and EwaldHandler3D.

Definition at line 175 of file LRHandlerBase.h.

175 { return 0; };

◆ evaluateSR_dstrain()

virtual SymTensor<mRealType, OHMMS_DIM> evaluateSR_dstrain ( TinyVector< pRealType, OHMMS_DIM r,
pRealType  rmag 
) const
inlinevirtual

Reimplemented in LRHandlerSRCoulomb< Func, BreakupBasis >, and EwaldHandler3D.

Definition at line 181 of file LRHandlerBase.h.

182  {
183  return 0;
184  };

◆ evaluateSR_k0()

virtual mRealType evaluateSR_k0 ( ) const
inlinevirtual

◆ evaluateSR_k0_dstrain()

virtual SymTensor<mRealType, OHMMS_DIM> evaluateSR_k0_dstrain ( ) const
inlinevirtual

Reimplemented in LRHandlerSRCoulomb< Func, BreakupBasis >, and EwaldHandler3D.

Definition at line 176 of file LRHandlerBase.h.

176 { return 0; };

◆ evaluateStress()

SymTensor<pRealType, OHMMS_DIM> evaluateStress ( const std::vector< int > &  kshell,
const pRealType rhokA_r,
const pRealType rhokA_i,
const pRealType rhokB_r,
const pRealType rhokB_i 
) const
inline

FIX_PRECISION.

Definition at line 151 of file LRHandlerBase.h.

References LRHandlerBase::dFk_dstrain.

156  {
157  SymTensor<pRealType, OHMMS_DIM> stress;
158  for (int ki = 0; ki < dFk_dstrain.size(); ki++)
159  {
160  stress += (rhokA_r[ki] * rhokB_r[ki] + rhokA_i[ki] * rhokB_i[ki]) * dFk_dstrain[ki];
161  }
162 
163  return stress;
164  }
std::vector< SymTensor< mRealType, OHMMS_DIM > > dFk_dstrain
Fourier component of the LR part of strain tensor, by optimized breakup.
Definition: LRHandlerBase.h:45

◆ get_kc()

mRealType get_kc ( ) const
inline

Definition at line 71 of file LRHandlerBase.h.

References LRHandlerBase::LR_kc.

71 { return LR_kc; }
mRealType LR_kc
Maximum k cutoff.
Definition: LRHandlerBase.h:37

◆ get_rc()

mRealType get_rc ( ) const
inline

Definition at line 69 of file LRHandlerBase.h.

References LRHandlerBase::LR_rc.

Referenced by BackflowBuilder::makeShortRange_twoBody().

69 { return LR_rc; }
mRealType LR_rc
Maximum r cutoff.
Definition: LRHandlerBase.h:39

◆ initBreakup()

◆ lrDf()

virtual mRealType lrDf ( mRealType  r) const
inlinevirtual

Reimplemented in LRHandlerTemp< Func, BreakupBasis >, LRHandlerSRCoulomb< Func, BreakupBasis >, EwaldHandler3D, EwaldHandlerQuasi2D, and EwaldHandler2D.

Definition at line 194 of file LRHandlerBase.h.

References APP_ABORT, and LRHandlerBase::ClassName.

195  {
196  APP_ABORT("Error: lrDf(r) is not implemented in " + ClassName + "\n");
197  return 0.0;
198  };
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27

◆ makeClone()

◆ resetTargetParticleSet()

◆ srDf()

Member Data Documentation

◆ ClassName

◆ coefs

◆ dFk_dstrain

std::vector<SymTensor<mRealType, OHMMS_DIM> > dFk_dstrain

Fourier component of the LR part of strain tensor, by optimized breakup.

Definition at line 45 of file LRHandlerBase.h.

Referenced by LRHandlerBase::evaluateStress(), EwaldHandler3D::filldFk_dk(), and LRHandlerSRCoulomb< Func, BreakupBasis >::filldFk_dk().

◆ Fk

◆ Fk_symm

◆ Fkg

◆ Fkgstrain

Vector<mRealType> Fkgstrain

Vector of df_k/dk, fit as to optimize strains.

Definition at line 47 of file LRHandlerBase.h.

Referenced by EwaldHandler3D::fillYkgstrain(), and LRHandlerSRCoulomb< Func, BreakupBasis >::fillYkgstrain().

◆ gcoefs

◆ gstraincoefs

◆ LR_kc

◆ LR_rc

◆ MaxKshell


The documentation for this struct was generated from the following file: