Bridge++  Ver. 2.0.4
topologicalCharge.cpp
Go to the documentation of this file.
1 
14 #include "topologicalCharge.h"
15 
16 const std::string TopologicalCharge::class_name = "TopologicalCharge";
17 
18 //====================================================================
20 {
21  m_filename_output = params.get_string("filename_output");
22  if (m_filename_output.empty()) {
23  m_filename_output = "stdout";
24  }
25 
26  const string str_vlevel = params.get_string("verbose_level");
27  m_vl = vout.set_verbose_level(str_vlevel);
28 
29  //- fetch and check input parameters
30  double c_plaq, c_rect;
31  int max_mom;
32 
33  int err = 0;
34  err += params.fetch_double("c_plaq", c_plaq);
35  err += params.fetch_double("c_rect", c_rect);
36  err += params.fetch_int("max_momentum", max_mom);
37 
38  if (err) {
39  vout.crucial(m_vl, "Error at %s: input parameter not found.\n", class_name.c_str());
40  exit(EXIT_FAILURE);
41  }
42 
43 
44  set_parameters(c_plaq, c_rect, max_mom);
45 }
46 
47 
48 //====================================================================
50 {
51  params.set_double("c_plaq", m_c_plaq);
52  params.set_double("c_rect", m_c_rect);
53  params.set_int("max_momentum", m_max_mom);
54 
55  params.set_string("filename_output", m_filename_output);
56  params.set_string("verbose_level", vout.get_verbose_level(m_vl));
57 }
58 
59 
60 //====================================================================
61 void TopologicalCharge::set_parameters(const double c_plaq, const double c_rect, const int max_mom)
62 {
63  //- print input parameters
64  vout.general(m_vl, "Topological Charge measurement:\n");
65  vout.general(m_vl, " c_plaq = %12.6f\n", c_plaq);
66  vout.general(m_vl, " c_rect = %12.6f\n", c_rect);
67  vout.general(m_vl, " max_momentum = %d\n", max_mom);
68 
69  //- range check
70  // NB. beta,c_plaq,c_rect == 0 is allowed.
71 
72  //- store values
73  m_c_plaq = c_plaq;
74  m_c_rect = c_rect;
75  m_max_mom = max_mom;
76 }
77 
78 
79 //====================================================================
81 {
82  const int Ndim = CommonParameters::Ndim();
83 
84  static const double eps = CommonParameters::epsilon_criterion();
85  static const double PI = 4.0 * atan(1.0);
86  static const double PI2 = PI * PI;
87 
88 
89  //--- 1x1 part ---
90  double Q_1x1 = 0.0;
91 
92  {
93  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
94  std::vector<Field_G> Fmunu_1x1(6);
95 
96  int i_munu = 0;
97  for (int mu = 0; mu < Ndim; ++mu) {
98  for (int nu = mu + 1; nu < Ndim; ++nu) {
99  m_field_strength.construct_Fmunu_1x1_traceless(Fmunu_1x1[i_munu], mu, nu, U);
100 
101  ++i_munu;
102  }
103  }
104 
105  // (mu,nu, rho,sigma) = (1,2, 3,4)
106  Q_1x1 += m_field_strength.contract(Fmunu_1x1[0], Fmunu_1x1[5]);
107 
108  // (mu,nu, rho,sigma) = (1,3, 2,4)
109  Q_1x1 -= m_field_strength.contract(Fmunu_1x1[1], Fmunu_1x1[4]);
110 
111  // (mu,nu, rho,sigma) = (1,4, 2,3)
112  Q_1x1 += m_field_strength.contract(Fmunu_1x1[2], Fmunu_1x1[3]);
113 
114  // #degeneracy of (mu,nu, rho,sigma) is 8
115  Q_1x1 *= 8.0;
116 
117  // overall factor
118  Q_1x1 /= (32.0 * PI2);
119  }
120  //----------------
121 
122 
123  //--- 1x2 part ---
124  double Q_1x2 = 0.0;
125 
126  {
127  // NB. skip this part, if m_c_rect = 0.0
128  if (fabs(m_c_rect) > eps) {
129  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
130  std::vector<Field_G> Fmunu_1x2(6);
131 
132  int i_munu = 0;
133  for (int mu = 0; mu < Ndim; ++mu) {
134  for (int nu = mu + 1; nu < Ndim; ++nu) {
135  m_field_strength.construct_Fmunu_1x2_traceless(Fmunu_1x2[i_munu], mu, nu, U);
136 
137  ++i_munu;
138  }
139  }
140 
141  Q_1x2 += m_field_strength.contract(Fmunu_1x2[0], Fmunu_1x2[5]);
142  Q_1x2 -= m_field_strength.contract(Fmunu_1x2[1], Fmunu_1x2[4]);
143  Q_1x2 += m_field_strength.contract(Fmunu_1x2[2], Fmunu_1x2[3]);
144  Q_1x2 *= 8.0;
145  // extra factor "2" for 1x2
146  Q_1x2 *= 2.0;
147  Q_1x2 /= (32.0 * PI2);
148  }
149  }
150  //----------------
151 
152 
153  const double Q_topo = m_c_plaq * Q_1x1 + m_c_rect * Q_1x2;
154 
155 
156  //- output
157  const bool use_outputfile = (m_filename_output != "stdout");
158  if (use_outputfile) {
159  int rank_io = 0;
160  vout.init(m_filename_output, rank_io, std::ios::app);
161  }
162 
163  vout.general(m_vl, " Q_1x1 = %20.16e\n", Q_1x1);
164  if (fabs(m_c_rect) > eps) {
165  vout.general(m_vl, " Q_1x2 = %20.16e\n", Q_1x2);
166  }
167  vout.general(m_vl, " Q_topo = %20.16e\n", Q_topo);
168 
169  if (use_outputfile) {
170  vout.unset();
171  }
172 
173  return Q_topo;
174 }
175 
176 
177 //====================================================================
179 {
180  assert(m_flag_field_set == true);
181 
182  static const double PI = 4.0 * atan(1.0);
183  static const double PI2 = PI * PI;
184  // #degeneracy of (mu,nu, rho,sigma) is 8
185  static const double factor1 = 8.0 / (32.0 * PI2);
186  // extra factor "2" for 1x2
187  static const double factor2 = 16.0 / (32.0 * PI2);
188 
189  //--- Field strength by one plaquette ---
190  double Q_plaq = 0.0;
191 
195  Q_plaq *= factor1;
196 
197  //--- 1x1 part ---
198  double Q_1x1 = 0.0;
199 
200  // (mu,nu, rho,sigma) = (1,2, 3,4)
202  // (mu,nu, rho,sigma) = (1,3, 2,4)
204  // (mu,nu, rho,sigma) = (1,4, 2,3)
206  Q_1x1 *= factor1;
207  //----------------
208 
209  //--- 1x2 part ---
210  double Q_1x2 = 0.0;
211 
215  Q_1x2 *= factor2;
216  //----------------
217 
218  m_c_rect = -1.0 / 12.0;
219  m_c_plaq = 1.0 - 8 * m_c_rect;
220  const double Q_imp = m_c_plaq * Q_1x1 + m_c_rect * Q_1x2;
221 
222  m_c_rect = 1.0 / 8.0;
223  const double Q_rect = m_c_rect * Q_1x2;
224 
225  //- output
226  const bool use_outputfile = (m_filename_output != "stdout");
227  if (use_outputfile) {
228  int rank_io = 0;
229  vout.init(m_filename_output, rank_io, std::ios::app);
230  }
231 
232  vout.general(m_vl, " Q_clover_plaq = %.8f %.16e\n", tt, Q_1x1);
233  vout.general(m_vl, " Q_clover_rect = %.8f %.16e\n", tt, Q_rect);
234  vout.general(m_vl, " Q_clover_imp = %.8f %.16e\n", tt, Q_imp);
235  vout.general(m_vl, " Q_plaq = %.8f %.16e\n", tt, Q_plaq);
236 
237  if (use_outputfile) {
238  vout.unset();
239  }
240 }
241 
242 
243 //====================================================================
245 {
246  assert(m_flag_field_set == true);
247 
248  static const double PI = 4.0 * atan(1.0);
249  static const double PI2 = PI * PI;
250  static const double factor1 = 8.0 / (32.0 * PI2);
251  static const double factor2 = 16.0 / (32.0 * PI2);
252 
253  static const double l_c_rect = 1.0 / 8.0;
254  m_c_rect = -1.0 / 12.0;
255  m_c_plaq = 1.0 - 8 * m_c_rect;
256 
257  const int Lt = CommonParameters::Lt();
258 
259  std::vector<double> corr_scr(Lt);
260 
261  //--- Field strength by one plaquette ---
262  std::vector<double> corr_plaq(Lt, 0.0);
263 
265  for (int t = 0; t < Lt; ++t) {
266  corr_plaq[t] += corr_scr[t];
267  }
269  for (int t = 0; t < Lt; ++t) {
270  corr_plaq[t] -= corr_scr[t];
271  }
273  for (int t = 0; t < Lt; ++t) {
274  corr_plaq[t] += corr_scr[t];
275  }
276  // double Q_plaq = 0.0;
277  for (int t = 0; t < Lt; ++t) {
278  corr_plaq[t] *= factor1;
279  // Q_plaq += corr_plaq[t];
280  }
281 
282  //--- 1x1 part ---
283  std::vector<double> corr_1x1(Lt, 0.0);
284 
285  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
286  // (mu,nu, rho,sigma) = (1,2, 3,4)
288  for (int t = 0; t < Lt; ++t) {
289  corr_1x1[t] += corr_scr[t];
290  }
291  // (mu,nu, rho,sigma) = (1,3, 2,4)
293  for (int t = 0; t < Lt; ++t) {
294  corr_1x1[t] -= corr_scr[t];
295  }
296  // (mu,nu, rho,sigma) = (1,4, 2,3)
298  for (int t = 0; t < Lt; ++t) {
299  corr_1x1[t] += corr_scr[t];
300  }
301  // double Q_1x1 = 0.0;
302  for (int t = 0; t < Lt; ++t) {
303  corr_1x1[t] *= factor1;
304  // Q_1x1 += corr_1x1[t];
305  }
306 
307  //--- 1x2 part ---
308  std::vector<double> corr_1x2(Lt, 0.0);
309 
310  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
312  for (int t = 0; t < Lt; ++t) {
313  corr_1x2[t] += corr_scr[t];
314  }
316  for (int t = 0; t < Lt; ++t) {
317  corr_1x2[t] -= corr_scr[t];
318  }
320  for (int t = 0; t < Lt; ++t) {
321  corr_1x2[t] += corr_scr[t];
322  }
323  // double Q_1x2 = 0.0;
324  for (int t = 0; t < Lt; ++t) {
325  corr_1x2[t] *= factor2;
326  // Q_1x2 += corr_1x2[t];
327  }
328  //----------------
329 
330  //- output
331  const bool use_outputfile = (m_filename_output != "stdout");
332  if (use_outputfile) {
333  int rank_io = 0;
334  vout.init(m_filename_output, rank_io, std::ios::app);
335  }
336 
337  for (int t = 0; t < Lt; ++t) {
338  vout.general(m_vl, " Q_clover_plaq_t = %.8f %d %.16e\n", tt, t, corr_1x1[t]);
339 
340  double scr = m_c_plaq * corr_1x1[t] + m_c_rect * corr_1x2[t];
341  vout.general(m_vl, " Q_clover_imp_t = %.8f %d %.16e\n", tt, t, scr);
342 
343  scr = l_c_rect * corr_1x2[t];
344  vout.general(m_vl, " Q_clover_rect_t = %.8f %d %.16e\n", tt, t, scr);
345  vout.general(m_vl, " Q_plaq_t = %.8f %d %.16e\n", tt, t, corr_plaq[t]);
346  }
347 
348  /*
349  vout.general(m_vl, " Q_clover_plaq_sumt = %.8f %.16e\n", tt, Q_1x1);
350  const double Q_rect = l_c_rect * Q_1x2;
351  vout.general(m_vl, " Q_clover_rect_sumt = %.8f %.16e\n", tt, Q_rect);
352  const double Q_imp = m_c_plaq * Q_1x1 + m_c_rect * Q_1x2;
353  vout.general(m_vl, " Q_clover_imp_sumt = %.8f %.16e\n", tt, Q_imp);
354  vout.general(m_vl, " Q_plaq_sumt = %.8f %.16e\n", tt, Q_plaq);
355  */
356  if (use_outputfile) {
357  vout.unset();
358  }
359 }
360 
361 
362 //====================================================================
364 {
365  assert(m_flag_field_set == 1);
366  static const double PI = 4.0 * atan(1.0);
367  static const double PI2 = PI * PI;
368  static const double factor1 = 8.0 / (32.0 * PI2);
369  static const double factor2 = 16.0 / (32.0 * PI2);
370  static const double l_c_rect = 1.0 / 8.0;
371  m_c_rect = -1.0 / 12.0;
372  m_c_plaq = 1.0 - 8 * m_c_rect;
373 
374  const int Lt = CommonParameters::Lt();
375 
376  const int Np = (2 * m_max_mom + 1);
377  vector<int> source_position(4, 0);
378  vector<int> momentum_sink(3);
379 
380  for (int ipx = 0; ipx < m_max_mom + 1; ipx++) {
381  for (int ipy = 0; ipy < Np; ipy++) {
382  for (int ipz = 0; ipz < Np; ipz++) {
383  momentum_sink[0] = ipx;
384  momentum_sink[1] = ipy - m_max_mom;
385  momentum_sink[2] = ipz - m_max_mom;
386 
387  std::vector<double> corr_plaq(Lt, 0);
388  std::vector<double> corr_1x1(Lt, 0);
389  std::vector<double> corr_1x2(Lt, 0);
390  std::vector<double> corr_scr(Lt);
391 
392  //--- Field strength by one plaquette ---
393  m_field_strength.contract_at_t(corr_scr, m_Fmunu_plaq[0], m_Fmunu_plaq[5], momentum_sink, source_position);
394  for (int t = 0; t < Lt; ++t) {
395  corr_plaq[t] += corr_scr[t];
396  }
397  m_field_strength.contract_at_t(corr_scr, m_Fmunu_plaq[1], m_Fmunu_plaq[4], momentum_sink, source_position);
398  for (int t = 0; t < Lt; ++t) {
399  corr_plaq[t] -= corr_scr[t];
400  }
401  m_field_strength.contract_at_t(corr_scr, m_Fmunu_plaq[2], m_Fmunu_plaq[3], momentum_sink, source_position);
402  for (int t = 0; t < Lt; ++t) {
403  corr_plaq[t] += corr_scr[t];
404  }
405  // double Q_plaq = 0.0;
406  for (int t = 0; t < Lt; ++t) {
407  corr_plaq[t] *= factor1;
408  // Q_plaq += corr_plaq[t];
409  }
410 
411  //--- 1x1 part ---
412  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
413  // (mu,nu, rho,sigma) = (1,2, 3,4)
414  m_field_strength.contract_at_t(corr_scr, m_Fmunu_1x1[0], m_Fmunu_1x1[5], momentum_sink, source_position);
415  for (int t = 0; t < Lt; ++t) {
416  corr_1x1[t] += corr_scr[t];
417  }
418  // (mu,nu, rho,sigma) = (1,3, 2,4)
419  m_field_strength.contract_at_t(corr_scr, m_Fmunu_1x1[1], m_Fmunu_1x1[4], momentum_sink, source_position);
420  for (int t = 0; t < Lt; ++t) {
421  corr_1x1[t] -= corr_scr[t];
422  }
423  // (mu,nu, rho,sigma) = (1,4, 2,3)
424  m_field_strength.contract_at_t(corr_scr, m_Fmunu_1x1[2], m_Fmunu_1x1[3], momentum_sink, source_position);
425  for (int t = 0; t < Lt; ++t) {
426  corr_1x1[t] += corr_scr[t];
427  }
428  // double Q_1x1 = 0.0;
429  for (int t = 0; t < Lt; ++t) {
430  corr_1x1[t] *= factor1;
431  // Q_1x1 += corr_1x1[t];
432  }
433 
434  //--- 1x2 part ---
435  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
436  m_field_strength.contract_at_t(corr_scr, m_Fmunu_1x2[0], m_Fmunu_1x2[5], momentum_sink, source_position);
437  for (int t = 0; t < Lt; ++t) {
438  corr_1x2[t] += corr_scr[t];
439  }
440  m_field_strength.contract_at_t(corr_scr, m_Fmunu_1x2[1], m_Fmunu_1x2[4], momentum_sink, source_position);
441  for (int t = 0; t < Lt; ++t) {
442  corr_1x2[t] -= corr_scr[t];
443  }
444  m_field_strength.contract_at_t(corr_scr, m_Fmunu_1x2[2], m_Fmunu_1x2[3], momentum_sink, source_position);
445  for (int t = 0; t < Lt; ++t) {
446  corr_1x2[t] += corr_scr[t];
447  }
448  // double Q_1x2 = 0.0;
449  for (int t = 0; t < Lt; ++t) {
450  corr_1x2[t] *= factor2;
451  // Q_1x2 += corr_1x2[t];
452  }
453  //----------------
454 
455  //- output
456  const bool use_outputfile = (m_filename_output != "stdout");
457  if (use_outputfile) {
458  int rank_io = 0;
459  vout.init(m_filename_output, rank_io, std::ios::app);
460  }
461 
462  for (int t = 0; t < Lt; ++t) {
463  vout.general(m_vl, " Q_clover_plaq_t_FT = %d %d %d %.8f %d %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, t, corr_1x1[t]);
464  double scr = m_c_plaq * corr_1x1[t] + m_c_rect * corr_1x2[t];
465  vout.general(m_vl, " Q_clover_imp_t_FT = %d %d %d %.8f %d %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, t, scr);
466  scr = l_c_rect * corr_1x2[t];
467  vout.general(m_vl, " Q_clover_rect_t_FT = %d %d %d %.8f %d %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, t, scr);
468  vout.general(m_vl, " Q_plaq_t_FT = %d %d %d %.8f %d %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, t, corr_plaq[t]);
469  }
470 
471  /*
472  vout.general(m_vl, " Q_clover_plaq_sumt_FT = %d %d %d %.8f %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, Q_1x1);
473  double Q_rect = l_c_rect * Q_1x2;
474  vout.general(m_vl, " Q_clover_rect_sumt_FT = %d %d %d %.8f %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, Q_rect);
475  double Q_imp = m_c_plaq * Q_1x1 + m_c_rect * Q_1x2;
476  vout.general(m_vl, " Q_clover_imp_sumt_FT = %d %d %d %.8f %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, Q_imp);
477  vout.general(m_vl, " Q_plaq_sumt = %d %d %d %.8f %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, Q_plaq);
478  */
479 
480  if (use_outputfile) {
481  vout.unset();
482  }
483  }
484  }
485  }
486 }
487 
488 
489 //====================================================================
491 {
492  assert(m_flag_field_set == true);
493 
494  static const double PI = 4.0 * atan(1.0);
495  static const double PI2 = PI * PI;
496  static const double factor1 = 8.0 / (32.0 * PI2);
497  static const double factor2 = 16.0 / (32.0 * PI2);
498 
499  static const double l_c_rect = 1.0 / 8.0;
500  m_c_rect = -1.0 / 12.0;
501  m_c_plaq = 1.0 - 8 * m_c_rect;
502 
503  const int Lx = CommonParameters::Lx();
504 
505  std::vector<double> corr_scr(Lx);
506 
507  //--- Field strength by one plaquette ---
508  std::vector<double> corr_plaq(Lx, 0.0);
509 
511  for (int x = 0; x < Lx; ++x) {
512  corr_plaq[x] += corr_scr[x];
513  }
515  for (int x = 0; x < Lx; ++x) {
516  corr_plaq[x] -= corr_scr[x];
517  }
519  for (int x = 0; x < Lx; ++x) {
520  corr_plaq[x] += corr_scr[x];
521  }
522  // double Q_plaq = 0.0;
523  for (int x = 0; x < Lx; ++x) {
524  corr_plaq[x] *= factor1;
525  // Q_plaq += corr_plaq[x];
526  }
527 
528  //--- 1x1 part ---
529  std::vector<double> corr_1x1(Lx, 0.0);
530 
531  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
532  // (mu,nu, rho,sigma) = (1,2, 3,4)
534  for (int x = 0; x < Lx; ++x) {
535  corr_1x1[x] += corr_scr[x];
536  }
537  // (mu,nu, rho,sigma) = (1,3, 2,4)
539  for (int x = 0; x < Lx; ++x) {
540  corr_1x1[x] -= corr_scr[x];
541  }
542  // (mu,nu, rho,sigma) = (1,4, 2,3)
544  for (int x = 0; x < Lx; ++x) {
545  corr_1x1[x] += corr_scr[x];
546  }
547  // double Q_1x1 = 0.0;
548  for (int x = 0; x < Lx; ++x) {
549  corr_1x1[x] *= factor1;
550  // Q_1x1 += corr_1x1[x];
551  }
552 
553  //--- 1x2 part ---
554  std::vector<double> corr_1x2(Lx, 0.0);
555 
556  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
558  for (int x = 0; x < Lx; ++x) {
559  corr_1x2[x] += corr_scr[x];
560  }
562  for (int x = 0; x < Lx; ++x) {
563  corr_1x2[x] -= corr_scr[x];
564  }
566  for (int x = 0; x < Lx; ++x) {
567  corr_1x2[x] += corr_scr[x];
568  }
569  // double Q_1x2 = 0.0;
570  for (int x = 0; x < Lx; ++x) {
571  corr_1x2[x] *= factor2;
572  // Q_1x2 += corr_1x2[x];
573  }
574  //----------------
575 
576  //- output
577  const bool use_outputfile = (m_filename_output != "stdout");
578  if (use_outputfile) {
579  int rank_io = 0;
580  vout.init(m_filename_output, rank_io, std::ios::app);
581  }
582 
583  for (int x = 0; x < Lx; ++x) {
584  vout.general(m_vl, " Q_clover_plaq_x = %.8f %d %.16e\n", tt, x, corr_1x1[x]);
585 
586  double scr = m_c_plaq * corr_1x1[x] + m_c_rect * corr_1x2[x];
587  vout.general(m_vl, " Q_clover_imp_x = %.8f %d %.16e\n", tt, x, scr);
588 
589  scr = l_c_rect * corr_1x2[x];
590  vout.general(m_vl, " Q_clover_rect_x = %.8f %d %.16e\n", tt, x, scr);
591  vout.general(m_vl, " Q_plaq_x = %.8f %d %.16e\n", tt, x, corr_plaq[x]);
592  }
593 
594  /*
595  vout.general(m_vl, " Q_clover_plaq_sumx = %.8f %.16e\n", tt, Q_1x1);
596  const double Q_rect = l_c_rect * Q_1x2;
597  vout.general(m_vl, " Q_clover_rect_sumx = %.8f %.16e\n", tt, Q_rect);
598  const double Q_imp = m_c_plaq * Q_1x1 + m_c_rect * Q_1x2;
599  vout.general(m_vl, " Q_clover_imp_sumx = %.8f %.16e\n", tt, Q_imp);
600  vout.general(m_vl, " Q_plaq_sumx = %.8f %.16e\n", tt, Q_plaq);
601  */
602 
603  if (use_outputfile) {
604  vout.unset();
605  }
606 }
607 
608 
609 //====================================================================
611 {
612  assert(m_flag_field_set == 1);
613  static const double PI = 4.0 * atan(1.0);
614  static const double PI2 = PI * PI;
615  static const double factor1 = 8.0 / (32.0 * PI2);
616  static const double factor2 = 16.0 / (32.0 * PI2);
617  static const double l_c_rect = 1.0 / 8.0;
618  m_c_rect = -1.0 / 12.0;
619  m_c_plaq = 1.0 - 8 * m_c_rect;
620 
621  const int Lx = CommonParameters::Lx();
622 
623  const int Np = (2 * m_max_mom + 1);
624  vector<int> source_position(4, 0);
625  vector<int> momentum_sink(3);
626 
627  for (int ipx = 0; ipx < m_max_mom + 1; ipx++) {
628  for (int ipy = 0; ipy < Np; ipy++) {
629  for (int ipz = 0; ipz < Np; ipz++) {
630  momentum_sink[0] = ipx;
631  momentum_sink[1] = ipy - m_max_mom;
632  momentum_sink[2] = ipz - m_max_mom;
633 
634  std::vector<double> corr_plaq(Lx, 0);
635  std::vector<double> corr_1x1(Lx, 0);
636  std::vector<double> corr_1x2(Lx, 0);
637  std::vector<double> corr_scr(Lx);
638 
639  //--- Field strength by one plaquette ---
640  m_field_strength.contract_at_x(corr_scr, m_Fmunu_plaq[0], m_Fmunu_plaq[5], momentum_sink, source_position);
641  for (int t = 0; t < Lx; ++t) {
642  corr_plaq[t] += corr_scr[t];
643  }
644  m_field_strength.contract_at_x(corr_scr, m_Fmunu_plaq[1], m_Fmunu_plaq[4], momentum_sink, source_position);
645  for (int t = 0; t < Lx; ++t) {
646  corr_plaq[t] -= corr_scr[t];
647  }
648  m_field_strength.contract_at_x(corr_scr, m_Fmunu_plaq[2], m_Fmunu_plaq[3], momentum_sink, source_position);
649  for (int t = 0; t < Lx; ++t) {
650  corr_plaq[t] += corr_scr[t];
651  }
652  // double Q_plaq = 0.0;
653  for (int t = 0; t < Lx; ++t) {
654  corr_plaq[t] *= factor1;
655  // Q_plaq += corr_plaq[t];
656  }
657 
658  //--- 1x1 part ---
659  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
660  // (mu,nu, rho,sigma) = (1,2, 3,4)
661  m_field_strength.contract_at_x(corr_scr, m_Fmunu_1x1[0], m_Fmunu_1x1[5], momentum_sink, source_position);
662  for (int t = 0; t < Lx; ++t) {
663  corr_1x1[t] += corr_scr[t];
664  }
665  // (mu,nu, rho,sigma) = (1,3, 2,4)
666  m_field_strength.contract_at_x(corr_scr, m_Fmunu_1x1[1], m_Fmunu_1x1[4], momentum_sink, source_position);
667  for (int t = 0; t < Lx; ++t) {
668  corr_1x1[t] -= corr_scr[t];
669  }
670  // (mu,nu, rho,sigma) = (1,4, 2,3)
671  m_field_strength.contract_at_x(corr_scr, m_Fmunu_1x1[2], m_Fmunu_1x1[3], momentum_sink, source_position);
672  for (int t = 0; t < Lx; ++t) {
673  corr_1x1[t] += corr_scr[t];
674  }
675  // double Q_1x1 = 0.0;
676  for (int t = 0; t < Lx; ++t) {
677  corr_1x1[t] *= factor1;
678  // Q_1x1 += corr_1x1[t];
679  }
680 
681  //--- 1x2 part ---
682  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
683  m_field_strength.contract_at_x(corr_scr, m_Fmunu_1x2[0], m_Fmunu_1x2[5], momentum_sink, source_position);
684  for (int t = 0; t < Lx; ++t) {
685  corr_1x2[t] += corr_scr[t];
686  }
687  m_field_strength.contract_at_x(corr_scr, m_Fmunu_1x2[1], m_Fmunu_1x2[4], momentum_sink, source_position);
688  for (int t = 0; t < Lx; ++t) {
689  corr_1x2[t] -= corr_scr[t];
690  }
691  m_field_strength.contract_at_x(corr_scr, m_Fmunu_1x2[2], m_Fmunu_1x2[3], momentum_sink, source_position);
692  for (int t = 0; t < Lx; ++t) {
693  corr_1x2[t] += corr_scr[t];
694  }
695  // double Q_1x2 = 0.0;
696  for (int t = 0; t < Lx; ++t) {
697  corr_1x2[t] *= factor2;
698  // Q_1x2 += corr_1x2[t];
699  }
700  //----------------
701 
702  //- output
703  const bool use_outputfile = (m_filename_output != "stdout");
704  if (use_outputfile) {
705  int rank_io = 0;
706  vout.init(m_filename_output, rank_io, std::ios::app);
707  }
708 
709  for (int t = 0; t < Lx; ++t) {
710  vout.general(m_vl, " Q_clover_plaq_x_FT = %d %d %d %.8f %d %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, t, corr_1x1[t]);
711  double scr = m_c_plaq * corr_1x1[t] + m_c_rect * corr_1x2[t];
712  vout.general(m_vl, " Q_clover_imp_x_FT = %d %d %d %.8f %d %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, t, scr);
713  scr = l_c_rect * corr_1x2[t];
714  vout.general(m_vl, " Q_clover_rect_x_FT = %d %d %d %.8f %d %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, t, scr);
715  vout.general(m_vl, " Q_plaq_x_FT = %d %d %d %.8f %d %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, t, corr_plaq[t]);
716  }
717 
718  /*
719  vout.general(m_vl, " Q_clover_plaq_sumx_FT = %d %d %d %.8f %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, Q_1x1);
720  double Q_rect = l_c_rect * Q_1x2;
721  vout.general(m_vl, " Q_clover_rect_sumx_FT = %d %d %d %.8f %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, Q_rect);
722  double Q_imp = m_c_plaq * Q_1x1 + m_c_rect * Q_1x2;
723  vout.general(m_vl, " Q_clover_imp_sumx_FT = %d %d %d %.8f %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, Q_imp);
724  vout.general(m_vl, " Q_plaq_sumx = %d %d %d %.8f %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, Q_plaq);
725  */
726 
727  if (use_outputfile) {
728  vout.unset();
729  }
730  }
731  }
732  }
733 }
734 
735 
736 //====================================================================
738 {
739  assert(m_flag_field_set == true);
740 
741  static const double PI = 4.0 * atan(1.0);
742  static const double PI2 = PI * PI;
743  static const double factor1 = 8.0 / (32.0 * PI2);
744  static const double factor2 = 16.0 / (32.0 * PI2);
745 
746  static const double l_c_rect = 1.0 / 8.0;
747  m_c_rect = -1.0 / 12.0;
748  m_c_plaq = 1.0 - 8 * m_c_rect;
749 
750  const int Ly = CommonParameters::Ly();
751 
752  std::vector<double> corr_scr(Ly);
753 
754  //--- Field strength by one plaquette ---
755  std::vector<double> corr_plaq(Ly, 0.0);
756 
758  for (int y = 0; y < Ly; ++y) {
759  corr_plaq[y] += corr_scr[y];
760  }
762  for (int y = 0; y < Ly; ++y) {
763  corr_plaq[y] -= corr_scr[y];
764  }
766  for (int y = 0; y < Ly; ++y) {
767  corr_plaq[y] += corr_scr[y];
768  }
769  // double Q_plaq = 0.0;
770  for (int y = 0; y < Ly; ++y) {
771  corr_plaq[y] *= factor1;
772  // Q_plaq += corr_plaq[y];
773  }
774 
775  //--- 1x1 part ---
776  std::vector<double> corr_1x1(Ly, 0.0);
777 
778  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
779  // (mu,nu, rho,sigma) = (1,2, 3,4)
781  for (int y = 0; y < Ly; ++y) {
782  corr_1x1[y] += corr_scr[y];
783  }
784  // (mu,nu, rho,sigma) = (1,3, 2,4)
786  for (int y = 0; y < Ly; ++y) {
787  corr_1x1[y] -= corr_scr[y];
788  }
789  // (mu,nu, rho,sigma) = (1,4, 2,3)
791  for (int y = 0; y < Ly; ++y) {
792  corr_1x1[y] += corr_scr[y];
793  }
794  // double Q_1x1 = 0.0;
795  for (int y = 0; y < Ly; ++y) {
796  corr_1x1[y] *= factor1;
797  // Q_1x1 += corr_1x1[y];
798  }
799 
800  //--- 1x2 part ---
801  std::vector<double> corr_1x2(Ly, 0.0);
802 
803  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
805  for (int y = 0; y < Ly; ++y) {
806  corr_1x2[y] += corr_scr[y];
807  }
809  for (int y = 0; y < Ly; ++y) {
810  corr_1x2[y] -= corr_scr[y];
811  }
813  for (int y = 0; y < Ly; ++y) {
814  corr_1x2[y] += corr_scr[y];
815  }
816  // double Q_1x2 = 0.0;
817  for (int y = 0; y < Ly; ++y) {
818  corr_1x2[y] *= factor2;
819  // Q_1x2 += corr_1x2[y];
820  }
821  //----------------
822 
823  //- output
824  const bool use_outputfile = (m_filename_output != "stdout");
825  if (use_outputfile) {
826  int rank_io = 0;
827  vout.init(m_filename_output, rank_io, std::ios::app);
828  }
829 
830  for (int y = 0; y < Ly; ++y) {
831  vout.general(m_vl, " Q_clover_plaq_y = %.8f %d %.16e\n", tt, y, corr_1x1[y]);
832 
833  double scr = m_c_plaq * corr_1x1[y] + m_c_rect * corr_1x2[y];
834  vout.general(m_vl, " Q_clover_imp_y = %.8f %d %.16e\n", tt, y, scr);
835 
836  scr = l_c_rect * corr_1x2[y];
837  vout.general(m_vl, " Q_clover_rect_y = %.8f %d %.16e\n", tt, y, scr);
838  vout.general(m_vl, " Q_plaq_y = %.8f %d %.16e\n", tt, y, corr_plaq[y]);
839  }
840 
841  /*
842  vout.general(m_vl, " Q_clover_plaq_sumy = %.8f %.16e\n", tt, Q_1x1);
843  const double Q_rect = l_c_rect * Q_1x2;
844  vout.general(m_vl, " Q_clover_rect_sumy = %.8f %.16e\n", tt, Q_rect);
845  const double Q_imp = m_c_plaq * Q_1x1 + m_c_rect * Q_1x2;
846  vout.general(m_vl, " Q_clover_imp_sumy = %.8f %.16e\n", tt, Q_imp);
847  vout.general(m_vl, " Q_plaq_sumy = %.8f %.16e\n", tt, Q_plaq);
848  */
849 
850  if (use_outputfile) {
851  vout.unset();
852  }
853 }
854 
855 
856 //====================================================================
858 {
859  assert(m_flag_field_set == 1);
860  static const double PI = 4.0 * atan(1.0);
861  static const double PI2 = PI * PI;
862  static const double factor1 = 8.0 / (32.0 * PI2);
863  static const double factor2 = 16.0 / (32.0 * PI2);
864  static const double l_c_rect = 1.0 / 8.0;
865  m_c_rect = -1.0 / 12.0;
866  m_c_plaq = 1.0 - 8 * m_c_rect;
867 
868  const int Ly = CommonParameters::Ly();
869 
870  const int Np = (2 * m_max_mom + 1);
871  vector<int> source_position(4, 0);
872  vector<int> momentum_sink(3);
873 
874  for (int ipx = 0; ipx < m_max_mom + 1; ipx++) {
875  for (int ipy = 0; ipy < Np; ipy++) {
876  for (int ipz = 0; ipz < Np; ipz++) {
877  momentum_sink[0] = ipx;
878  momentum_sink[1] = ipy - m_max_mom;
879  momentum_sink[2] = ipz - m_max_mom;
880 
881  std::vector<double> corr_plaq(Ly, 0);
882  std::vector<double> corr_1x1(Ly, 0);
883  std::vector<double> corr_1x2(Ly, 0);
884  std::vector<double> corr_scr(Ly);
885 
886  //--- Field strength by one plaquette ---
887  m_field_strength.contract_at_y(corr_scr, m_Fmunu_plaq[0], m_Fmunu_plaq[5], momentum_sink, source_position);
888  for (int t = 0; t < Ly; ++t) {
889  corr_plaq[t] += corr_scr[t];
890  }
891  m_field_strength.contract_at_y(corr_scr, m_Fmunu_plaq[1], m_Fmunu_plaq[4], momentum_sink, source_position);
892  for (int t = 0; t < Ly; ++t) {
893  corr_plaq[t] -= corr_scr[t];
894  }
895  m_field_strength.contract_at_y(corr_scr, m_Fmunu_plaq[2], m_Fmunu_plaq[3], momentum_sink, source_position);
896  for (int t = 0; t < Ly; ++t) {
897  corr_plaq[t] += corr_scr[t];
898  }
899  // double Q_plaq = 0.0;
900  for (int t = 0; t < Ly; ++t) {
901  corr_plaq[t] *= factor1;
902  // Q_plaq += corr_plaq[t];
903  }
904 
905  //--- 1x1 part ---
906  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
907  // (mu,nu, rho,sigma) = (1,2, 3,4)
908  m_field_strength.contract_at_y(corr_scr, m_Fmunu_1x1[0], m_Fmunu_1x1[5], momentum_sink, source_position);
909  for (int t = 0; t < Ly; ++t) {
910  corr_1x1[t] += corr_scr[t];
911  }
912  // (mu,nu, rho,sigma) = (1,3, 2,4)
913  m_field_strength.contract_at_y(corr_scr, m_Fmunu_1x1[1], m_Fmunu_1x1[4], momentum_sink, source_position);
914  for (int t = 0; t < Ly; ++t) {
915  corr_1x1[t] -= corr_scr[t];
916  }
917  // (mu,nu, rho,sigma) = (1,4, 2,3)
918  m_field_strength.contract_at_y(corr_scr, m_Fmunu_1x1[2], m_Fmunu_1x1[3], momentum_sink, source_position);
919  for (int t = 0; t < Ly; ++t) {
920  corr_1x1[t] += corr_scr[t];
921  }
922  // double Q_1x1 = 0.0;
923  for (int t = 0; t < Ly; ++t) {
924  corr_1x1[t] *= factor1;
925  // Q_1x1 += corr_1x1[t];
926  }
927 
928  //--- 1x2 part ---
929  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
930  m_field_strength.contract_at_y(corr_scr, m_Fmunu_1x2[0], m_Fmunu_1x2[5], momentum_sink, source_position);
931  for (int t = 0; t < Ly; ++t) {
932  corr_1x2[t] += corr_scr[t];
933  }
934  m_field_strength.contract_at_y(corr_scr, m_Fmunu_1x2[1], m_Fmunu_1x2[4], momentum_sink, source_position);
935  for (int t = 0; t < Ly; ++t) {
936  corr_1x2[t] -= corr_scr[t];
937  }
938  m_field_strength.contract_at_y(corr_scr, m_Fmunu_1x2[2], m_Fmunu_1x2[3], momentum_sink, source_position);
939  for (int t = 0; t < Ly; ++t) {
940  corr_1x2[t] += corr_scr[t];
941  }
942  // double Q_1x2 = 0.0;
943  for (int t = 0; t < Ly; ++t) {
944  corr_1x2[t] *= factor2;
945  // Q_1x2 += corr_1x2[t];
946  }
947  //----------------
948 
949  //- output
950  const bool use_outputfile = (m_filename_output != "stdout");
951  if (use_outputfile) {
952  int rank_io = 0;
953  vout.init(m_filename_output, rank_io, std::ios::app);
954  }
955 
956  for (int t = 0; t < Ly; ++t) {
957  vout.general(m_vl, " Q_clover_plaq_y_FT = %d %d %d %.8f %d %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, t, corr_1x1[t]);
958  double scr = m_c_plaq * corr_1x1[t] + m_c_rect * corr_1x2[t];
959  vout.general(m_vl, " Q_clover_imp_y_FT = %d %d %d %.8f %d %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, t, scr);
960  scr = l_c_rect * corr_1x2[t];
961  vout.general(m_vl, " Q_clover_rect_y_FT = %d %d %d %.8f %d %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, t, scr);
962  vout.general(m_vl, " Q_plaq_y_FT = %d %d %d %.8f %d %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, t, corr_plaq[t]);
963  }
964 
965  /*
966  vout.general(m_vl, " Q_clover_plaq_sumy_FT = %d %d %d %.8f %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, Q_1x1);
967  double Q_rect = l_c_rect * Q_1x2;
968  vout.general(m_vl, " Q_clover_rect_sumy_FT = %d %d %d %.8f %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, Q_rect);
969  double Q_imp = m_c_plaq * Q_1x1 + m_c_rect * Q_1x2;
970  vout.general(m_vl, " Q_clover_imp_sumy_FT = %d %d %d %.8f %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, Q_imp);
971  vout.general(m_vl, " Q_plaq_sumy = %d %d %d %.8f %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, Q_plaq);
972  */
973 
974  if (use_outputfile) {
975  vout.unset();
976  }
977  }
978  }
979  }
980 }
981 
982 
983 //====================================================================
985 {
986  assert(m_flag_field_set == true);
987 
988  static const double PI = 4.0 * atan(1.0);
989  static const double PI2 = PI * PI;
990  static const double factor1 = 8.0 / (32.0 * PI2);
991  static const double factor2 = 16.0 / (32.0 * PI2);
992 
993  static const double l_c_rect = 1.0 / 8.0;
994  m_c_rect = -1.0 / 12.0;
995  m_c_plaq = 1.0 - 8 * m_c_rect;
996 
997  const int Lz = CommonParameters::Lz();
998 
999  std::vector<double> corr_scr(Lz);
1000 
1001  //--- Field strength by one plaquette ---
1002  std::vector<double> corr_plaq(Lz, 0.0);
1003 
1005  for (int z = 0; z < Lz; ++z) {
1006  corr_plaq[z] += corr_scr[z];
1007  }
1009  for (int z = 0; z < Lz; ++z) {
1010  corr_plaq[z] -= corr_scr[z];
1011  }
1013  for (int z = 0; z < Lz; ++z) {
1014  corr_plaq[z] += corr_scr[z];
1015  }
1016  // double Q_plaq = 0.0;
1017  for (int z = 0; z < Lz; ++z) {
1018  corr_plaq[z] *= factor1;
1019  // Q_plaq += corr_plaq[z];
1020  }
1021 
1022  //--- 1x1 part ---
1023  std::vector<double> corr_1x1(Lz, 0.0);
1024 
1025  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
1026  // (mu,nu, rho,sigma) = (1,2, 3,4)
1028  for (int z = 0; z < Lz; ++z) {
1029  corr_1x1[z] += corr_scr[z];
1030  }
1031  // (mu,nu, rho,sigma) = (1,3, 2,4)
1033  for (int z = 0; z < Lz; ++z) {
1034  corr_1x1[z] -= corr_scr[z];
1035  }
1036  // (mu,nu, rho,sigma) = (1,4, 2,3)
1038  for (int z = 0; z < Lz; ++z) {
1039  corr_1x1[z] += corr_scr[z];
1040  }
1041  // double Q_1x1 = 0.0;
1042  for (int z = 0; z < Lz; ++z) {
1043  corr_1x1[z] *= factor1;
1044  // Q_1x1 += corr_1x1[z];
1045  }
1046 
1047  //--- 1x2 part ---
1048  std::vector<double> corr_1x2(Lz, 0.0);
1049 
1050  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
1052  for (int z = 0; z < Lz; ++z) {
1053  corr_1x2[z] += corr_scr[z];
1054  }
1056  for (int z = 0; z < Lz; ++z) {
1057  corr_1x2[z] -= corr_scr[z];
1058  }
1060  for (int z = 0; z < Lz; ++z) {
1061  corr_1x2[z] += corr_scr[z];
1062  }
1063  // double Q_1x2 = 0.0;
1064  for (int z = 0; z < Lz; ++z) {
1065  corr_1x2[z] *= factor2;
1066  // Q_1x2 += corr_1x2[z];
1067  }
1068  //----------------
1069 
1070  //- output
1071  const bool use_outputfile = (m_filename_output != "stdout");
1072  if (use_outputfile) {
1073  int rank_io = 0;
1074  vout.init(m_filename_output, rank_io, std::ios::app);
1075  }
1076 
1077  for (int z = 0; z < Lz; ++z) {
1078  vout.general(m_vl, " Q_clover_plaq_z = %.8f %d %.16e\n", tt, z, corr_1x1[z]);
1079 
1080  double scr = m_c_plaq * corr_1x1[z] + m_c_rect * corr_1x2[z];
1081  vout.general(m_vl, " Q_clover_imp_z = %.8f %d %.16e\n", tt, z, scr);
1082 
1083  scr = l_c_rect * corr_1x2[z];
1084  vout.general(m_vl, " Q_clover_rect_z = %.8f %d %.16e\n", tt, z, scr);
1085  vout.general(m_vl, " Q_plaq_z = %.8f %d %.16e\n", tt, z, corr_plaq[z]);
1086  }
1087 
1088  /*
1089  vout.general(m_vl, " Q_clover_plaq_sumz = %.8f %.16e\n", tt, Q_1x1);
1090  const double Q_rect = l_c_rect * Q_1x2;
1091  vout.general(m_vl, " Q_clover_rect_sumz = %.8f %.16e\n", tt, Q_rect);
1092  const double Q_imp = m_c_plaq * Q_1x1 + m_c_rect * Q_1x2;
1093  vout.general(m_vl, " Q_clover_imp_sumz = %.8f %.16e\n", tt, Q_imp);
1094  vout.general(m_vl, " Q_plaq_sumz = %.8f %.16e\n", tt, Q_plaq);
1095  */
1096 
1097  if (use_outputfile) {
1098  vout.unset();
1099  }
1100 }
1101 
1102 
1103 //====================================================================
1105 {
1106  assert(m_flag_field_set == 1);
1107  static const double PI = 4.0 * atan(1.0);
1108  static const double PI2 = PI * PI;
1109  static const double factor1 = 8.0 / (32.0 * PI2);
1110  static const double factor2 = 16.0 / (32.0 * PI2);
1111  static const double l_c_rect = 1.0 / 8.0;
1112  m_c_rect = -1.0 / 12.0;
1113  m_c_plaq = 1.0 - 8 * m_c_rect;
1114 
1115  const int Lz = CommonParameters::Lz();
1116 
1117  const int Np = (2 * m_max_mom + 1);
1118  vector<int> source_position(4, 0);
1119  vector<int> momentum_sink(3);
1120 
1121  for (int ipx = 0; ipx < m_max_mom + 1; ipx++) {
1122  for (int ipy = 0; ipy < Np; ipy++) {
1123  for (int ipz = 0; ipz < Np; ipz++) {
1124  momentum_sink[0] = ipx;
1125  momentum_sink[1] = ipy - m_max_mom;
1126  momentum_sink[2] = ipz - m_max_mom;
1127 
1128  std::vector<double> corr_plaq(Lz, 0);
1129  std::vector<double> corr_1x1(Lz, 0);
1130  std::vector<double> corr_1x2(Lz, 0);
1131  std::vector<double> corr_scr(Lz);
1132 
1133  //--- Field strength by one plaquette ---
1134  m_field_strength.contract_at_z(corr_scr, m_Fmunu_plaq[0], m_Fmunu_plaq[5], momentum_sink, source_position);
1135  for (int t = 0; t < Lz; ++t) {
1136  corr_plaq[t] += corr_scr[t];
1137  }
1138  m_field_strength.contract_at_z(corr_scr, m_Fmunu_plaq[1], m_Fmunu_plaq[4], momentum_sink, source_position);
1139  for (int t = 0; t < Lz; ++t) {
1140  corr_plaq[t] -= corr_scr[t];
1141  }
1142  m_field_strength.contract_at_z(corr_scr, m_Fmunu_plaq[2], m_Fmunu_plaq[3], momentum_sink, source_position);
1143  for (int t = 0; t < Lz; ++t) {
1144  corr_plaq[t] += corr_scr[t];
1145  }
1146  // double Q_plaq = 0.0;
1147  for (int t = 0; t < Lz; ++t) {
1148  corr_plaq[t] *= factor1;
1149  // Q_plaq += corr_plaq[t];
1150  }
1151 
1152  //--- 1x1 part ---
1153  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
1154  // (mu,nu, rho,sigma) = (1,2, 3,4)
1155  m_field_strength.contract_at_z(corr_scr, m_Fmunu_1x1[0], m_Fmunu_1x1[5], momentum_sink, source_position);
1156  for (int t = 0; t < Lz; ++t) {
1157  corr_1x1[t] += corr_scr[t];
1158  }
1159  // (mu,nu, rho,sigma) = (1,3, 2,4)
1160  m_field_strength.contract_at_z(corr_scr, m_Fmunu_1x1[1], m_Fmunu_1x1[4], momentum_sink, source_position);
1161  for (int t = 0; t < Lz; ++t) {
1162  corr_1x1[t] -= corr_scr[t];
1163  }
1164  // (mu,nu, rho,sigma) = (1,4, 2,3)
1165  m_field_strength.contract_at_z(corr_scr, m_Fmunu_1x1[2], m_Fmunu_1x1[3], momentum_sink, source_position);
1166  for (int t = 0; t < Lz; ++t) {
1167  corr_1x1[t] += corr_scr[t];
1168  }
1169  // double Q_1x1 = 0.0;
1170  for (int t = 0; t < Lz; ++t) {
1171  corr_1x1[t] *= factor1;
1172  // Q_1x1 += corr_1x1[t];
1173  }
1174 
1175  //--- 1x2 part ---
1176  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
1177  m_field_strength.contract_at_z(corr_scr, m_Fmunu_1x2[0], m_Fmunu_1x2[5], momentum_sink, source_position);
1178  for (int t = 0; t < Lz; ++t) {
1179  corr_1x2[t] += corr_scr[t];
1180  }
1181  m_field_strength.contract_at_z(corr_scr, m_Fmunu_1x2[1], m_Fmunu_1x2[4], momentum_sink, source_position);
1182  for (int t = 0; t < Lz; ++t) {
1183  corr_1x2[t] -= corr_scr[t];
1184  }
1185  m_field_strength.contract_at_z(corr_scr, m_Fmunu_1x2[2], m_Fmunu_1x2[3], momentum_sink, source_position);
1186  for (int t = 0; t < Lz; ++t) {
1187  corr_1x2[t] += corr_scr[t];
1188  }
1189  // double Q_1x2 = 0.0;
1190  for (int t = 0; t < Lz; ++t) {
1191  corr_1x2[t] *= factor2;
1192  // Q_1x2 += corr_1x2[t];
1193  }
1194  //----------------
1195 
1196  //- output
1197  const bool use_outputfile = (m_filename_output != "stdout");
1198  if (use_outputfile) {
1199  int rank_io = 0;
1200  vout.init(m_filename_output, rank_io, std::ios::app);
1201  }
1202 
1203  for (int t = 0; t < Lz; ++t) {
1204  vout.general(m_vl, " Q_clover_plaq_z_FT = %d %d %d %.8f %d %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, t, corr_1x1[t]);
1205  double scr = m_c_plaq * corr_1x1[t] + m_c_rect * corr_1x2[t];
1206  vout.general(m_vl, " Q_clover_imp_z_FT = %d %d %d %.8f %d %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, t, scr);
1207  scr = l_c_rect * corr_1x2[t];
1208  vout.general(m_vl, " Q_clover_rect_z_FT = %d %d %d %.8f %d %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, t, scr);
1209  vout.general(m_vl, " Q_plaq_z_FT = %d %d %d %.8f %d %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, t, corr_plaq[t]);
1210  }
1211 
1212  /*
1213  vout.general(m_vl, " Q_clover_plaq_sumz_FT = %d %d %d %.8f %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, Q_1x1);
1214  double Q_rect = l_c_rect * Q_1x2;
1215  vout.general(m_vl, " Q_clover_rect_sumz_FT = %d %d %d %.8f %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, Q_rect);
1216  double Q_imp = m_c_plaq * Q_1x1 + m_c_rect * Q_1x2;
1217  vout.general(m_vl, " Q_clover_imp_sumz_FT = %d %d %d %.8f %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, Q_imp);
1218  vout.general(m_vl, " Q_plaq_sumz = %d %d %d %.8f %.16e\n", momentum_sink[0], momentum_sink[1], momentum_sink[2], tt, Q_plaq);
1219  */
1220 
1221  if (use_outputfile) {
1222  vout.unset();
1223  }
1224  }
1225  }
1226  }
1227 }
1228 
1229 
1230 //====================================================================
1231 
1232 /*
1233 double TopologicalCharge::contract_epsilon_tensor(const Field_G& Fmunu_1, const Field_G& Fmunu_2)
1234 {
1235  const int Nvol = CommonParameters::Nvol();
1236 
1237  double Q_topo = 0.0;
1238  for (int site = 0; site < Nvol; ++site) {
1239  Q_topo += ReTr(Fmunu_1.mat(site) * Fmunu_2.mat(site));
1240  }
1241  const double result = Communicator::reduce_sum(Q_topo);
1242 
1243  return result;
1244 }
1245 */
1246 
1247 
1248 //====================================================================
1250 {
1251  const int Ndim = CommonParameters::Ndim();
1252 
1253  // NB. #(mu,nu)=6 i.e. (1,2),(1,3),(1,4),(2,3),(2,4),(3,4)
1254  m_Fmunu_plaq.resize(6);
1255  m_Fmunu_1x1.resize(6);
1256  m_Fmunu_1x2.resize(6);
1257 
1258  int i_munu = 0;
1259  for (int mu = 0; mu < Ndim; ++mu) {
1260  for (int nu = mu + 1; nu < Ndim; ++nu) {
1264  ++i_munu;
1265  }
1266  }
1267  m_flag_field_set = true;
1268 }
1269 
1270 
1271 //====================================================================
1272 //============================================================END=====
topologicalCharge.h
TopologicalCharge::get_parameters
virtual void get_parameters(Parameters &params) const
getting parameters.
Definition: topologicalCharge.cpp:49
Bridge::BridgeIO::init
void init(const std::string &filename)
Definition: bridgeIO.cpp:62
Parameters::set_string
void set_string(const string &key, const string &value)
Definition: parameters.cpp:39
CommonParameters::Ndim
static int Ndim()
Definition: commonParameters.h:117
TopologicalCharge::m_Fmunu_1x1
std::vector< Field_G > m_Fmunu_1x1
Definition: topologicalCharge.h:63
Parameters
Class for parameters.
Definition: parameters.h:46
TopologicalCharge::m_Fmunu_1x2
std::vector< Field_G > m_Fmunu_1x2
Definition: topologicalCharge.h:64
Parameters::set_double
void set_double(const string &key, const double value)
Definition: parameters.cpp:33
TopologicalCharge::m_flag_field_set
bool m_flag_field_set
Definition: topologicalCharge.h:65
TopologicalCharge::m_filename_output
std::string m_filename_output
Definition: topologicalCharge.h:52
CommonParameters::Ly
static int Ly()
Definition: commonParameters.h:92
Bridge::BridgeIO::unset
void unset()
Definition: bridgeIO.cpp:142
TopologicalCharge::measure_topological_density_z_FT
void measure_topological_density_z_FT(const double tt)
Measure Fourier transformation of topological charge density corr[z]= using the stored m_Fmunu and p...
Definition: topologicalCharge.cpp:1104
TopologicalCharge::set_field_strength
void set_field_strength(const Field_G &U)
Construct the anti-Hermitian traceless field strength by the link U. Should be called before measuri...
Definition: topologicalCharge.cpp:1249
TopologicalCharge::class_name
static const std::string class_name
Definition: topologicalCharge.h:46
TopologicalCharge::measure
double measure(const Field_G &U)
main function to measure Topological Charge. The field strength is constructed inside the function.
Definition: topologicalCharge.cpp:80
FieldStrength::construct_Fmunu_1x2_traceless
void construct_Fmunu_1x2_traceless(Field_G &Fmunu, const int mu, const int nu, const Field_G &U)
Constructs the anti-Hermitian traceless field strength with eight 1x2 rectangular clover leaves.
Definition: fieldStrength.cpp:395
FieldStrength::contract
double contract(const Field_G &Fmunu_1, const Field_G &Fmunu_2)
Calculate and returns its value. Intended to be used for the topological charge and energy momentum ...
Definition: fieldStrength.cpp:662
FieldStrength::contract_at_x
void contract_at_x(std::vector< double > &corr_global, const Field_G &Fmunu_1, const Field_G &Fmunu_2)
Calculate corr[x]= . Intended to be used to calculate correlations function of the topological charge...
Definition: fieldStrength.cpp:762
FieldStrength::construct_Fmunu_plaq_traceless
void construct_Fmunu_plaq_traceless(Field_G &Fmunu, const int mu, const int nu, const Field_G &U)
Constructs the anti-Hermitian traceless field strength with an imaginary part of the plaquette.
Definition: fieldStrength.cpp:630
FieldStrength::contract_at_z
void contract_at_z(std::vector< double > &corr_global, const Field_G &Fmunu_1, const Field_G &Fmunu_2)
Calculate corr[z]= . Intended to be used to calculate correlations function of the topological charge...
Definition: fieldStrength.cpp:932
TopologicalCharge::m_Fmunu_plaq
std::vector< Field_G > m_Fmunu_plaq
Definition: topologicalCharge.h:62
TopologicalCharge::measure_topological_density_z
void measure_topological_density_z(const double tt)
Measure topological charge density corr[z]= in z direction using the stored m_Fmunu and print out th...
Definition: topologicalCharge.cpp:984
CommonParameters::Lt
static int Lt()
Definition: commonParameters.h:94
TopologicalCharge::measure_topological_charge
void measure_topological_charge(const double tt)
Definition: topologicalCharge.cpp:178
CommonParameters::Lx
static int Lx()
Definition: commonParameters.h:91
TopologicalCharge::measure_topological_density_y
void measure_topological_density_y(const double tt)
Measure topological charge density corr[y]= in y direction using the stored m_Fmunu and print out th...
Definition: topologicalCharge.cpp:737
CommonParameters::Lz
static int Lz()
Definition: commonParameters.h:93
FieldStrength::contract_at_y
void contract_at_y(std::vector< double > &corr_global, const Field_G &Fmunu_1, const Field_G &Fmunu_2)
Calculate corr[y]= . Intended to be used to calculate correlations function of the topological charge...
Definition: fieldStrength.cpp:847
TopologicalCharge::measure_topological_density_y_FT
void measure_topological_density_y_FT(const double tt)
Measure Fourier transformation of topological charge density corr[y]= using the stored m_Fmunu and p...
Definition: topologicalCharge.cpp:857
TopologicalCharge::m_c_rect
double m_c_rect
Definition: topologicalCharge.h:55
TopologicalCharge::m_c_plaq
double m_c_plaq
Definition: topologicalCharge.h:54
TopologicalCharge::measure_topological_density_t
void measure_topological_density_t(const double tt)
Measure topological charge density corr[t]= in temporal direction using the stored m_Fmunu and print...
Definition: topologicalCharge.cpp:244
TopologicalCharge::set_parameters
virtual void set_parameters(const Parameters &params)
setting parameters.
Definition: topologicalCharge.cpp:19
TopologicalCharge::measure_topological_density_x_FT
void measure_topological_density_x_FT(const double tt)
Measure Fourier transformation of topological charge density corr[x]= using the stored m_Fmunu and p...
Definition: topologicalCharge.cpp:610
TopologicalCharge::m_max_mom
int m_max_mom
maximum of momentum for Fourier transformation: p_x=[0,max_mom], p_y=[-max_mom,max_mom],...
Definition: topologicalCharge.h:58
Bridge::BridgeIO::set_verbose_level
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:195
FieldStrength::contract_at_t
void contract_at_t(std::vector< double > &corr_global, const Field_G &Fmunu_1, const Field_G &Fmunu_2)
Calculate corr[t]= . Intended to be used to calculate correlations function of the topological charge...
Definition: fieldStrength.cpp:678
TopologicalCharge::m_vl
Bridge::VerboseLevel m_vl
Definition: topologicalCharge.h:49
TopologicalCharge::m_field_strength
FieldStrength m_field_strength
Definition: topologicalCharge.h:60
Parameters::set_int
void set_int(const string &key, const int value)
Definition: parameters.cpp:36
FieldStrength::construct_Fmunu_1x1_traceless
void construct_Fmunu_1x1_traceless(Field_G &Fmunu, const int mu, const int nu, const Field_G &U)
Constructs the anti-Hermitian traceless field strength with four 1x1 plquette clover leaves.
Definition: fieldStrength.cpp:324
Parameters::fetch_double
int fetch_double(const string &key, double &value) const
Definition: parameters.cpp:327
Parameters::get_string
string get_string(const string &key) const
Definition: parameters.cpp:221
Bridge::BridgeIO::crucial
void crucial(const char *format,...)
Definition: bridgeIO.cpp:242
TopologicalCharge::measure_topological_density_x
void measure_topological_density_x(const double tt)
Measure topological charge density corr[x]= in x direction using the stored m_Fmunu and print out th...
Definition: topologicalCharge.cpp:490
Field_G
SU(N) gauge field.
Definition: field_G.h:38
TopologicalCharge::measure_topological_density_t_FT
void measure_topological_density_t_FT(const double tt)
Measure Fourier transformation of topological charge density corr[t]= using the stored m_Fmunu and p...
Definition: topologicalCharge.cpp:363
Parameters::fetch_int
int fetch_int(const string &key, int &value) const
Definition: parameters.cpp:346
Bridge::BridgeIO::general
void general(const char *format,...)
Definition: bridgeIO.cpp:262
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:569
Bridge::BridgeIO::get_verbose_level
static std::string get_verbose_level(const VerboseLevel vl)
Definition: bridgeIO.cpp:216
CommonParameters::epsilon_criterion
static double epsilon_criterion()
Definition: commonParameters.h:119