CHROMA
pion_local_s.cc
Go to the documentation of this file.
1 /*! File: pion_local_s.cc
2  *
3  * The routines in this file compute the local staggered pions
4  * (gamma_5 cross gamma_5)
5  *
6  *
7  */
8 
11 
12 namespace Chroma {
13 
14 // I cant forward declare this for some reason
15 // Standard Time Slicery
16  class TimeSliceFunc : public SetFunc
17  {
18  public:
19  TimeSliceFunc(int dir): dir_decay(dir) {}
20 
21  int operator() (const multi1d<int>& coordinate) const {return coordinate[dir_decay];}
22  int numSubsets() const {return Layout::lattSize()[dir_decay];}
23 
24  int dir_decay;
25 
26  private:
27  TimeSliceFunc() {} // hide default constructor
28  };
29 
30 /*! compute method for the staggered_local_pion class
31  *
32  * This routine computes all 16 staggered pions.
33  *
34  * Caveats: i) It assumes that the propagators you give
35  * have been computed in some spatially fixed gauge
36  * eg the Coulomb Gauge.
37  *
38  *
39  * iii) The assumption is that you are working in 4d
40  *
41  * Parameters:
42  *
43  * quark_props -- The array of input propagators (Read)
44  * pion_corr_fn -- The 2d array of pion correlation functions
45  * (16, Nt) (Write)
46  *
47  * j_decay -- The time direction (has to be Nd-1 for now)
48  * (Read)
49  */
50 
51 
52 // THis brings the staggered phases alpha and beta into the namespace
53  using namespace StagPhases;
54 
55  void
57  LatticeStaggeredPropagator& quark_prop_A,
58  LatticeStaggeredPropagator& quark_prop_B,
59  int j_decay)
60  {
61 
62  // Paranoid Checks
63 
64  if( Nd != 4 ) {
65  QDPIO::cerr << "The no of dimensions should be 4 for now. It is: "
66  << Nd << std::endl;
67  QDP_abort(1);
68  }
69 
70  // Also for now we want j_decay to be 3.
71  switch( j_decay ) {
72  case 3:
73  break;
74 
75  default:
76  QDPIO::cerr << "pions_s: j_decay must be 3 for just now. It is " << j_decay << std::endl;
77  QDP_abort(1);
78  };
79 
80  // Get the lattice size.
81  const multi1d<int>& latt_size = Layout::lattSize();
82 
83 
84  // Correlation functions before spatial sum
85  LatticeComplex latt_corr_fn;
86 
87  // Machinery to do timeslice sums with
88  Set timeslice;
89  timeslice.make(TimeSliceFunc(Nd-1));
90 
91  // Counters/Indices
92  int pion_index = 0;
93  int i;
94  int mu, nu, rho;
95 
96  // Goldstone Pion
97  latt_corr_fn = trace(adj(quark_prop_A)*quark_prop_B);
98 
99  // Slice Sum
100  corr_fn[ pion_index ] = sumMulti(latt_corr_fn, timeslice);
101  tag_names[pion_index] = "gamma5_CROSS_gamma5" ;
102 
103  pion_index++;
104 
105  if( pion_index != no_pions ) {
106  QDPIO::cerr << "Panic! Panic! Something has gone horribly wrong" << std::endl;
107  QDP_abort(1);
108  }
109  }
110 
111 
112  /**
113  Include the momentum phase factors
114 
115 
116  **/
117 
118  void
120  LatticeStaggeredPropagator& quark_prop_A,
121  LatticeStaggeredPropagator& quark_prop_B,
122  int j_decay, int t0,
123  const SftMom& phases, XMLWriter& xml)
124  {
125 
126  // Paranoid Checks
127 
128  if( Nd != 4 ) {
129  QDPIO::cerr << "The no of dimensions should be 4 for now. It is: "
130  << Nd << std::endl;
131  QDP_abort(1);
132  }
133 
134  // Also for now we want j_decay to be 3.
135  switch( j_decay ) {
136  case 3:
137  break;
138 
139  default:
140  QDPIO::cerr << "pions_s: j_decay must be 3 for just now. It is " << j_decay << std::endl;
141  QDP_abort(1);
142  };
143 
144  // Get the lattice size.
145  const multi1d<int>& latt_size = Layout::lattSize();
146 
147  // Correlation functions before spatial sum
148  LatticeComplex latt_corr_fn;
149 
150  // Machinery to do timeslice sums with
151  Set timeslice;
152  timeslice.make(TimeSliceFunc(Nd-1));
153 
154  // Counters/Indices
155  int pion_index = 0;
156  int i;
157  int mu, nu, rho;
158 
159  // Goldstone Pion
160  latt_corr_fn = trace(adj(quark_prop_A)*quark_prop_B);
161 
162  multi2d<DComplex> hsum;
163  hsum = phases.sft(latt_corr_fn);
164 
165  XMLArrayWriter xml_sink_mom(xml,phases.numMom());
166 
167  push(xml_sink_mom, "gamma5_CROSS_gamma5_mom");
168 
169  for (int sink_mom_num=0; sink_mom_num < phases.numMom(); ++sink_mom_num)
170  {
171  push(xml_sink_mom);
172  write(xml_sink_mom, "sink_mom_num", sink_mom_num);
173  write(xml_sink_mom, "sink_mom", phases.numToMom(sink_mom_num));
174 
175  int tt_length = latt_size[Nd-1] ; // DEBUG
176  multi1d<DComplex> mesprop(tt_length);
177  for (int t=0; t < tt_length; ++t)
178  {
179  int t_eff = (t - t0 + tt_length) % tt_length;
180  mesprop[t_eff] = hsum[sink_mom_num][t];
181  }
182 
183  write(xml_sink_mom, "mesprop", mesprop);
184  pop(xml_sink_mom);
185 
186  } // end for(sink_mom_num)
187 
188  // push(xml_sink_mom);
189 
190 
191 
192  }
193 
194 
195 
196 } // end namespace Chroma
197 
Fourier transform phase factor support.
Definition: sftmom.h:35
multi1d< int > numToMom(int mom_num) const
Convert momenta id to actual array of momenta.
Definition: sftmom.h:78
multi2d< DComplex > sft(const LatticeComplex &cf) const
Do a sumMulti(cf*phases,getSet())
Definition: sftmom.cc:524
int numMom() const
Number of momenta.
Definition: sftmom.h:60
Function object used for constructing the time-slice set.
Definition: barQll_w.h:95
int numSubsets() const
Definition: pion_local_s.cc:22
int operator()(const multi1d< int > &coordinate) const
Definition: barQll_w.h:99
void compute(LatticeStaggeredPropagator &quark_prop_A, LatticeStaggeredPropagator &quark_prop_B, int j_decay)
Definition: pion_local_s.cc:56
void compute_and_dump(LatticeStaggeredPropagator &quark_prop_A, LatticeStaggeredPropagator &quark_prop_B, int j_decay, int, const SftMom &phases, XMLWriter &xml)
Function object used for constructing the time-slice set.
int mu
Definition: cool.cc:24
int nu
Definition: cool.cc:25
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
int j_decay
Definition: meslate.cc:22
int t
Definition: meslate.cc:37
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
push(xml_out,"Condensates")
int i
Definition: pbg5p_w.cc:55
pop(xml_out)