CHROMA
inline_disco_eigcg_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Inline measurement of stochastic 3pt functions.
4  *
5  * spectroscopy
6  */
7 
8 #ifndef __inline_disco_eigcg_h__
9 #define __inline_disco_eigcg_h__
10 
11 //#include <qdp_subset.h>
12 
13 #include "chromabase.h"
15 #include "io/qprop_io.h"
16 #include "meas/hadron/barQll_w.h"
17 
18 //#include <map>
19 
20 namespace Chroma
21 {
22  /*! \ingroup inlinehadron */
23  namespace InlineDiscoEigCGEnv
24  {
25  extern const std::string name;
26  bool registerAll();
27 
28  // The flavors
29  //! Parameter structure
30  /*! \ingroup inlinehadron */
31  struct Params
32  {
33  Params();
34  Params(XMLReader& xml_in, const std::string& path);
35 
36  unsigned long frequency;
37 
38  struct Param_t
39  {
40  int max_path_length ; /*! maximum displacement path */
41  int p2_max ; /*! maximum p2 */
42  multi1d<GroupXML_t> chi ; /*! dilutions */
43  std::string mass_label ; /*! a std::string flag maybe used in analysis*/
44  GroupXML_t action ; /*! need to specify the action whose operator D we are computing the trace. The vectors may require manipulation if they come from an EO action and or if they are vectors that approximate the D^\dagger D invese (as those that EigCG produces are */
45  } param;
46 
48  {
53 
54  std::string xml_file; // Alternate XML file pattern
55 
56  void write(XMLWriter& xml_out, const std::string& path);
57 
58  };
59 
60  //! Function object used for constructing the time-slice set but only with odd sites
61  //! Has an index ultimately such that
62  //! ind = 2*t + rb
63  //! where t is the timeslice we want and rb is 0 (even) or 1 (odd), telling us what
64  //! kind of site this will be.
65  class TimeSliceRBFunc : public SetFunc
66  {
67  public:
68  TimeSliceRBFunc(int dir): dir_decay(dir) {}
69 
70  int operator() (const multi1d<int>& coordinate) const
71  {
72  int sum = 0;
73  for(int m=0; m < coordinate.size(); ++m)
74  sum += coordinate[m];
75 
76  if ((dir_decay<0)||(dir_decay>=Nd)) {
77  return sum & 1 ; //In this case return the entire rb subset, with all timeslices
78  }
79  else {
80  return ( 2*(coordinate[dir_decay]) + (sum & 1) ) ;
81  }
82  }
83 
84  int numSubsets() const
85  {
86  if ((dir_decay<0)||(dir_decay>=Nd)) {
87  return 2 ; //Here there's the even or the odd subset
88  } else {
89  // There are this many subsets, because for each time direction, we have
90  // either even or odd sites...
91  return 2*(Layout::lattSize()[dir_decay]) ;
92  }
93  }
94 
95  private:
96  TimeSliceRBFunc() {} // hide default constructor
97 
98  int dir_decay;
99  };
100 
101 
102  //! Inline measurement of stochastic baryon operators
103  /*! \ingroup inlinehadron */
105  protected:
106  //! Do the measurement
107  void func(const unsigned long update_no,
108  XMLWriter& xml_out);
109 
110  private:
112 
113  public:
115  InlineMeas(const Params& p) : params(p) {}
117 
118  unsigned long getFrequency(void) const {return params.frequency;}
119 
120  //! Do the measurement
121  void operator()(const unsigned long update_no,
122  XMLWriter& xml_out);
123 
124  };
125 
126 
127 
128  } // name space InlineDiscoEigCGEnv
129 }
130 
131 #endif
Abstract inline measurements.
Heavy Baryon (Qll) 2-pt function : Orginos and Savage.
Primary include file for CHROMA library code.
Inline measurement of stochastic baryon operators.
void operator()(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
void func(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
unsigned long getFrequency(void) const
Tell me how often I should measure this beastie.
int operator()(const multi1d< int > &coordinate) const
static int m[4]
Definition: make_seeds.cc:16
Nd
Definition: meslate.cc:74
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
::std::string string
Definition: gtest.h:1979
Routines associated with Chroma propagator IO.
Double sum
Definition: qtopcor.cc:37
Hold group xml and type id.
struct Chroma::InlineDiscoEigCGEnv::Params::NamedObject_t named_obj
struct Chroma::InlineDiscoEigCGEnv::Params::Param_t param
void write(XMLWriter &xml_out, const std::string &path)