CHROMA
stag_scalars_s.cc
Go to the documentation of this file.
1 /*! File: stag_scalars_s.cc
2  *
3  * The routines in this file compute eight 1xTASTE and eight gamma3xTASTE
4  * (gamma_txTASTE)
5  * staggered scalars.
6  * The latter may be exotic and the former may be redundant. Run it if you
7  * want. Your call.
8  *
9  * comments added to elucidate what operators are being computed
10  * for consistency we keep the same crazy indexing, and for now the same
11  * XML tags. This whole file might be redundant.
12  *
13  */
14 
15 #include "chromabase.h"
19 
20 namespace Chroma {
21 
22  // I cant forward declare this for some reason
23  // Standard Time Slicery
24  class TimeSliceFunc : public SetFunc
25  {
26  public:
27  TimeSliceFunc(int dir): dir_decay(dir) {}
28 
29  int operator() (const multi1d<int>& coordinate) const {return coordinate[dir_decay];}
30  int numSubsets() const {return Layout::lattSize()[dir_decay];}
31 
32  int dir_decay;
33 
34  private:
35  TimeSliceFunc() {} // hide default constructor
36  };
37 
38  /*! staggeredScalars
39  *
40  * This routine computes all 16 staggered scalars.
41  *
42  * Caveats: i) It assumes that the propagators you give
43  * have been computed in some spatially fixed gauge
44  * eg the Coulomb Gauge.
45  *
46  * ii) This means that there is only
47  * 8 propagators corresponding to the 8 corners of the
48  * spatial cube. The props come in an array whose single
49  * index std::maps lexicographically to the corners of the cube.
50  * ie: prop_index = 0, hypercube_coord (0,0,0,0)
51  * prop_index = 1, hypercube_coord (1,0,0,0)
52  * prop_index = 2, hypercube_coord (0,1,0,0)
53  *
54  * essentially prop_index = x + 2*y + 4*z
55  *
56  * iii) The assumption is that you are working in 4d
57  *
58  * Parameters:
59  *
60  * quark_props -- The array of input propagators (Read)
61  * scalar_corr_fn -- The 2d array of scalar correlation functions
62  * (16, Nt) (Write)
63  *
64  * j_decay -- The time direction (has to be Nd-1 for now)
65  * (Read)
66  */
67 
68 
69 // THis brings the staggered phases alpha and beta into the namespace
70 
71  void
73  multi1d<LatticeStaggeredPropagator>& quark_props,
74  int j_decay)
75  {
76 
77  // Paranoid Checks
78 
79  if( Nd != 4 ) {
80  QDPIO::cerr << "The no of dimensions should be 4 for now. It is: "
81  << Nd << std::endl;
82  QDP_abort(1);
83  }
84 
85  // Check for 8 props
86  if( quark_props.size() != NUM_STAG_PROPS ) {
87  QDPIO::cerr << "staggeredScalars: input quark props has the wrong number of elements. It should be 8 but is " << quark_props.size() << std::endl;
88  QDP_abort(1);
89  };
90 
91  // Also for now we want j_decay to be 3.
92  switch( j_decay ) {
93  case 3:
94  break;
95 
96  default:
97  QDPIO::cerr << "staggeredScalars: j_decay must be 3 for just now. It is " << j_decay << std::endl;
98  QDP_abort(1);
99  };
100 
101  // Get the lattice size.
102  const multi1d<int>& latt_size = Layout::lattSize();
103 
104  // resize output array appropriately
105  corr_fn.resize(NUM_STAG_PIONS, latt_size[Nd-1]);
106 
107  // Correlation functions before spatial sum
108  LatticeComplex corr_fn_s;
109 
110  // Machinery to do timeslice sums with
111  Set timeslice;
112  timeslice.make(TimeSliceFunc(Nd-1));
113 
114  // Phases
115  //multi1d<LatticeInteger> alpha(Nd); // KS Phases
116  //multi1d<LatticeInteger> beta(Nd); // Auxiliary phases for this work
117 
118  // Get the phases -- now done elsewhere
119  // mesPhasFollana(alpha, beta);
120 
121  // Counters/Indices
122  int sca_index = 0;
123  int i;
124  int mu, nu, rho;
125 
126  // Taste singlet scalar (connected correlator)
127  // 1x1
128  corr_fn_s = - StagPhases::alpha(1)*StagPhases::beta(0)*trace(adj(quark_props[0])*quark_props[0]);
129 
130  // Slice Sum
131  corr_fn[ sca_index ] = sumMulti(corr_fn_s, timeslice);
132 
133  sca_index++;
134 
135 
136  // Array to describe shifts in cube
137  multi1d<int> delta(Nd);
138 
139  // One link spatial scalars.
140  // 1xgamma0, 1xgamma1, 1xgamma2
141 
142  for(mu=0; mu<Nd-1; mu++) {
143 
144  delta = 0;
145  delta[mu] = 1;
146 
147  corr_fn_s = StagPhases::alpha(mu+1)*trace(shift_deltaProp(delta,quark_props[0])
148  *adj(quark_props[ deltaToPropIndex(delta) ]));
149 
150  corr_fn[ sca_index ] = sumMulti(corr_fn_s, timeslice);
151  sca_index++;
152  }
153 
154  // zero link gamma3 operator
155  // gamma3xgamma3
156 
157  corr_fn_s = - StagPhases::beta(0)*StagPhases::alpha(1)*StagPhases::alpha(3)*trace(adj(quark_props[0])*quark_props[0]);
158  corr_fn[ sca_index ] = sumMulti(corr_fn_s, timeslice);
159 
160  sca_index++;
161 
162  // Two link spatial
163  // 1xgamma0gamma1, 1xgamma0gamm2, 1xgamma1gamma2
164 
165  for(mu=0; mu<Nd-1; mu++) {
166  for(nu=mu+1; nu <Nd-1; nu++) {
167  delta = 0;
168  delta[mu] = 1;
169  delta[nu] = 1;
170 
171  corr_fn_s = StagPhases::beta(mu)* StagPhases::alpha(nu+1)
172  *trace(adj(shift_deltaProp(delta,quark_props[0]))
173  *quark_props[ deltaToPropIndex(delta) ]);
174 
175  corr_fn[ sca_index ] = sumMulti(corr_fn_s, timeslice);
176  sca_index++;
177  }
178  }
179 
180  // one link gamma3 operators
181  // gamma3xgamma0gamma3, gamma3xgamma1gamma3, gamma3xgamma2gamma3
182  for(mu=0; mu<Nd-1; mu++) {
183  delta = 0;
184  delta[mu] = 1;
185 
186  corr_fn_s = - StagPhases::beta(mu)* StagPhases::beta(2)
187  *trace(adj(shift_deltaProp(delta,quark_props[0]))
188  *quark_props[ deltaToPropIndex(delta) ]);
189 
190 
191  corr_fn[ sca_index ] = sumMulti(corr_fn_s, timeslice);
192  sca_index++;
193  }
194 
195  // Three link spatial scalar
196  // despite the loops, there can be only one
197  // 1xgamma3gamma5
198 
199  for(mu=0; mu<Nd-1; mu++) {
200  for(nu=mu+1; nu <Nd-1; nu++) {
201  for(rho=nu+1; rho < Nd-1; rho++) {
202 
203  delta = 0;
204  delta[mu] = 1;
205  delta[nu] = 1;
206  delta[rho] = 1;
207 
208  corr_fn_s = - StagPhases::alpha(mu+1) * StagPhases::alpha(nu+1)* StagPhases::alpha(rho+1)
209  *trace(adj(shift_deltaProp(delta,quark_props[0]))
210  *quark_props[ deltaToPropIndex(delta) ]);
211 
212  corr_fn[ sca_index ] = sumMulti(corr_fn_s, timeslice);
213  sca_index++;
214  }
215  }
216  }
217 
218  // two-link gamma3 operators
219  // gamma3xgamma2gamma5, gamma3xgamma1gamma5, gamma3xgamma0gamma5
220  //
221  for(mu=0; mu<Nd-1; mu++) {
222  for(nu=mu+1; nu <Nd-1; nu++) {
223 
224  delta = 0;
225  delta[mu] = 1;
226  delta[nu] = 1;
227 
229  *trace(adj(shift_deltaProp(delta,quark_props[0]))
230  *quark_props[ deltaToPropIndex(delta) ]);
231 
232  corr_fn[ sca_index ] = sumMulti(corr_fn_s, timeslice);
233  sca_index++;
234  }
235  }
236 
237  // three-link gamma3 operator
238  // gamma3xgamma5
239 
240  delta = 0;
241  delta[0] = delta[1] = delta[2] = 1;
242 
243  corr_fn_s = StagPhases::beta(0)* StagPhases::beta(1)
244  *trace(adj(shift_deltaProp(delta, quark_props[0]))
245  *quark_props[ deltaToPropIndex(delta) ] );
246 
247  corr_fn[ sca_index ] = sumMulti(corr_fn_s, timeslice);
248  sca_index++;
249 
250  if( sca_index != NUM_STAG_PIONS) {
251  QDPIO::cerr << "Panic! Panic! Something has gone horribly wrong" << std::endl;
252  QDP_abort(1);
253  }
254  }
255 
256 } // 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 operator()(const multi1d< int > &coordinate) const
Definition: barQll_w.h:99
multi2d< DComplex > corr_fn
LatticeStaggeredPropagator shift_deltaProp(multi1d< int > &delta, const LatticeStaggeredPropagator &src)
void compute(multi1d< LatticeStaggeredPropagator > &quark_props, int j_decay)
Function object used for constructing the time-slice set.
int mu
Definition: cool.cc:24
int nu
Definition: cool.cc:25
#define NUM_STAG_PIONS
Definition: hadron_corr_s.h:6
#define NUM_STAG_PROPS
Definition: hadron_corr_s.h:5
int j_decay
Definition: meslate.cc:22
Nd
Definition: meslate.cc:74
static const LatticeInteger & beta(const int dim)
Definition: stag_phases_s.h:47
static const LatticeInteger & alpha(const int dim)
Definition: stag_phases_s.h:43
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
int deltaToPropIndex(multi1d< int > &delta)
int i
Definition: pbg5p_w.cc:55