QMCPACK
SpeciesKineticEnergy.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: Yubo Yang, paul.young.0414@gmail.com, University of Illinois at Urbana-Champaign
8 //
9 // File created by: Yubo Yang, paul.young.0414@gmail.com, University of Illinois at Urbana-Champaign
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 #ifndef QMCPLUSPLUS_SPECIESKINETICENERGY_H
13 #define QMCPLUSPLUS_SPECIESKINETICENERGY_H
14 
16 
17 namespace qmcplusplus
18 {
19 /** SpeciesKineticEnergy evaluate the kinetic energy of each species in the target
20  * particle set separately instead of sum over every particle in the set such as BareKinetic
21  * <![CDATA][<estimator type="specieskinetic" name="skinetic"/>]]>
22  * By default skinetic_u, skinetic_d, etc. columns will be added to scalar.dat.
23  * If hdf5="yes", then data will be added to stat.h5 as well.
24  * The sum of every column that starts with skinetic should be equivalent to the Kinetic column.
25  */
27 {
28 public:
30 
31  std::string getClassName() const override { return "SpeciesKineticEnergy"; }
32  bool put(xmlNodePtr cur) override; // read input xml node, required
33  bool get(std::ostream& os) const override; // class description, required
34 
35  Return_t evaluate(ParticleSet& P) override;
36 
37  // pure virtual functions require overrider
38  void resetTargetParticleSet(ParticleSet& P) override {} // required
39  std::unique_ptr<OperatorBase> makeClone(ParticleSet& qp, TrialWaveFunction& psi) final; // required
40 
41  // allocate multiple columns in scalar.dat
42  void addObservables(PropertySetType& plist, BufferType& collectables) override;
43  // fill multiple columns in scalar.dat
44  void setObservables(PropertySetType& plist) override;
45 
46  // allow h5 output
47  void registerCollectables(std::vector<ObservableHelper>& h5desc, hdf_archive& file) const override;
48 
49 private:
50  ParticleSet& tpset; // reference to target particle set
52  std::vector<std::string> species_names;
53  std::vector<RealType> species_kinetic, vec_minus_over_2m;
54  bool hdf5_out;
55  int h5_index; // index of this estimator in the collectables carried by target pset
56  // myIndex: the index of this estimator in the property list in target pset
57 
58 }; // SpeciesKineticEnergy
59 
60 } // namespace qmcplusplus
61 #endif
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
std::vector< std::string > species_names
Declaration of OperatorBase.
SpeciesKineticEnergy evaluate the kinetic energy of each species in the target particle set separatel...
class to handle hdf file
Definition: hdf_archive.h:51
void resetTargetParticleSet(ParticleSet &P) override
Reset the data with the target ParticleSet.
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
ParticleSet::Buffer_t BufferType
typedef for the serialized buffer
Definition: OperatorBase.h:75
void setObservables(PropertySetType &plist) override
Set the values evaluated by this object to plist Default implementation is to assign Value which is u...
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.
void registerCollectables(std::vector< ObservableHelper > &h5desc, hdf_archive &file) const override
An abstract class for Local Energy operators.
Definition: OperatorBase.h:59
void addObservables(PropertySetType &plist, BufferType &collectables) override
named values to the property list Default implementaton uses addValue(plist_)
std::unique_ptr< OperatorBase > makeClone(ParticleSet &qp, TrialWaveFunction &psi) final
Class to represent a many-body trial wave function.
std::string getClassName() const override
return class name
std::vector< RealType > vec_minus_over_2m
BareKineticEnergy::Return_t Return_t
std::vector< RealType > species_kinetic
bool put(xmlNodePtr cur) override
Read the input parameter.
RecordNamedProperty< FullPrecRealType > PropertySetType
define PropertyList_t
Definition: Configuration.h:69