![]() |
QMCPACK
|
Class to accumulate the local energy and components. More...
Public Member Functions | |
RMCLocalEnergyEstimator (QMCHamiltonian &ham, int nobs=2) | |
constructor More... | |
RMCLocalEnergyEstimator (RMCLocalEnergyInput &&input, const QMCHamiltonian &ham) | |
Construct from LocalEnergyInput and const reference to hamiltonian. More... | |
void | accumulate (const Walker_t &awalker, RealType wgt) |
accumulation per walker More... | |
void | accumulate (const RefVector< MCPWalker > &walkers) override |
a virtual function to accumulate observables or collectables More... | |
void | accumulate (const MCWalkerConfiguration &W, WalkerIterator first, WalkerIterator last, RealType wgt) override |
a virtual function to accumulate observables or collectables More... | |
std::string | getName () const override |
void | add2Record (RecordListType &record) override |
add the local energy, variance and all the Hamiltonian components to the scalar record container More... | |
void | registerObservables (std::vector< ObservableHelper > &h5dec, hdf_archive &file) override |
add descriptors of observables to utilize hdf5 More... | |
RMCLocalEnergyEstimator * | clone () override |
clone the object More... | |
const std::string & | getSubTypeStr () const override |
String representation of the derived type of the ScalarEstimator. More... | |
bool | isMainEstimator () const override |
RMCLocalEnergyEstimator is the main estimator type for RMC driver. More... | |
![]() | |
ScalarEstimatorBase () | |
virtual | ~ScalarEstimatorBase () |
RealType | average (int i=0) const |
return average of the More... | |
RealType | variance (int i=0) const |
return a variance More... | |
std::pair< RealType, RealType > | operator[] (int i) const |
retrun mean and variance More... | |
virtual int | size () const |
return the size of scalars it manages More... | |
void | clear () |
clear the scalars to collect More... | |
template<typename IT > | |
void | takeBlockAverage (IT first) |
take block average and write to a common container More... | |
template<typename IT > | |
void | takeBlockAverage (IT first, IT first_sq) |
take block average and write to common containers for values and squared values More... | |
template<typename IT > | |
void | addAccumulated (IT first) |
add the block accumulated scalars More... | |
virtual void | add2Record (RecordNamedProperty< RealType > &record)=0 |
add the content of the scalar estimator to the record More... | |
Private Types | |
using | WP = WalkerProperties::Indexes |
Private Member Functions | |
void | resizeBasedOnHamiltonian (const QMCHamiltonian &ham) |
Private Attributes | |
int | FirstHamiltonian |
int | SizeOfHamiltonians |
const QMCHamiltonian & | refH |
int | NObs |
int | RMCSpecificTerms = 8 |
const RMCLocalEnergyInput | input_ |
Additional Inherited Members | |
![]() | |
using | RealType = QMCTraits::FullPrecRealType |
using | accumulator_type = accumulator_set< RealType > |
using | Walker_t = MCWalkerConfiguration::Walker_t |
using | MCPWalker = Walker< QMCTraits, PtclOnLatticeTraits > |
using | WalkerIterator = MCWalkerConfiguration::const_iterator |
using | RecordListType = RecordNamedProperty< RealType > |
![]() | |
int | FirstIndex |
first index within an record of the first element handled by an object More... | |
int | LastIndex |
last index within an record of the first element handled by an object More... | |
std::vector< accumulator_type > | scalars |
scalars to be measured More... | |
std::vector< accumulator_type > | scalars_saved |
scalars saved More... | |
Class to accumulate the local energy and components.
Use Walker::Properties to accumulate Hamiltonian-related quantities.
Definition at line 28 of file RMCLocalEnergyEstimator.h.
|
private |
Definition at line 30 of file RMCLocalEnergyEstimator.h.
RMCLocalEnergyEstimator | ( | QMCHamiltonian & | ham, |
int | nobs = 2 |
||
) |
constructor
h | QMCHamiltonian to define the components |
Definition at line 19 of file RMCLocalEnergyEstimator.cpp.
References qmcplusplus::ham, and RMCLocalEnergyEstimator::resizeBasedOnHamiltonian().
Referenced by RMCLocalEnergyEstimator::clone().
RMCLocalEnergyEstimator | ( | RMCLocalEnergyInput && | input, |
const QMCHamiltonian & | ham | ||
) |
Construct from LocalEnergyInput and const reference to hamiltonian.
[in] | RMCLocalEnergyEstimatorInput | contains input parameters for RMCLocalEnergyEstimator |
[in] | is | taken as a local reference and used to size scalars data and to get obs output names |
Definition at line 24 of file RMCLocalEnergyEstimator.cpp.
References qmcplusplus::ham, and RMCLocalEnergyEstimator::resizeBasedOnHamiltonian().
accumulation per walker
awalker | current walker |
wgt | weight |
Weight of observables should take into account the walkers weight. For Pure DMC. In branching DMC set weights to 1.
Definition at line 56 of file RMCLocalEnergyEstimator.h.
a virtual function to accumulate observables or collectables
global_walkers_ | walkers per ranks or walkers total? |
RefVector | of MCPWalkers |
wgt | weight or maybe norm |
Implements ScalarEstimatorBase.
Definition at line 58 of file RMCLocalEnergyEstimator.h.
|
inlineoverridevirtual |
a virtual function to accumulate observables or collectables
W | const MCWalkerConfiguration |
first | const_iterator for the first walker |
last | const_iterator for the last walker |
wgt | weight |
Pass W along with the iterators so that the properties of W can be utilized.
Implements ScalarEstimatorBase.
Definition at line 62 of file RMCLocalEnergyEstimator.h.
References RMCLocalEnergyEstimator::FirstHamiltonian, Reptile::getCenter(), Reptile::getHead(), Walker< t_traits, p_traits >::getPropertyBase(), Reptile::getTail(), MCWalkerConfiguration::reptile, RMCLocalEnergyEstimator::RMCSpecificTerms, ScalarEstimatorBase::scalars, and RMCLocalEnergyEstimator::SizeOfHamiltonians.
|
override |
add the local energy, variance and all the Hamiltonian components to the scalar record container
record | storage of scalar records (name,value) |
Definition at line 42 of file RMCLocalEnergyEstimator.cpp.
References RecordNamedProperty< T >::add(), ScalarEstimatorBase::clear(), ScalarEstimatorBase::FirstIndex, QMCHamiltonian::getObservableName(), ScalarEstimatorBase::LastIndex, RMCLocalEnergyEstimator::refH, RecordNamedProperty< T >::size(), and RMCLocalEnergyEstimator::SizeOfHamiltonians.
|
overridevirtual |
clone the object
Implements ScalarEstimatorBase.
Definition at line 37 of file RMCLocalEnergyEstimator.cpp.
References RMCLocalEnergyEstimator::RMCLocalEnergyEstimator().
|
inlineoverridevirtual |
Implements ScalarEstimatorBase.
Definition at line 150 of file RMCLocalEnergyEstimator.h.
|
inlineoverridevirtual |
String representation of the derived type of the ScalarEstimator.
Implements ScalarEstimatorBase.
Definition at line 155 of file RMCLocalEnergyEstimator.h.
References RMCLocalEnergyInput::get_type(), and RMCLocalEnergyEstimator::input_.
|
inlineoverridevirtual |
RMCLocalEnergyEstimator is the main estimator type for RMC driver.
Reimplemented from ScalarEstimatorBase.
Definition at line 157 of file RMCLocalEnergyEstimator.h.
|
inlineoverridevirtual |
add descriptors of observables to utilize hdf5
h5desc | descriptor of a data stored in a h5 group |
file | file to which each statistical data will be stored |
Implements ScalarEstimatorBase.
Definition at line 153 of file RMCLocalEnergyEstimator.h.
|
private |
Definition at line 29 of file RMCLocalEnergyEstimator.cpp.
References RMCLocalEnergyEstimator::FirstHamiltonian, qmcplusplus::ham, RMCLocalEnergyEstimator::RMCSpecificTerms, ScalarEstimatorBase::scalars, ScalarEstimatorBase::scalars_saved, RMCLocalEnergyEstimator::SizeOfHamiltonians, QMCHamiltonian::sizeOfObservables(), and QMCHamiltonian::startIndex().
Referenced by RMCLocalEnergyEstimator::RMCLocalEnergyEstimator().
|
private |
Definition at line 31 of file RMCLocalEnergyEstimator.h.
Referenced by RMCLocalEnergyEstimator::accumulate(), and RMCLocalEnergyEstimator::resizeBasedOnHamiltonian().
|
private |
Definition at line 38 of file RMCLocalEnergyEstimator.h.
Referenced by RMCLocalEnergyEstimator::getSubTypeStr().
|
private |
Definition at line 34 of file RMCLocalEnergyEstimator.h.
|
private |
Definition at line 33 of file RMCLocalEnergyEstimator.h.
Referenced by RMCLocalEnergyEstimator::add2Record().
|
private |
Definition at line 35 of file RMCLocalEnergyEstimator.h.
Referenced by RMCLocalEnergyEstimator::accumulate(), and RMCLocalEnergyEstimator::resizeBasedOnHamiltonian().
|
private |
Definition at line 32 of file RMCLocalEnergyEstimator.h.
Referenced by RMCLocalEnergyEstimator::accumulate(), RMCLocalEnergyEstimator::add2Record(), and RMCLocalEnergyEstimator::resizeBasedOnHamiltonian().