31 std::vector<TrialWaveFunction*>& psi,
32 std::vector<QMCHamiltonian*>& h,
45 for (
int ipsi = 0; ipsi <
nPsi; ipsi++)
53 for (
int iter = 0; iter <
nSubSteps; ++iter)
57 for (
int ig = 0; ig <
W.
groups(); ++ig)
60 for (
int iat =
W.
first(ig); iat <
W.
last(ig); ++iat)
66 for (
int ipsi = 0; ipsi <
nPsi; ipsi++)
70 for (
int ipsi = 0; ipsi <
nPsi; ipsi++)
73 bool is_accepted =
false;
79 for (
int ipsi = 0; ipsi <
nPsi; ipsi++)
80 Psi1[ipsi]->acceptMove(
W, iat,
true);
89 for (
int ipsi = 0; ipsi <
nPsi; ipsi++)
90 Psi1[ipsi]->rejectMove(iat);
103 for (
int ipsi = 0; ipsi <
nPsi; ipsi++)
104 Psi1[ipsi]->completeUpdates();
109 for (
int ipsi = 0; ipsi <
nPsi; ipsi++)
115 *
G1[ipsi] = thisWalker.G;
116 *
L1[ipsi] = thisWalker.
L;
123 for (
int ipsi = 0; ipsi <
nPsi; ipsi++)
129 for (
int ipsi = 0; ipsi <
nPsi; ipsi++)
133 thisWalker.G = *
G1[ipsi];
134 thisWalker.
L = *
L1[ipsi];
137 thisWalker.
Properties(ipsi, WP::LOCALENERGY) =
H1[ipsi]->evaluate(
W);
143 H1[ipsi]->auxHevaluate(
W, thisWalker);
151 std::vector<TrialWaveFunction*>& psi,
152 std::vector<QMCHamiltonian*>& h,
154 :
CSUpdateBase(w, psi, h, rg){
APP_ABORT(
"CSVMCUpdatePbyPWithDriftFast currently not working. Please eliminate \ 155 drift option, or choose all electron moves instead.")}
std::vector< RealType > sumratio
PropertyContainer_t Properties
scalar properties of a walker
std::vector< RealType > cumNorm
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.
helper functions for EinsplineSetBuilder
QTBase::RealType RealType
void computeSumRatio(const std::vector< RealType > &logpsi, const std::vector< RealType > &avgNorm, std::vector< RealType > &sumratio)
void updateRatioMatrix(const std::vector< RealType > &ratio_pbyp, Matrix< RealType > &ratioij)
int first(int igroup) const
return the first index of a group i
ParticleSet::ParticlePos deltaR
temporary storage for random displacement
ParticleLaplacian L
laplacians of the particles
std::vector< TrialWaveFunction * > Psi1
a list of TrialWaveFunctions for multiple method
~CSVMCUpdatePbyP() override
int groups() const
return the number of groups
std::vector< RealType > logpsi
double norm(const zVec &c)
WalkerProperties::Indexes WP
std::vector< RealType > invsumratio
ParticleGradient G
gradients of the particles
void saveWalker(Walker_t &awalker)
save this to awalker
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...
std::vector< ParticleSet::ParticleGradient * > G1
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Matrix< RealType > RatioIJ
int last(int igroup) const
return the last index of a group i
MCWalkerConfiguration & W
walker ensemble
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
int nSubSteps
number of steps per measurement
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
RandomBase< FullPrecRealType > & RandomGen
random number generator
Indexes
an enum denoting index of physical properties
std::vector< RealType > ratio
std::vector< RealType > avgNorm
bool makeMoveAndCheck(Index_t iat, const SingleParticlePos &displ)
move the iat-th particle to active_pos_
std::vector< ParticleSet::ParticleLaplacian * > L1
IndexType nAccept
counter for number of moves accepted
IndexType nReject
counter for number of moves rejected
CSVMCUpdatePbyPWithDriftFast(MCWalkerConfiguration &w, std::vector< TrialWaveFunction *> &psi, std::vector< QMCHamiltonian *> &h, RandomBase< FullPrecRealType > &rg)
Constructor.
~CSVMCUpdatePbyPWithDriftFast() override
FullPrecRealType * getPropertyBase()
FullPrecRealType Multiplicity
Number of copies for branching When Multiplicity = 0, this walker will be destroyed.
CSVMCUpdatePbyP(MCWalkerConfiguration &w, std::vector< TrialWaveFunction *> &psi, std::vector< QMCHamiltonian *> &h, RandomBase< FullPrecRealType > &rg)
Constructor.
std::vector< RealType > MassInvS
1/Mass per species
Declaration of a MCWalkerConfiguration.
A container class to represent a walker.
std::vector< QMCHamiltonian * > H1
a list of QMCHamiltonians for multiple method
void donePbyP(bool skipSK=false)
update structure factor and unmark active_ptcl_
ParticleLaplacian L
^2_i d for the i-th particle
IndexType nAllRejected
Total number of the steps when all the particle moves are rejected.
void makeGaussRandomWithEngine(ParticleAttrib< TinyVector< T, D >> &a, RG &rng)