QMCPACK
CollectablesEstimator.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
8 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
9 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
10 //
11 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
12 //////////////////////////////////////////////////////////////////////////////////////
13 
14 
15 #ifndef QMCPLUSPLUS_COLLECTABLES_ESTIMATOR_H
16 #define QMCPLUSPLUS_COLLECTABLES_ESTIMATOR_H
19 
20 namespace qmcplusplus
21 {
22 /** Handle an ensemble average of Hamiltonian components
23 */
25 {
26  ///save the reference hamiltonian
28 
29 public:
30  /** constructor
31  * @param h QMCHamiltonian to define the components
32  */
34  //LocalEnergyEstimatorHDF(const LocalEnergyEstimatorHDF& est);
35 
36  /** implement virtual function
37  */
38  CollectablesEstimator* clone() override;
39 
40  void registerObservables(std::vector<ObservableHelper>& h5dec, hdf_archive& file) override;
41  void add2Record(RecordListType& record) override;
42  /** do nothing with accumulate */
43  void accumulate(const MCWalkerConfiguration& W, WalkerIterator first, WalkerIterator last, RealType wgt) override {}
44 
45  inline void accumulate(const RefVector<MCPWalker>& walkers) override {}
46 
47  /** accumulate the collectables */
49  {
50  for (int i = 0; i < data.size(); ++i)
51  scalars[i](data[i], wgt);
52  }
53 
54  std::string getName() const override { return "CollectiblesEstimator"; }
55 
56  const std::string type_str = "ColletiblesEstimatorNotSupportedInBatchedVersion";
57  const std::string& getSubTypeStr() const override { return type_str; }
58 };
59 } // namespace qmcplusplus
60 #endif
size_type size() const
return the size of the data
Definition: PooledData.h:48
A set of walkers that are to be advanced by Metropolis Monte Carlo.
const std::string & getSubTypeStr() const override
String representation of the derived type of the ScalarEstimator.
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
std::string getName() const override
Collection of Local Energy Operators.
class to handle hdf file
Definition: hdf_archive.h:51
const char walkers[]
Definition: HDFVersion.h:36
CollectablesEstimator * clone() override
implement virtual function
QMCTraits::FullPrecRealType RealType
std::vector< accumulator_type > scalars
scalars to be measured
void add2Record(RecordListType &record) override
add the local energy, variance and all the Hamiltonian components to the scalar record container ...
void accumulate(const MCWalkerConfiguration &W, WalkerIterator first, WalkerIterator last, RealType wgt) override
do nothing with accumulate
Handle an ensemble average of Hamiltonian components.
void accumulate(const RefVector< MCPWalker > &walkers) override
a virtual function to accumulate observables or collectables
std::vector< std::reference_wrapper< T > > RefVector
MCWalkerConfiguration::const_iterator WalkerIterator
void registerObservables(std::vector< ObservableHelper > &h5dec, hdf_archive &file) override
add descriptors of observables to utilize hdf5
Abstract class for an estimator of a scalar operator.
const QMCHamiltonian & refH
save the reference hamiltonian
void accumulate_all(const MCWalkerConfiguration::Buffer_t &data, RealType wgt)
accumulate the collectables
Declaration of QMCHamiltonian.
CollectablesEstimator(QMCHamiltonian &h)
constructor