QMCPACK
Walker< t_traits, p_traits > Class Template Reference

A container class to represent a walker. More...

+ Inheritance diagram for Walker< t_traits, p_traits >:
+ Collaboration diagram for Walker< t_traits, p_traits >:

Public Types

enum  { DIM = t_traits::DIM }
 
using WP = WalkerProperties::Indexes
 
using RealType = typename t_traits::RealType
 typedef for real data type More...
 
using FullPrecRealType = typename t_traits::FullPrecRealType
 typedef for estimator real data type More...
 
using ValueType = typename t_traits::ValueType
 typedef for value data type. More...
 
using ParticlePos = typename p_traits::ParticlePos
 array of particles More...
 
using ParticleScalar = typename p_traits::ParticleScalar
 array of scalars More...
 
using ParticleGradient = typename p_traits::ParticleGradient
 array of gradients More...
 
using ParticleLaplacian = typename p_traits::ParticleLaplacian
 array of laplacians More...
 
using SingleParticleValue = typename p_traits::SingleParticleValue
 typedef for value data type. More...
 
using PropertyContainer_t = ConstantSizeMatrix< FullPrecRealType, std::allocator< FullPrecRealType > >
 typedef for the property container, fixed size More...
 
using WFBuffer_t = PooledMemory< FullPrecRealType >
 
using Buffer_t = PooledData< RealType >
 
long walker_id_ = 0
 }@ More...
 
long parent_id_ = 0
 in legacy the ancients have said only: id reserved for forward walking More...
 
bool has_been_on_wire_ = false
 
int Generation = 0
 allegedly DMCgeneration PD: I can find no evidence it is ever updated anywhere in the code. More...
 
int Age = 0
 Age of this walker age is incremented when a walker is not moved after a sweep. More...
 
FullPrecRealType Weight = 1.0
 Weight of the walker. More...
 
FullPrecRealType Multiplicity = 1.0
 Number of copies for branching When Multiplicity = 0, this walker will be destroyed. More...
 
bool SendInProgress
 mark true if this walker is being sent. More...
 
bool wasTouched = true
 if true, this walker is either copied or tranferred from another MPI rank. More...
 
ParticlePos R
 The configuration vector (3N-dimensional vector to store the positions of all the particles for a single walker) More...
 
ParticleScalar spins
 
