19 #ifndef QMCPLUSPLUS_LRHANLDERBASE_AND_DUMMY_H 20 #define QMCPLUSPLUS_LRHANLDERBASE_AND_DUMMY_H 76 for (
int ks = 0, ki = 0; ks <
MaxKshell; ks++)
79 for (; ki < kshell[ks + 1]; ki++)
100 for (
int ks = 0, ki = 0; ks <
MaxKshell; ks++)
103 for (; ki < kshell[ks + 1]; ki++)
104 u += ((*rk1_r++) * (*rk2_r++) + (*rk1_i++) * (*rk2_i++));
112 const std::vector<int>& kshell,
132 std::vector<pRealType>& Zat,
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++)
143 for (
int iat = 0; iat < Zat.size(); iat++)
145 grad1[iat] -= Zat[iat] * k *
Fkg[ki] * (e2ikrA_r(iat, ki) * rhokB_i[ki] - e2ikrA_i(iat, ki) * rhokB_r[ki]);
160 stress += (rhokA_r[ki] * rhokB_r[ki] + rhokA_i[ki] * rhokB_i[ki]) *
dFk_dstrain[ki];
227 int maxshell = KList.kshell.size() - 1;
228 const auto& kk(KList.ksq);
230 while (ksh < maxshell)
234 ik = KList.kshell[++ksh];
239 for (ksh = 0, ik = 0; ksh <
MaxKshell; ksh++, ik++)
243 for (; ik < KList.kshell[ksh + 1]; ik++)
void resize(size_type n, Type_t val=Type_t())
Resize the container.
virtual SymTensor< mRealType, OHMMS_DIM > evaluateLR_r0_dstrain() const
These functions return the strain derivatives of all corresponding quantities in total energy...
mRealType evaluate(mRealType r, mRealType rinv) const override
virtual mRealType evaluate_vlr_k(mRealType k) const =0
helper functions for EinsplineSetBuilder
mRealType LR_kc
Maximum k cutoff.
virtual mRealType evaluateLR(mRealType r) const =0
virtual void Breakup(ParticleSet &ref, mRealType rs_in)=0
mRealType srDf(mRealType r, mRealType rinv) const override
virtual SymTensor< mRealType, OHMMS_DIM > evaluateLR_dstrain(TinyVector< pRealType, OHMMS_DIM > k, pRealType kmag) const
DECLARE_COULOMB_TYPES int MaxKshell
Maxkimum Kshell for the given Kc.
EwaldHandler3D::mRealType mRealType
LRHandler without breakup.
Vector< mRealType > Fkgstrain
Vector of df_k/dk, fit as to optimize strains.
DummyLRHandler(const DummyLRHandler &aLR)
LRHandlerBase(mRealType kc)
std::vector< mRealType > coefs
Fourier component for each k-shell Coefficient.
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.
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
mRealType evaluate_vlr_k(mRealType k) const override
mRealType evaluate_w_sk(const std::vector< int > &kshell, const pRealType *restrict sk) const
virtual mRealType evaluateLR_r0() const
evaluate for the self-interaction term
std::vector< SymTensor< mRealType, OHMMS_DIM > > dFk_dstrain
Fourier component of the LR part of strain tensor, by optimized breakup.
virtual ~LRHandlerBase()=default
const auto & getSimulationCell() const
Specialized paritlce class for atomistic simulations.
size_type size() const
return the current size
qmcplusplus::LRHandlerBase::pRealType pRealType
virtual SymTensor< mRealType, OHMMS_DIM > evaluateSR_k0_dstrain() const
virtual void initBreakup(ParticleSet &ref)=0
double norm(const zVec &c)
mRealType LR_rc
Maximum r cutoff.
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
FIX_PRECISION.
mRealType evaluateLR(mRealType r) const override
void resetTargetParticleSet(ParticleSet &ref) override
Vector< mRealType > Fkg
Fourier component of the LR part, fit to optimize the gradients.
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Vector< mRealType > Fk
Fourier component for all the k-point.
std::vector< mRealType > gcoefs
Coefficient for gradient fit.
void initBreakup(ParticleSet &ref) override
virtual mRealType lrDf(mRealType r) const
#define DECLARE_COULOMB_TYPES
virtual LRHandlerBase * makeClone(ParticleSet &ref) const =0
make clone
void Breakup(ParticleSet &ref, mRealType rs_in) override
DummyLRHandler(mRealType kc=-1.0)
std::vector< mRealType > gstraincoefs
Coefficient for strain fit.
const auto & getLattice() const
virtual SymTensor< mRealType, OHMMS_DIM > evaluateSR_dstrain(TinyVector< pRealType, OHMMS_DIM > r, pRealType rmag) const
virtual mRealType evaluateSR_k0() const
evaluate
base class for LRHandlerTemp<FUNC,BASIS> and DummyLRHanlder<typename Func>
void evaluateGrad(const ParticleSet &A, const ParticleSet &B, int specB, std::vector< pRealType > &Zat, std::vector< TinyVector< pRealType, OHMMS_DIM >> &grad1) const
evaluate and
double B(double x, int k, int i, const std::vector< double > &t)
virtual mRealType srDf(mRealType r, mRealType rinv) const =0
virtual void resetTargetParticleSet(ParticleSet &ref)=0
LRHandlerBase * makeClone(ParticleSet &ref) const override
make clone
Vector< mRealType > Fk_symm
Fourier component for each k-shell.