CHROMA
loops_w.cc
Go to the documentation of this file.
1 // $Id: loops_w.cc,v 3.1 2007-02-22 21:11:49 bjoo Exp $
2 //
3 
4 #include "chromabase.h"
5 
6 namespace Chroma {
7 
8 
9 // I cant forward declare this for some reason
10 // Standard Time Slicery
11 class TimeSliceFunc : public SetFunc
12 {
13 public:
14  TimeSliceFunc(int dir): dir_decay(dir) {}
15 
16  int operator() (const multi1d<int>& coordinate) const {return coordinate[dir_decay];}
17  int numSubsets() const {return Layout::lattSize()[dir_decay];}
18 
19  int dir_decay;
20 
21 private:
22  TimeSliceFunc() {} // hide default constructor
23 };
24 
25 
26 
27 
28 //! Fermion loop code
29 /*!
30  * \ingroup hadron
31  *
32  * This routine is specific to Wilson fermions!
33  *
34  * Compute fermion loops via noise source
35  *
36  * \param q_source -- noise source
37  * \param psi -- M^{-1} on source
38  * \param length -- length of lattice in time direction
39  * \param xml -- namelist file object ( Read )
40  * \param xml_tag -- std::string used for writing xml data ( Read )
41  *
42  * ____
43  * \ dagger
44  * m(t) = > < Source Gamma quark_solution >
45  * /
46  * ----
47  * x
48  *
49  * where Gamma is a Dirac gamma matrix.
50  *
51  */
52 
53 void loops(const LatticeFermion &q_source,
54  const LatticeFermion &psi,
55  int length,
56  XMLWriter& xml_gamma,
57  const std::string& xml_tag)
58 {
59  push(xml_gamma, xml_tag);
60 
61  // Machinery to do timeslice sums with
62  Set timeslice;
63  timeslice.make(TimeSliceFunc(Nd-1));
64 
65  multi1d<DComplex> corr_fn_t(length);
66  LatticeReal corr_fn_re ;
67 
68  // Loop over gamma matrix insertions
69  for (int gamma_value=0; gamma_value < (Ns*Ns); ++gamma_value)
70  {
71  push(xml_gamma,"loop_diagram"); // next array element
72  write(xml_gamma,"gamma_value", gamma_value );
73 
74  // Construct the meson correlation function
75  LatticeComplex corr_fn;
76  corr_fn = innerProduct(q_source , Gamma(gamma_value) *psi ) ;
77 
78  corr_fn_t = sumMulti(corr_fn, timeslice);
79 
80 
81  multi1d<Real> mesprop(length);
82  for (int t=0; t < length; ++t)
83  {
84  mesprop[t] = real(corr_fn_t[t]);
85  }
86 
87  write(xml_gamma, "mesprop", mesprop);
88 
89  pop(xml_gamma); // end of array element
90 
91  } // end for(gamma_value)
92 
93  pop(xml_gamma);
94 
95 }
96 
97 } // end namespace Chroma
Primary include file for CHROMA library code.
Function object used for constructing the time-slice set.
Definition: barQll_w.h:95
int numSubsets() const
Definition: loops_w.cc:17
int operator()(const multi1d< int > &coordinate) const
Definition: barQll_w.h:99
TimeSliceFunc(int dir)
Definition: loops_w.cc:14
Function object used for constructing the time-slice set.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
void loops(const LatticeFermion &q_source, const LatticeFermion &psi, int length, XMLWriter &xml_gamma, const std::string &xml_tag)
Fermion loop code.
Definition: loops_w.cc:53
int t
Definition: meslate.cc:37
Nd
Definition: meslate.cc:74
BinaryReturn< C1, C2, FnInnerProduct >::Type_t innerProduct(const QDPSubType< T1, C1 > &s1, const QDPType< T2, C2 > &s2)
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
push(xml_out,"Condensates")
LatticeFermion psi
Definition: mespbg5p_w.cc:35
pop(xml_out)
::std::string string
Definition: gtest.h:1979