ParticleLaplacian L
 $ \nabla_i d\log \Psi for the i-th particle */ ParticleGradient G; /** $ ^2_i d for the i-th particle More...
 
PropertyContainer_t Properties
 scalar properties of a walker More...
 
std::vector< std::vector< FullPrecRealType > > PropertyHistory
 Property history vector. More...
 
std::vector< int > PHindex
 
WFBuffer_t DataSet
 buffer for the data for particle-by-particle update More...
 
size_t block_end
 
size_t scalar_end
 
bool get_has_been_on_wire () const
 
void set_has_been_on_wire (bool tf)
 
long getWalkerID () const
 
long getParentID () const
 
void setWalkerID (long walker_id)
 set function for walker walker_id_ only necessary because as an optimization we reuse walkers. More...
 
void setParentID (long parent_id)
 
 Walker (int nptcl=0)
 create a walker for n-particles More...
 
 Walker (const Walker &a)
 
 Walker (const Walker &a, long walker_id, long parent_id)
 
 Walker (long walker_id, long parent_id, int nptcl=0)
 create a valid walker for n-particles (batched version) the goal is for this walker is valid after construction without the need for more initialization functions to be called. More...
 
int addPropertyHistory (int leng)
 
void deletePropertyHistory ()
 
void resetPropertyHistory ()
 
void addPropertyHistoryPoint (int index, FullPrecRealType data)
 
FullPrecRealType getPropertyHistorySum (int index, int endN)
 
Walkeroperator= (const Walker &a)
 assignment operator More...
 
int size () const
 return the number of particles per walker More...
 
void resize (int nptcl)
 resize for n particles More...
 
void makeCopy (const Walker &a)
 copy the content of a walker More...
 
FullPrecRealTypegetPropertyBase ()
 
const FullPrecRealTypegetPropertyBase () const
 
FullPrecRealTypegetPropertyBase (int i)
 return the address of the i-th properties More...
 
const FullPrecRealTypegetPropertyBase (int i) const
 return the address of the i-th properties More...
 
void resetProperty (FullPrecRealType logpsi, FullPrecRealType sigN, FullPrecRealType ene)
 reset the property of a walker More...
 
void resetProperty (FullPrecRealType logpsi, FullPrecRealType sigN, FullPrecRealType ene, FullPrecRealType r2a, FullPrecRealType r2p, FullPrecRealType vq)
 reset the property of a walker More...
 
void willDie ()
 marked to die More...
 
void reset ()
 reset the walker weight, multiplicity and age More...
 
void resizeProperty (int n, int m)
 
size_t byteSize ()
 byte size for a packed message More...
 
void registerData ()
 
void copyFromBuffer ()
 
void updateBuffer ()
 
template<class Msg >
Msg & putMessage (Msg &m)
 
template<class Msg >
Msg & getMessage (Msg &m)
 

Detailed Description

template<typename t_traits, typename p_traits>
class qmcplusplus::Walker< t_traits, p_traits >

A container class to represent a walker.

A walker stores the particle configurations {R} and a property container. RealTypehe template (P)articleSet(A)ttribute is a generic container of position types. RealTypehe template (G)radient(A)ttribute is a generic container of gradients types. Data members for each walker

  • walker_id_ : identity for a walker. default is 0.
  • Age : generation after a move is accepted.
  • Weight : weight to take the ensemble averages
  • Multiplicity : multiplicity for branching. Probably can be removed.
  • Properties : 2D container. RealType first index corresponds to the H/Psi index and second index >=WP::NUMPROPERTIES.
  • DataSet : a contiguous buffer providing a state snapshot of most/all walker data. Much complicated state management arises in keeping this up to date, or purposefully out of sync with actual datamembers. Here and in TWF, HAMs and PARTICLE sets associated with the walker.

Definition at line 49 of file Walker.h.

Member Typedef Documentation

◆ Buffer_t

Definition at line 81 of file Walker.h.

◆ FullPrecRealType

using FullPrecRealType = typename t_traits::FullPrecRealType

typedef for estimator real data type

Definition at line 60 of file Walker.h.

◆ ParticleGradient

using ParticleGradient = typename p_traits::ParticleGradient

array of gradients

Definition at line 68 of file Walker.h.

◆ ParticleLaplacian

using ParticleLaplacian = typename p_traits::ParticleLaplacian

array of laplacians

Definition at line 70 of file Walker.h.

◆ ParticlePos

using ParticlePos = typename p_traits::ParticlePos

array of particles

Definition at line 64 of file Walker.h.

◆ ParticleScalar

using ParticleScalar = typename p_traits::ParticleScalar

array of scalars

Definition at line 66 of file Walker.h.

◆ PropertyContainer_t

typedef for the property container, fixed size

Definition at line 75 of file Walker.h.

◆ RealType

using RealType = typename t_traits::RealType

typedef for real data type

Definition at line 58 of file Walker.h.

◆ SingleParticleValue

using SingleParticleValue = typename p_traits::SingleParticleValue

typedef for value data type.

Definition at line 72 of file Walker.h.

◆ ValueType

using ValueType = typename t_traits::ValueType

typedef for value data type.

Definition at line 62 of file Walker.h.

◆ WFBuffer_t

Not really "buffers", "walker message" also used to serialize walker, rename

Definition at line 80 of file Walker.h.

◆ WP

Definition at line 52 of file Walker.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
DIM 

Definition at line 53 of file Walker.h.

Constructor & Destructor Documentation

◆ Walker() [1/4]

Walker ( int  nptcl = 0)
inlineexplicit

create a walker for n-particles

Definition at line 157 of file Walker.h.

157  : Properties(1, WP::NUMPROPERTIES, 1, WP::MAXPROPERTIES)
158  {
159  if (nptcl > 0)
160  resize(nptcl);
161  }
PropertyContainer_t Properties
scalar properties of a walker
Definition: Walker.h:125
void resize(int nptcl)
resize for n particles
Definition: Walker.h:238

◆ Walker() [2/4]

Walker ( const Walker< t_traits, p_traits > &  a)
inline

Definition at line 163 of file Walker.h.

163 : Properties(1, WP::NUMPROPERTIES, 1, WP::MAXPROPERTIES) { makeCopy(a); }
PropertyContainer_t Properties
scalar properties of a walker
Definition: Walker.h:125
void makeCopy(const Walker &a)
copy the content of a walker
Definition: Walker.h:247

◆ Walker() [3/4]

Walker ( const Walker< t_traits, p_traits > &  a,
long  walker_id,
long  parent_id 
)
inline

Definition at line 164 of file Walker.h.

165  : walker_id_(walker_id), parent_id_(parent_id), Properties(1, WP::NUMPROPERTIES, 1, WP::MAXPROPERTIES)
166  {
167  makeCopy(a);
168  }
PropertyContainer_t Properties
scalar properties of a walker
Definition: Walker.h:125
long parent_id_
in legacy the ancients have said only: id reserved for forward walking
Definition: Walker.h:92
void makeCopy(const Walker &a)
copy the content of a walker
Definition: Walker.h:247
long walker_id_
}@
Definition: Walker.h:88

◆ Walker() [4/4]

Walker ( long  walker_id,
long  parent_id,
int  nptcl = 0 
)
inlineexplicit

create a valid walker for n-particles (batched version) the goal is for this walker is valid after construction without the need for more initialization functions to be called.

Definition at line 174 of file Walker.h.

175  : walker_id_(walker_id), parent_id_(parent_id), Properties(1, WP::NUMPROPERTIES, 1, WP::MAXPROPERTIES)
176  {
177  if (nptcl > 0)
178  resize(nptcl);
179  }
PropertyContainer_t Properties
scalar properties of a walker
Definition: Walker.h:125
long parent_id_
in legacy the ancients have said only: id reserved for forward walking
Definition: Walker.h:92
void resize(int nptcl)
resize for n particles
Definition: Walker.h:238
long walker_id_
}@
Definition: Walker.h:88

Member Function Documentation

◆ addPropertyHistory()

int addPropertyHistory ( int  leng)
inline

Definition at line 181 of file Walker.h.

182  {
183  int newL = PropertyHistory.size();
184  PropertyHistory.push_back(std::vector<RealType>(leng, 0.0));
185  PHindex.push_back(0);
186  return newL;
187  }
std::vector< int > PHindex
Definition: Walker.h:132
std::vector< std::vector< FullPrecRealType > > PropertyHistory
Property history vector.
Definition: Walker.h:131

◆ addPropertyHistoryPoint()

void addPropertyHistoryPoint ( int  index,
FullPrecRealType  data 
)
inline

Definition at line 203 of file Walker.h.

Referenced by ForwardWalking::evaluate(), and ForwardWalking::rejectedMove().

204  {
205  PropertyHistory[index][PHindex[index]] = (data);
206  PHindex[index]++;
207  if (PHindex[index] == PropertyHistory[index].size())
208  PHindex[index] = 0;
209  // PropertyHistory[index].pop_back();
210  }
std::vector< int > PHindex
Definition: Walker.h:132
int size() const
return the number of particles per walker
Definition: Walker.h:235
std::vector< std::vector< FullPrecRealType > > PropertyHistory
Property history vector.
Definition: Walker.h:131

◆ byteSize()

size_t byteSize ( )
inline

byte size for a packed message

walker_id_, Age, Properties, R, Drift, DataSet is packed

Definition at line 357 of file Walker.h.

358  {
359  // TODO: fix this! this is a non intuitive side effect for a size call
360  // breaks a bunch of things that could be const
361  if (!DataSet.size())
362  {
363  registerData();
364  DataSet.allocate();
365  }
366  return DataSet.byteSize();
367  }
WFBuffer_t DataSet
buffer for the data for particle-by-particle update
Definition: Walker.h:135
void registerData()
Definition: Walker.h:369
void allocate()
allocate the data
Definition: PooledMemory.h:104
size_type byteSize() const
return the size of the data
Definition: PooledMemory.h:70
size_type size() const
return the size of the data
Definition: PooledMemory.h:73

◆ copyFromBuffer()

void copyFromBuffer ( )
inline

Definition at line 402 of file Walker.h.

Referenced by Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::getMessage().

403  {
404  assert(DataSet.size() != 0);
405  DataSet.rewind();
407  // vectors
408  assert(R.size() != 0);
409  DataSet.get(R.first_address(), R.last_address());
410  assert(spins.size() != 0);
411  DataSet.get(spins.first_address(), spins.last_address());
412 #if !defined(SOA_MEMORY_OPTIMIZED)
413  assert(G.size() != 0);
414  DataSet.get(G.first_address(), G.last_address());
415  assert(L.size() != 0);
416  DataSet.get(L.first_address(), L.last_address());
417 #endif
419  for (int iat = 0; iat < PropertyHistory.size(); iat++)
420  DataSet.get(PropertyHistory[iat].data(), PropertyHistory[iat].data() + PropertyHistory[iat].size());
421  DataSet.get(PHindex.data(), PHindex.data() + PHindex.size());
422  assert(block_end == DataSet.current());
423  assert(scalar_end == DataSet.current_scalar());
424  }
std::vector< int > PHindex
Definition: Walker.h:132
PropertyContainer_t Properties
scalar properties of a walker
Definition: Walker.h:125
WFBuffer_t DataSet
buffer for the data for particle-by-particle update
Definition: Walker.h:135
std::vector< std::vector< FullPrecRealType > > PropertyHistory
Property history vector.
Definition: Walker.h:131
long parent_id_
in legacy the ancients have said only: id reserved for forward walking
Definition: Walker.h:92
int Generation
allegedly DMCgeneration PD: I can find no evidence it is ever updated anywhere in the code...
Definition: Walker.h:98
int Age
Age of this walker age is incremented when a walker is not moved after a sweep.
Definition: Walker.h:100
size_t block_end
Definition: Walker.h:136
ParticleScalar spins
Definition: Walker.h:117
size_t scalar_end
Definition: Walker.h:136
size_type current() const
Definition: PooledMemory.h:76
size_type size() const
return the size of the data
Definition: PooledMemory.h:73
size_type current_scalar() const
Definition: PooledMemory.h:79
void rewind(size_type cur=0, size_type cur_scalar=0)
set the cursors
Definition: PooledMemory.h:85
ParticleLaplacian L
^2_i d for the i-th particle
Definition: Walker.h:122
ParticlePos R
The configuration vector (3N-dimensional vector to store the positions of all the particles for a sin...
Definition: Walker.h:114
long walker_id_
}@
Definition: Walker.h:88
void get(std::complex< T1 > &x)
Definition: PooledMemory.h:132

◆ deletePropertyHistory()

void deletePropertyHistory ( )
inline

Definition at line 189 of file Walker.h.

189 { PropertyHistory.clear(); }
std::vector< std::vector< FullPrecRealType > > PropertyHistory
Property history vector.
Definition: Walker.h:131

◆ get_has_been_on_wire()

bool get_has_been_on_wire ( ) const
inline

Definition at line 144 of file Walker.h.

144 { return has_been_on_wire_; }
bool has_been_on_wire_
Definition: Walker.h:141

◆ getMessage()

Msg& getMessage ( Msg &  m)
inline

Definition at line 462 of file Walker.h.

463  {
464  if (!DataSet.size())
465  {
466  registerData();
467  DataSet.allocate();
468  }
469  m.Unpack(DataSet.data(), DataSet.size());
470  copyFromBuffer();
471  return m;
472  }
WFBuffer_t DataSet
buffer for the data for particle-by-particle update
Definition: Walker.h:135
void copyFromBuffer()
Definition: Walker.h:402
void registerData()
Definition: Walker.h:369
void allocate()
allocate the data
Definition: PooledMemory.h:104
T * data()
return the address of the first element
Definition: PooledMemory.h:187
size_type size() const
return the size of the data
Definition: PooledMemory.h:73

◆ getParentID()

long getParentID ( ) const
inline

Definition at line 149 of file Walker.h.

149 { return parent_id_; }
long parent_id_
in legacy the ancients have said only: id reserved for forward walking
Definition: Walker.h:92

◆ getPropertyBase() [1/4]

◆ getPropertyBase() [2/4]

const FullPrecRealType* getPropertyBase ( ) const
inline

Definition at line 280 of file Walker.h.

280 { return Properties.data(); }
PropertyContainer_t Properties
scalar properties of a walker
Definition: Walker.h:125

◆ getPropertyBase() [3/4]

FullPrecRealType* getPropertyBase ( int  i)
inline

return the address of the i-th properties

Definition at line 283 of file Walker.h.

283 { return Properties[i]; }
PropertyContainer_t Properties
scalar properties of a walker
Definition: Walker.h:125

◆ getPropertyBase() [4/4]

const FullPrecRealType* getPropertyBase ( int  i) const
inline

return the address of the i-th properties

Definition at line 286 of file Walker.h.

286 { return Properties[i]; }
PropertyContainer_t Properties
scalar properties of a walker
Definition: Walker.h:125

◆ getPropertyHistorySum()

FullPrecRealType getPropertyHistorySum ( int  index,
int  endN 
)
inline

Definition at line 212 of file Walker.h.

213  {
214  FullPrecRealType mean = 0.0;
215  typename std::vector<FullPrecRealType>::const_iterator phStart;
216  phStart = PropertyHistory[index].begin() + PHindex[index];
217  for (int i = 0; i < endN; phStart++, i++)
218  {
219  if (phStart >= PropertyHistory[index].end())
220  phStart -= PropertyHistory[index].size();
221  mean += (*phStart);
222  }
223  return mean;
224  }
std::vector< int > PHindex
Definition: Walker.h:132
std::vector< std::vector< FullPrecRealType > > PropertyHistory
Property history vector.
Definition: Walker.h:131
typename t_traits::FullPrecRealType FullPrecRealType
typedef for estimator real data type
Definition: Walker.h:60
ACC::value_type mean(const ACC &ac)
Definition: accumulators.h:147

◆ getWalkerID()

long getWalkerID ( ) const
inline

Definition at line 148 of file Walker.h.

148 { return walker_id_; }
long walker_id_
}@
Definition: Walker.h:88

◆ makeCopy()

void makeCopy ( const Walker< t_traits, p_traits > &  a)
inline

copy the content of a walker

Definition at line 247 of file Walker.h.

Referenced by Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::operator=(), and Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::Walker().

248  {
249  walker_id_ = a.walker_id_;
250  parent_id_ = a.parent_id_;
251  Generation = a.Generation;
252  Age = a.Age;
253  Weight = a.Weight;
254  Multiplicity = a.Multiplicity;
255  if (R.size() != a.R.size())
256  resize(a.R.size());
257  R = a.R;
258  if (spins.size() != a.spins.size())
259  resize(a.spins.size());
260  spins = a.spins;
261 #if !defined(SOA_MEMORY_OPTIMIZED)
262  G = a.G;
263  L = a.L;
264 #endif
265  Properties.copy(a.Properties);
266  DataSet = a.DataSet;
267  block_end = a.block_end;
268  scalar_end = a.scalar_end;
269  if (PropertyHistory.size() != a.PropertyHistory.size())
270  PropertyHistory.resize(a.PropertyHistory.size());
271  for (int i = 0; i < PropertyHistory.size(); i++)
272  PropertyHistory[i] = a.PropertyHistory[i];
273  PHindex = a.PHindex;
274  }
std::vector< int > PHindex
Definition: Walker.h:132
PropertyContainer_t Properties
scalar properties of a walker
Definition: Walker.h:125
WFBuffer_t DataSet
buffer for the data for particle-by-particle update
Definition: Walker.h:135
std::vector< std::vector< FullPrecRealType > > PropertyHistory
Property history vector.
Definition: Walker.h:131
void copy(const RHS &rhs)
Methods for assignment or copy of identically sized or smaller ConstantSizeMatrix<T, ALLOC>.
long parent_id_
in legacy the ancients have said only: id reserved for forward walking
Definition: Walker.h:92
int Generation
allegedly DMCgeneration PD: I can find no evidence it is ever updated anywhere in the code...
Definition: Walker.h:98
int Age
Age of this walker age is incremented when a walker is not moved after a sweep.
Definition: Walker.h:100
size_t block_end
Definition: Walker.h:136
ParticleScalar spins
Definition: Walker.h:117
void resize(int nptcl)
resize for n particles
Definition: Walker.h:238
size_t scalar_end
Definition: Walker.h:136
FullPrecRealType Weight
Weight of the walker.
Definition: Walker.h:102
FullPrecRealType Multiplicity
Number of copies for branching When Multiplicity = 0, this walker will be destroyed.
Definition: Walker.h:106
ParticleLaplacian L
^2_i d for the i-th particle
Definition: Walker.h:122
ParticlePos R
The configuration vector (3N-dimensional vector to store the positions of all the particles for a sin...
Definition: Walker.h:114
long walker_id_
}@
Definition: Walker.h:88

◆ operator=()

Walker& operator= ( const Walker< t_traits, p_traits > &  a)
inline

assignment operator

Definition at line 227 of file Walker.h.

228  {
229  if (this != &a)
230  makeCopy(a);
231  return *this;
232  }
void makeCopy(const Walker &a)
copy the content of a walker
Definition: Walker.h:247

◆ putMessage()

Msg& putMessage ( Msg &  m)
inline

Definition at line 448 of file Walker.h.

449  {
450  // Pack DataSet buffer
451  if (!DataSet.size())
452  {
453  registerData();
454  DataSet.allocate();
455  }
456  updateBuffer();
457  m.Pack(DataSet.data(), DataSet.size());
458  return m;
459  }
WFBuffer_t DataSet
buffer for the data for particle-by-particle update
Definition: Walker.h:135
void updateBuffer()
Definition: Walker.h:428
void registerData()
Definition: Walker.h:369
void allocate()
allocate the data
Definition: PooledMemory.h:104
T * data()
return the address of the first element
Definition: PooledMemory.h:187
size_type size() const
return the size of the data
Definition: PooledMemory.h:73

◆ registerData()

void registerData ( )
inline

Definition at line 369 of file Walker.h.

Referenced by Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::byteSize(), Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::getMessage(), CSUpdateBase::initCSWalkersForPbyP(), QMCUpdateBase::initWalkersForPbyP(), and Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::putMessage().

370  {
371  // walker data must be placed at the beginning
372  assert(DataSet.size() == 0);
373  // scalars
377  DataSet.add(Age);
378  // vectors
379  assert(R.size() != 0);
380  DataSet.add(R.first_address(), R.last_address());
381  assert(spins.size() != 0);
382  DataSet.add(spins.first_address(), spins.last_address());
383 #if !defined(SOA_MEMORY_OPTIMIZED)
384  assert(G.size() != 0);
385  DataSet.add(G.first_address(), G.last_address());
386  assert(L.size() != 0);
387  DataSet.add(L.first_address(), L.last_address());
388 #endif
389  //Don't add the nLocal but the actual allocated size. We want to register once for the life of a
390  //walker so we leave space for additional properties.
392  //DataSet.add(Properties.first_address(), Properties.last_address());
393 
394  // \todo likely to be broken if the Properties change above is needed.
395  for (int iat = 0; iat < PropertyHistory.size(); iat++)
396  DataSet.add(PropertyHistory[iat].data(), PropertyHistory[iat].data() + PropertyHistory[iat].size());
397  DataSet.add(PHindex.data(), PHindex.data() + PHindex.size());
400  }
std::vector< int > PHindex
Definition: Walker.h:132
PropertyContainer_t Properties
scalar properties of a walker
Definition: Walker.h:125
WFBuffer_t DataSet
buffer for the data for particle-by-particle update
Definition: Walker.h:135
std::vector< std::vector< FullPrecRealType > > PropertyHistory
Property history vector.
Definition: Walker.h:131
long parent_id_
in legacy the ancients have said only: id reserved for forward walking
Definition: Walker.h:92
int Generation
allegedly DMCgeneration PD: I can find no evidence it is ever updated anywhere in the code...
Definition: Walker.h:98
int Age
Age of this walker age is incremented when a walker is not moved after a sweep.
Definition: Walker.h:100
size_t block_end
Definition: Walker.h:136
ParticleScalar spins
Definition: Walker.h:117
size_t scalar_end
Definition: Walker.h:136
size_type current() const
Definition: PooledMemory.h:76
size_type size() const
return the size of the data
Definition: PooledMemory.h:73
size_type current_scalar() const
Definition: PooledMemory.h:79
ParticleLaplacian L
^2_i d for the i-th particle
Definition: Walker.h:122
ParticlePos R
The configuration vector (3N-dimensional vector to store the positions of all the particles for a sin...
Definition: Walker.h:114
void add(std::complex< T1 > &x)
Definition: PooledMemory.h:113
long walker_id_
}@
Definition: Walker.h:88

◆ reset()

void reset ( )
inline

reset the walker weight, multiplicity and age

Definition at line 343 of file Walker.h.

344  {
345  Age = 0;
346  Multiplicity = 1.0e0;
347  Weight = 1.0e0;
348  }
int Age
Age of this walker age is incremented when a walker is not moved after a sweep.
Definition: Walker.h:100
FullPrecRealType Weight
Weight of the walker.
Definition: Walker.h:102
FullPrecRealType Multiplicity
Number of copies for branching When Multiplicity = 0, this walker will be destroyed.
Definition: Walker.h:106

◆ resetProperty() [1/2]

void resetProperty ( FullPrecRealType  logpsi,
FullPrecRealType  sigN,
FullPrecRealType  ene 
)
inline

reset the property of a walker

Parameters
logpsi$\log |\Psi|$
sigNsign of the trial wavefunction
enethe local energy

Assign the values and reset the age but leave the weight and multiplicity

Definition at line 296 of file Walker.h.

Referenced by SOVMCUpdateAll::advanceWalker(), DMCUpdateAllWithRejection::advanceWalker(), SODMCUpdatePbyPWithRejectionFast::advanceWalker(), VMCUpdateAll::advanceWalker(), SOVMCUpdatePbyP::advanceWalker(), DMCUpdatePbyPWithRejectionFast::advanceWalker(), VMCUpdatePbyP::advanceWalker(), DMCUpdatePbyPL2::advanceWalker(), DMCUpdateAllWithKill::advanceWalker(), RMCUpdatePbyPWithDrift::advanceWalkersVMC(), RMCUpdatePbyPWithDrift::initWalkersForPbyP(), QMCUpdateBase::initWalkersForPbyP(), and WaveFunctionTester::runRatioTest().

297  {
298  Age = 0;
299  //Weight=1.0;
300  Properties(WP::LOGPSI) = logpsi;
301  Properties(WP::SIGN) = sigN;
302  Properties(WP::LOCALENERGY) = ene;
303  }
PropertyContainer_t Properties
scalar properties of a walker
Definition: Walker.h:125
int Age
Age of this walker age is incremented when a walker is not moved after a sweep.
Definition: Walker.h:100

◆ resetProperty() [2/2]

void resetProperty ( FullPrecRealType  logpsi,
FullPrecRealType  sigN,
FullPrecRealType  ene,
FullPrecRealType  r2a,
FullPrecRealType  r2p,
FullPrecRealType  vq 
)
inline

reset the property of a walker

Parameters
logpsi$\log |\Psi|$
sigNsign of the trial wavefunction
enethe local energy
r2a$r^2$ for the accepted moves
r2p$r^2$ for the proposed moves
vq$\bar{V}/V$ scaling to control node divergency in JCP 93

Assign the values and reset the age but leave the weight and multiplicity

Definition at line 316 of file Walker.h.

322  {
323  Age = 0;
324  Properties(WP::LOGPSI) = logpsi;
325  Properties(WP::SIGN) = sigN;
326  Properties(WP::LOCALENERGY) = ene;
327  Properties(WP::R2ACCEPTED) = r2a;
328  Properties(WP::R2PROPOSED) = r2p;
329  Properties(WP::DRIFTSCALE) = vq;
330  }
PropertyContainer_t Properties
scalar properties of a walker
Definition: Walker.h:125
int Age
Age of this walker age is incremented when a walker is not moved after a sweep.
Definition: Walker.h:100

◆ resetPropertyHistory()

void resetPropertyHistory ( )
inline

Definition at line 191 of file Walker.h.

192  {
193  for (int i = 0; i < PropertyHistory.size(); i++)
194  {
195  PHindex[i] = 0;
196  for (int k = 0; k < PropertyHistory[i].size(); k++)
197  {
198  PropertyHistory[i][k] = 0.0;
199  }
200  }
201  }
std::vector< int > PHindex
Definition: Walker.h:132
std::vector< std::vector< FullPrecRealType > > PropertyHistory
Property history vector.
Definition: Walker.h:131

◆ resize()

void resize ( int  nptcl)
inline

resize for n particles

Definition at line 238 of file Walker.h.

Referenced by Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::makeCopy(), and Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::Walker().

239  {
240  R.resize(nptcl);
241  spins.resize(nptcl);
242  G.resize(nptcl);
243  L.resize(nptcl);
244  }
ParticleScalar spins
Definition: Walker.h:117
ParticleLaplacian L
^2_i d for the i-th particle
Definition: Walker.h:122
ParticlePos R
The configuration vector (3N-dimensional vector to store the positions of all the particles for a sin...
Definition: Walker.h:114

◆ resizeProperty()

void resizeProperty ( int  n,
int  m 
)
inline

Definition at line 350 of file Walker.h.

350 { Properties.resize(n, m); }
PropertyContainer_t Properties
scalar properties of a walker
Definition: Walker.h:125

◆ set_has_been_on_wire()

void set_has_been_on_wire ( bool  tf)
inline

Definition at line 145 of file Walker.h.

145 { has_been_on_wire_ = tf; }
bool has_been_on_wire_
Definition: Walker.h:141

◆ setParentID()

void setParentID ( long  parent_id)
inline

Definition at line 154 of file Walker.h.

154 { parent_id_ = parent_id; }
long parent_id_
in legacy the ancients have said only: id reserved for forward walking
Definition: Walker.h:92

◆ setWalkerID()

void setWalkerID ( long  walker_id)
inline

set function for walker walker_id_ only necessary because as an optimization we reuse walkers.

Definition at line 153 of file Walker.h.

153 { walker_id_ = walker_id; }
long walker_id_
}@
Definition: Walker.h:88

◆ size()

int size ( void  ) const
inline

return the number of particles per walker

Definition at line 235 of file Walker.h.

Referenced by Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::addPropertyHistoryPoint().

235 { return R.size(); }
ParticlePos R
The configuration vector (3N-dimensional vector to store the positions of all the particles for a sin...
Definition: Walker.h:114

◆ updateBuffer()

void updateBuffer ( )
inline

Definition at line 428 of file Walker.h.

Referenced by Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::putMessage().

429  {
430  DataSet.rewind();
432  // vectors
433  DataSet.put(R.first_address(), R.last_address());
434  DataSet.put(spins.first_address(), spins.last_address());
435 #if !defined(SOA_MEMORY_OPTIMIZED)
436  DataSet.put(G.first_address(), G.last_address());
437  DataSet.put(L.first_address(), L.last_address());
438 #endif
440  for (int iat = 0; iat < PropertyHistory.size(); iat++)
441  DataSet.put(PropertyHistory[iat].data(), PropertyHistory[iat].data() + PropertyHistory[iat].size());
442  DataSet.put(PHindex.data(), PHindex.data() + PHindex.size());
443  assert(block_end == DataSet.current());
444  assert(scalar_end == DataSet.current_scalar());
445  }
std::vector< int > PHindex
Definition: Walker.h:132
PropertyContainer_t Properties
scalar properties of a walker
Definition: Walker.h:125
WFBuffer_t DataSet
buffer for the data for particle-by-particle update
Definition: Walker.h:135
std::vector< std::vector< FullPrecRealType > > PropertyHistory
Property history vector.
Definition: Walker.h:131
long parent_id_
in legacy the ancients have said only: id reserved for forward walking
Definition: Walker.h:92
int Generation
allegedly DMCgeneration PD: I can find no evidence it is ever updated anywhere in the code...
Definition: Walker.h:98
int Age
Age of this walker age is incremented when a walker is not moved after a sweep.
Definition: Walker.h:100
size_t block_end
Definition: Walker.h:136
ParticleScalar spins
Definition: Walker.h:117
size_t scalar_end
Definition: Walker.h:136
size_type current() const
Definition: PooledMemory.h:76
size_type current_scalar() const
Definition: PooledMemory.h:79
void rewind(size_type cur=0, size_type cur_scalar=0)
set the cursors
Definition: PooledMemory.h:85
void put(std::complex< T1 > &x)
Definition: PooledMemory.h:165
ParticleLaplacian L
^2_i d for the i-th particle
Definition: Walker.h:122
ParticlePos R
The configuration vector (3N-dimensional vector to store the positions of all the particles for a sin...
Definition: Walker.h:114
long walker_id_
}@
Definition: Walker.h:88

◆ willDie()

void willDie ( )
inline

marked to die

Multiplicity and weight are set to zero.

Definition at line 336 of file Walker.h.

Referenced by DMCUpdateAllWithKill::advanceWalker().

337  {
338  Multiplicity = 0;
339  Weight = 0.0;
340  }
FullPrecRealType Weight
Weight of the walker.
Definition: Walker.h:102
FullPrecRealType Multiplicity
Number of copies for branching When Multiplicity = 0, this walker will be destroyed.
Definition: Walker.h:106

Member Data Documentation

◆ Age

◆ block_end

◆ DataSet

◆ Generation

◆ has_been_on_wire_

◆ L

◆ Multiplicity

◆ parent_id_

◆ PHindex

◆ Properties

PropertyContainer_t Properties

scalar properties of a walker

Definition at line 125 of file Walker.h.

Referenced by SOVMCUpdateAll::advanceWalker(), SODMCUpdatePbyPWithRejectionFast::advanceWalker(), DMCUpdateAllWithRejection::advanceWalker(), VMCUpdateAll::advanceWalker(), DMCUpdatePbyPWithRejectionFast::advanceWalker(), DMCUpdatePbyPL2::advanceWalker(), CSVMCUpdatePbyP::advanceWalker(), CSVMCUpdateAll::advanceWalker(), DMCUpdateAllWithKill::advanceWalker(), CSVMCUpdateAllWithDrift::advanceWalker(), RMCUpdatePbyPWithDrift::advanceWalkersRMC(), RMCUpdateAllWithDrift::advanceWalkersRMC(), RMCUpdatePbyPWithDrift::advanceWalkersVMC(), RMCUpdateAllWithDrift::advanceWalkersVMC(), SimpleFixedNodeBranch::collect(), MCSample::convertToWalker(), Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::copyFromBuffer(), Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::getPropertyBase(), CSUpdateBase::initCSWalkers(), CSUpdateBase::initCSWalkersForPbyP(), QMCUpdateBase::initWalkersForPbyP(), Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::makeCopy(), MCSample::MCSample(), WaveFunctionTester::printEloc(), Reptile::printState(), Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::registerData(), Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::resetProperty(), Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::resizeProperty(), WaveFunctionTester::runCloneTest(), WaveFunctionTester::runDerivNLPPTest(), WaveFunctionTester::runDerivTest(), WaveFunctionTester::runGradSourceTest(), WaveFunctionTester::runRatioTest(), WaveFunctionTester::runRatioTest2(), WaveFunctionTester::runZeroVarianceTest(), qmcplusplus::TEST_CASE(), Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::updateBuffer(), and CSUpdateBase::updateCSWalkers().

◆ PropertyHistory

◆ R

The configuration vector (3N-dimensional vector to store the positions of all the particles for a single walker)

Definition at line 114 of file Walker.h.

Referenced by SOVMCUpdateAll::advanceWalker(), DMCUpdateAllWithRejection::advanceWalker(), VMCUpdateAll::advanceWalker(), CSVMCUpdateAll::advanceWalker(), DMCUpdateAllWithKill::advanceWalker(), CSVMCUpdateAllWithDrift::advanceWalker(), RMCUpdatePbyPWithDrift::advanceWalkersRMC(), RMCUpdateAllWithDrift::advanceWalkersRMC(), RMCUpdatePbyPWithDrift::advanceWalkersVMC(), RMCUpdateAllWithDrift::advanceWalkersVMC(), MCSample::convertToWalker(), Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::copyFromBuffer(), CSUpdateBase::initCSWalkers(), CSUpdateBase::initCSWalkersForPbyP(), RMCUpdatePbyPWithDrift::initWalkersForPbyP(), QMCUpdateBase::initWalkersForPbyP(), Reptile::linearInterp(), ParticleSet::loadWalker(), Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::makeCopy(), ParticleSet::makeMoveAllParticles(), ParticleSet::makeMoveAllParticlesWithDrift(), SetupSimpleFixedNodeBranch::operator()(), WaveFunctionTester::printEloc(), Reptile::printState(), Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::registerData(), Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::resize(), WaveFunctionTester::runCloneTest(), WaveFunctionTester::runDerivCloneTest(), WaveFunctionTester::runDerivNLPPTest(), WaveFunctionTester::runDerivTest(), WaveFunctionTester::runGradSourceTest(), WaveFunctionTester::runRatioTest(), WaveFunctionTester::runZeroVarianceTest(), ParticleSet::saveWalker(), Reptile::setReptileSlicePositions(), Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::size(), qmcplusplus::TEST_CASE(), and Walker< qmcplusplus::QMCTraits, qmcplusplus::PtclOnLatticeTraits >::updateBuffer().

◆ scalar_end

◆ SendInProgress

bool SendInProgress

mark true if this walker is being sent.

Definition at line 108 of file Walker.h.

◆ spins

◆ walker_id_

◆ wasTouched

bool wasTouched = true

if true, this walker is either copied or tranferred from another MPI rank.

Definition at line 110 of file Walker.h.

◆ Weight


The documentation for this class was generated from the following file: