CHROMA
inline_disco_eoprec_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_eoprec_h__
9 #define __inline_disco_eoprec_h__
10 
11 #include "chromabase.h"
13 #include "io/qprop_io.h"
14 //#include <map>
15 
16 namespace Chroma
17 {
18  /*! \ingroup inlinehadron */
19  namespace InlineDiscoEOPrecEnv
20  {
21  extern const std::string name;
22  bool registerAll();
23 
24  // The flavors
25  //! Parameter structure
26  /*! \ingroup inlinehadron */
27  struct Params
28  {
29  Params();
30  Params(XMLReader& xml_in, const std::string& path);
31 
32  unsigned long frequency;
33 
34  struct Param_t
35  {
36  int max_path_length ; /*! maximum displacement path */
37  int p2_max ; /*! maximum p2 */
38  multi1d<GroupXML_t> chi ; /*! dilutions */
39  std::string mass_label ; /*! a std::string flag maybe used in analysis*/
40  GroupXML_t action ; /*! need to specify the action whose operator D we are computing the trace. \
41 The vectors may require manipulation if they come from an EO action and or if they are vectors that appr\
42 oximate the D^\dagger D invese (as those that EigCG produces are */
43 
44  } param;
45 
47  {
51 
52  std::string xml_file; // Alternate XML file pattern
53 
54  void write(XMLWriter& xml_out, const std::string& path);
55 
56  };
57 
58 
59  //! Inline measurement of stochastic baryon operators
60  /*! \ingroup inlinehadron */
62  protected:
63  //! Do the measurement
64  void func(const unsigned long update_no,
65  XMLWriter& xml_out);
66 
67  private:
68 
69 
71 
72  public:
74  InlineMeas(const Params& p) : params(p) {}
76 
77  unsigned long getFrequency(void) const {return params.frequency;}
78 
79  //! Do the measurement
80  void operator()(const unsigned long update_no,
81  XMLWriter& xml_out);
82 
83  };
84 
85  //! Function object used for constructing the time-slice set but only with odd sites
86  //! Has an index ultimately such that
87  //! ind = 2*t + rb
88  //! where t is the timeslice we want and rb is 0 (even) or 1 (odd), telling us what
89  //! kind of site this will be.
90  class TimeSliceRBFunc : public SetFunc
91  {
92  public:
93  TimeSliceRBFunc(int dir): dir_decay(dir) {}
94 
95  int operator() (const multi1d<int>& coordinate) const
96  {
97  int sum = 0;
98  for(int m=0; m < coordinate.size(); ++m)
99  sum += coordinate[m];
100 
101  if ((dir_decay<0)||(dir_decay>=Nd)) {
102  return sum & 1 ; //In this case return the entire rb subset, with all timeslices
103  }
104  else {
105  return ( 2*(coordinate[dir_decay]) + (sum & 1) ) ;
106  }
107  }
108 
109  int numSubsets() const
110  {
111  if ((dir_decay<0)||(dir_decay>=Nd)) {
112  return 2 ; //Here there's the even or the odd subset
113  } else {
114  // There are this many subsets, because for each time direction, we have
115  // either even or odd sites...
116  return 2*(Layout::lattSize()[dir_decay]) ;
117  }
118  }
119 
120  private:
121  TimeSliceRBFunc() {} // hide default constructor
122 
124  };
125 
126 
127 
128  } // name space InlineDiscoEOPrecEnv
129 
130 }
131 
132 #endif
Abstract inline measurements.
Primary include file for CHROMA library code.
Inline measurement of stochastic baryon operators.
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.
void operator()(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
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.
void write(XMLWriter &xml_out, const std::string &path)
struct Chroma::InlineDiscoEOPrecEnv::Params::Param_t param
struct Chroma::InlineDiscoEOPrecEnv::Params::NamedObject_t named_obj