19 #if defined USE_GROUP_SU3
21 #elif defined USE_GROUP_SU2
23 #elif defined USE_GROUP_SU_N
34 const std::string str_vlevel = params.
get_string(
"verbose_level");
39 double kappa_s, kappa_t, cSW_s, cSW_t;
43 err += params.
fetch_double(
"hopping_parameter_spatial", kappa_s);
44 err += params.
fetch_double(
"hopping_parameter_temporal", kappa_t);
45 err += params.
fetch_double(
"clover_coefficient_spatial", cSW_s);
46 err += params.
fetch_double(
"clover_coefficient_temporal", cSW_t);
61 const double cSW_s,
const double cSW_t,
62 const std::vector<int> bc)
70 for (
int mu = 0; mu <
m_Ndim; ++mu) {
76 assert(bc.size() ==
m_Ndim);
141 }
else if (
m_repr ==
"Chiral") {
160 (this->*
m_gm5)(v, f);
170 const double *v1 = f.
ptr(0);
171 double *v2 = w.
ptr(0);
175 const int id3 = Nvc * 2;
176 const int id4 = Nvc * 3;
182 const int is =
m_Nvol * i_thread / Nthread;
183 const int ns =
m_Nvol * (i_thread + 1) / Nthread - is;
185 for (
int site = is; site < is + ns; ++site) {
187 for (
int icc = 0; icc < Nvc; icc++) {
188 int in = Nvc * Nd * site;
190 v2[icc + id1 + in] = v1[icc + id3 + in];
191 v2[icc + id2 + in] = v1[icc + id4 + in];
192 v2[icc + id3 + in] = v1[icc + id1 + in];
193 v2[icc + id4 + in] = v1[icc + id2 + in];
205 const double *v1 = f.
ptr(0);
206 double *v2 = w.
ptr(0);
210 const int id3 = Nvc * 2;
211 const int id4 = Nvc * 3;
217 const int is =
m_Nvol * i_thread / Nthread;
218 const int ns =
m_Nvol * (i_thread + 1) / Nthread - is;
220 for (
int site = is; site < is + ns; ++site) {
222 for (
int icc = 0; icc < Nvc; icc++) {
223 int in = Nvc * Nd * site;
225 v2[icc + id1 + in] = v1[icc + id1 + in];
226 v2[icc + id2 + in] = v1[icc + id2 + in];
227 v2[icc + id3 + in] = -v1[icc + id3 + in];
228 v2[icc + id4 + in] = -v1[icc + id4 + in];
236 const int mu,
const int nu)
255 (this->*
m_csw)(v, w);
264 assert(w.
nex() == 1);
267 const int Nvc = 2 * Nc;
268 const int Ndf = 2 * Nc * Nc;
270 const int Nvol = w.
nvol();
274 const int id3 = Nvc * 2;
275 const int id4 = Nvc * 3;
280 const double *w2 = w.
ptr(0);
281 double *v2 = v.
ptr(0);
294 const int is =
m_Nvol * i_thread / Nthread;
295 const int ns =
m_Nvol * (i_thread + 1) / Nthread - is;
297 for (
int site = is; site < is + ns; ++site) {
298 int iv = Nvc * Nd * site;
301 for (
int ic = 0; ic < Nc; ++ic) {
304 int ic_g = ic * Nvc + ig;
306 v2[ic_r + id1 + iv] = 0.0;
307 v2[ic_i + id1 + iv] = 0.0;
308 v2[ic_r + id2 + iv] = 0.0;
309 v2[ic_i + id2 + iv] = 0.0;
311 v2[ic_r + id3 + iv] = 0.0;
312 v2[ic_i + id3 + iv] = 0.0;
313 v2[ic_r + id4 + iv] = 0.0;
314 v2[ic_i + id4 + iv] = 0.0;
317 v2[ic_r + id1 + iv] -= kappa_cSW_s * mult_uv_i(&Bx[ic_g], &w2[id2 + iv], Nc);
318 v2[ic_i + id1 + iv] += kappa_cSW_s * mult_uv_r(&Bx[ic_g], &w2[id2 + iv], Nc);
319 v2[ic_r + id2 + iv] -= kappa_cSW_s * mult_uv_i(&Bx[ic_g], &w2[id1 + iv], Nc);
320 v2[ic_i + id2 + iv] += kappa_cSW_s * mult_uv_r(&Bx[ic_g], &w2[id1 + iv], Nc);
322 v2[ic_r + id3 + iv] -= kappa_cSW_s * mult_uv_i(&Bx[ic_g], &w2[id4 + iv], Nc);
323 v2[ic_i + id3 + iv] += kappa_cSW_s * mult_uv_r(&Bx[ic_g], &w2[id4 + iv], Nc);
324 v2[ic_r + id4 + iv] -= kappa_cSW_s * mult_uv_i(&Bx[ic_g], &w2[id3 + iv], Nc);
325 v2[ic_i + id4 + iv] += kappa_cSW_s * mult_uv_r(&Bx[ic_g], &w2[id3 + iv], Nc);
328 v2[ic_r + id1 + iv] += kappa_cSW_s * mult_uv_r(&By[ic_g], &w2[id2 + iv], Nc);
329 v2[ic_i + id1 + iv] += kappa_cSW_s * mult_uv_i(&By[ic_g], &w2[id2 + iv], Nc);
330 v2[ic_r + id2 + iv] -= kappa_cSW_s * mult_uv_r(&By[ic_g], &w2[id1 + iv], Nc);
331 v2[ic_i + id2 + iv] -= kappa_cSW_s * mult_uv_i(&By[ic_g], &w2[id1 + iv], Nc);
333 v2[ic_r + id3 + iv] += kappa_cSW_s * mult_uv_r(&By[ic_g], &w2[id4 + iv], Nc);
334 v2[ic_i + id3 + iv] += kappa_cSW_s * mult_uv_i(&By[ic_g], &w2[id4 + iv], Nc);
335 v2[ic_r + id4 + iv] -= kappa_cSW_s * mult_uv_r(&By[ic_g], &w2[id3 + iv], Nc);
336 v2[ic_i + id4 + iv] -= kappa_cSW_s * mult_uv_i(&By[ic_g], &w2[id3 + iv], Nc);
339 v2[ic_r + id1 + iv] -= kappa_cSW_s * mult_uv_i(&Bz[ic_g], &w2[id1 + iv], Nc);
340 v2[ic_i + id1 + iv] += kappa_cSW_s * mult_uv_r(&Bz[ic_g], &w2[id1 + iv], Nc);
341 v2[ic_r + id2 + iv] += kappa_cSW_s * mult_uv_i(&Bz[ic_g], &w2[id2 + iv], Nc);
342 v2[ic_i + id2 + iv] -= kappa_cSW_s * mult_uv_r(&Bz[ic_g], &w2[id2 + iv], Nc);
344 v2[ic_r + id3 + iv] -= kappa_cSW_s * mult_uv_i(&Bz[ic_g], &w2[id3 + iv], Nc);
345 v2[ic_i + id3 + iv] += kappa_cSW_s * mult_uv_r(&Bz[ic_g], &w2[id3 + iv], Nc);
346 v2[ic_r + id4 + iv] += kappa_cSW_s * mult_uv_i(&Bz[ic_g], &w2[id4 + iv], Nc);
347 v2[ic_i + id4 + iv] -= kappa_cSW_s * mult_uv_r(&Bz[ic_g], &w2[id4 + iv], Nc);
350 v2[ic_r + id1 + iv] += kappa_cSW_t * mult_uv_i(&Ex[ic_g], &w2[id2 + iv], Nc);
351 v2[ic_i + id1 + iv] -= kappa_cSW_t * mult_uv_r(&Ex[ic_g], &w2[id2 + iv], Nc);
352 v2[ic_r + id2 + iv] += kappa_cSW_t * mult_uv_i(&Ex[ic_g], &w2[id1 + iv], Nc);
353 v2[ic_i + id2 + iv] -= kappa_cSW_t * mult_uv_r(&Ex[ic_g], &w2[id1 + iv], Nc);
355 v2[ic_r + id3 + iv] -= kappa_cSW_t * mult_uv_i(&Ex[ic_g], &w2[id4 + iv], Nc);
356 v2[ic_i + id3 + iv] += kappa_cSW_t * mult_uv_r(&Ex[ic_g], &w2[id4 + iv], Nc);
357 v2[ic_r + id4 + iv] -= kappa_cSW_t * mult_uv_i(&Ex[ic_g], &w2[id3 + iv], Nc);
358 v2[ic_i + id4 + iv] += kappa_cSW_t * mult_uv_r(&Ex[ic_g], &w2[id3 + iv], Nc);
361 v2[ic_r + id1 + iv] -= kappa_cSW_t * mult_uv_r(&Ey[ic_g], &w2[id2 + iv], Nc);
362 v2[ic_i + id1 + iv] -= kappa_cSW_t * mult_uv_i(&Ey[ic_g], &w2[id2 + iv], Nc);
363 v2[ic_r + id2 + iv] += kappa_cSW_t * mult_uv_r(&Ey[ic_g], &w2[id1 + iv], Nc);
364 v2[ic_i + id2 + iv] += kappa_cSW_t * mult_uv_i(&Ey[ic_g], &w2[id1 + iv], Nc);
366 v2[ic_r + id3 + iv] += kappa_cSW_t * mult_uv_r(&Ey[ic_g], &w2[id4 + iv], Nc);
367 v2[ic_i + id3 + iv] += kappa_cSW_t * mult_uv_i(&Ey[ic_g], &w2[id4 + iv], Nc);
368 v2[ic_r + id4 + iv] -= kappa_cSW_t * mult_uv_r(&Ey[ic_g], &w2[id3 + iv], Nc);
369 v2[ic_i + id4 + iv] -= kappa_cSW_t * mult_uv_i(&Ey[ic_g], &w2[id3 + iv], Nc);
372 v2[ic_r + id1 + iv] += kappa_cSW_t * mult_uv_i(&Ez[ic_g], &w2[id1 + iv], Nc);
373 v2[ic_i + id1 + iv] -= kappa_cSW_t * mult_uv_r(&Ez[ic_g], &w2[id1 + iv], Nc);
374 v2[ic_r + id2 + iv] -= kappa_cSW_t * mult_uv_i(&Ez[ic_g], &w2[id2 + iv], Nc);
375 v2[ic_i + id2 + iv] += kappa_cSW_t * mult_uv_r(&Ez[ic_g], &w2[id2 + iv], Nc);
377 v2[ic_r + id3 + iv] -= kappa_cSW_t * mult_uv_i(&Ez[ic_g], &w2[id3 + iv], Nc);
378 v2[ic_i + id3 + iv] += kappa_cSW_t * mult_uv_r(&Ez[ic_g], &w2[id3 + iv], Nc);
379 v2[ic_r + id4 + iv] += kappa_cSW_t * mult_uv_i(&Ez[ic_g], &w2[id4 + iv], Nc);
380 v2[ic_i + id4 + iv] -= kappa_cSW_t * mult_uv_r(&Ez[ic_g], &w2[id4 + iv], Nc);
392 assert(w.
nex() == 1);
395 const int Nvc = 2 * Nc;
396 const int Ndf = 2 * Nc * Nc;
398 const int Nvol = w.
nvol();
402 const int id3 = Nvc * 2;
403 const int id4 = Nvc * 3;
408 const double *w2 = w.
ptr(0);
409 double *v2 = v.
ptr(0);
422 const int is =
m_Nvol * i_thread / Nthread;
423 const int ns =
m_Nvol * (i_thread + 1) / Nthread - is;
425 for (
int site = is; site < is + ns; ++site) {
426 int iv = Nvc * Nd * site;
429 for (
int ic = 0; ic < Nc; ++ic) {
432 int ic_g = ic * Nvc + ig;
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;
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;
445 v2[ic_r + id1 + iv] -= kappa_cSW_s * mult_uv_i(&Bx[ic_g], &w2[id2 + iv], Nc);
446 v2[ic_i + id1 + iv] += kappa_cSW_s * mult_uv_r(&Bx[ic_g], &w2[id2 + iv], Nc);
447 v2[ic_r + id2 + iv] -= kappa_cSW_s * mult_uv_i(&Bx[ic_g], &w2[id1 + iv], Nc);
448 v2[ic_i + id2 + iv] += kappa_cSW_s * mult_uv_r(&Bx[ic_g], &w2[id1 + iv], Nc);
450 v2[ic_r + id3 + iv] -= kappa_cSW_s * mult_uv_i(&Bx[ic_g], &w2[id4 + iv], Nc);
451 v2[ic_i + id3 + iv] += kappa_cSW_s * mult_uv_r(&Bx[ic_g], &w2[id4 + iv], Nc);
452 v2[ic_r + id4 + iv] -= kappa_cSW_s * mult_uv_i(&Bx[ic_g], &w2[id3 + iv], Nc);
453 v2[ic_i + id4 + iv] += kappa_cSW_s * mult_uv_r(&Bx[ic_g], &w2[id3 + iv], Nc);
456 v2[ic_r + id1 + iv] += kappa_cSW_s * mult_uv_r(&By[ic_g], &w2[id2 + iv], Nc);
457 v2[ic_i + id1 + iv] += kappa_cSW_s * mult_uv_i(&By[ic_g], &w2[id2 + iv], Nc);
458 v2[ic_r + id2 + iv] -= kappa_cSW_s * mult_uv_r(&By[ic_g], &w2[id1 + iv], Nc);
459 v2[ic_i + id2 + iv] -= kappa_cSW_s * mult_uv_i(&By[ic_g], &w2[id1 + iv], Nc);
461 v2[ic_r + id3 + iv] += kappa_cSW_s * mult_uv_r(&By[ic_g], &w2[id4 + iv], Nc);
462 v2[ic_i + id3 + iv] += kappa_cSW_s * mult_uv_i(&By[ic_g], &w2[id4 + iv], Nc);
463 v2[ic_r + id4 + iv] -= kappa_cSW_s * mult_uv_r(&By[ic_g], &w2[id3 + iv], Nc);
464 v2[ic_i + id4 + iv] -= kappa_cSW_s * mult_uv_i(&By[ic_g], &w2[id3 + iv], Nc);
467 v2[ic_r + id1 + iv] -= kappa_cSW_s * mult_uv_i(&Bz[ic_g], &w2[id1 + iv], Nc);
468 v2[ic_i + id1 + iv] += kappa_cSW_s * mult_uv_r(&Bz[ic_g], &w2[id1 + iv], Nc);
469 v2[ic_r + id2 + iv] += kappa_cSW_s * mult_uv_i(&Bz[ic_g], &w2[id2 + iv], Nc);
470 v2[ic_i + id2 + iv] -= kappa_cSW_s * mult_uv_r(&Bz[ic_g], &w2[id2 + iv], Nc);
472 v2[ic_r + id3 + iv] -= kappa_cSW_s * mult_uv_i(&Bz[ic_g], &w2[id3 + iv], Nc);
473 v2[ic_i + id3 + iv] += kappa_cSW_s * mult_uv_r(&Bz[ic_g], &w2[id3 + iv], Nc);
474 v2[ic_r + id4 + iv] += kappa_cSW_s * mult_uv_i(&Bz[ic_g], &w2[id4 + iv], Nc);
475 v2[ic_i + id4 + iv] -= kappa_cSW_s * mult_uv_r(&Bz[ic_g], &w2[id4 + iv], Nc);
478 v2[ic_r + id1 + iv] += kappa_cSW_t * mult_uv_i(&Ex[ic_g], &w2[id4 + iv], Nc);
479 v2[ic_i + id1 + iv] -= kappa_cSW_t * mult_uv_r(&Ex[ic_g], &w2[id4 + iv], Nc);
480 v2[ic_r + id2 + iv] += kappa_cSW_t * mult_uv_i(&Ex[ic_g], &w2[id3 + iv], Nc);
481 v2[ic_i + id2 + iv] -= kappa_cSW_t * mult_uv_r(&Ex[ic_g], &w2[id3 + iv], Nc);
483 v2[ic_r + id3 + iv] += kappa_cSW_t * mult_uv_i(&Ex[ic_g], &w2[id2 + iv], Nc);
484 v2[ic_i + id3 + iv] -= kappa_cSW_t * mult_uv_r(&Ex[ic_g], &w2[id2 + iv], Nc);
485 v2[ic_r + id4 + iv] += kappa_cSW_t * mult_uv_i(&Ex[ic_g], &w2[id1 + iv], Nc);
486 v2[ic_i + id4 + iv] -= kappa_cSW_t * mult_uv_r(&Ex[ic_g], &w2[id1 + iv], Nc);
489 v2[ic_r + id1 + iv] -= kappa_cSW_t * mult_uv_r(&Ey[ic_g], &w2[id4 + iv], Nc);
490 v2[ic_i + id1 + iv] -= kappa_cSW_t * mult_uv_i(&Ey[ic_g], &w2[id4 + iv], Nc);
491 v2[ic_r + id2 + iv] += kappa_cSW_t * mult_uv_r(&Ey[ic_g], &w2[id3 + iv], Nc);
492 v2[ic_i + id2 + iv] += kappa_cSW_t * mult_uv_i(&Ey[ic_g], &w2[id3 + iv], Nc);
494 v2[ic_r + id3 + iv] -= kappa_cSW_t * mult_uv_r(&Ey[ic_g], &w2[id2 + iv], Nc);
495 v2[ic_i + id3 + iv] -= kappa_cSW_t * mult_uv_i(&Ey[ic_g], &w2[id2 + iv], Nc);
496 v2[ic_r + id4 + iv] += kappa_cSW_t * mult_uv_r(&Ey[ic_g], &w2[id1 + iv], Nc);
497 v2[ic_i + id4 + iv] += kappa_cSW_t * mult_uv_i(&Ey[ic_g], &w2[id1 + iv], Nc);
500 v2[ic_r + id1 + iv] += kappa_cSW_t * mult_uv_i(&Ez[ic_g], &w2[id3 + iv], Nc);
501 v2[ic_i + id1 + iv] -= kappa_cSW_t * mult_uv_r(&Ez[ic_g], &w2[id3 + iv], Nc);
502 v2[ic_r + id2 + iv] -= kappa_cSW_t * mult_uv_i(&Ez[ic_g], &w2[id4 + iv], Nc);
503 v2[ic_i + id2 + iv] += kappa_cSW_t * mult_uv_r(&Ez[ic_g], &w2[id4 + iv], Nc);
505 v2[ic_r + id3 + iv] += kappa_cSW_t * mult_uv_i(&Ez[ic_g], &w2[id1 + iv], Nc);
506 v2[ic_i + id3 + iv] -= kappa_cSW_t * mult_uv_r(&Ez[ic_g], &w2[id1 + iv], Nc);
507 v2[ic_r + id4 + iv] -= kappa_cSW_t * mult_uv_i(&Ez[ic_g], &w2[id2 + iv], Nc);
508 v2[ic_i + id4 + iv] += kappa_cSW_t * mult_uv_r(&Ez[ic_g], &w2[id2 + iv], Nc);
529 const int mu,
const int nu)
533 assert(Nthread == 1);
572 const double gflop = flop_site * (Nvol * (NPE / 1.0e+9));
void scal(Field &x, const double a)
scal(x, a): x = a * x
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
void mult_isigma(Field_F &, const Field_F &, const int mu, const int nu)
void general(const char *format,...)
GammaMatrix get_GM(GMspecies spec)
void set_parameters(const Parameters ¶ms)
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.
int fetch_double(const string &key, double &value) const
Field_G m_Ez
field strength.
int sg_index(const int mu, const int nu)
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 set_fieldstrength(Field_G &, const int, const int)
void lower(Field_G &, const Field_G &, const int mu, const int nu)
constructs lower staple in mu-nu plane.
static int get_thread_id()
returns thread id.
Wilson-type fermion field.
void gm5_dirac(Field &, const Field &)
const Field_G * m_U
pointer to gauge configuration.
void mult_csw_dirac(Field &, const Field &)
void gm5_chiral(Field &, const Field &)
void mult_iGM(Field_F &y, const GammaMatrix &gm, const Field_F &x)
gamma matrix multiplication (i is multiplied)
Bridge::VerboseLevel m_vl
void upper(Field_G &, const Field_G &, const int mu, const int nu)
constructs upper staple in mu-nu plane.
void set_config(Field *U)
setting pointer to the gauge configuration.
void(Fopr_CloverTerm_General::* m_gm5)(Field &, const Field &)
std::vector< GammaMatrix > m_SG
void mult_csw(Field &, const Field &)
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
void crucial(const char *format,...)
void mult_sigmaF(Field &, const Field &)
std::vector< int > m_boundary
void init(std::string repr)
Field_G m_v2
for calculation of field strength.
void mult_gm5(Field &v, const Field &w)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
void mult_csw_chiral(Field &, const Field &)
double flop_count()
this returns the number of floating point operations.
string get_string(const string &key) const
int fetch_int_vector(const string &key, vector< int > &value) const
static const std::string class_name
static VerboseLevel set_verbose_level(const std::string &str)
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(Fopr_CloverTerm_General::* m_csw)(Field &, const Field &)
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)