QMCPACK
RMCLocalEnergyEstimator.cpp
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: Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
8 // Raymond Clay III, j.k.rofling@gmail.com, Lawrence Livermore National Laboratory
9 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
10 //
11 // File created by: Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
12 //////////////////////////////////////////////////////////////////////////////////////
13 
14 
16 
17 namespace qmcplusplus
18 {
20 {
22 }
23 
25 {
27 }
28 
30 {
35 }
36 
38 
39 /** add the local energy, variance and all the Hamiltonian components to the scalar record container
40  * @param record storage of scalar records (name,value)
41  */
43 {
44  FirstIndex = record.size();
45  record.add("LocalEnergy");
46  record.add("LocalEnergy_sq");
47  record.add("LocalEnergy_p");
48  record.add("LocalEnergy_sq_p");
49  record.add("LocalEnergy_sq_cross");
50  record.add("LocalPotential");
51  record.add("LocalPotential_pure");
52 
53  record.add("OldestBead");
54  //for(int j=0; j <= NObs; j++)
55  for (int i = 0; i < SizeOfHamiltonians; i++)
56  {
57  std::ostringstream ss;
58  ss << refH.getObservableName(i) << "_m";
59  record.add(ss.str());
60  }
61  for (int i = 0; i < SizeOfHamiltonians; i++)
62  {
63  std::ostringstream ss;
64  ss << refH.getObservableName(i) << "_p";
65  // app_log()<<"Registering observable "<<ss.str()<< std::endl;
66  record.add(ss.str());
67  }
68  LastIndex = record.size();
69  clear();
70 }
71 
72 } // namespace qmcplusplus
std::string getObservableName(int i) const
return the name of the i-th observable
int startIndex() const
retrun the starting index
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
Class to accumulate the local energy and components.
Collection of Local Energy Operators.
int FirstIndex
first index within an record of the first element handled by an object
std::vector< accumulator_type > scalars
scalars to be measured
int add(const std::string &aname)
void resizeBasedOnHamiltonian(const QMCHamiltonian &ham)
RMCLocalEnergyEstimator(QMCHamiltonian &ham, int nobs=2)
constructor
int sizeOfObservables() const
return the size of observables
RMCLocalEnergyEstimator * clone() override
clone the object
std::vector< accumulator_type > scalars_saved
scalars saved
void clear()
clear the scalars to collect
void add2Record(RecordListType &record) override
add the local energy, variance and all the Hamiltonian components to the scalar record container ...
int LastIndex
last index within an record of the first element handled by an object