36 :
ParticleSet(simulation_cell, kind), ReadyForPbyP(false), UpdateMode(Update_Walker), reptile(0), Polymer(0)
40 :
ParticleSet(mcw), ReadyForPbyP(false), UpdateMode(Update_Walker), Polymer(0)
59 awalker->spins =
spins;
68 app_warning() <<
"MCWalkerConfiguration::resize cleans up the walker list." << std::endl;
77 awalker->spins =
spins;
89 throw std::runtime_error(
"MCWalkerConfiguration::sample obsolete");
100 app_log() <<
" Resetting Properties of the walkers " << ncopy <<
" x " <<
m << std::endl;
105 catch (std::domain_error& de)
108 <<
"This is likely because some object has attempted to add walker properties\n" 109 <<
" in excess of WALKER_MAX_PROPERTIES.\n" 110 <<
"build with cmake ... -DWALKER_MAX_PROPERTIES=at_least_properties_required" << std::endl;
116 walker->resizeProperty(ncopy,
m);
172 for (
int i = 0; i < nsamples; ++i)
174 auto awalker = std::make_unique<Walker_t>(
TotalNum);
175 awalker->Properties.copy(prop);
189 for (
auto* mcwc : others)
191 const auto& astack(mcwc->getSampleStack());
192 const size_t sample_size =
std::min(mcwc->getMaxSamples(), mcwc->numSamples());
193 for (
int j = 0; j < sample_size; ++j)
195 const auto&
sample = astack.getSample(j);
196 const size_t num_ptcls =
sample.getNumPtcls();
197 auto awalker = std::make_unique<Walker_t>(num_ptcls);
198 sample.convertToWalker(*awalker);
207 std::vector<int> nwoff(np + 1, 0);
208 for (
int ip = 0; ip < np; ++ip)
209 nwoff[ip + 1] = nwoff[ip] + w;
211 out.
dump(wctemp, nBlock);
220 std::vector<int> off(others.size() + 1, 0);
221 for (
int i = 0; i < others.size(); ++i)
225 int nw_tot = off.back();
232 for (
int i = 0; i < others.size(); ++i)
235 for (
int j = 0, iw = off[i]; iw < off[i + 1]; ++j, ++iw)
237 auto awalker = std::make_unique<Walker_t>(
TotalNum);
238 awalker->Properties.copy(prop);
243 others[i]->clearEnsemble();
bool dump(const WalkerConfigurations &w, int block)
dump configurations
DynamicCoordinateKind
enumerator for DynamicCoordinates kinds
void saveEnsemble()
save the position of current walkers to SampleStack
void sample(iterator it, RealType tauinv)
make random moves for all the walkers
Stores particle configurations for later use in DMC and wavefunction optimization.
A set of walkers that are to be advanced by Metropolis Monte Carlo.
std::ostream & app_warning()
helper functions for EinsplineSetBuilder
size_t getMaxSamples() const
ParticleScalar spins
internal spin variables for dynamical spin calculations
PropertyContainer_t Properties
properties of the current walker
void resizeWalkerHistories()
resize Walker::PropertyHistory and Walker::PHindex:
QTBase::RealType RealType
size_t getActiveWalkers() const
return the number of active walkers
size_t TotalNum
total number of particles
Writes a set of walker configurations to an HDF5 file.
A set of light weight walkers that are carried between driver sections and restart.
std::ostream & app_error()
std::vector< std::vector< FullPrecRealType > > PropertyHistory
Property history vector.
void pop_back()
delete the last Walker_t*
int getMaxSamples() const
Transitional forwarding methods.
size_t getNumSamples() const
int first(int igroup) const
return the first index of a group i
void setWalkerOffsets(const std::vector< int > &o)
return the total number of active walkers among a MPI group
void push_back(std::unique_ptr< Walker_t > awalker)
add Walker_t* at the end
MCWalkerConfiguration(const SimulationCell &simulation_cell, const DynamicCoordinateKind kind=DynamicCoordinateKind::DC_POS)
default constructor
void loadEnsemble()
load SampleStack data to the current list of walker configurations
void clearEnsemble()
clear the ensemble
void clearEnsemble()
clear the ensemble
PropertySetType PropertyList
name-value map of Walker Properties
store minimum Walker data
void loadSample(ParticleSet &pset, size_t iw) const
load a single sample from SampleStack
Specialized paritlce class for atomistic simulations.
WalkerList_t::iterator iterator
FIX: a type alias of iterator for an object should not be for just one of many objects it holds...
void createWalkers(int numWalkers, size_t numPtcls)
create numWalkers Walkers
const MCSample & getSample(size_t i) const
void resize(size_t numPtcl)
resize internal storage
void resize(size_t m, size_t n)
std::vector< int > PHindex
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
void setNumSamples(int n)
set the number of max samples
int last(int igroup) const
return the last index of a group i
void resize(int numWalkers, int numPtcls)
clean up the walker list and make a new list
void setMaxSamples(size_t n, size_t number_of_ranks=1)
set the number of max samples per rank.
const std::vector< int > & getWalkerOffsets() const
static bool dumpEnsemble(std::vector< MCWalkerConfiguration *> &others, HDFWalkerOutput &out, int np, int nBlock)
dump Samples to a file
void resize(int numWalkers, size_t numPtcls)
clean up the walker list and make a new list
void convertToWalker(Walker_t &w) const
Indexes
an enum denoting index of physical properties
void appendSample(MCSample &&sample)
void loadSample(ParticleSet &pset, size_t iw) const
load a single sample from SampleStack
const SampleStack & getSampleStack() const
void createWalkers(int numWalkers)
create numWalkers Walkers
walker_list__t walker_list_
a collection of walkers
Declaration of a MCWalkerConfiguration.
void resetWalkerProperty(int ncopy=1)
reset the Property container of all the walkers