CHROMA
curcor2_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Mesonic current correlators
3  */
4 
5 #include "chromabase.h"
6 #include "util/ft/sftmom.h"
7 #include "meas/hadron/mesons_w.h"
8 #include "qdp_util.h" // part of QDP++, for crtesn()
9 
10 namespace Chroma {
11 
12 //! Construct current correlators
13 /*!
14  * \ingroup hadron
15  *
16  * This routine is specific to Wilson fermions!
17  *
18  * The two propagators can be identical or different.
19 
20  * This includes the "rho_1--rho_2" correlators used for O(a) improvement
21 
22  * For use with "rotated" propagators we added the possibility of also
23  * computing the local std::vector current, when no_vec_cur = 4. In this
24  * case the 3 local currents come last.
25 
26  * \param u gauge field ( Read )
27  * \param quark_prop_1 first quark propagator ( Read )
28  * \param quark_prop_2 second (anti-) quark propagator ( Read )
29  * \param phases fourier transform phase factors ( Read )
30  * \param t0 timeslice coordinate of the source ( Read )
31  * \param no_vec_cur number of std::vector current types, 3 or 4 ( Read )
32  * \param xml namelist file object ( Read )
33  * \param xml_group std::string used for writing xml data ( Read )
34  *
35  * ____
36  * \
37  * cc(t) = > < m(t_source, 0) c(t + t_source, x) >
38  * /
39  * ----
40  * x
41  */
42 
43 
44 void curcor2(const multi1d<LatticeColorMatrix>& u,
45  const LatticePropagator& quark_prop_1,
46  const LatticePropagator& quark_prop_2,
47  const SftMom& phases,
48  int t0,
49  int no_vec_cur,
50  XMLWriter& xml,
51  const std::string& xml_group)
52 {
53  START_CODE();
54 
55  if ( no_vec_cur < 2 || no_vec_cur > 4 )
56  QDP_error_exit("no_vec_cur must be 2 or 3 or 4", no_vec_cur);
57 
58  // Initial group
59  push(xml, xml_group);
60 
61  write(xml, "num_vec_cur", no_vec_cur);
62 
63  // Length of lattice in decay direction
64  int length = phases.numSubsets();
65  int j_decay = phases.getDir();
66 
67  LatticePropagator tmp_prop1;
68  LatticePropagator tmp_prop2;
69 
70  LatticeReal psi_sq;
71  LatticeReal chi_sq;
72 
73  multi1d<Double> hsum(length);
74 
75  // Construct the anti-quark propagator from quark_prop_2
76  int G5 = Ns*Ns-1;
77  LatticePropagator anti_quark_prop = Gamma(G5) * quark_prop_2 * Gamma(G5);
78 
79  // Vector currents
80  {
81  multi2d<Real> vector_current(no_vec_cur*(Nd-1), length);
82 
83  /* Construct the 2*(Nd-1) non-local std::vector-current to rho correlators */
84  int kv = -1;
85  int kcv = Nd-2;
86 
87  for(int k = 0; k < Nd; ++k)
88  {
89  if( k != j_decay )
90  {
91  int n = 1 << k;
92  kv = kv + 1;
93  kcv = kcv + 1;
94 
95  tmp_prop2 = u[k] * shift(quark_prop_1, FORWARD, k) * Gamma(n);
96  chi_sq = - real(trace(adj(anti_quark_prop) * tmp_prop2));
97 
98  tmp_prop1 = Gamma(n) * tmp_prop2;
99  psi_sq = real(trace(adj(anti_quark_prop) * tmp_prop1));
100 
101  tmp_prop2 = u[k] * shift(anti_quark_prop, FORWARD, k) * Gamma(n);
102  chi_sq += real(trace(adj(tmp_prop2) * quark_prop_1));
103 
104  tmp_prop1 = Gamma(n) * tmp_prop2;
105  psi_sq += real(trace(adj(tmp_prop1) * quark_prop_1));
106 
107  chi_sq += psi_sq;
108 
109  /* Do a slice-wise sum. */
110 
111 // Real dummy1 = Real(meson_eta[n]) / Real(2);
112  Real dummy1 = 0.5;
113 
114  /* The nonconserved std::vector current first */
115  hsum = sumMulti(psi_sq, phases.getSet());
116 
117  for(int t = 0; t < length; ++t)
118  {
119  int t_eff = (t - t0 + length) % length;
120  vector_current[kv][t_eff] = dummy1 * Real(hsum[t]);
121  }
122 
123  /* The conserved std::vector current next */
124  hsum = sumMulti(chi_sq, phases.getSet());
125 
126  for(int t = 0; t < length; ++t)
127  {
128  int t_eff = (t - t0 + length) % length;
129  vector_current[kcv][t_eff] = dummy1 * Real(hsum[t]);
130  }
131  }
132  }
133 
134 
135  /* Construct the O(a) improved std::vector-current to rho correlators,
136  if desired */
137  if ( no_vec_cur >= 3 )
138  {
139  kv = 2*Nd-3;
140  int jd = 1 << j_decay;
141 
142  for(int k = 0; k < Nd; ++k)
143  {
144  if( k != j_decay )
145  {
146  int n = 1 << k;
147  kv = kv + 1;
148  int n1 = n ^ jd;
149 
150  psi_sq = real(trace(adj(anti_quark_prop) * Gamma(n1) * quark_prop_1 * Gamma(n)));
151 
152 // dummy1 = - Real(meson_eta[n]);
153  Real dummy1 = - 1;
154 
155  /* Do a slice-wise sum. */
156  hsum = sumMulti(psi_sq, phases.getSet());
157 
158  for(int t = 0; t < length; ++t)
159  {
160  int t_eff = (t - t0 + length) % length;
161  vector_current[kv][t_eff] = dummy1 * Real(hsum[t]);
162  }
163  }
164  }
165  }
166 
167 
168  /* Construct the local std::vector-current to rho correlators, if desired */
169  if ( no_vec_cur >= 4 )
170  {
171  kv = 3*Nd-4;
172 
173  for(int k = 0; k < Nd; ++k)
174  {
175  if( k != j_decay )
176  {
177  int n = 1 << k;
178  kv = kv + 1;
179 
180  psi_sq = real(trace(adj(anti_quark_prop) * Gamma(n) * quark_prop_1 * Gamma(n)));
181 
182 // dummy1 = Real(meson_eta[n]);
183  Real dummy1 = 1;
184 
185  /* Do a slice-wise sum. */
186  hsum = sumMulti(psi_sq, phases.getSet());
187 
188  for(int t = 0; t < length; ++t)
189  {
190  int t_eff = (t - t0 + length) % length;
191  vector_current[kv][t_eff] = dummy1 * Real(hsum[t]);
192  }
193  }
194  }
195  }
196 
197 
198  // Loop over currents to print
199  XMLArrayWriter xml_cur(xml,vector_current.size2());
200  push(xml_cur, "Vector_currents");
201 
202  for (int current_value=0; current_value < vector_current.size2(); ++current_value)
203  {
204  push(xml_cur); // next array element
205 
206  write(xml_cur, "current_value", current_value);
207  write(xml_cur, "vector_current", vector_current[current_value]);
208 
209  pop(xml_cur);
210  }
211 
212  pop(xml_cur);
213  }
214 
215 
216  //
217  // Axial currents
218  //
219  {
220  multi2d<Real> axial_current(2, length);
221 
222  /* Construct the 2 axial-current to pion correlators */
223  int n = G5 ^ (1 << j_decay);
224 
225  /* The local axial current first */
226  psi_sq = real(trace(adj(anti_quark_prop) * Gamma(n) * quark_prop_1 * Gamma(G5)));
227 
228  /* The nonlocal axial current next */
229  chi_sq = real(trace(adj(anti_quark_prop) * Gamma(n) *
230  u[j_decay] * shift(quark_prop_1, FORWARD, j_decay) * Gamma(G5)));
231 
232  // The () forces precedence
233  chi_sq -= real(trace(adj(Gamma(n) * (u[j_decay] * shift(anti_quark_prop, FORWARD, j_decay)) *
234  Gamma(G5)) * quark_prop_1));
235 
236  /* Do a slice-wise sum. */
237 
238  Real dummy1 = Real(-1) / Real(2);
239 
240  /* The local axial current first */
241  hsum = sumMulti(psi_sq, phases.getSet());
242 
243  for(int t = 0; t < length; ++t)
244  {
245  int t_eff = (t - t0 + length) % length;
246  axial_current[1][t_eff] = - Real(hsum[t]);
247  }
248 
249  /* The nonlocal axial current next */
250  hsum = sumMulti(chi_sq, phases.getSet());
251 
252  for(int t = 0; t < length; ++t)
253  {
254  int t_eff = (t - t0 + length) % length;
255  axial_current[0][t_eff] = dummy1 * Real(hsum[t]);
256  }
257 
258 
259  // Loop over currents to print
260  XMLArrayWriter xml_cur(xml,axial_current.size2());
261  push(xml_cur, "Axial_currents");
262 
263  for (int current_value=0; current_value < axial_current.size2(); ++current_value)
264  {
265  push(xml_cur); // next array element
266 
267  write(xml_cur, "current_value", current_value);
268  write(xml_cur, "axial_current", axial_current[current_value]);
269 
270  pop(xml_cur);
271  }
272 
273  pop(xml_cur);
274  }
275 
276 
277  pop(xml); // xml_group
278 
279  END_CODE();
280 }
281 
282 } // end namespace Chroma
Primary include file for CHROMA library code.
Fourier transform phase factor support.
Definition: sftmom.h:35
int numSubsets() const
Number of subsets - length in decay direction.
Definition: sftmom.h:63
int getDir() const
Decay direction.
Definition: sftmom.h:69
const Set & getSet() const
The set to be used in sumMulti.
Definition: sftmom.h:57
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
void curcor2(const multi1d< LatticeColorMatrix > &u, const LatticePropagator &quark_prop_1, const LatticePropagator &quark_prop_2, const SftMom &phases, int t0, int no_vec_cur, XMLWriter &xml, const std::string &xml_group)
Construct current correlators.
Definition: curcor2_w.cc:44
unsigned n
Definition: ldumul_w.cc:36
int j_decay
Definition: meslate.cc:22
int t
Definition: meslate.cc:37
Nd
Definition: meslate.cc:74
Meson 2-pt functions.
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
push(xml_out,"Condensates")
pop(xml_out)
START_CODE()
int k
Definition: invbicg.cc:119
::std::string string
Definition: gtest.h:1979
#define FORWARD
Definition: primitives.h:82
Fourier transform phase factor support.