![]() |
QMCPACK
|
Abstract class for an estimator of a scalar operator. More...
Public Types | |
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 > |
Public Member Functions | |
ScalarEstimatorBase () | |
virtual | ~ScalarEstimatorBase () |
virtual bool | isMainEstimator () const |
Is this estimator a main estimator i.e. the estimator required for a particular driver. More... | |
virtual std::string | getName () const =0 |
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 | accumulate (const MCWalkerConfiguration &W, WalkerIterator first, WalkerIterator last, RealType wgt)=0 |
a virtual function to accumulate observables or collectables More... | |
virtual void | accumulate (const RefVector< MCPWalker > &)=0 |
a virtual function to accumulate observables or collectables More... | |
virtual void | add2Record (RecordNamedProperty< RealType > &record)=0 |
add the content of the scalar estimator to the record More... | |
virtual void | registerObservables (std::vector< ObservableHelper > &h5dec, hdf_archive &file)=0 |
add descriptors of observables to utilize hdf5 More... | |
virtual ScalarEstimatorBase * | clone ()=0 |
clone the object More... | |
virtual const std::string & | getSubTypeStr () const =0 |
String representation of the derived type of the ScalarEstimator. More... | |
Public Attributes | |
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... | |
Abstract class for an estimator of a scalar operator.
ScalarEstimators derived from ScalarEstimatorBase implement three main functions
Definition at line 40 of file ScalarEstimatorBase.h.
using accumulator_type = accumulator_set<RealType> |
Definition at line 43 of file ScalarEstimatorBase.h.
using MCPWalker = Walker<QMCTraits, PtclOnLatticeTraits> |
Definition at line 45 of file ScalarEstimatorBase.h.
using RealType = QMCTraits::FullPrecRealType |
Definition at line 42 of file ScalarEstimatorBase.h.
using RecordListType = RecordNamedProperty<RealType> |
Definition at line 47 of file ScalarEstimatorBase.h.
Definition at line 44 of file ScalarEstimatorBase.h.
Definition at line 46 of file ScalarEstimatorBase.h.
|
inline |
Definition at line 59 of file ScalarEstimatorBase.h.
|
inlinevirtual |
Definition at line 61 of file ScalarEstimatorBase.h.
|
pure virtual |
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.
Implemented in LocalEnergyEstimator, RMCLocalEnergyEstimator, CollectablesEstimator, LocalEnergyOnlyEstimator, and FakeEstimator.
a virtual function to accumulate observables or collectables
global_walkers_ | walkers per ranks or walkers total? |
RefVector | of MCPWalkers |
wgt | weight or maybe norm |
Implemented in LocalEnergyEstimator, CSEnergyEstimator, RMCLocalEnergyEstimator, LocalEnergyOnlyEstimator, CollectablesEstimator, and FakeEstimator.
|
pure virtual |
add the content of the scalar estimator to the record
record | scalar data list |
Each ScalarEstimatorBase object adds 1 to many accumulator_type
Implemented in FakeEstimator.
|
inline |
add the block accumulated scalars
first | starting iterator of values |
Definition at line 125 of file ScalarEstimatorBase.h.
References ScalarEstimatorBase::FirstIndex, and ScalarEstimatorBase::scalars.
|
inline |
return average of the
Definition at line 68 of file ScalarEstimatorBase.h.
References ScalarEstimatorBase::scalars_saved.
|
inline |
clear the scalars to collect
Definition at line 78 of file ScalarEstimatorBase.h.
References ScalarEstimatorBase::scalars.
Referenced by CollectablesEstimator::add2Record(), LocalEnergyOnlyEstimator::add2Record(), LocalEnergyEstimator::add2Record(), CSEnergyEstimator::add2Record(), and RMCLocalEnergyEstimator::add2Record().
|
pure virtual |
clone the object
Implemented in RMCLocalEnergyEstimator, CSEnergyEstimator, LocalEnergyEstimator, LocalEnergyOnlyEstimator, CollectablesEstimator, and FakeEstimator.
|
pure virtual |
Implemented in RMCLocalEnergyEstimator, LocalEnergyEstimator, CSEnergyEstimator, CollectablesEstimator, LocalEnergyOnlyEstimator, and FakeEstimator.
|
pure virtual |
String representation of the derived type of the ScalarEstimator.
Implemented in RMCLocalEnergyEstimator, LocalEnergyEstimator, CSEnergyEstimator, LocalEnergyOnlyEstimator, CollectablesEstimator, and FakeEstimator.
|
inlinevirtual |
Is this estimator a main estimator i.e. the estimator required for a particular driver.
Reimplemented in RMCLocalEnergyEstimator, LocalEnergyEstimator, and CSEnergyEstimator.
Definition at line 64 of file ScalarEstimatorBase.h.
retrun mean and variance
Definition at line 72 of file ScalarEstimatorBase.h.
References ScalarEstimatorBase::scalars.
|
pure virtual |
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 |
Implemented in RMCLocalEnergyEstimator, CSEnergyEstimator, LocalEnergyEstimator, LocalEnergyOnlyEstimator, CollectablesEstimator, and FakeEstimator.
|
inlinevirtual |
return the size of scalars it manages
Definition at line 75 of file ScalarEstimatorBase.h.
References ScalarEstimatorBase::scalars.
|
inline |
take block average and write to a common container
Definition at line 86 of file ScalarEstimatorBase.h.
References ScalarEstimatorBase::FirstIndex, ScalarEstimatorBase::scalars, and ScalarEstimatorBase::scalars_saved.
|
inline |
take block average and write to common containers for values and squared values
first | starting iterator of values |
first_sq | starting iterator of squared values |
Definition at line 102 of file ScalarEstimatorBase.h.
References ScalarEstimatorBase::FirstIndex, ScalarEstimatorBase::scalars, and ScalarEstimatorBase::scalars_saved.
|
inline |
return a variance
Definition at line 70 of file ScalarEstimatorBase.h.
References ScalarEstimatorBase::scalars_saved.
int FirstIndex |
first index within an record of the first element handled by an object
Definition at line 50 of file ScalarEstimatorBase.h.
Referenced by CollectablesEstimator::add2Record(), LocalEnergyOnlyEstimator::add2Record(), LocalEnergyEstimator::add2Record(), CSEnergyEstimator::add2Record(), RMCLocalEnergyEstimator::add2Record(), ScalarEstimatorBase::addAccumulated(), CollectablesEstimator::registerObservables(), LocalEnergyEstimator::registerObservables(), and ScalarEstimatorBase::takeBlockAverage().
int LastIndex |
last index within an record of the first element handled by an object
Definition at line 52 of file ScalarEstimatorBase.h.
Referenced by CollectablesEstimator::add2Record(), LocalEnergyOnlyEstimator::add2Record(), LocalEnergyEstimator::add2Record(), CSEnergyEstimator::add2Record(), and RMCLocalEnergyEstimator::add2Record().
std::vector<accumulator_type> scalars |
scalars to be measured
Definition at line 54 of file ScalarEstimatorBase.h.
Referenced by LocalEnergyOnlyEstimator::accumulate(), RMCLocalEnergyEstimator::accumulate(), LocalEnergyEstimator::accumulate(), CSEnergyEstimator::accumulate(), CollectablesEstimator::accumulate_all(), CollectablesEstimator::add2Record(), ScalarEstimatorBase::addAccumulated(), ScalarEstimatorBase::clear(), CollectablesEstimator::CollectablesEstimator(), CSEnergyEstimator::CSEnergyEstimator(), EstimatorManagerNewTest::fakeMainScalarSamples(), EstimatorManagerNewTest::fakeScalarSamplesAndCollect(), EstimatorManagerBaseTest::fakeSomeScalarSamples(), LocalEnergyEstimator::LocalEnergyEstimator(), LocalEnergyOnlyEstimator::LocalEnergyOnlyEstimator(), ScalarEstimatorBase::operator[](), RMCLocalEnergyEstimator::resizeBasedOnHamiltonian(), ScalarEstimatorBase::size(), ScalarEstimatorBase::takeBlockAverage(), and qmcplusplus::TEST_CASE().
std::vector<accumulator_type> scalars_saved |
scalars saved
Definition at line 56 of file ScalarEstimatorBase.h.
Referenced by ScalarEstimatorBase::average(), CollectablesEstimator::CollectablesEstimator(), CSEnergyEstimator::CSEnergyEstimator(), EstimatorManagerNewTest::fakeMainScalarSamples(), EstimatorManagerNewTest::fakeScalarSamplesAndCollect(), EstimatorManagerBaseTest::fakeSomeScalarSamples(), CSEnergyEstimator::getUmbrellaWeight(), LocalEnergyEstimator::LocalEnergyEstimator(), LocalEnergyOnlyEstimator::LocalEnergyOnlyEstimator(), RMCLocalEnergyEstimator::resizeBasedOnHamiltonian(), ScalarEstimatorBase::takeBlockAverage(), and ScalarEstimatorBase::variance().