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