65 for (; it != it_end; ++it)
92 std::string action =
"SLA";
93 m_param.
add(usedrift,
"useDrift");
94 m_param.
add(action,
"Action");
102 app_log() <<
" Using Umrigar scaled drift\n";
107 app_log() <<
" Using non-scaled drift\n";
114 app_log() <<
" Using DMC link-action\n";
119 app_log() <<
" Using Symmetrized Link-Action\n";
142 for (
int ig = 0; ig <
W.
groups(); ++ig)
145 RealType oneover2tau = 0.5 / (tauovermass);
147 for (
int iat =
W.
first(ig); iat <
W.
last(ig); ++iat)
153 dr += sqrttau *
deltaR[iat];
178 bool is_accepted =
false;
246 for (
int n = 0;
n < initsteps;
n++)
266 for (
int ig = 0; ig <
W.
groups(); ++ig)
269 RealType oneover2tau = 0.5 / (tauovermass);
271 for (
int iat =
W.
first(ig); iat <
W.
last(ig); ++iat)
277 dr += sqrttau *
deltaR[iat];
302 bool is_accepted =
false;
322 if (nAcceptTemp == 0)
341 app_log() <<
"\tForce Acceptance...\n";
344 prophead.
Properties(WP::R2ACCEPTED) = rr_accepted;
345 prophead.
Properties(WP::R2PROPOSED) = rr_proposed;
349 overwriteWalker = prophead;
357 curhead.
Properties(WP::R2PROPOSED) = rr_proposed;
RealType evaluateLog(ParticleSet &P)
evalaute the log (internally gradients and laplacian) of the trial wavefunction.
const BranchEngineType * branchEngine
branch engine, stateless reference to the one in QMCDriver
PropertyContainer_t Properties
scalar properties of a walker
Base class for update methods for each step.
NewTimer & update_mbo_timer_
void rejectMove(int iat)
restore to the original state
WFBuffer_t DataSet
buffer for the data for particle-by-particle update
A set of walkers that are to be advanced by Metropolis Monte Carlo.
MCWalkerConfiguration::iterator WalkerIter_t
void copyFromBuffer(ParticleSet &P, WFBufferType &buf)
copy all the wavefunction components from buffer.
helper functions for EinsplineSetBuilder
void accumulate(MCWalkerConfiguration &W)
accumulate the measurements
QTBase::RealType RealType
RealType getPhaseDiff() const
TrialWaveFunction & Psi
trial function
void acceptMove(ParticleSet &P, int iat, bool safe_to_delay=false)
update the state with the new data
void saveProperty(IT first)
save the values of Hamiltonian elements to the Properties
bool phaseChanged(RealType psi0) const
virtual bool put(xmlNodePtr cur)
process options
RealType DMCLinkAction(RealType enew, RealType eold) const
Collection of Local Energy Operators.
void allocate()
allocate the data
int first(int igroup) const
return the first index of a group i
void accumulate(WalkerIter_t it, WalkerIter_t it_end)
void update(bool skipSK=false)
update the internal data
ParticleSet::ParticlePos deltaR
temporary storage for random displacement
ParticleLaplacian L
laplacians of the particles
RealType updateBuffer(ParticleSet &P, WFBufferType &buf, bool fromscratch=false)
update all the wavefunction components in buffer.
int Age
Age of this walker age is incremented when a walker is not moved after a sweep.
NewTimer & movepbyp_timer_
bool put(std::istream &is) override
read from std::istream
IndexType nNodeCrossing
Total number of node crossings per block.
int groups() const
return the number of groups
omp_int_t omp_get_thread_num()
const PosType & getActivePos() const
class to handle a set of parameters
double norm(const zVec &c)
WalkerProperties::Indexes WP
QTBase::ValueType ValueType
EstimatorManagerBase * Estimators
estimator
RMCUpdatePbyPWithDrift(MCWalkerConfiguration &w, TrialWaveFunction &psi, QMCHamiltonian &h, RandomBase< FullPrecRealType > &rg, std::vector< int > act, std::vector< int > tp)
Constructor.
ParticleGradient G
gradients of the particles
void saveWalker(Walker_t &awalker)
save this to awalker
NewTimer & createGlobalTimer(const std::string &myname, timer_levels mylevel)
~RMCUpdatePbyPWithDrift() override
void accept_rejectMove(Index_t iat, bool accepted, bool forward_mode=true)
accept or reject a proposed move Two operation modes: The using and updating distance tables via Part...
void registerData(ParticleSet &P, WFBufferType &buf)
register all the wavefunction components in buffer.
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)
MCWalkerConfiguration & W
walker ensemble
OHMMS_INDEXTYPE IndexType
define other types
void advanceWalker(Walker_t &thisWalker, bool recompute) override
move a walker
void loadWalker(Walker_t &awalker, bool pbyp)
load a Walker_t to the current ParticleSet
void auxHevaluate(ParticleSet &P)
RealType getPhase() const
void add(PDT &aparam, const std::string &aname_in, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new parameter corresponding to an xmlNode <parameter>
IndexType MaxAge
MaxAge>0 indicates branch is done.
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
void rejectedMove(ParticleSet &P, Walker_t &ThisWalker)
Looks like a hack see DMCBatched.cpp and DMC.cpp weight is used like temporary flag from DMC...
size_type size() const
return the size of the data
Class to represent a many-body trial wave function.
RandomBase< FullPrecRealType > & RandomGen
random number generator
GradType evalGrad(ParticleSet &P, int iat)
Indexes
an enum denoting index of physical properties
FullPrecRealType evaluate(ParticleSet &P)
evaluate Local Energy
FullPrecRealType Weight
Weight of the walker.
void initWalkers(WalkerIter_t it, WalkerIter_t it_end) override
initialize Walker for walker update
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
bool makeMoveAndCheck(Index_t iat, const SingleParticlePos &displ)
move the iat-th particle to active_pos_
void initWalkersForPbyP(WalkerIter_t it, WalkerIter_t it_end) override
initialize Walker buffers for PbyP update
IndexType nAccept
counter for number of moves accepted
bool put(xmlNodePtr cur) override
process options
IndexType nReject
counter for number of moves rejected
FullPrecRealType * getPropertyBase()
void clear()
clear the data and set Current=0
virtual void getDrift(RealType tau, const GradType &qf, PosType &drift) const =0
evaluate a drift with a real force
NewTimer & advance_timer_
std::vector< RealType > MassInvS
1/Mass per species
void rewind(size_type cur=0, size_type cur_scalar=0)
set the cursors
A container class to represent a walker.
QMCHamiltonian & H
Hamiltonian.
ValueType calcRatioGrad(ParticleSet &P, int iat, GradType &grad_iat)
compute psi(R_new) / psi(R_current) ratio and ln(psi(R_new)) gradients It returns a complex value if...
RealType m_r2max
maximum displacement^2
void donePbyP(bool skipSK=false)
update structure factor and unmark active_ptcl_
void resetProperty(FullPrecRealType logpsi, FullPrecRealType sigN, FullPrecRealType ene)
reset the property of a walker
void completeUpdates()
complete all the delayed or asynchronous operations before leaving the p-by-p move region...
void advanceWalkers(WalkerIter_t it, WalkerIter_t it_end, bool measure) override
advance walkers executed at each step
ParticleLaplacian L
^2_i d for the i-th particle
ParticlePos R
The configuration vector (3N-dimensional vector to store the positions of all the particles for a sin...
IndexType nAllRejected
Total number of the steps when all the particle moves are rejected.
bool UpdatePbyP
update particle-by-particle
const DriftModifierBase * DriftModifier
drift modifer, stateless reference to the one in QMCDriver
void makeGaussRandomWithEngine(ParticleAttrib< TinyVector< T, D >> &a, RG &rng)