CHROMA
inline_disco_eo_eigcg_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Inline measurement of stochastic 3pt functions.
4  *
5  * This uses eo-preconditioning on the noise std::vector side as well as
6  * with the eig-cg vectors. NOTE THIS CODE DOES NOT WORK.
7  */
8 
9 #ifndef __inline_disco_eo_eigcg_h__
10 #define __inline_disco_eo_eigcg_h__
11 
12 #include "chromabase.h"
14 #include "io/qprop_io.h"
15 #include "meas/hadron/barQll_w.h"
16 
17 namespace Chroma
18 {
19  /*! \ingroup inlinehadron */
20  namespace InlineDiscoEoEigCGEnv
21  {
22  extern const std::string name;
23  bool registerAll();
24 
25  // The flavors
26  //! Parameter structure
27  /*! \ingroup inlinehadron */
28  struct Params
29  {
30  Params();
31  Params(XMLReader& xml_in, const std::string& path);
32 
33  unsigned long frequency;
34 
35  struct Param_t
36  {
37  int max_path_length ; /*! maximum displacement path */
38  int p2_max ; /*! maximum p2 */
39  multi1d<GroupXML_t> chi ; /*! dilutions */
40  std::string mass_label ; /*! a std::string flag maybe used in analysis*/
41  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 */
42  } param;
43 
45  {
50 
51  std::string xml_file; // Alternate XML file pattern
52 
53  void write(XMLWriter& xml_out, const std::string& path);
54 
55  };
56 
57  //! Function object used for constructing the time-slice set but only with odd sites
58  //! Has an index ultimately such that
59  //! ind = 2*t + rb
60  //! where t is the timeslice we want and rb is 0 (even) or 1 (odd), telling us what
61  //! kind of site this will be.
62  class TimeSliceRBFunc : public SetFunc
63  {
64  public:
65  TimeSliceRBFunc(int dir): dir_decay(dir) {}
66 
67  int operator() (const multi1d<int>& coordinate) const
68  {
69  int sum = 0;
70  for(int m=0; m < coordinate.size(); ++m)
71  sum += coordinate[m];
72 
73  if ((dir_decay<0)||(dir_decay>=Nd)) {
74  return sum & 1 ; //In this case return the entire rb subset, with all timeslices
75  }
76  else {
77  return ( 2*(coordinate[dir_decay]) + (sum & 1) ) ;
78  }
79  }
80 
81  int numSubsets() const
82  {
83  if ((dir_decay<0)||(dir_decay>=Nd)) {
84  return 2 ; //Here there's the even or the odd subset
85  } else {
86  // There are this many subsets, because for each time direction, we have
87  // either even or odd sites...
88  return 2*(Layout::lattSize()[dir_decay]) ;
89  }
90  }
91 
92  private:
93  TimeSliceRBFunc() {} // hide default constructor
94 
95  int dir_decay;
96  };
97 
98 
99  //! Inline measurement of stochastic baryon operators
100  /*! \ingroup inlinehadron */
102  protected:
103  //! Do the measurement
104  void func(const unsigned long update_no,
105  XMLWriter& xml_out);
106 
107  private:
109 
110  public:
112  InlineMeas(const Params& p) : params(p) {}
114 
115  unsigned long getFrequency(void) const {return params.frequency;}
116 
117  //! Do the measurement
118  void operator()(const unsigned long update_no,
119  XMLWriter& xml_out);
120 
121  };
122 
123 
124 
125  } // name space InlineDiscoEoEigCGEnv
126 }
127 
128 #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 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.
struct Chroma::InlineDiscoEoEigCGEnv::Params::NamedObject_t named_obj
void write(XMLWriter &xml_out, const std::string &path)
struct Chroma::InlineDiscoEoEigCGEnv::Params::Param_t param