7 : myTableIndex(elns.addTable(ions)), Nelec(elns.getTotalNum()), Nions(ions.getTotalNum()), swpow(4.0)
22 for (
size_t iel = 0; iel <
Nelec; ++iel)
24 const auto& dist = d_ab.getDistRow(iel);
25 const auto& dr = d_ab.getDisplRow(iel);
26 for (
size_t ionid = 0; ionid <
Nions; ++ionid)
28 warpval[iel][ionid] =
f(dist[ionid]);
29 gradval[iel][ionid] = -dr[ionid] *
30 (
df(dist[ionid]) / dist[ionid]);
39 for (
size_t iel = 0; iel <
Nelec; iel++)
43 for (
size_t ionid = 0; ionid <
Nions; ionid++)
45 warpdenom +=
warpval[iel][ionid];
46 denomgrad +=
gradval[iel][ionid];
48 w[iel] =
warpval[iel][iat] / warpdenom;
49 grad_w[iel] =
gradval[iel][iat] / warpdenom - w[iel] * denomgrad / warpdenom;
70 for (
size_t iat = 0; iat <
Nions; iat++)
75 for (
size_t iel = 0; iel <
Nelec; iel++)
77 el_contribution[iat] += w[iel] * dEl[iel];
79 #if defined(QMC_COMPLEX) 84 psi_contribution[iat] += w[iel] * gwfn + 0.5 * gradw[iel];
void resize(size_type n, Type_t val=Type_t())
Resize the container.
Matrix< PosType > gradval
Nelec x Nion matrix of F(|r_i-R_J|)
helper functions for EinsplineSetBuilder
QTBase::RealType RealType
RealType df(RealType r)
Derivative of space warp transformation function F(r) w.r.t.
RealType swpow
Power of space warp transformation. Right now, r^{-swpow}.
void convertToReal(const T1 &in, T2 &out)
generic conversion from type T1 to type T2 using implicit conversion
Matrix< RealType > warpval
Nelec x Nion matrix of F(|r_i-R_J|)
void resize(size_type n, size_type m)
Resize the container.
Attaches a unit to a Vector for IO.
const int myTableIndex
The electron-ion table index in electron table.
const DistanceTableAB & getDistTableAB(int table_ID) const
get a distance table by table_ID and dyanmic_cast to DistanceTableAB
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)
Specialized paritlce class for atomistic simulations.
RealType f(RealType r)
Space warp transformation function F(r).
void computeSWT(ParticleSet &elec, const ParticleSet &ions, Force_t &dEl, ParticleGradient &dlogpsi, Force_t &el_contribution, Force_t &psi_contribution)
Takes in precomputed grad(E_L) and grad(logPsi) and computes the ZV and ZB space warp contributions t...
void computeSWTIntermediates(ParticleSet &P, const ParticleSet &ions)
Computes intermediate matrices required to build all space warp components and gradients.
void getSWT(int iat, ParticleScalar &w, Force_t &grad_w)
Generates required space warp quantities to generate the actual "Space Warp" contribution to the iat-...
SpaceWarpTransformation(ParticleSet &elns, const ParticleSet &ions)