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: Jaron T. Krogel, krogeljt@ornl.gov, Oak Ridge National Laboratory 8 // Ye Luo, yeluo@anl.gov, Argonne National Laboratory 9 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory 10 // 11 // File created by: Jaron T. Krogel, krogeljt@ornl.gov, Oak Ridge National Laboratory 12 ////////////////////////////////////////////////////////////////////////////////////// 13 14 15 #ifndef QMCPLUSPLUS_SPIN_DENSITY_H 16 #define QMCPLUSPLUS_SPIN_DENSITY_H 17 18 #include "QMCHamiltonians/OperatorBase.h" 19 20 namespace qmcplusplus 21 { 22 class SpinDensity : public OperatorBase 23 { 24 public: 25 typedef ParticleSet::ParticleLayout_t Lattice_t; 26 typedef std::vector<RealType> dens_t; 27 typedef std::vector<PosType> pts_t; 28 29 ParticleSet* Ptmp; 30 31 //data members 32 int nspecies; 33 std::vector<int> species_size; 34 std::vector<std::string> species_name; 35 Lattice_t cell; 36 PosType corner; 37 TinyVector<int, DIM> grid; 38 TinyVector<int, DIM> gdims; 39 int npoints; 40 41 //constructor/destructor 42 SpinDensity(ParticleSet& P); ~SpinDensity()43 ~SpinDensity() {} 44 45 //standard interface 46 OperatorBase* makeClone(ParticleSet& P, TrialWaveFunction& psi); 47 bool put(xmlNodePtr cur); 48 Return_t evaluate(ParticleSet& P); 49 50 //required for Collectables interface 51 void addObservables(PropertySetType& plist, BufferType& olist); 52 void registerCollectables(std::vector<observable_helper*>& h5desc, hid_t gid) const; 53 54 //should be empty for Collectables interface resetTargetParticleSet(ParticleSet & P)55 void resetTargetParticleSet(ParticleSet& P) {} setObservables(PropertySetType & plist)56 void setObservables(PropertySetType& plist) {} setParticlePropertyList(PropertySetType & plist,int offset)57 void setParticlePropertyList(PropertySetType& plist, int offset) {} 58 #if !defined(REMOVE_TRACEMANAGER) checkout_scalar_arrays(TraceManager & tm)59 void checkout_scalar_arrays(TraceManager& tm) {} collect_scalar_samples()60 void collect_scalar_samples() {} delete_scalar_arrays()61 void delete_scalar_arrays() {} 62 #endif 63 64 //obsolete? get(std::ostream & os)65 bool get(std::ostream& os) const { return false; } 66 67 //local functions 68 void reset(); 69 void report(const std::string& pad); 70 void test(int moves, ParticleSet& P); 71 Return_t test_evaluate(ParticleSet& P, int& pmin, int& pmax); 72 void addEnergy(MCWalkerConfiguration& W, std::vector<RealType>& LocalEnergy); 73 }; 74 75 } // namespace qmcplusplus 76 77 #endif 78