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