24 using MCPWalker = Walker<QMCTraits, PtclOnLatticeTraits>;
31 properties_include = {
"R2Accepted",
"R2Proposed",
"LocalEnergy",
"LocalPotential",
"Kinetic",
32 "ElecElec",
"ElecIon",
"LocalECP",
"NonLocalECP"};
49 app_log() <<
"WalkerLogCollector::startBlock " << std::endl;
64 int current_step = (step == -1) ?
pset.current_step : step;
73 size_t nparticles =
walker.R.size();
74 size_t ndim =
walker.R[0].size();
77 for (
size_t p = 0; p < nparticles; ++p)
78 for (
size_t d = 0; d < ndim; ++d)
85 for (
size_t p = 0; p < nparticles; ++p)
91 for (
size_t p = 0; p < nparticles; ++p)
92 for (
size_t d = 0; d < ndim; ++d)
97 for (
size_t p = 0; p < nparticles; ++p)
103 bsi.collect(
"step", (
WLog::Int)current_step);
115 if (bsr.first_collect)
117 for (
size_t n = 0;
n <
pset.PropertyList.size(); ++
n)
119 auto& name =
pset.PropertyList.Names[
n];
120 auto& value =
walker.Properties(0,
n);
126 if (name ==
"LocalEnergy")
130 throw std::runtime_error(
"LogCollector::collect energy_index must not be negative");
135 auto& name =
pset.PropertyList.Names[
n];
136 auto& value =
walker.Properties(0,
n);
141 WLog::Real dr = std::numeric_limits<WLog::Real>::max();
142 for (
size_t n = 0;
n < gv.size(); ++
n)
144 auto dr_node_min = dr;
146 for (
size_t n = 0;
n < gv.size(); ++
n)
149 for (
size_t n = 0;
n < gv.size(); ++
n)
151 bsr.collect(
"dr_node_min", dr_node_min);
152 bsr.collect(
"dlogpsi2", dlogpsi2);
153 bsr.collect(
"dphase2", dphase2);
157 steps.push_back((
size_t)current_step);
165 app_log() <<
"WalkerLogCollector::reset_buffers" << std::endl;
179 app_log() <<
"WalkerLogCollector::checkBuffers" << std::endl;
183 auto steps_bad =
steps.size() != nrows;
184 auto energies_bad =
energies.size() != nrows;
185 auto any_bad = prop_real_bad || part_real_bad || steps_bad || energies_bad;
188 app_log() <<
"WalkerLogCollector::checkBuffers walker_property_real_buffer row count does not match\n";
190 app_log() <<
"WalkerLogCollector::checkBuffers walker_particle_real_buffer row count does not match\n";
192 app_log() <<
"WalkerLogCollector::checkBuffers steps entry count does not match\n";
194 app_log() <<
"WalkerLogCollector::checkBuffers energies entry count does not match\n";
196 throw std::runtime_error(
"WalkerLogCollector::checkBuffers buffer lengths do not match");
Array< WLog::PsiVal, 2 > Gtmp
tmp storage for walker wavefunction gradients
Array< WLog::Real, 2 > Rtmp
tmp storage for walker positions
helper functions for EinsplineSetBuilder
Array< WLog::PsiVal, 1 > Ltmp
tmp storage for walker wavefunciton laplacians
int energy_index
location of LocalEnergy in ParticleSet::PropertyList
bool verbose
controls verbosity of log file writes
int step_period
period between MC steps for data collection
MakeReturn< UnaryNode< FnFabs, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t abs(const Vector< T1, C1 > &l)
WalkerLogBuffer< WLog::Int > walker_property_int_buffer
buffer containing integer walker properties
void checkBuffers()
Check that all buffers have the same number of rows.
std::vector< size_t > property_indices
indices in ParticleSet::PropertyList for included quantities
WalkerLogBuffer< WLog::Real > walker_property_real_buffer
buffer containing real-valued walker properties
Collection of Local Energy Operators.
OHMMS_PRECISION_FULL Real
std::unordered_set< std::string > properties_include
ParticleSet::PropertyList quantities to include.
const WalkerLogState & state_
state data set by WalkerLogManager
void resize(const std::array< SIZET, D > &dims)
Resize the container.
void resetBuffers()
resize buffers to zero rows
std::string label
label for this data in HDF file
Array< WLog::Real, 1 > Stmp
tmp storage for walker spins
bool logs_active
whether logs are active in the current driver
Specialized paritlce class for atomistic simulations.
float imag(const float &c)
imaginary part of a scalar. Cannot be replaced by std::imag due to AFQMC specific needs...
WalkerLogBuffer< WLog::Real > walker_particle_real_buffer
buffer containing per-particle walker data
void init()
shared variable setting in constructors
RealType getLogPsi() const
size_t nrows()
current number of rows in the data buffer
void collect(const MCPWalker &walker, const ParticleSet &pset, const TrialWaveFunction &wfn, const QMCHamiltonian &ham, int step=-1)
collect all data for one walker into the data buffers
Declaration of a TrialWaveFunction.
RealType getPhase() const
Class to represent a many-body trial wave function.
std::vector< WLog::Real > energies
LocalEnergy information for each walker throughout the MC block.
Walker< QMCTraits, PtclOnLatticeTraits > MCPWalker
void resetBuffer()
resize the buffer to zero
void startBlock()
resize buffers to zero rows at beginning of each MC block
Helper struct holding data transferred from WalkerLogManager to WalkerLogCollector following input re...
std::vector< size_t > steps
MC step information for each walker throughout the MC block.
A container class to represent a walker.
WalkerLogCollector(const WalkerLogState &state)
constructor. The state should be given by the manager.
Declaration of QMCHamiltonian.