Bridge++  Ver. 2.0.2
fopr_CloverTerm_General_impl.cpp
Go to the documentation of this file.
1 
15 
17 
18 namespace Imp {
19 #if defined USE_GROUP_SU3
21 #elif defined USE_GROUP_SU2
23 #elif defined USE_GROUP_SU_N
25 #endif
26 
27 //====================================================================
28 
29  const std::string Fopr_CloverTerm_General::class_name = "Imp::Fopr_CloverTerm_General";
30 
31 //====================================================================
33  {
34  std::string vlevel;
35  if (!params.fetch_string("verbose_level", vlevel)) {
36  m_vl = vout.set_verbose_level(vlevel);
37  }
38 
39  //- fetch and check input parameters
40  double kappa_s, kappa_t, cSW_s, cSW_t;
41  std::vector<int> bc;
42 
43  int err = 0;
44  err += params.fetch_double("hopping_parameter_spatial", kappa_s);
45  err += params.fetch_double("hopping_parameter_temporal", kappa_t);
46  err += params.fetch_double("clover_coefficient_spatial", cSW_s);
47  err += params.fetch_double("clover_coefficient_temporal", cSW_t);
48  err += params.fetch_int_vector("boundary_condition", bc);
49 
50  if (err) {
51  vout.crucial(m_vl, "Error at %s: input parameter not found.\n", class_name.c_str());
52  exit(EXIT_FAILURE);
53  }
54 
55 
56  set_parameters(kappa_s, kappa_t, cSW_s, cSW_t, bc);
57  }
58 
59 
60 //====================================================================
62  {
63  params.set_double("hopping_parameter_spatial", m_kappa_s);
64  params.set_double("hopping_parameter_temporal", m_kappa_t);
65  params.set_double("clover_coefficient_spatial", m_cSW_s);
66  params.set_double("clover_coefficient_temporal", m_cSW_t);
67  params.set_int_vector("boundary_condition", m_boundary);
68 
69  params.set_string("verbose_level", vout.get_verbose_level(m_vl));
70  }
71 
72 
73 //====================================================================
74  void Fopr_CloverTerm_General::set_parameters(const double kappa_s, const double kappa_t,
75  const double cSW_s, const double cSW_t,
76  const std::vector<int> bc)
77  {
78  //- print input parameters
79  vout.general(m_vl, "%s:\n", class_name.c_str());
80  vout.general(m_vl, " kappa_s = %12.8f\n", kappa_s);
81  vout.general(m_vl, " kappa_t = %12.8f\n", kappa_t);
82  vout.general(m_vl, " cSW_s = %12.8f\n", cSW_s);
83  vout.general(m_vl, " cSW_t = %12.8f\n", cSW_t);
84  for (int mu = 0; mu < m_Ndim; ++mu) {
85  vout.general(m_vl, " boundary[%d] = %2d\n", mu, bc[mu]);
86  }
87 
88  //- range check
89  // NB. kappa,cSW == 0 is allowed.
90  assert(bc.size() == m_Ndim);
91 
92  //- store values
93  m_kappa_s = kappa_s;
94  m_kappa_t = kappa_t;
95  m_cSW_s = cSW_s;
96  m_cSW_t = cSW_t;
97 
98  // m_boundary.resize(m_Ndim); // already resized in init.
99  m_boundary = bc;
100  }
101 
102 
103 //====================================================================
105  {
106  m_U = (Field_G *)U;
107  set_csw();
108  }
109 
110 
111 //====================================================================
112  void Fopr_CloverTerm_General::init(const std::string repr)
113  {
118  m_NinF = 2 * m_Nc * m_Nd;
119 
120  m_U = 0;
121 
122  m_repr = repr;
123 
124  m_boundary.resize(m_Ndim);
125  m_SG.resize(m_Ndim * m_Ndim);
126 
127  GammaMatrixSet *gmset = GammaMatrixSet::New(m_repr);
128 
129  m_GM5 = gmset->get_GM(gmset->GAMMA5);
130 
131  m_SG[sg_index(0, 1)] = gmset->get_GM(gmset->SIGMA12);
132  m_SG[sg_index(1, 2)] = gmset->get_GM(gmset->SIGMA23);
133  m_SG[sg_index(2, 0)] = gmset->get_GM(gmset->SIGMA31);
134  m_SG[sg_index(3, 0)] = gmset->get_GM(gmset->SIGMA41);
135  m_SG[sg_index(3, 1)] = gmset->get_GM(gmset->SIGMA42);
136  m_SG[sg_index(3, 2)] = gmset->get_GM(gmset->SIGMA43);
137 
138  m_SG[sg_index(1, 0)] = m_SG[sg_index(0, 1)].mult(-1);
139  m_SG[sg_index(2, 1)] = m_SG[sg_index(1, 2)].mult(-1);
140  m_SG[sg_index(0, 2)] = m_SG[sg_index(2, 0)].mult(-1);
141  m_SG[sg_index(0, 3)] = m_SG[sg_index(3, 0)].mult(-1);
142  m_SG[sg_index(1, 3)] = m_SG[sg_index(3, 1)].mult(-1);
143  m_SG[sg_index(2, 3)] = m_SG[sg_index(3, 2)].mult(-1);
144 
145  m_SG[sg_index(0, 0)] = gmset->get_GM(gmset->UNITY);
146  m_SG[sg_index(1, 1)] = gmset->get_GM(gmset->UNITY);
147  m_SG[sg_index(2, 2)] = gmset->get_GM(gmset->UNITY);
148  m_SG[sg_index(3, 3)] = gmset->get_GM(gmset->UNITY);
149  // these 4 gamma matrices are actually not used.
150 
151  // m_fopr_w = new Fopr_Wilson(repr);
152  if (m_repr == "Dirac") {
155  } else if (m_repr == "Chiral") {
158  }
159 
160  // m_w2.reset(m_NinF,m_Nvol,1);
161 
162  delete gmset;
163  }
164 
165 
166 //====================================================================
168  {
169  // nothing to do.
170  }
171 
172 
173 //====================================================================
175  {
176  (this->*m_gm5)(v, f);
177  }
178 
179 
180 //====================================================================
182  {
183  const int Nvc = 2 * CommonParameters::Nc();
184  const int Nd = CommonParameters::Nd();
185 
186  const double *v1 = f.ptr(0);
187  double *v2 = w.ptr(0);
188 
189  const int id1 = 0;
190  const int id2 = Nvc;
191  const int id3 = Nvc * 2;
192  const int id4 = Nvc * 3;
193 
194  // threadding applied.
195  const int Nthread = ThreadManager::get_num_threads();
196  const int i_thread = ThreadManager::get_thread_id();
197 
198  const int is = m_Nvol * i_thread / Nthread;
199  const int ns = m_Nvol * (i_thread + 1) / Nthread - is;
200 
201  for (int site = is; site < is + ns; ++site) {
202  // for (int site = 0; site < m_Nvol; ++site) {
203  for (int icc = 0; icc < Nvc; icc++) {
204  int in = Nvc * Nd * site;
205 
206  v2[icc + id1 + in] = v1[icc + id3 + in];
207  v2[icc + id2 + in] = v1[icc + id4 + in];
208  v2[icc + id3 + in] = v1[icc + id1 + in];
209  v2[icc + id4 + in] = v1[icc + id2 + in];
210  }
211  }
212  }
213 
214 
215 //====================================================================
217  {
218  const int Nvc = 2 * CommonParameters::Nc();
219  const int Nd = CommonParameters::Nd();
220 
221  const double *v1 = f.ptr(0);
222  double *v2 = w.ptr(0);
223 
224  const int id1 = 0;
225  const int id2 = Nvc;
226  const int id3 = Nvc * 2;
227  const int id4 = Nvc * 3;
228 
229  // threadding applied.
230  const int Nthread = ThreadManager::get_num_threads();
231  const int i_thread = ThreadManager::get_thread_id();
232 
233  const int is = m_Nvol * i_thread / Nthread;
234  const int ns = m_Nvol * (i_thread + 1) / Nthread - is;
235 
236  for (int site = is; site < is + ns; ++site) {
237  // for (int site = 0; site < m_Nvol; ++site) {
238  for (int icc = 0; icc < Nvc; icc++) {
239  int in = Nvc * Nd * site;
240 
241  v2[icc + id1 + in] = v1[icc + id1 + in];
242  v2[icc + id2 + in] = v1[icc + id2 + in];
243  v2[icc + id3 + in] = -v1[icc + id3 + in];
244  v2[icc + id4 + in] = -v1[icc + id4 + in];
245  }
246  }
247  }
248 
249 
250 //====================================================================
252  const int mu, const int nu)
253  {
254  assert(mu != nu);
255  mult_iGM(v, m_SG[sg_index(mu, nu)], w);
256  }
257 
258 
259 //====================================================================
261  {
262  mult_csw(v, f);
263  }
264 
265 
266 //====================================================================
268  {
269  // multiplies csw kappa sigma_{mu nu} F_{mu nu}
270  // NOTE: this is NOT 1 - csw kappa sigma_{mu nu} F_{mu nu}
271  (this->*m_csw)(v, w);
272  }
273 
274 
275 //====================================================================
277  {
278  // multiplies csw kappa sigma_{mu nu} F_{mu nu}
279  // NOTE: this is NOT 1 - csw kappa sigma_{mu nu} F_{mu nu}
280  assert(w.nex() == 1);
281 
282  const int Nc = CommonParameters::Nc();
283  const int Nvc = 2 * Nc;
284  const int Ndf = 2 * Nc * Nc;
285  const int Nd = CommonParameters::Nd();
286  const int Nvol = w.nvol();
287 
288  const int id1 = 0;
289  const int id2 = Nvc;
290  const int id3 = Nvc * 2;
291  const int id4 = Nvc * 3;
292 
293  const double kappa_cSW_s = m_kappa_s * m_cSW_s;
294  const double kappa_cSW_t = m_kappa_t * m_cSW_t;
295 
296  const double *w2 = w.ptr(0);
297  double *v2 = v.ptr(0);
298 
299  double *Bx = m_Bx.ptr(0);
300  double *By = m_By.ptr(0);
301  double *Bz = m_Bz.ptr(0);
302  double *Ex = m_Ex.ptr(0);
303  double *Ey = m_Ey.ptr(0);
304  double *Ez = m_Ez.ptr(0);
305 
306  // threading applied.
307  const int Nthread = ThreadManager::get_num_threads();
308  const int i_thread = ThreadManager::get_thread_id();
309 
310  const int is = m_Nvol * i_thread / Nthread;
311  const int ns = m_Nvol * (i_thread + 1) / Nthread - is;
312 
313  for (int site = is; site < is + ns; ++site) {
314  int iv = Nvc * Nd * site;
315  int ig = Ndf * site;
316 
317  for (int ic = 0; ic < Nc; ++ic) {
318  int ic_r = 2 * ic;
319  int ic_i = ic_r + 1;
320  int ic_g = ic * Nvc + ig;
321 
322  v2[ic_r + id1 + iv] = 0.0;
323  v2[ic_i + id1 + iv] = 0.0;
324  v2[ic_r + id2 + iv] = 0.0;
325  v2[ic_i + id2 + iv] = 0.0;
326 
327  v2[ic_r + id3 + iv] = 0.0;
328  v2[ic_i + id3 + iv] = 0.0;
329  v2[ic_r + id4 + iv] = 0.0;
330  v2[ic_i + id4 + iv] = 0.0;
331 
332  // isigma_23 * Bx
333  v2[ic_r + id1 + iv] -= kappa_cSW_s * mult_uv_i(&Bx[ic_g], &w2[id2 + iv], Nc);
334  v2[ic_i + id1 + iv] += kappa_cSW_s * mult_uv_r(&Bx[ic_g], &w2[id2 + iv], Nc);
335  v2[ic_r + id2 + iv] -= kappa_cSW_s * mult_uv_i(&Bx[ic_g], &w2[id1 + iv], Nc);
336  v2[ic_i + id2 + iv] += kappa_cSW_s * mult_uv_r(&Bx[ic_g], &w2[id1 + iv], Nc);
337 
338  v2[ic_r + id3 + iv] -= kappa_cSW_s * mult_uv_i(&Bx[ic_g], &w2[id4 + iv], Nc);
339  v2[ic_i + id3 + iv] += kappa_cSW_s * mult_uv_r(&Bx[ic_g], &w2[id4 + iv], Nc);
340  v2[ic_r + id4 + iv] -= kappa_cSW_s * mult_uv_i(&Bx[ic_g], &w2[id3 + iv], Nc);
341  v2[ic_i + id4 + iv] += kappa_cSW_s * mult_uv_r(&Bx[ic_g], &w2[id3 + iv], Nc);
342 
343  // isigma_31 * By
344  v2[ic_r + id1 + iv] += kappa_cSW_s * mult_uv_r(&By[ic_g], &w2[id2 + iv], Nc);
345  v2[ic_i + id1 + iv] += kappa_cSW_s * mult_uv_i(&By[ic_g], &w2[id2 + iv], Nc);
346  v2[ic_r + id2 + iv] -= kappa_cSW_s * mult_uv_r(&By[ic_g], &w2[id1 + iv], Nc);
347  v2[ic_i + id2 + iv] -= kappa_cSW_s * mult_uv_i(&By[ic_g], &w2[id1 + iv], Nc);
348 
349  v2[ic_r + id3 + iv] += kappa_cSW_s * mult_uv_r(&By[ic_g], &w2[id4 + iv], Nc);
350  v2[ic_i + id3 + iv] += kappa_cSW_s * mult_uv_i(&By[ic_g], &w2[id4 + iv], Nc);
351  v2[ic_r + id4 + iv] -= kappa_cSW_s * mult_uv_r(&By[ic_g], &w2[id3 + iv], Nc);
352  v2[ic_i + id4 + iv] -= kappa_cSW_s * mult_uv_i(&By[ic_g], &w2[id3 + iv], Nc);
353 
354  // isigma_12 * Bz
355  v2[ic_r + id1 + iv] -= kappa_cSW_s * mult_uv_i(&Bz[ic_g], &w2[id1 + iv], Nc);
356  v2[ic_i + id1 + iv] += kappa_cSW_s * mult_uv_r(&Bz[ic_g], &w2[id1 + iv], Nc);
357  v2[ic_r + id2 + iv] += kappa_cSW_s * mult_uv_i(&Bz[ic_g], &w2[id2 + iv], Nc);
358  v2[ic_i + id2 + iv] -= kappa_cSW_s * mult_uv_r(&Bz[ic_g], &w2[id2 + iv], Nc);
359 
360  v2[ic_r + id3 + iv] -= kappa_cSW_s * mult_uv_i(&Bz[ic_g], &w2[id3 + iv], Nc);
361  v2[ic_i + id3 + iv] += kappa_cSW_s * mult_uv_r(&Bz[ic_g], &w2[id3 + iv], Nc);
362  v2[ic_r + id4 + iv] += kappa_cSW_s * mult_uv_i(&Bz[ic_g], &w2[id4 + iv], Nc);
363  v2[ic_i + id4 + iv] -= kappa_cSW_s * mult_uv_r(&Bz[ic_g], &w2[id4 + iv], Nc);
364 
365  // isigma_41 * Ex
366  v2[ic_r + id1 + iv] += kappa_cSW_t * mult_uv_i(&Ex[ic_g], &w2[id2 + iv], Nc);
367  v2[ic_i + id1 + iv] -= kappa_cSW_t * mult_uv_r(&Ex[ic_g], &w2[id2 + iv], Nc);
368  v2[ic_r + id2 + iv] += kappa_cSW_t * mult_uv_i(&Ex[ic_g], &w2[id1 + iv], Nc);
369  v2[ic_i + id2 + iv] -= kappa_cSW_t * mult_uv_r(&Ex[ic_g], &w2[id1 + iv], Nc);
370 
371  v2[ic_r + id3 + iv] -= kappa_cSW_t * mult_uv_i(&Ex[ic_g], &w2[id4 + iv], Nc);
372  v2[ic_i + id3 + iv] += kappa_cSW_t * mult_uv_r(&Ex[ic_g], &w2[id4 + iv], Nc);
373  v2[ic_r + id4 + iv] -= kappa_cSW_t * mult_uv_i(&Ex[ic_g], &w2[id3 + iv], Nc);
374  v2[ic_i + id4 + iv] += kappa_cSW_t * mult_uv_r(&Ex[ic_g], &w2[id3 + iv], Nc);
375 
376  // isigma_42 * Ey
377  v2[ic_r + id1 + iv] -= kappa_cSW_t * mult_uv_r(&Ey[ic_g], &w2[id2 + iv], Nc);
378  v2[ic_i + id1 + iv] -= kappa_cSW_t * mult_uv_i(&Ey[ic_g], &w2[id2 + iv], Nc);
379  v2[ic_r + id2 + iv] += kappa_cSW_t * mult_uv_r(&Ey[ic_g], &w2[id1 + iv], Nc);
380  v2[ic_i + id2 + iv] += kappa_cSW_t * mult_uv_i(&Ey[ic_g], &w2[id1 + iv], Nc);
381 
382  v2[ic_r + id3 + iv] += kappa_cSW_t * mult_uv_r(&Ey[ic_g], &w2[id4 + iv], Nc);
383  v2[ic_i + id3 + iv] += kappa_cSW_t * mult_uv_i(&Ey[ic_g], &w2[id4 + iv], Nc);
384  v2[ic_r + id4 + iv] -= kappa_cSW_t * mult_uv_r(&Ey[ic_g], &w2[id3 + iv], Nc);
385  v2[ic_i + id4 + iv] -= kappa_cSW_t * mult_uv_i(&Ey[ic_g], &w2[id3 + iv], Nc);
386 
387  // isigma_43 * Ez
388  v2[ic_r + id1 + iv] += kappa_cSW_t * mult_uv_i(&Ez[ic_g], &w2[id1 + iv], Nc);
389  v2[ic_i + id1 + iv] -= kappa_cSW_t * mult_uv_r(&Ez[ic_g], &w2[id1 + iv], Nc);
390  v2[ic_r + id2 + iv] -= kappa_cSW_t * mult_uv_i(&Ez[ic_g], &w2[id2 + iv], Nc);
391  v2[ic_i + id2 + iv] += kappa_cSW_t * mult_uv_r(&Ez[ic_g], &w2[id2 + iv], Nc);
392 
393  v2[ic_r + id3 + iv] -= kappa_cSW_t * mult_uv_i(&Ez[ic_g], &w2[id3 + iv], Nc);
394  v2[ic_i + id3 + iv] += kappa_cSW_t * mult_uv_r(&Ez[ic_g], &w2[id3 + iv], Nc);
395  v2[ic_r + id4 + iv] += kappa_cSW_t * mult_uv_i(&Ez[ic_g], &w2[id4 + iv], Nc);
396  v2[ic_i + id4 + iv] -= kappa_cSW_t * mult_uv_r(&Ez[ic_g], &w2[id4 + iv], Nc);
397  }
398  }
399 #pragma omp barrier
400  }
401 
402 
403 //====================================================================
405  {
406  // multiplies csw kappa sigma_{mu nu} F_{mu nu}
407  // NOTE: this is NOT 1 - csw kappa sigma_{mu nu} F_{mu nu}
408  assert(w.nex() == 1);
409 
410  const int Nc = CommonParameters::Nc();
411  const int Nvc = 2 * Nc;
412  const int Ndf = 2 * Nc * Nc;
413  const int Nd = CommonParameters::Nd();
414  const int Nvol = w.nvol();
415 
416  const int id1 = 0;
417  const int id2 = Nvc;
418  const int id3 = Nvc * 2;
419  const int id4 = Nvc * 3;
420 
421  const double kappa_cSW_s = m_kappa_s * m_cSW_s;
422  const double kappa_cSW_t = m_kappa_t * m_cSW_t;
423 
424  const double *w2 = w.ptr(0);
425  double *v2 = v.ptr(0);
426 
427  double *Bx = m_Bx.ptr(0);
428  double *By = m_By.ptr(0);
429  double *Bz = m_Bz.ptr(0);
430  double *Ex = m_Ex.ptr(0);
431  double *Ey = m_Ey.ptr(0);
432  double *Ez = m_Ez.ptr(0);
433 
434  // threadding applied.
435  const int Nthread = ThreadManager::get_num_threads();
436  const int i_thread = ThreadManager::get_thread_id();
437 
438  const int is = m_Nvol * i_thread / Nthread;
439  const int ns = m_Nvol * (i_thread + 1) / Nthread - is;
440 
441  for (int site = is; site < is + ns; ++site) {
442  int iv = Nvc * Nd * site;
443  int ig = Ndf * site;
444 
445  for (int ic = 0; ic < Nc; ++ic) {
446  int ic_r = 2 * ic;
447  int ic_i = ic_r + 1;
448  int ic_g = ic * Nvc + ig;
449 
450  v2[ic_r + id1 + iv] = 0.0;
451  v2[ic_i + id1 + iv] = 0.0;
452  v2[ic_r + id2 + iv] = 0.0;
453  v2[ic_i + id2 + iv] = 0.0;
454 
455  v2[ic_r + id3 + iv] = 0.0;
456  v2[ic_i + id3 + iv] = 0.0;
457  v2[ic_r + id4 + iv] = 0.0;
458  v2[ic_i + id4 + iv] = 0.0;
459 
460  // isigma_23 * Bx
461  v2[ic_r + id1 + iv] -= kappa_cSW_s * mult_uv_i(&Bx[ic_g], &w2[id2 + iv], Nc);
462  v2[ic_i + id1 + iv] += kappa_cSW_s * mult_uv_r(&Bx[ic_g], &w2[id2 + iv], Nc);
463  v2[ic_r + id2 + iv] -= kappa_cSW_s * mult_uv_i(&Bx[ic_g], &w2[id1 + iv], Nc);
464  v2[ic_i + id2 + iv] += kappa_cSW_s * mult_uv_r(&Bx[ic_g], &w2[id1 + iv], Nc);
465 
466  v2[ic_r + id3 + iv] -= kappa_cSW_s * mult_uv_i(&Bx[ic_g], &w2[id4 + iv], Nc);
467  v2[ic_i + id3 + iv] += kappa_cSW_s * mult_uv_r(&Bx[ic_g], &w2[id4 + iv], Nc);
468  v2[ic_r + id4 + iv] -= kappa_cSW_s * mult_uv_i(&Bx[ic_g], &w2[id3 + iv], Nc);
469  v2[ic_i + id4 + iv] += kappa_cSW_s * mult_uv_r(&Bx[ic_g], &w2[id3 + iv], Nc);
470 
471  // isigma_31 * By
472  v2[ic_r + id1 + iv] += kappa_cSW_s * mult_uv_r(&By[ic_g], &w2[id2 + iv], Nc);
473  v2[ic_i + id1 + iv] += kappa_cSW_s * mult_uv_i(&By[ic_g], &w2[id2 + iv], Nc);
474  v2[ic_r + id2 + iv] -= kappa_cSW_s * mult_uv_r(&By[ic_g], &w2[id1 + iv], Nc);
475  v2[ic_i + id2 + iv] -= kappa_cSW_s * mult_uv_i(&By[ic_g], &w2[id1 + iv], Nc);
476 
477  v2[ic_r + id3 + iv] += kappa_cSW_s * mult_uv_r(&By[ic_g], &w2[id4 + iv], Nc);
478  v2[ic_i + id3 + iv] += kappa_cSW_s * mult_uv_i(&By[ic_g], &w2[id4 + iv], Nc);
479  v2[ic_r + id4 + iv] -= kappa_cSW_s * mult_uv_r(&By[ic_g], &w2[id3 + iv], Nc);
480  v2[ic_i + id4 + iv] -= kappa_cSW_s * mult_uv_i(&By[ic_g], &w2[id3 + iv], Nc);
481 
482  // isigma_12 * Bz
483  v2[ic_r + id1 + iv] -= kappa_cSW_s * mult_uv_i(&Bz[ic_g], &w2[id1 + iv], Nc);
484  v2[ic_i + id1 + iv] += kappa_cSW_s * mult_uv_r(&Bz[ic_g], &w2[id1 + iv], Nc);
485  v2[ic_r + id2 + iv] += kappa_cSW_s * mult_uv_i(&Bz[ic_g], &w2[id2 + iv], Nc);
486  v2[ic_i + id2 + iv] -= kappa_cSW_s * mult_uv_r(&Bz[ic_g], &w2[id2 + iv], Nc);
487 
488  v2[ic_r + id3 + iv] -= kappa_cSW_s * mult_uv_i(&Bz[ic_g], &w2[id3 + iv], Nc);
489  v2[ic_i + id3 + iv] += kappa_cSW_s * mult_uv_r(&Bz[ic_g], &w2[id3 + iv], Nc);
490  v2[ic_r + id4 + iv] += kappa_cSW_s * mult_uv_i(&Bz[ic_g], &w2[id4 + iv], Nc);
491  v2[ic_i + id4 + iv] -= kappa_cSW_s * mult_uv_r(&Bz[ic_g], &w2[id4 + iv], Nc);
492 
493  // isigma_41 * Ex
494  v2[ic_r + id1 + iv] += kappa_cSW_t * mult_uv_i(&Ex[ic_g], &w2[id4 + iv], Nc);
495  v2[ic_i + id1 + iv] -= kappa_cSW_t * mult_uv_r(&Ex[ic_g], &w2[id4 + iv], Nc);
496  v2[ic_r + id2 + iv] += kappa_cSW_t * mult_uv_i(&Ex[ic_g], &w2[id3 + iv], Nc);
497  v2[ic_i + id2 + iv] -= kappa_cSW_t * mult_uv_r(&Ex[ic_g], &w2[id3 + iv], Nc);
498 
499  v2[ic_r + id3 + iv] += kappa_cSW_t * mult_uv_i(&Ex[ic_g], &w2[id2 + iv], Nc);
500  v2[ic_i + id3 + iv] -= kappa_cSW_t * mult_uv_r(&Ex[ic_g], &w2[id2 + iv], Nc);
501  v2[ic_r + id4 + iv] += kappa_cSW_t * mult_uv_i(&Ex[ic_g], &w2[id1 + iv], Nc);
502  v2[ic_i + id4 + iv] -= kappa_cSW_t * mult_uv_r(&Ex[ic_g], &w2[id1 + iv], Nc);
503 
504  // isigma_42 * Ey
505  v2[ic_r + id1 + iv] -= kappa_cSW_t * mult_uv_r(&Ey[ic_g], &w2[id4 + iv], Nc);
506  v2[ic_i + id1 + iv] -= kappa_cSW_t * mult_uv_i(&Ey[ic_g], &w2[id4 + iv], Nc);
507  v2[ic_r + id2 + iv] += kappa_cSW_t * mult_uv_r(&Ey[ic_g], &w2[id3 + iv], Nc);
508  v2[ic_i + id2 + iv] += kappa_cSW_t * mult_uv_i(&Ey[ic_g], &w2[id3 + iv], Nc);
509 
510  v2[ic_r + id3 + iv] -= kappa_cSW_t * mult_uv_r(&Ey[ic_g], &w2[id2 + iv], Nc);
511  v2[ic_i + id3 + iv] -= kappa_cSW_t * mult_uv_i(&Ey[ic_g], &w2[id2 + iv], Nc);
512  v2[ic_r + id4 + iv] += kappa_cSW_t * mult_uv_r(&Ey[ic_g], &w2[id1 + iv], Nc);
513  v2[ic_i + id4 + iv] += kappa_cSW_t * mult_uv_i(&Ey[ic_g], &w2[id1 + iv], Nc);
514 
515  // isigma_43 * Ez
516  v2[ic_r + id1 + iv] += kappa_cSW_t * mult_uv_i(&Ez[ic_g], &w2[id3 + iv], Nc);
517  v2[ic_i + id1 + iv] -= kappa_cSW_t * mult_uv_r(&Ez[ic_g], &w2[id3 + iv], Nc);
518  v2[ic_r + id2 + iv] -= kappa_cSW_t * mult_uv_i(&Ez[ic_g], &w2[id4 + iv], Nc);
519  v2[ic_i + id2 + iv] += kappa_cSW_t * mult_uv_r(&Ez[ic_g], &w2[id4 + iv], Nc);
520 
521  v2[ic_r + id3 + iv] += kappa_cSW_t * mult_uv_i(&Ez[ic_g], &w2[id1 + iv], Nc);
522  v2[ic_i + id3 + iv] -= kappa_cSW_t * mult_uv_r(&Ez[ic_g], &w2[id1 + iv], Nc);
523  v2[ic_r + id4 + iv] -= kappa_cSW_t * mult_uv_i(&Ez[ic_g], &w2[id2 + iv], Nc);
524  v2[ic_i + id4 + iv] += kappa_cSW_t * mult_uv_r(&Ez[ic_g], &w2[id2 + iv], Nc);
525  }
526  }
527 #pragma omp barrier
528  }
529 
530 
531 //====================================================================
533  {
534  set_fieldstrength(m_Bx, 1, 2);
535  set_fieldstrength(m_By, 2, 0);
536  set_fieldstrength(m_Bz, 0, 1);
537  set_fieldstrength(m_Ex, 3, 0);
538  set_fieldstrength(m_Ey, 3, 1);
539  set_fieldstrength(m_Ez, 3, 2);
540  }
541 
542 
543 //====================================================================
545  const int mu, const int nu)
546  {
547  const int Nthread = ThreadManager::get_num_threads();
548 
549  assert(Nthread == 1);
550  // this function must be called in single thread region.
551 
552  m_staple.upper(m_Cup, *m_U, mu, nu); // these staple constructions
553  m_staple.lower(m_Cdn, *m_U, mu, nu); // are multi-threaded.
554 
555  //#pragma omp parallel
556  {
557  mult_Field_Gnd(Fst, 0, *m_U, mu, m_Cup, 0);
558  multadd_Field_Gnd(Fst, 0, *m_U, mu, m_Cdn, 0, -1.0);
559 
560  mult_Field_Gdn(m_v1, 0, m_Cup, 0, *m_U, mu);
561  multadd_Field_Gdn(m_v1, 0, m_Cdn, 0, *m_U, mu, -1.0);
562  }
563 
564  m_shift.forward(m_v2, m_v1, mu);
565 
566  //#pragma omp parallel
567  {
568  axpy(Fst, 1.0, m_v2);
569  ah_Field_G(Fst, 0);
570  scal(Fst, 0.25);
571  }
572  }
573 
574 
575 //====================================================================
577  {
578  // Counting of floating point operations in giga unit.
579  // The following counting explicitly depends on the implementation
580  // and to be recalculated when the code is modified.
581  // Present counting is based on rev.1107. [24 Aug 2014 H.Matsufuru]
582 
583  const int Nvol = CommonParameters::Nvol();
584  const int NPE = CommonParameters::NPE();
585 
586  const int flop_site = m_Nc * m_Nd * (2 + 48 * m_Nc);
587 
588  const double gflop = flop_site * (Nvol * (NPE / 1.0e+9));
589 
590  return gflop;
591  }
592 
593 
594 //====================================================================
595 }
596 //============================================================END=====
GammaMatrixSet
Set of Gamma Matrices: basis class.
Definition: gammaMatrixSet.h:37
Imp::Fopr_CloverTerm_General::gm5_dirac
void gm5_dirac(Field &, const Field &)
Definition: fopr_CloverTerm_General_impl.cpp:181
Imp::Fopr_CloverTerm_General::m_shift
ShiftField_lex m_shift
Definition: fopr_CloverTerm_General_impl.h:63
Imp::Fopr_CloverTerm_General::m_Nc
int m_Nc
Definition: fopr_CloverTerm_General_impl.h:58
GammaMatrixSet::GAMMA5
@ GAMMA5
Definition: gammaMatrixSet.h:48
mult_Field_Gdn
void mult_Field_Gdn(Field_G &W, const int ex, const Field_G &U1, const int ex1, const Field_G &U2, const int ex2)
Definition: field_G_imp.cpp:134
Parameters::set_string
void set_string(const string &key, const string &value)
Definition: parameters.cpp:39
fopr_Wilson_impl_SU_N-inc.h
fopr_Wilson_impl_SU3-inc.h
Imp::Fopr_CloverTerm_General::tidyup
void tidyup()
Definition: fopr_CloverTerm_General_impl.cpp:167
Imp::Fopr_CloverTerm_General::m_NinF
int m_NinF
Definition: fopr_CloverTerm_General_impl.h:58
ShiftField_lex::forward
void forward(Field &, const Field &, const int mu)
Definition: shiftField_lex.cpp:79
ThreadManager::get_num_threads
static int get_num_threads()
returns available number of threads.
Definition: threadManager.cpp:246
CommonParameters::Ndim
static int Ndim()
Definition: commonParameters.h:117
Parameters
Class for parameters.
Definition: parameters.h:46
GammaMatrixSet::UNITY
@ UNITY
Definition: gammaMatrixSet.h:48
Parameters::set_double
void set_double(const string &key, const double value)
Definition: parameters.cpp:33
Imp::Fopr_CloverTerm_General::m_Nvol
int m_Nvol
Definition: fopr_CloverTerm_General_impl.h:59
Imp::Fopr_CloverTerm_General::init
void init(std::string repr)
Definition: fopr_CloverTerm_General_impl.cpp:112
Imp::Fopr_CloverTerm_General::mult_isigma
void mult_isigma(Field_F &, const Field_F &, const int mu, const int nu)
Definition: fopr_CloverTerm_General_impl.cpp:251
Field::nex
int nex() const
Definition: field.h:128
Imp::Fopr_CloverTerm_General::m_By
Field_G m_By
Definition: fopr_CloverTerm_General_impl.h:66
CommonParameters::Nvol
static int Nvol()
Definition: commonParameters.h:109
Staple_lex::lower
void lower(Field_G &, const Field_G &, const int mu, const int nu)
constructs lower staple in mu-nu plane.
Definition: staple_lex.cpp:286
axpy
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
Definition: field.cpp:380
Imp::Fopr_CloverTerm_General::set_config
void set_config(Field *U)
sets the gauge configuration.
Definition: fopr_CloverTerm_General_impl.cpp:104
Imp::Fopr_CloverTerm_General::m_vl
Bridge::VerboseLevel m_vl
Definition: fopr_CloverTerm_General_impl.h:48
Imp::Fopr_CloverTerm_General::m_U
const Field_G * m_U
pointer to gauge configuration.
Definition: fopr_CloverTerm_General_impl.h:61
Imp::Fopr_CloverTerm_General::m_Cdn
Field_G m_Cdn
Definition: fopr_CloverTerm_General_impl.h:65
Imp::Fopr_CloverTerm_General::m_csw
void(Fopr_CloverTerm_General::* m_csw)(Field &, const Field &)
Definition: fopr_CloverTerm_General_impl.h:55
Imp::Fopr_CloverTerm_General::gm5_chiral
void gm5_chiral(Field &, const Field &)
Definition: fopr_CloverTerm_General_impl.cpp:216
Imp::Fopr_CloverTerm_General::m_v2
Field_G m_v2
for calculation of field strength.
Definition: fopr_CloverTerm_General_impl.h:65
Imp::Fopr_CloverTerm_General::mult_csw
void mult_csw(Field &, const Field &)
Definition: fopr_CloverTerm_General_impl.cpp:267
GammaMatrixSet::SIGMA41
@ SIGMA41
Definition: gammaMatrixSet.h:52
CommonParameters::Nc
static int Nc()
Definition: commonParameters.h:115
Imp::Fopr_CloverTerm_General::m_boundary
std::vector< int > m_boundary
Definition: fopr_CloverTerm_General_impl.h:52
Imp::Fopr_CloverTerm_General::m_kappa_t
double m_kappa_t
Definition: fopr_CloverTerm_General_impl.h:50
Imp::Fopr_CloverTerm_General::m_Ex
Field_G m_Ex
Definition: fopr_CloverTerm_General_impl.h:66
ah_Field_G
void ah_Field_G(Field_G &W, const int ex)
Definition: field_G_imp.cpp:462
mult_iGM
void mult_iGM(Field_F &y, const GammaMatrix &gm, const Field_F &x)
gamma matrix multiplication (i is multiplied)
Definition: field_F_imp.cpp:250
Parameters::fetch_int_vector
int fetch_int_vector(const string &key, vector< int > &value) const
Definition: parameters.cpp:429
Imp::Fopr_CloverTerm_General::m_cSW_s
double m_cSW_s
Definition: fopr_CloverTerm_General_impl.h:51
Imp::Fopr_CloverTerm_General::set_fieldstrength
void set_fieldstrength(Field_G &, const int, const int)
Definition: fopr_CloverTerm_General_impl.cpp:544
Imp::Fopr_CloverTerm_General::mult_csw_chiral
void mult_csw_chiral(Field &, const Field &)
Definition: fopr_CloverTerm_General_impl.cpp:276
Imp::Fopr_CloverTerm_General::m_Ndim
int m_Ndim
Definition: fopr_CloverTerm_General_impl.h:58
threadManager.h
Imp::Fopr_CloverTerm_General::sg_index
int sg_index(const int mu, const int nu)
Definition: fopr_CloverTerm_General_impl.h:171
Field::nvol
int nvol() const
Definition: field.h:127
Imp::Fopr_CloverTerm_General::m_staple
Staple_lex m_staple
Definition: fopr_CloverTerm_General_impl.h:64
CommonParameters::NPE
static int NPE()
Definition: commonParameters.h:101
Imp::Fopr_CloverTerm_General::m_Bz
Field_G m_Bz
Definition: fopr_CloverTerm_General_impl.h:66
Imp::Fopr_CloverTerm_General::m_Nd
int m_Nd
Definition: fopr_CloverTerm_General_impl.h:58
Imp::Fopr_CloverTerm_General::flop_count
double flop_count()
this returns the number of floating point operations.
Definition: fopr_CloverTerm_General_impl.cpp:576
Parameters::set_int_vector
void set_int_vector(const string &key, const vector< int > &value)
Definition: parameters.cpp:45
GammaMatrixSet::SIGMA42
@ SIGMA42
Definition: gammaMatrixSet.h:52
multadd_Field_Gnd
void multadd_Field_Gnd(Field_G &W, const int ex, const Field_G &U1, const int ex1, const Field_G &U2, const int ex2, const double ff)
Definition: field_G_imp.cpp:335
Imp::Fopr_CloverTerm_General::m_SG
std::vector< GammaMatrix > m_SG
Definition: fopr_CloverTerm_General_impl.h:70
Imp::Fopr_CloverTerm_General::m_Ey
Field_G m_Ey
Definition: fopr_CloverTerm_General_impl.h:66
Imp::Fopr_CloverTerm_General::mult_csw_dirac
void mult_csw_dirac(Field &, const Field &)
Definition: fopr_CloverTerm_General_impl.cpp:404
Field::ptr
const double * ptr(const int jin, const int site, const int jex) const
Definition: field.h:153
Staple_lex::upper
void upper(Field_G &, const Field_G &, const int mu, const int nu)
constructs upper staple in mu-nu plane.
Definition: staple_lex.cpp:263
Imp::Fopr_CloverTerm_General::m_repr
std::string m_repr
Definition: fopr_CloverTerm_General_impl.h:53
CommonParameters::Nd
static int Nd()
Definition: commonParameters.h:116
Imp::Fopr_CloverTerm_General::set_parameters
void set_parameters(const Parameters &params)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_CloverTerm_General_impl.cpp:32
fopr_Wilson_impl_SU2-inc.h
Bridge::BridgeIO::set_verbose_level
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:133
Imp::Fopr_CloverTerm_General::m_cSW_t
double m_cSW_t
Definition: fopr_CloverTerm_General_impl.h:51
Imp::Fopr_CloverTerm_General::mult_sigmaF
void mult_sigmaF(Field &, const Field &)
Definition: fopr_CloverTerm_General_impl.cpp:260
fopr_CloverTerm_General_impl.h
Imp::Fopr_CloverTerm_General::m_GM5
GammaMatrix m_GM5
Definition: fopr_CloverTerm_General_impl.h:71
GammaMatrixSet::SIGMA23
@ SIGMA23
Definition: gammaMatrixSet.h:51
scal
void scal(Field &x, const double a)
scal(x, a): x = a * x
Definition: field.cpp:261
Parameters::fetch_string
int fetch_string(const string &key, string &value) const
Definition: parameters.cpp:378
Field_F
Wilson-type fermion field.
Definition: field_F.h:37
Parameters::fetch_double
int fetch_double(const string &key, double &value) const
Definition: parameters.cpp:327
GammaMatrixSet::SIGMA12
@ SIGMA12
Definition: gammaMatrixSet.h:51
Imp::Fopr_CloverTerm_General::m_gm5
void(Fopr_CloverTerm_General::* m_gm5)(Field &, const Field &)
Definition: fopr_CloverTerm_General_impl.h:56
Imp::Fopr_CloverTerm_General::mult_gm5
void mult_gm5(Field &v, const Field &w)
multiplies gamma_5 matrix.
Definition: fopr_CloverTerm_General_impl.cpp:174
Imp::Fopr_CloverTerm_General::m_Bx
Field_G m_Bx
Definition: fopr_CloverTerm_General_impl.h:66
GammaMatrixSet::get_GM
GammaMatrix get_GM(GMspecies spec)
Definition: gammaMatrixSet.h:76
Bridge::BridgeIO::crucial
void crucial(const char *format,...)
Definition: bridgeIO.cpp:180
Imp
Clover term operator.
Definition: fopr_CloverTerm_eo_impl.cpp:32
Field
Container of Field-type object.
Definition: field.h:46
Imp::Fopr_CloverTerm_General::m_Cup
Field_G m_Cup
Definition: fopr_CloverTerm_General_impl.h:65
GammaMatrixSet::SIGMA31
@ SIGMA31
Definition: gammaMatrixSet.h:51
ThreadManager::get_thread_id
static int get_thread_id()
returns thread id.
Definition: threadManager.cpp:253
GammaMatrixSet::SIGMA43
@ SIGMA43
Definition: gammaMatrixSet.h:52
Field_G
SU(N) gauge field.
Definition: field_G.h:38
Imp::Fopr_CloverTerm_General::set_csw
void set_csw()
Definition: fopr_CloverTerm_General_impl.cpp:532
Imp::Fopr_CloverTerm_General::class_name
static const std::string class_name
Definition: fopr_CloverTerm_General_impl.h:45
Bridge::BridgeIO::general
void general(const char *format,...)
Definition: bridgeIO.cpp:200
Imp::Fopr_CloverTerm_General::m_kappa_s
double m_kappa_s
Definition: fopr_CloverTerm_General_impl.h:50
multadd_Field_Gdn
void multadd_Field_Gdn(Field_G &W, const int ex, const Field_G &U1, const int ex1, const Field_G &U2, const int ex2, const double ff)
Definition: field_G_imp.cpp:293
mult_Field_Gnd
void mult_Field_Gnd(Field_G &W, const int ex, const Field_G &U1, const int ex1, const Field_G &U2, const int ex2)
Definition: field_G_imp.cpp:173
Imp::Fopr_CloverTerm_General::m_v1
Field_G m_v1
Definition: fopr_CloverTerm_General_impl.h:65
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
Imp::Fopr_CloverTerm_General::get_parameters
void get_parameters(Parameters &params) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_CloverTerm_General_impl.cpp:61
Imp::Fopr_CloverTerm_General::m_Ez
Field_G m_Ez
field strength.
Definition: fopr_CloverTerm_General_impl.h:66
Bridge::BridgeIO::get_verbose_level
static std::string get_verbose_level(const VerboseLevel vl)
Definition: bridgeIO.cpp:154