CHROMA
walldeltaff_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Wall-sink delta^+ -> gamma+delta^+ form-factors
3  *
4  * Form factors constructed from a quark and a backward quark propagator
5  */
6 
7 #include "qdp_config.h"
8 #if QDP_NS == 4
9 #if QDP_ND == 4
10 #if QDP_NC == 3
11 
12 
13 #include "chromabase.h"
15 #include "util/ferm/gammasgn_w.h"
16 
17 namespace Chroma {
18 
19 //! Compute the 123-123 contraction of a delta and P
20 /*!
21  * \ingroup hadron
22  *
23  * quark contraction within a baryon
24  *
25  * \param q1 first quark ( Read )
26  * \param q2 second quark ( Read )
27  * \param q3 third quark ( Read )
28  * \param n Lorentz index of delta ( Read )
29  * \param m Lorentz index of delta ( Read )
30  *
31  * \return color-contracted spin object
32  */
33 template<class T1, class T2, class T3>
34 static
35 LatticeSpinMatrix deltaContract123(const T1& q1,
36  const T2& q2,
37  const T3& q3,
38  int n, int m)
39 {
40  /* C gamma_5 = Gamma(5) = - (C gamma_5)^T */
41  /* C gamma_mu = Gamma(10) * Gamma(1 << mu) = + (C gamma_mu)^T */
42  LatticeSpinMatrix S =
43  traceColor(q3 * traceSpin(quarkContract13((q1*Gamma(10))*Gamma(n), Gamma(10)*(Gamma(m)*q2))));
44 
45  return S;
46 }
47 
48 //! Compute the 123-132 contraction of a delta
49 /*!
50  * \ingroup hadron
51  *
52  * quark contraction within a baryon
53  *
54  * \param q1 first quark ( Read )
55  * \param q2 second quark ( Read )
56  * \param q3 third quark ( Read )
57  * \param n Lorentz index of delta ( Read )
58  * \param m Lorentz index of delta ( Read )
59  *
60  * \return color-contracted spin object
61  */
62 template<class T1, class T2, class T3>
63 static
64 LatticeSpinMatrix deltaContract132(const T1& q1,
65  const T2& q2,
66  const T3& q3,
67  int n, int m)
68 {
69  /* C gamma_5 = Gamma(5) = - (C gamma_5)^T */
70  /* C gamma_mu = Gamma(10) * Gamma(1 << mu) = + (C gamma_mu)^T */
71  LatticeSpinMatrix S =
72  traceColor(q3 * quarkContract13((q1*Gamma(10))*Gamma(n), Gamma(10)*(Gamma(m)*q2)));
73 
74  return S;
75 }
76 
77 //! Compute delta 2-pt contraction
78 /*!
79  * \ingroup hadron
80  *
81  * quark contraction within a baryon
82  *
83  * \param u1 first quark ( Read )
84  * \param u2 second quark ( Read )
85  * \param d third quark ( Read )
86  * \param n Lorentz index of delta ( Read )
87  * \param m Lorentz index of delta ( Read )
88  *
89  * \return color-contracted spin object
90  */
91 template<class T1, class T2, class T3>
92 static
93 LatticeSpinMatrix deltaContract(const T1& u1,
94  const T2& u2,
95  const T3& d,
96  int n, int m)
97 {
98 #if 0
99  LatticeSpinMatrix S =
100  2*deltaContract123( d, u1, u2, n, m) + deltaContract123(u1, u2, d, n, m)
101  + 2*deltaContract132( d, u1, u2, n, m) + 2*deltaContract132(u1, d, u2, n, m)
102  + 2*deltaContract132(u1, u2, d, n, m);
103 
104  S *= 2;
105 #endif
106 
107 #if 0
108  LatticeSpinMatrix S =
109  traceColor(u2 * traceSpin(quarkContract13(( d*Gamma(10))*Gamma(n), Gamma(10)*(Gamma(m)*u1))))
110 + 0.5*traceColor( d * traceSpin(quarkContract13((u1*Gamma(10))*Gamma(n), Gamma(10)*(Gamma(m)*u2))))
111  + traceColor(u2 * quarkContract13(( d*Gamma(10))*Gamma(n), Gamma(10)*(Gamma(m)*u1)))
112  + traceColor(u2 * quarkContract13((u1*Gamma(10))*Gamma(n), Gamma(10)*(Gamma(m)* d)))
113  + traceColor( d * quarkContract13((u1*Gamma(10))*Gamma(n), Gamma(10)*(Gamma(m)*u2)));
114 
115  S *= 4;
116 #endif
117 
118 // (More) Optimized version
119 #if 1
120  int n10 = 10 ^ n;
121  int m10 = 10 ^ m;
122 
123  LatticeSpinMatrix S =
124  traceColor(u2 * traceSpin(quarkContract13( d*Gamma(n10), Gamma(m10)*u1)))
125 + 0.5*traceColor( d * traceSpin(quarkContract13(u1*Gamma(n10), Gamma(m10)*u2)))
126  + traceColor(u2 * quarkContract13( d*Gamma(n10), Gamma(m10)*u1))
127  + traceColor(u2 * quarkContract13(u1*Gamma(n10), Gamma(m10)* d))
128  + traceColor( d * quarkContract13(u1*Gamma(n10), Gamma(m10)*u2));
129 
130  S *= 4 * gammaSgn(10,n) * gammaSgn(10,m);
131 #endif
132 
133  return S;
134 }
135 
136 
137 
138 //! Compute contractions for current insertion 3-point functions.
139 /*!
140  * \ingroup hadron
141  *
142  * This routine is specific to Wilson fermions!
143  *
144  * \param form Mega-structure holding form-factors ( Write )
145  * \param u gauge fields (used for non-local currents) ( Read )
146  * \param forw_u_prop forward U quark propagator ( Read )
147  * \param back_u_prop backward D quark propagator ( Read )
148  * \param forw_d_prop forward U quark propagator ( Read )
149  * \param back_d_prop backward D quark propagator ( Read )
150  * \param u_x2 forward U quark propagator evaluated at sink ( Read )
151  * \param d_x2 forward D quark propagator evaluated at sink ( Read )
152  * \param phases fourier transform phase factors ( Read )
153  * \param t0 time slice of the source ( Read )
154  * \param wall_source true if using a wall source ( Read )
155  */
156 
157 void wallDeltaFormFac(WallFormFac_formfacs_t& form,
158  const multi1d<LatticeColorMatrix>& u,
159  const LatticePropagator& forw_u_prop,
160  const LatticePropagator& back_u_prop,
161  const LatticePropagator& forw_d_prop,
162  const LatticePropagator& back_d_prop,
163  const Propagator& u_x2,
164  const Propagator& d_x2,
165  const SftMom& phases,
166  int t0,
167  bool wall_source)
168 {
169  START_CODE();
170 
171  if ( Ns != 4 || Nc != 3 || Nd != 4 ) // Code is specific to Ns=4, Nc=3, Nd=4
172  return;
173 
174  QDPIO::cout << "Entering wallDeltaFormFac" << std::endl;
175  QDP::StopWatch swatch;
176  swatch.reset();
177  swatch.start();
178 
179  form.subroutine = "wallDeltaFormFac";
180 
181  // Length of lattice in decay direction and 3pt correlations fcns
182  int length = phases.numSubsets();
183 
184  int G5 = Ns*Ns-1;
185 
186  // The list of meaningful insertions
187  // The gamma matrices specified correspond to
188  // V_mu and A_mu = gamma_mu gamma_5, specificially
189  // where in the Chroma code gamma_5 = g_3 g_2 g_1 g_0
190  //
191  // GAMMA CURRENT
192  // 1 V_0
193  // 2 V_1
194  // 4 V_2
195  // 8 V_3
196  // 14 -A_0
197  // 13 A_1
198  // 11 -A_2
199  // 7 A_3
200  multi1d<int> gamma_list(2*Nd);
201  gamma_list[0] = 1;
202  gamma_list[1] = 2;
203  gamma_list[2] = 4;
204  gamma_list[3] = 8;
205  gamma_list[4] = 14;
206  gamma_list[5] = 13;
207  gamma_list[6] = 11;
208  gamma_list[7] = 7;
209 
210  // Spin projectors
211  multi1d<SpinMatrix> S_proj(Nd);
212  SpinMatrix g_one = 1.0;
213 
214  // T = (1 + gamma_4) / 2 = (1 + Gamma(8)) / 2
215  S_proj[0] = 0.5 * (g_one + (g_one * Gamma(8)));
216 
217  // T = \Sigma_k (1 + gamma_4) / 2 = -i gamma_i gamma_j S_proj[0] i,j cyclic perms
218  S_proj[1] = timesMinusI(Gamma(1 << 1) * (Gamma(1 << 2) * S_proj[0]));
219  S_proj[2] = timesMinusI(Gamma(1 << 2) * (Gamma(1 << 0) * S_proj[0]));
220  S_proj[3] = timesMinusI(Gamma(1 << 0) * (Gamma(1 << 1) * S_proj[0]));
221 
222 
223  // Quark names
224  multi1d<std::string> quark_name(2);
225  quark_name[0] = "u";
226  quark_name[1] = "d";
227 
228  // Formfac names
229  multi1d<std::string> formfac_name(1);
230  formfac_name[0] = "nucleon->gamma+nucleon";
231 
232  // Projector names
233  multi1d<std::string> proj_name(Nd);
234  proj_name[0] = "I";
235  proj_name[1] = "sigma_1";
236  proj_name[2] = "sigma_2";
237  proj_name[3] = "sigma_3";
238 
239 
240  // Antiquarks
241  LatticePropagator anti_u_prop = adj(Gamma(G5)*back_u_prop*Gamma(G5));
242  LatticePropagator anti_d_prop = adj(Gamma(G5)*back_d_prop*Gamma(G5));
243 
244 
245  // Resize some things - this is needed upfront because I traverse the
246  // structure in a non-recursive scheme
247  form.quark.resize(quark_name.size());
248  for (int ud=0; ud < form.quark.size(); ++ud)
249  {
250  form.quark[ud].formfac.resize(formfac_name.size());
251  for(int dp = 0; dp < form.quark[ud].formfac.size(); ++dp)
252  {
253  form.quark[ud].formfac[dp].lorentz.resize(Nd*Nd);
254  for(int lorz = 0; lorz < form.quark[ud].formfac[dp].lorentz.size(); ++lorz)
255  {
256  form.quark[ud].formfac[dp].lorentz[lorz].projector.resize(proj_name.size());
257  for (int proj = 0; proj < form.quark[ud].formfac[dp].lorentz[lorz].projector.size(); ++proj)
258  {
259  form.quark[ud].formfac[dp].lorentz[lorz].projector[proj].insertion.resize(gamma_list.size());
260  }
261  }
262  }
263  }
264 
265  swatch.stop();
266  QDPIO::cout << "Time(init): " << swatch.getTimeInMicroseconds() << " s" << std::endl;
267  swatch.start();
268 
269  // For calculational purpose, loop over insertions first.
270  // This is out-of-order from storage within the data structure
271  // Loop over gamma matrices of the insertion current of insertion current
272  for(int gamma_ctr = 0; gamma_ctr < gamma_list.size(); ++gamma_ctr)
273  {
274  swatch.stop();
275  QDPIO::cout << "Time(gamma_ctr=" << gamma_ctr << "): " << swatch.getTimeInMicroseconds() << " s" << std::endl;
276  swatch.start();
277 
278  int gamma_value = gamma_list[gamma_ctr];
279  int mu = gamma_ctr % Nd;
280  bool compute_nonlocal = (gamma_ctr < Nd) ? true : false;
281 
282  // Loop over "u"=0 or "d"=1 pieces
283  for(int ud = 0; ud < form.quark.size(); ++ud)
284  {
285  swatch.stop();
286  QDPIO::cout << "Time(ud=" << ud << "): " << swatch.getTimeInMicroseconds() << " s" << std::endl;
287  swatch.start();
288 
289  WallFormFac_quark_t& quark = form.quark[ud];
290  quark.quark_ctr = ud;
291  quark.quark_name = quark_name[ud];
292 
293  LatticePropagator local_insert_prop, nonlocal_insert_prop;
294 
295 
296  switch (ud)
297  {
298  case 0:
299  {
300  // "\bar u O u" insertion in rho
301  // The local non-conserved current contraction
302  local_insert_prop = anti_u_prop*Gamma(gamma_value)*forw_u_prop;
303 
304  if (compute_nonlocal)
305  {
306  // Construct the non-local (possibly conserved) current contraction
307  nonlocal_insert_prop = nonlocalCurrentProp(u, mu, forw_u_prop, anti_u_prop);
308  }
309  }
310  break;
311 
312  case 1:
313  {
314  // "\bar d O d" insertion in rho
315  // The local non-conserved current contraction
316  local_insert_prop = anti_d_prop*Gamma(gamma_value)*forw_d_prop;
317 
318  if (compute_nonlocal)
319  {
320  // Construct the non-local (possibly conserved) current contraction
321  nonlocal_insert_prop = nonlocalCurrentProp(u, mu, forw_d_prop, anti_d_prop);
322  }
323  }
324  break;
325 
326  default:
327  QDP_error_exit("Unknown ud type", ud);
328  }
329 
330 
331  // Loop over "rho->rho"=0 types of form-factors
332  for(int dp = 0; dp < quark.formfac.size(); ++dp)
333  {
334  swatch.stop();
335  QDPIO::cout << "Time(dp=" << dp << "): " << swatch.getTimeInMicroseconds() << " s" << std::endl;
336  swatch.start();
337 
338  WallFormFac_formfac_t& formfac = quark.formfac[dp];
339  formfac.formfac_ctr = dp;
340  formfac.formfac_name = formfac_name[dp];
341 
342  LatticeSpinMatrix local_contract, nonlocal_contract;
343 
344 
345  // Loop over Lorentz indices of source and sink hadron operators
346  for(int lorz = 0; lorz < formfac.lorentz.size(); ++lorz)
347  {
348  swatch.stop();
349  QDPIO::cout << "Time(lorz=" << lorz << "): " << swatch.getTimeInMicroseconds() << " s" << std::endl;
350  swatch.start();
351 
352  WallFormFac_lorentz_t& lorentz = formfac.lorentz[lorz];
353  lorentz.lorentz_ctr = lorz;
354 
355  int sigma; // Lorentz index at sink
356  int tau; // Lorentz index at source
357 
358  // Encoding of lorentz indices
359  sigma = lorz % Nd;
360  tau = int(lorz / Nd);
361 
362  int gamma_value1 = 1 << sigma;
363  int gamma_value2 = 1 << tau;
364 
365  lorentz.snk_gamma = gamma_value1;
366  lorentz.src_gamma = gamma_value2;
367 
368  // Contractions depend on "ud" (u or d quark contribution)
369  // and source/sink operators
370  switch (ud)
371  {
372  case 0:
373  {
374  // "\bar u O u" insertion in delta
375  // The local non-conserved current contraction
376  local_contract =
377  deltaContract(local_insert_prop, u_x2, d_x2, gamma_value1, gamma_value2) +
378  deltaContract(u_x2, local_insert_prop, d_x2, gamma_value1, gamma_value2);
379 
380  if (compute_nonlocal)
381  {
382  // Construct the non-local (possibly conserved) current contraction
383  nonlocal_contract =
384  deltaContract(nonlocal_insert_prop, u_x2, d_x2, gamma_value1, gamma_value2) +
385  deltaContract(u_x2, nonlocal_insert_prop, d_x2, gamma_value1, gamma_value2);
386  }
387  }
388  break;
389 
390  case 1:
391  {
392  // "\bar d O d" insertion in delta
393  // The local non-conserved current contraction
394  local_contract =
395  deltaContract(u_x2, u_x2, local_insert_prop, gamma_value1, gamma_value2);
396 
397  if (compute_nonlocal)
398  {
399  // Construct the non-local (possibly conserved) current contraction
400  nonlocal_contract =
401  deltaContract(u_x2, u_x2, nonlocal_insert_prop, gamma_value1, gamma_value2);
402  }
403  }
404  break;
405 
406  default:
407  QDP_error_exit("Unknown ud type", ud);
408  }
409 
410 
411  // Loop over the spin projectors
412  for (int proj = 0; proj < lorentz.projector.size(); ++proj)
413  {
414  swatch.stop();
415  QDPIO::cout << "Time(proj=" << proj << "): " << swatch.getTimeInMicroseconds() << " s" << std::endl;
416  swatch.start();
417 
418  WallFormFac_projector_t& projector = lorentz.projector[proj];
419  projector.proj_ctr = proj;
420  projector.proj_name = proj_name[proj];
421 
422  WallFormFac_insertion_t& insertion = projector.insertion[gamma_ctr];
423 
424  insertion.gamma_ctr = gamma_ctr;
425  insertion.mu = mu;
426  insertion.gamma_value = gamma_value;
427 
428  // The local non-conserved std::vector-current matrix element
429  LatticeComplex corr_local_fn = traceSpin(S_proj[proj] * local_contract);
430 
431  // The nonlocal (possibly conserved) current matrix element
432  LatticeComplex corr_nonlocal_fn = traceSpin(S_proj[proj] * nonlocal_contract);
433 
434  multi1d<WallFormFac_momenta_t>& momenta = insertion.momenta;
435 
436  swatch.stop();
437  QDPIO::cout << "Time(before sft): " << swatch.getTimeInMicroseconds() << " s" << std::endl;
438  swatch.start();
439  wallFormFacSft(momenta, corr_local_fn, corr_nonlocal_fn, phases,
440  compute_nonlocal, t0);
441  swatch.stop();
442  QDPIO::cout << "Time(after sft): " << swatch.getTimeInMicroseconds() << " s" << std::endl;
443  swatch.start();
444  } // end for(proj)
445  } // end for(dp)
446  } // end for(lorz)
447  } // end for(ud)
448  } // end for(gamma_ctr)
449 
450  swatch.stop();
451  QDPIO::cout << "Time(wallDeltaFormFac): " << swatch.getTimeInMicroseconds() << " s" << std::endl;
452  QDPIO::cout << "Exiting wallDeltaFormFac" << std::endl;
453 
454  END_CODE();
455 }
456 
457 } // end namespace Chroma
458 
459 #endif
460 #endif
461 #endif
462 
Primary include file for CHROMA library code.
int mu
Definition: cool.cc:24
Compute gamma matrix multiplication table factors.
int gammaSgn(int n, int m)
Return gamma matrix multiplication table factors.
Definition: gammasgn_w.cc:76
void wallFormFacSft(multi1d< WallFormFac_momenta_t > &momenta, const LatticeComplex &corr_local_fn, const LatticeComplex &corr_nonlocal_fn, const SftMom &phases, bool compute_nonlocal, int t0)
Do slow SFT over hadron correlator data.
Definition: wallff_w.cc:54
LatticePropagator nonlocalCurrentProp(const multi1d< LatticeColorMatrix > &u, int mu, const LatticePropagator &forw_prop, const LatticePropagator &anti_prop)
Compute nonlocal current propagator.
Definition: wallff_w.cc:28
void wallDeltaFormFac(WallFormFac_formfacs_t &form, const multi1d< LatticeColorMatrix > &u, const LatticePropagator &forw_u_prop, const LatticePropagator &back_u_prop, const LatticePropagator &forw_d_prop, const LatticePropagator &back_d_prop, const Propagator &u_x2, const Propagator &d_x2, const SftMom &phases, int t0, bool wall_source)
Wall-sink delta-> gamma+delta form-factors.
unsigned n
Definition: ldumul_w.cc:36
static int m[4]
Definition: make_seeds.cc:16
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
QDP_error_exit("too many BiCG iterations", n_count, rsd_sq, cp, c, re_rvr, im_rvr, re_a, im_a, re_b, im_b)
int G5
Definition: pbg5p_w.cc:57
static multi1d< LatticeColorMatrix > u
DComplex d
Definition: invbicg.cc:99
START_CODE()
Wall-sink delta-> gamma+delta form-factors.