![]() |
QMCPACK
|
Class to accumulate the local energy and components. More...
Public Member Functions | |
LocalEnergyEstimator (const QMCHamiltonian &h, bool use_hdf5) | |
constructor More... | |
LocalEnergyEstimator (LocalEnergyInput &&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 MCWalkerConfiguration &W, WalkerIterator first, WalkerIterator last, RealType wgt) override |
legacy accumulation function 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... | |
LocalEnergyEstimator * | clone () override |
clone the object More... | |
void | accumulate (const RefVector< MCPWalker > &walkers) override |
Accumulate the hamiltonian operator values for system This is the batched version. More... | |
bool | isMainEstimator () const override |
LocalEnergyEstimator is the main estimator for VMC and DMC. More... | |
const std::string & | getSubTypeStr () const override |
String representation of the derived type of the ScalarEstimator. 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 | |
enum | { ENERGY_INDEX, ENERGY2_INDEX, POTENTIAL_INDEX, LE_MAX } |
using | WP = WalkerProperties::Indexes |
Private Attributes | |
int | FirstHamiltonian |
int | SizeOfHamiltonians |
bool | UseHDF5 |
const QMCHamiltonian & | refH |
const LocalEnergyInput | 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 30 of file LocalEnergyEstimator.h.
|
private |
Definition at line 32 of file LocalEnergyEstimator.h.
|
private |
Enumerator | |
---|---|
ENERGY_INDEX | |
ENERGY2_INDEX | |
POTENTIAL_INDEX | |
LE_MAX |
Definition at line 33 of file LocalEnergyEstimator.h.
LocalEnergyEstimator | ( | const QMCHamiltonian & | h, |
bool | use_hdf5 | ||
) |
constructor
[in] | h | QMCHamiltonian to define the components |
[in] | use_hdf5 | record local energy values in hdf5? |
Definition at line 20 of file LocalEnergyEstimator.cpp.
References LocalEnergyEstimator::FirstHamiltonian, LocalEnergyEstimator::LE_MAX, ScalarEstimatorBase::scalars, ScalarEstimatorBase::scalars_saved, LocalEnergyEstimator::SizeOfHamiltonians, QMCHamiltonian::sizeOfObservables(), and QMCHamiltonian::startIndex().
Referenced by LocalEnergyEstimator::clone().
LocalEnergyEstimator | ( | LocalEnergyInput && | input, |
const QMCHamiltonian & | ham | ||
) |
Construct from LocalEnergyInput and const reference to hamiltonian.
[in] | input | contains input parameters for LocalEnergyEstimator |
[in] | ham | is taken as a local reference and used to size scalars data |
Definition at line 28 of file LocalEnergyEstimator.cpp.
References LocalEnergyEstimator::FirstHamiltonian, LocalEnergyEstimator::LE_MAX, ScalarEstimatorBase::scalars, ScalarEstimatorBase::scalars_saved, LocalEnergyEstimator::SizeOfHamiltonians, QMCHamiltonian::sizeOfObservables(), and QMCHamiltonian::startIndex().
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 64 of file LocalEnergyEstimator.h.
References LocalEnergyEstimator::FirstHamiltonian, Walker< t_traits, p_traits >::getPropertyBase(), ScalarEstimatorBase::scalars, and Walker< t_traits, p_traits >::Weight.
Referenced by LocalEnergyEstimator::accumulate(), and qmcplusplus::TEST_CASE().
|
inlineoverridevirtual |
legacy accumulation function
Implements ScalarEstimatorBase.
Definition at line 77 of file LocalEnergyEstimator.h.
References LocalEnergyEstimator::accumulate().
Accumulate the hamiltonian operator values for system This is the batched version.
Implements ScalarEstimatorBase.
Definition at line 95 of file LocalEnergyEstimator.h.
References LocalEnergyEstimator::accumulate(), qmcplusplus::walker, and qmcplusplus::hdf::walkers.
|
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 63 of file LocalEnergyEstimator.cpp.
References RecordNamedProperty< T >::add(), ScalarEstimatorBase::clear(), ScalarEstimatorBase::FirstIndex, QMCHamiltonian::getObservableName(), ScalarEstimatorBase::LastIndex, LocalEnergyEstimator::refH, RecordNamedProperty< T >::size(), and LocalEnergyEstimator::SizeOfHamiltonians.
Referenced by qmcplusplus::TEST_CASE().
|
overridevirtual |
clone the object
Implements ScalarEstimatorBase.
Definition at line 37 of file LocalEnergyEstimator.cpp.
References LocalEnergyEstimator::LocalEnergyEstimator().
Referenced by qmcplusplus::TEST_CASE().
|
inlineoverridevirtual |
Implements ScalarEstimatorBase.
Definition at line 86 of file LocalEnergyEstimator.h.
Referenced by qmcplusplus::TEST_CASE().
|
inlineoverridevirtual |
String representation of the derived type of the ScalarEstimator.
Implements ScalarEstimatorBase.
Definition at line 103 of file LocalEnergyEstimator.h.
References LocalEnergyInput::get_type(), and LocalEnergyEstimator::input_.
|
inlineoverridevirtual |
LocalEnergyEstimator is the main estimator for VMC and DMC.
Reimplemented from ScalarEstimatorBase.
Definition at line 102 of file LocalEnergyEstimator.h.
|
overridevirtual |
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 39 of file LocalEnergyEstimator.cpp.
References ScalarEstimatorBase::FirstIndex, qmcplusplus::lower_bound(), LocalEnergyEstimator::refH, QMCHamiltonian::registerObservables(), qmcplusplus::Units::time::s, and LocalEnergyEstimator::UseHDF5.
Referenced by qmcplusplus::TEST_CASE().
|
private |
Definition at line 41 of file LocalEnergyEstimator.h.
Referenced by LocalEnergyEstimator::accumulate(), and LocalEnergyEstimator::LocalEnergyEstimator().
|
private |
Definition at line 45 of file LocalEnergyEstimator.h.
Referenced by LocalEnergyEstimator::getSubTypeStr().
|
private |
Definition at line 44 of file LocalEnergyEstimator.h.
Referenced by LocalEnergyEstimator::add2Record(), and LocalEnergyEstimator::registerObservables().
|
private |
Definition at line 42 of file LocalEnergyEstimator.h.
Referenced by LocalEnergyEstimator::add2Record(), and LocalEnergyEstimator::LocalEnergyEstimator().
|
private |
Definition at line 43 of file LocalEnergyEstimator.h.
Referenced by LocalEnergyEstimator::registerObservables().