13 #ifndef QMCPLUSPLUS_EEIJASTROW_OPTIMIZED_SOA_H 14 #define QMCPLUSPLUS_EEIJASTROW_OPTIMIZED_SOA_H 16 #if !defined(QMC_BUILD_SANDBOX_ONLY) 73 std::map<std::string, std::unique_ptr<FT>>
J3Unique;
122 auto functorPtr = j3UniquePair.second.get();
124 const int numParams = functorPtr->getNumParameters();
135 for (
int iat = 0; iat <
Nelec; ++iat)
138 L[iat] +=
d2Uat[iat];
155 throw std::runtime_error(
"JeeIOrbitalSoA object name cannot be empty!");
163 auto eeIcopy = std::make_unique<JeeIOrbitalSoA<FT>>(
my_name_,
Ions, elecs);
164 std::map<const FT*, FT*> fcmap;
165 for (
int iG = 0; iG <
iGroups; iG++)
166 for (
int eG1 = 0; eG1 <
eGroups; eG1++)
167 for (
int eG2 = 0; eG2 <
eGroups; eG2++)
169 if (
F(iG, eG1, eG2) ==
nullptr)
171 auto fit = fcmap.find(
F(iG, eG1, eG2));
172 if (fit == fcmap.end())
174 auto fc = std::make_unique<FT>(*
F(iG, eG1, eG2));
175 fcmap[
F(iG, eG1, eG2)] = fc.get();
176 eeIcopy->addFunc(iG, eG1, eG2, std::move(fc));
180 eeIcopy->myVars.clear();
181 eeIcopy->myVars.insertFrom(
myVars);
226 void addFunc(
int iSpecies,
int eSpecies1,
int eSpecies2, std::unique_ptr<FT> j)
228 if (eSpecies1 == eSpecies2)
232 for (
int eG1 = 0; eG1 <
eGroups; eG1++)
233 for (
int eG2 = 0; eG2 <
eGroups; eG2++)
235 if (
F(iSpecies, eG1, eG2) == 0)
236 F(iSpecies, eG1, eG2) = j.get();
241 F(iSpecies, eSpecies1, eSpecies2) = j.get();
242 F(iSpecies, eSpecies2, eSpecies1) = j.get();
246 RealType rcut = 0.5 * j->cutoff_radius;
247 for (
int i = 0; i <
Nion; i++)
253 APP_ABORT(
"JeeIOrbitalSoA::addFunc Jastrow function pointer is NULL");
255 std::stringstream aname;
256 aname << iSpecies <<
"_" << eSpecies1 <<
"_" << eSpecies2;
257 J3Unique.emplace(aname.str(), std::move(j));
266 bool complete =
true;
267 for (
int i = 0; i <
iGroups; ++i)
271 for (
int e1 = 0; e1 <
eGroups; ++e1)
272 for (
int e2 = 0; e2 <
eGroups; ++e2)
273 if (
F(i, e1, e2) != 0)
277 app_log() <<
"J3 eeI is missing correlation for ion " << i << std::endl;
278 complete = complete && !partial;
282 APP_ABORT(
"JeeIOrbitalSoA::check_complete J3 eeI is missing correlation components\n see preceding messages " 286 for (
int i = 0; i <
Nion; ++i)
293 bool all_radii_match =
true;
294 for (
int i = 0; i <
iGroups; ++i)
298 bool radii_match =
true;
299 RealType rcut =
F(i, 0, 0)->cutoff_radius;
300 for (
int e1 = 0; e1 <
eGroups; ++e1)
301 for (
int e2 = 0; e2 <
eGroups; ++e2)
302 radii_match = radii_match &&
F(i, e1, e2)->cutoff_radius == rcut;
304 app_log() <<
"eeI functors for ion species " << i <<
" have different radii" << std::endl;
305 all_radii_match = all_radii_match && radii_match;
308 if (!all_radii_match)
310 APP_ABORT(
"JeeIOrbitalSoA::check_radii J3 eeI are inconsistent for some ion species\n see preceding messages " 319 for (
auto& [key, functor] :
J3Unique)
331 ftPair.second->myVars.getIndex(active);
341 for (
int ig = 0; ig <
iGroups; ig++)
342 for (
int jg = 0; jg <
eGroups; jg++)
345 FT* func_ijk =
F(ig, jg,
kg);
346 if (func_ijk ==
nullptr)
348 VarOffset(ig, jg,
kg).first = func_ijk->myVars.Index.front() - varoffset;
359 for (
int iat = 0; iat <
Nion; ++iat)
360 for (
int jg = 0; jg <
eGroups; ++jg)
367 for (
int jg = 0; jg <
eGroups; ++jg)
368 for (
int jel = P.
first(jg); jel < P.
last(jg); jel++)
369 for (
int iat = 0; iat <
Nion; ++iat)
400 for (
int k = 0; k < ratios.size(); ++k)
413 for (
int jg = 0; jg <
eGroups; ++jg)
417 for (
int j = P.
first(jg); j < P.
last(jg); ++j)
421 for (
int iat = 0; iat <
Nion; ++iat)
423 const valT& r_Ij = eI_table.getTempDists()[iat];
424 const valT& r_Ik = eI_dists[j][iat];
428 Uself +=
F(ig, jg, jg)->evaluate(ee_table.getTempDists()[j], r_Ij, r_Ik);
444 computeU3(P, iat, eI_table.getTempDists(), eI_table.getTempDispls(), ee_table.getTempDists(),
458 computeU3(P, iat, eI_table.getDistRow(iat), eI_table.getDisplRow(iat), ee_table.getOldDists(),
462 computeU3(P, iat, eI_table.getTempDists(), eI_table.getTempDispls(), ee_table.getTempDists(),
467 for (
int jel = 0; jel <
Nelec; jel++)
472 for (
int idim = 0; idim <
OHMMS_DIM; ++idim)
477 #pragma omp simd aligned(save_g, new_g, old_g : QMC_SIMD_ALIGNMENT) 478 for (
int jel = 0; jel <
Nelec; jel++)
479 save_g[jel] += new_g[jel] - old_g[jel];
500 std::cerr << std::setprecision(std::numeric_limits<valT>::digits10 + 1) <<
"updating electron iat = " << iat
501 <<
" near ion " << jat <<
" dist " << eI_table.getDistRow(iat)[jat] << std::endl;
502 throw std::runtime_error(
"BUG electron not found in elecs_inside");
504 else if (
std::abs(eI_table.getDistRow(iat)[jat] - *iter_dist) >= std::numeric_limits<valT>::epsilon())
506 std::cerr << std::setprecision(std::numeric_limits<valT>::digits10 + 1) <<
"inconsistent electron iat = " << iat
507 <<
" near ion " << jat <<
" dist " << eI_table.getDistRow(iat)[jat]
508 <<
" stored value = " << *iter_dist << std::endl;
509 throw std::runtime_error(
"BUG eI distance stored value elecs_inside_dist not matching distance table");
513 if (eI_table.getTempDists()[jat] <
Ion_cutoff[jat])
515 *iter_dist = eI_table.getTempDists()[jat];
516 *iter_displ = eI_table.getTempDispls()[jat];
550 for (
int jel = 0; jel <
Nelec; ++jel)
552 computeU3(P, jel, eI_table.getDistRow(jel), eI_table.getDisplRow(jel), ee_table.getDistRow(jel),
558 for (
int kel = 0; kel < jel; kel++)
563 for (
int idim = 0; idim <
OHMMS_DIM; ++idim)
567 #pragma omp simd aligned(save_g, new_g : QMC_SIMD_ALIGNMENT) 568 for (
int kel = 0; kel < jel; kel++)
569 save_g[kel] += new_g[kel];
579 std::vector<int>& ions_nearby)
582 for (
int iat = 0; iat <
Nion; ++iat)
584 ions_nearby.push_back(iat);
590 for (
int iind = 0; iind < ions_nearby.size(); ++iind)
592 const int iat = ions_nearby[iind];
594 const valT r_jI = distjI[iat];
606 const FT& feeI(*
F(ig, jg,
kg));
613 if ((iind + 1 == ions_nearby.size() || ig !=
Ions.
GroupID[ions_nearby[iind + 1]]) && kel_counter > 0)
615 const FT& feeI(*
F(ig, jg,
kg));
637 constexpr
valT ctwo(2);
651 gradF0, gradF1, gradF2, hessF00, hessF11, hessF22, hessF01, hessF02);
659 d2Uj -= hessF00_sum + hessF11_sum + lapfac * (gradF0_sum + gradF1_sum);
661 for (
int idim = 0; idim <
OHMMS_DIM; ++idim)
667 #pragma omp simd aligned(gradF0, gradF1, gradF2, hessF11, jk, jI, kI : QMC_SIMD_ALIGNMENT) reduction(+ : dUj_x) 668 for (
int kel_index = 0; kel_index < kel_counter; kel_index++)
671 hessF11[kel_index] += kI[kel_index] * jk[kel_index];
672 dUj_x += gradF1[kel_index] * jI[kel_index];
674 const valT temp = jk[kel_index] * gradF0[kel_index];
676 jk[kel_index] *= jI[kel_index];
677 kI[kel_index] = kI[kel_index] * gradF2[kel_index] - temp;
684 #pragma omp simd aligned(jk, jk0 : QMC_SIMD_ALIGNMENT) 685 for (
int kel_index = 0; kel_index < kel_counter; kel_index++)
686 jk0[kel_index] += jk[kel_index];
689 valT* restrict dUk_x = dUk.
data(idim);
690 for (
int kel_index = 0; kel_index < kel_counter; kel_index++)
695 #pragma omp simd aligned(jk0, hessF01 : QMC_SIMD_ALIGNMENT) reduction(+ : sum) 696 for (
int kel_index = 0; kel_index < kel_counter; kel_index++)
697 sum += hessF01[kel_index] * jk0[kel_index];
700 #pragma omp simd aligned(hessF00, hessF22, gradF0, gradF2, hessF02, hessF11 : QMC_SIMD_ALIGNMENT) 701 for (
int kel_index = 0; kel_index < kel_counter; kel_index++)
702 hessF00[kel_index] = hessF00[kel_index] + hessF22[kel_index] + lapfac * (gradF0[kel_index] + gradF2[kel_index]) -
703 ctwo * hessF02[kel_index] * hessF11[kel_index];
705 for (
int kel_index = 0; kel_index < kel_counter; kel_index++)
708 Uk[kel] += val[kel_index];
709 d2Uk[kel] -= hessF00[kel_index];
725 std::vector<int>& ions_nearby,
726 bool triangle =
false)
736 const int kelmax = triangle ? jel :
Nelec;
739 for (
int idim = 0; idim <
OHMMS_DIM; ++idim)
743 for (
int iat = 0; iat <
Nion; ++iat)
745 ions_nearby.push_back(iat);
750 for (
int iind = 0; iind < ions_nearby.size(); ++iind)
752 const int iat = ions_nearby[iind];
754 const valT r_jI = distjI[iat];
755 const posT disp_Ij = displjI[iat];
759 if (kel < kelmax && kel != jel)
771 const FT& feeI(*
F(ig, jg,
kg));
777 if ((iind + 1 == ions_nearby.size() || ig !=
Ions.
GroupID[ions_nearby[iind + 1]]) && kel_counter > 0)
779 const FT& feeI(*
F(ig, jg,
kg));
825 bool fromscratch =
false)
override 837 bool recalculate(
false);
851 constexpr
valT cminus(-1);
852 constexpr
valT ctwo(2);
857 const auto& ee_displs = ee_table.getDisplacements();
865 for (
int iat = 0; iat <
Nion; ++iat)
868 for (
int jg = 0; jg <
eGroups; ++jg)
886 const valT r_jk = ee_dists[jel][kel];
887 const posT disp_jk = ee_displs[jel][kel];
890 FT& func = *
F(ig, jg,
kg);
895 std::vector<RealType>& dlog =
du_dalpha[idx];
897 std::vector<Tensor<RealType, 3>>& dhess =
dhess_dalpha[idx];
899 for (
int p = first, ip = 0; p < last; p++, ip++)
909 PosType gr_ee = dg[0] * disp_jk;
911 gradLogPsi(p, jel) -= dg[1] * disp_Ij - gr_ee;
913 (dh(0, 0) + lapfac * dg[0] - ctwo * dh(0, 1) *
dot(disp_jk, disp_Ij) * r_jk_inv * r_Ij_inv +
914 dh(1, 1) + lapfac * dg[1]);
916 gradLogPsi(p, kel) -= dg[2] * disp_Ik + gr_ee;
918 (dh(0, 0) + lapfac * dg[0] + ctwo * dh(0, 2) *
dot(disp_jk, disp_Ik) * r_jk_inv * r_Ik_inv +
919 dh(2, 2) + lapfac * dg[2]);
935 for (
int i = 0; i <
Nelec; i++)
937 #if defined(QMC_COMPLEX) 939 for (
int jdim = 0; jdim <
OHMMS_DIM; ++jdim)
940 sum -= P.
G[i][jdim].real() *
gradLogPsi(k, i)[jdim];
954 bool recalculate(
false);
968 constexpr
valT cminus(-1);
969 constexpr
valT ctwo(2);
974 const auto& ee_displs = ee_table.getDisplacements();
982 for (
int iat = 0; iat <
Nion; ++iat)
985 for (
int jg = 0; jg <
eGroups; ++jg)
1003 const valT r_jk = ee_dists[jel][kel];
1004 const posT disp_jk = ee_displs[jel][kel];
1007 FT& func = *
F(ig, jg,
kg);
1012 std::vector<RealType>& dlog =
du_dalpha[idx];
1014 for (
int p = first, ip = 0; p < last; p++, ip++)
1036 std::vector<ValueType>& ratios,
1042 bool recalculate(
false);
1058 const auto& ei_dists = refPS.getDistTableAB(
ei_Table_ID_).getDistances();
1064 std::vector<Vector<RealType>> dLogPsi_vp(nVP);
1065 for (
auto&
dLogPsi : dLogPsi_vp)
1072 const int kg = refPS.getGroupID(kel);
1074 for (
int iat = 0; iat <
Nion; ++iat)
1077 for (
int jg = 0; jg <
eGroups; ++jg)
1079 FT& func = *
F(ig, jg,
kg);
1080 const size_t nparams = func.getNumParameters();
1081 std::vector<RealType> dlog_ref(nparams), dlog(nparams);
1088 const valT r_Ik_ref = ei_dists[kel][iat];
1089 const valT r_jk_ref = jel < kel ? ee_dists[kel][jel] : ee_dists[jel][kel];
1091 if (!func.evaluateDerivatives(r_jk_ref, r_Ij, r_Ik_ref, dlog_ref))
1092 std::fill(dlog_ref.begin(), dlog_ref.end(),
czero);
1094 for (
int ivp = 0; ivp < nVP; ivp++)
1096 const valT r_Ik = vpi_dists[ivp][iat];
1097 const valT r_jk = vpe_dists[ivp][jel];
1098 if (!func.evaluateDerivatives(r_jk, r_Ij, r_Ik, dlog))
1099 std::fill(dlog.begin(), dlog.end(),
czero);
1102 for (
int p = first, ip = 0; p < last; p++, ip++)
1103 dLogPsi_vp[ivp][p] -= dlog[ip] - dlog_ref[ip];
1114 for (
int ivp = 0; ivp < nVP; ivp++)
1115 dratios[ivp][kk] = (
ValueType)dLogPsi_vp[ivp][k];
1133 for (
int iondim = 0; iondim < 3; iondim++)
1135 source.
R[isrc][iondim] = rI[iondim] + delta;
1141 source.
R[isrc][iondim] = rI[iondim] - delta;
1148 log_p_r = log_p.real();
1149 log_m_r = log_m.real();
1151 g_return[iondim] = c1 * (log_p_r - log_m_r);
1154 source.
R[isrc][iondim] = rI[iondim];
1184 for (
int iondim = 0; iondim < 3; iondim++)
1190 source.
R[isrc][iondim] = rI[iondim] + delta;
1196 source.
R[isrc][iondim] = rI[iondim] - delta;
1202 log_p_r = log_p.real();
1203 log_m_r = log_m.real();
1207 g_return[iondim] = c1 * (log_p_r - log_m_r);
1208 grad_grad[iondim] += c1 * dG;
1209 lapl_grad[iondim] += c1 * dL;
1211 source.
R[isrc][iondim] = rI[iondim];
void resize(size_type n, Type_t val=Type_t())
Resize the container.
GradType evalGrad(ParticleSet &P, int iat) override
return the current gradient for the iat-th particle
T2 accumulate_n(const T1 *restrict in, size_t n, T2 res)
std::map< FT *, int > J3UniqueIndex
gContainer_type Disp_kI_Compressed
size_t Nelec_padded
number of particles + padded
LogValue evaluateGL(const ParticleSet &P, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L, bool fromscratch=false) override
compute gradients and laplacian of the TWF with respect to each particle.
const std::vector< DistRow > & getDistances() const
return full table distances
bool recompute(int i) const
std::vector< T, aligned_allocator< T > > aligned_vector
const std::string my_name_
Name of the object It is required to be different for objects of the same derived type like multiple ...
const ParticleSet & getRefPS() const
ParticleSet this object refers to.
Array< RealType, 2 > lapLogPsi
helper functions for EinsplineSetBuilder
void registerData(ParticleSet &P, WFBufferType &buf) override
For particle-by-particle move.
const DistanceTableAA & getDistTableAA(int table_ID) const
get a distance table by table_ID and dyanmic_cast to DistanceTableAA
QTBase::GradType GradType
const int ee_Table_ID_
table index for el-el
void addFunc(int iSpecies, int eSpecies1, int eSpecies2, std::unique_ptr< FT > j)
void evaluateDerivatives(ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi) override
const DistRow & getDistRow(int iel) const
return a row of distances for a given target particle
std::vector< int > DistIndice_k
void build_compact_list(const ParticleSet &P)
void forward(size_type n)
MakeReturn< UnaryNode< FnFabs, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t abs(const Vector< T1, C1 > &l)
size_t getTotalNum() const
void fill_n(T *x, size_t count, const T &value)
gContainer_type Disp_jk_Compressed
compressed displacements
const std::vector< DisplRow > & getDisplacements() const
return full table displacements
constexpr std::complex< float > czero
For distance tables of virtual particle (VP) sets constructed based on this table, whether full table is needed on host The corresponding DT of VP need to set MW_EVALUATE_RESULT_NO_TRANSFER_TO_HOST accordingly.
constexpr std::complex< float > cone
A ParticleSet that handles virtual moves of a selected particle of a given physical ParticleSet Virtu...
TinyVector< valT, OHMMS_DIM > posT
element position type
size_t getTotalNum() const
VectorSoaContainer< RealType, DIM > DisplRow
int refPtcl
Reference particle.
std::vector< int > Index
store locator of the named variable
SoA adaptor class for Vector<TinyVector<T,D> >
void extractOptimizableObjectRefs(UniqueOptObjRefs &opt_obj_refs) override
extract underlying OptimizableObject references
int first(int igroup) const
return the first index of a group i
QTFull::RealType computeGL(ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L) const
compute G and L from internally stored data
std::vector< int > ions_nearby_old
the ids of ions within the cutoff radius of an electron on which a move is proposed ...
void update(bool skipSK=false)
update the internal data
Attaches a unit to a Vector for IO.
ParticleLaplacian L
laplacians of the particles
void resize(const std::array< SIZET, D > &dims)
Resize the container.
aligned_vector< valT > DistjI_Compressed
void check_complete()
check that correlation information is complete
JeeIOrbitalSoA(const std::string &obj_name, const ParticleSet &ions, ParticleSet &elecs)
ParticleIndex GroupID
Species ID.
std::unique_ptr< WaveFunctionComponent > makeClone(ParticleSet &elecs) const override
make clone
opt_variables_type myVars
list of variables this WaveFunctionComponent handles
std::complex< QTFull::RealType > LogValue
int getTotalNum() const
return the number of species
const DistanceTableAB & getDistTableAB(int table_ID) const
get a distance table by table_ID and dyanmic_cast to DistanceTableAB
void restore(int iat) override
If a move for iat-th particle is rejected, restore to the content.
int groups() const
return the number of groups
An abstract class for a component of a many-body trial wave function.
void attachReference(T *ref, size_type n)
Array< std::vector< posT >, 2 > elecs_inside_displ
Specialized paritlce class for atomistic simulations.
void recompute(const ParticleSet &P) override
recompute the value of the WaveFunctionComponents which require critical accuracy.
Tensor<T,D> class for D by D tensor.
QTBase::ValueType ValueType
GradType evalGradSource(ParticleSet &P, ParticleSet &source, int isrc, TinyVector< ParticleSet::ParticleGradient, OHMMS_DIM > &grad_grad, TinyVector< ParticleSet::ParticleLaplacian, OHMMS_DIM > &lapl_grad) override
Adds the gradient w.r.t.
Array< std::vector< valT >, 2 > elecs_inside_dist
std::vector< valT > Ion_cutoff
the cutoff for e-I pairs
ParticleGradient G
gradients of the particles
LogValue evaluateLog(const ParticleSet &P, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L) override
evaluate the value of the WaveFunctionComponent from scratch
class to handle a set of variables that can be modified during optimizations
void computeU3(const ParticleSet &P, int jel, const DistRow &distjI, const DisplRow &displjI, const DistRow &distjk, const DisplRow &displjk, valT &Uj, posT &dUj, valT &d2Uj, Vector< valT > &Uk, gContainer_type &dUk, Vector< valT > &d2Uk, std::vector< int > &ions_nearby, bool triangle=false)
gContainer_type Disp_jI_Compressed
int where(int i) const
return the locator of the i-th Index
VectorSoaContainer< valT, 9 > mVGL
work result buffer
GradType evalGradSource(ParticleSet &P, ParticleSet &source, int isrc) override
return the logarithmic gradient for the iat-th particle of the source particleset ...
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
size_t Nbuffer
work buffer size
int last(int igroup) const
return the last index of a group i
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)
QTFull::ValueType PsiValue
const int ei_Table_ID_
table index for i-el
bool isOptimizable() const override
if true, this contains optimizable components
std::map< std::string, std::unique_ptr< FT > > J3Unique
void computeU3_engine(const ParticleSet &P, const FT &feeI, int kel_counter, valT &Uj, posT &dUj, valT &d2Uj, Vector< valT > &Uk, gContainer_type &dUk, Vector< valT > &d2Uk)
typename FT::real_type valT
type of each component U, dU, d2U;
void evaluateDerivRatios(const VirtualParticleSet &VP, const opt_variables_type &optvars, std::vector< ValueType > &ratios, Matrix< ValueType > &dratios) override
Array< std::pair< int, int >, 3 > VarOffset
void clear()
clear the variable set
size_type size() const
return the size
T * data()
return the base
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
void resizeWFOptVectors()
LogValue log_value_
Current .
size_type current() const
std::vector< int > ions_nearby_new
const ParticleSet & Ions
reference to the sources (ions)
LogValue updateBuffer(ParticleSet &P, WFBufferType &buf, bool fromscratch=false) override
For particle-by-particle move.
whether full table needs to be ready at anytime or not during PbyP Optimization can be implemented du...
OHMMS_PRECISION real_type
Vector< RealType, aligned_allocator< RealType > > DistRow
std::vector< std::vector< Tensor< RealType, 3 > > > dhess_dalpha
Array< FT *, 3 > F
container for the Jastrow functions
void evaluateRatiosAlltoOne(ParticleSet &P, std::vector< ValueType > &ratios) override
void evaluateDerivativesWF(ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi) override
const std::vector< DistRow > & getDistances() const
return full table distances
Vector< RealType > dLogPsi
void evaluateRatios(const VirtualParticleSet &VP, std::vector< ValueType > &ratios) override
Array< std::vector< int >, 2 > elecs_inside
the electrons around ions within the cutoff radius, grouped by species
Container_t::iterator begin()
void free()
free allocated memory and clear status variables
std::vector< std::vector< PosType > > dgrad_dalpha
aligned_vector< valT > DistkI_Compressed
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
void checkOutVariables(const opt_variables_type &active) override
check out optimizable variables
aligned_vector< valT > Distjk_Compressed
compressed distances
void insertFrom(const VariableSet &input)
insert a VariableSet to the list
Declaration of WaveFunctionComponent.
valT cur_Uat
current values during PbyP
void init(ParticleSet &p)
RealType DiffVal
diff value
void resize(size_type n)
resize myData
std::vector< std::vector< RealType > > du_dalpha
PsiValue ratioGrad(ParticleSet &P, int iat, GradType &grad_iat) override
evaluate the ratio of the new to old WaveFunctionComponent value and the new gradient ...
size_t Bytes_in_WFBuffer
Bytes in WFBuffer.
valT computeU(const ParticleSet &P, int jel, int jg, const DistRow &distjI, const DistRow &distjk, std::vector< int > &ions_nearby)
Array< PosType, 2 > gradLogPsi
FT FuncType
alias FuncType
void attachReference(size_type n, size_type n_padded, T *ptr)
attach to pre-allocated data
SIMD version of functions in algorithm.
int getIndex(const std::string &vname) const
return the Index vaule for the named parameter
T1 * lendReference(size_type n)
void push_back(OptimizableObject &obj)
whether temporary data set on the host is updated or not when a move is proposed. ...
Specialization for three-body Jastrow function using multiple functors.
PsiValue ratio(ParticleSet &P, int iat) override
evaluate the ratio of the new to old WaveFunctionComponent value
void copyFromBuffer(ParticleSet &P, WFBufferType &buf) override
For particle-by-particle move.
int getGroupID(int iat) const
return the group id of a given particle in the particle set.
void acceptMove(ParticleSet &P, int iat, bool safe_to_delay=false) override
a move for iat-th particle is accepted.
void add(std::complex< T1 > &x)
int UpdateMode
current update mode
std::string getClassName() const override
return class name