1 //////////////////////////////////////////////////////////////////
2 // (c) Copyright 2008-  by Jeongnim Kim
3 //////////////////////////////////////////////////////////////////
4 //////////////////////////////////////////////////////////////////
5 //   National Center for Supercomputing Applications &
6 //   Materials Computation Center
7 //   University of Illinois, Urbana-Champaign
8 //   Urbana, IL 61801
9 //   e-mail: jnkim@ncsa.uiuc.edu
10 //
11 // Supported by
12 //   National Center for Supercomputing Applications, UIUC
13 //   Materials Computation Center, UIUC
14 //////////////////////////////////////////////////////////////////
15 // -*- C++ -*-
16 /** @file SkAllEstimator.h
17  * @brief Declare SkAllEstimator
18  */
19 #ifndef QMCPLUSPLUS_SK_ALL_ESTIMATOR_H
20 #define QMCPLUSPLUS_SK_ALL_ESTIMATOR_H
21 #include "QMCHamiltonians/OperatorBase.h"
22 #include <vector>
23 namespace qmcplusplus
24 {
25 /** SkAllEstimator evaluate the structure factor of the target particleset
26  *
27  * <estimator name="sk" type="sk" debug="no"/>
28  */
29 class SkAllEstimator : public OperatorBase
30 {
31 public:
32   SkAllEstimator(ParticleSet& ions, ParticleSet& elns);
33 
34   void resetTargetParticleSet(ParticleSet& P);
35 
36   Return_t evaluate(ParticleSet& P);
37 
38   void evaluateIonIon();
39 
40   void addObservables(PropertySetType& plist);
41   void addObservables(PropertySetType& plist, BufferType& collectables);
42   void registerCollectables(std::vector<observable_helper*>& h5desc, hid_t gid) const;
43   void setObservables(PropertySetType& plist);
44   void setParticlePropertyList(PropertySetType& plist, int offset);
45   bool put(xmlNodePtr cur);
46   bool get(std::ostream& os) const;
47   OperatorBase* makeClone(ParticleSet& qp, TrialWaveFunction& psi);
48 
49 protected:
50   //  ParticleSet *sourcePtcl;
51   ParticleSet* elns;
52   ParticleSet* ions;
53   /** number of species */
54   int NumSpecies;
55   int NumeSpecies;
56   int NumIonSpecies;
57   /** number of kpoints */
58   unsigned int NumK;
59   /** number of kshells */
60   int MaxKshell;
61   /** normalization factor */
62   RealType OneOverN;
63   /** kshell counters */
64   std::vector<int> Kshell;
65   /** instantaneous structure factor  */
66   std::vector<RealType> Kmag;
67   /** 1.0/degenracy for a kshell */
68   std::vector<RealType> OneOverDnk;
69   /** \f$rho_k = \sum_{\alpha} \rho_k^{\alpha} \f$ for species index \f$\alpha\f$ */
70 #if defined(USE_REAL_STRUCT_FACTOR)
71   Vector<RealType> RhokTot_r, RhokTot_i;
72 #else
73   Vector<ComplexType> RhokTot;
74 #endif
75   Vector<RealType> values;
76   /** resize the internal data
77    *
78    * The argument list is not completed
79    */
80   void resize();
81 
82   bool hdf5_out;
83 };
84 
85 } // namespace qmcplusplus
86 #endif
87