17 #ifndef QMCPLUSPLUS_LRHANLDERSRCOULOMBTEMP_H 18 #define QMCPLUSPLUS_LRHANLDERSRCOULOMBTEMP_H 42 template<
class Func,
class BreakupBasis = LPQHISRCoulombBasis>
136 APP_ABORT(
"Stresses not supported yet\n");
158 for (
int n = 0;
n <
coefs.size();
n++)
160 return v0 * 2.0 * TWOPI /
Basis.get_CellVolume();
176 APP_ABORT(
"Stresses not supported yet\n");
178 for (
int dim1 = 0; dim1 <
OHMMS_DIM; dim1++)
179 for (
int dim2 = dim1; dim2 <
OHMMS_DIM; dim2++)
181 deriv_tensor(dim1, dim2) =
193 APP_ABORT(
"Stresses not supported yet\n");
198 for (
int dim1 = 0; dim1 <
OHMMS_DIM; dim1++)
200 for (
int dim2 = dim1; dim2 <
OHMMS_DIM; dim2++)
201 deriv_tensor(dim1, dim2) = r[dim1] * r[dim2] * Sr_r;
208 APP_ABORT(
"Stresses not supported yet\n");
212 for (
int n = 0;
n <
coefs.size();
n++)
225 APP_ABORT(
"Stresses not supported yet\n");
232 APP_ABORT(
"Stresses not supported yet\n");
255 APP_ABORT(
"Stresses not supported yet\n");
264 APP_ABORT(
"Stresses not supported yet\n");
280 Basis.set_Lattice(ref);
284 Basis.set_NumKnots(NumKnots);
285 Basis.set_rc(ref.LR_rc);
303 app_log() <<
"\nPerforming Optimized Breakup with Short Range Coulomb Basis\n";
304 app_log() <<
" finding kc: " << ref.LR_kc <<
" , " <<
LR_kc << std::endl;
305 app_log() <<
" LRBreakp parameter Kc =" << kc << std::endl;
306 app_log() <<
" Continuum approximation in k = [" << kcut <<
"," << kmax <<
")" << std::endl;
316 int Nbasis =
Basis.NumBasisElem();
328 constraints.
resize(Nbasis);
329 for (
int i = 0; i < Nbasis; i++)
344 constraints[2] = 0.0;
351 constraints[Nbasis - 1] = 0;
357 constraints[Nbasis - 2] = 0;
362 constraints[Nbasis - 3] = 0;
372 std::ios_base::fmtflags app_log_flags(
app_log().flags());
377 app_log() <<
" LR grad function chi^2 = " << chisqr_force << std::endl;
380 app_log().flags(app_log_flags);
390 for (
int ki = 0; ki < KList.size(); ki++)
403 const std::vector<int>& kshell(KList.
kshell);
407 for (
int ks = 0, ki = 0; ks <
Fk_symm.
size(); ks++)
427 const std::vector<int>& kshell(KList.
kshell);
431 for (
int ks = 0, ki = 0; ks <
MaxKshell; ks++)
446 APP_ABORT(
"Stresses not supported yet\n");
448 const std::vector<int>& kshell(KList.
kshell);
451 for (
int ks = 0, ki = 0; ks <
MaxKshell; ks++)
460 APP_ABORT(
"Stresses not supported yet\n");
void resize(size_type n, Type_t val=Type_t())
Resize the container.
a class that defines a supercell in D-dimensional Euclean space.
mRealType evaluate_vlr_k(mRealType k) const override
const auto & getLRBox() const
std::vector< PosType > kpts_cart
K-vector in Cartesian coordinates.
One-Dimensional linear-grid.
helper functions for EinsplineSetBuilder
mRealType evaluateLR_r0_dstrain(int i, int j) const
void fillVk(std::vector< TinyVector< mRealType, 2 >> &KList)
mRealType LR_kc
Maximum k cutoff.
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > ParticleLayout
int SetupKVecs(mRealType kc, mRealType kcont, mRealType kmax)
setup KList
DECLARE_COULOMB_TYPES int MaxKshell
Maxkimum Kshell for the given Kc.
mRealType DoGradBreakup(mRealType *Fk, mRealType *t, mRealType *adjust)
EwaldHandler3D::mRealType mRealType
SymTensor< mRealType, OHMMS_DIM > evaluateLR_r0_dstrain() const override
These functions return the strain derivatives of all corresponding quantities in total energy...
Vector< mRealType > Fkgstrain
Vector of df_k/dk, fit as to optimize strains.
void filldFk_dk(KContainer &KList)
mRealType evalYk(mRealType k) const
std::vector< mRealType > coefs
Fourier component for each k-shell Coefficient.
LRHandlerBase * makeClone(ParticleSet &ref) const override
make clone
LRHandlerSRCoulomb(ParticleSet &ref, mRealType kc_in=-1.0)
void resetTargetParticleSet(ParticleSet &ref, mRealType rs)
mRealType evaluateSR_k0() const override
evaluate
void initBreakup(ParticleSet &ref) override
std::vector< SymTensor< mRealType, OHMMS_DIM > > dFk_dstrain
Fourier component of the LR part of strain tensor, by optimized breakup.
mRealType lrDf(mRealType r) const override
MakeReturn< BinaryNode< FnPow, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t, typename CreateLeaf< Vector< T2, C2 > >::Leaf_t > >::Expression_t pow(const Vector< T1, C1 > &l, const Vector< T2, C2 > &r)
const auto & getSimulationCell() const
Decalaration of One-Dimesional grids.
Specialized paritlce class for atomistic simulations.
mRealType srDf(mRealType r, mRealType rinv) const override
evaluate the first derivative of the short range part at r
size_type size() const
return the current size
qmcplusplus::LRHandlerBase::pRealType pRealType
SymTensor< mRealType, OHMMS_DIM > evaluateLR_dstrain(TinyVector< pRealType, OHMMS_DIM > k, pRealType kmag) const override
double norm(const zVec &c)
std::vector< mRealType > Fk_copy
mRealType LR_rc
Maximum r cutoff.
void InitBreakup(const ParticleLayout &ref, int NumFunctions)
Initialise the basis and coefficients for the long-range beakup.
Vector< mRealType > Fkg
Fourier component of the LR part, fit to optimize the gradients.
mRealType srDf_strain(mRealType r, mRealType rinv) const
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
mRealType evaldYkgstrain(mRealType k) const
SymTensor< mRealType, OHMMS_DIM > evaluateSR_k0_dstrain() const override
void Breakup(ParticleSet &ref, mRealType rs_ext) override
std::vector< int > kshell
kpts which belong to the ith-shell [kshell[i], kshell[i+1])
Vector< mRealType > Fk
Fourier component for all the k-point.
std::vector< mRealType > gcoefs
Coefficient for gradient fit.
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
std::vector< RealType > ksq
squre of kpts in Cartesian coordniates
mRealType evalYkg(mRealType k) const
mRealType evaluateLR(mRealType r) const override
evaluate the contribution from the long-range part for for spline
SymTensor< mRealType, OHMMS_DIM > evaluateSR_dstrain(TinyVector< pRealType, OHMMS_DIM > r, pRealType rmag) const override
void fillYk(KContainer &KList)
std::vector< mRealType > gstraincoefs
Coefficient for strain fit.
void fillYkgstrain(KContainer &KList)
void resetTargetParticleSet(ParticleSet &ref) override
base class for LRHandlerTemp<FUNC,BASIS> and DummyLRHanlder<typename Func>
void fillYkg(const KContainer &KList)
std::vector< TinyVector< mRealType, 2 > > KList
For each k, KList[k][0] = |k| and KList[k][1] = degeneracy.
BreakupBasis BreakupBasisType
mRealType evaluate(mRealType r, mRealType rinv) const override
~LRHandlerSRCoulomb() override
Define LRHandlerBase and DummyLRHandler<typename Func>
LRHandlerSRCoulomb(const LRHandlerSRCoulomb &aLR, ParticleSet &ref)
"copy" constructor
Vector< mRealType > Fk_symm
Fourier component for each k-shell.
mRealType evalYkgstrain(mRealType k) const
mRealType evaluateLR_r0() const override
evaluate for the self-interaction term