19 #if defined USE_GROUP_SU3
21 #elif defined USE_GROUP_SU2
23 #elif defined USE_GROUP_SU_N
45 const int Nthread = 1;
46 const int i_thread = 0;
48 const int is =
nvol() * i_thread / Nthread;
49 const int ns =
nvol() * (i_thread + 1) / Nthread - is;
51 for (
int mu = 0; mu <
nex(); ++mu) {
52 for (
int site = is; site < is + ns; ++site) {
66 for (
int mu = 0; mu <
m_Nex; ++mu) {
67 for (
int site = 0; site <
m_Nvol; ++site) {
68 this->
mat(ut, site, mu);
90 const int Nthread = 1;
91 const int i_thread = 0;
93 const int is =
nvol() * i_thread / Nthread;
94 const int ns =
nvol() * (i_thread + 1) / Nthread - is;
96 for (
int mu = 0; mu <
nex(); ++mu) {
97 for (
int site = is; site < is + ns; ++site) {
108 const Field_G& U1,
const int ex1,
109 const Field_G& U2,
const int ex2)
111 assert(ex < W.
nex());
112 assert(ex1 < U1.
nex());
113 assert(ex2 < U2.
nex());
119 const int Nthread = 1;
120 const int i_thread = 0;
122 const int is = W.
nvol() * i_thread / Nthread;
123 const int ns = W.
nvol() * (i_thread + 1) / Nthread - is;
125 double *g = W.
ptr(0, is, ex);
126 const double *g1 = U1.
ptr(0, is, ex1);
127 const double *g2 = U2.
ptr(0, is, ex2);
129 const int Nc = W.
nc();
130 const int Nc2 = 2 * Nc;
131 const int Ndf = Nc2 * Nc;
133 for (
int site = 0; site < ns; ++site) {
136 for (
int ic2 = 0; ic2 < Nc; ++ic2) {
137 for (
int ic1 = 0; ic1 < Nc; ++ic1) {
138 int jg2 = ic2 * 2 + ig;
139 int jg1 = ic1 * Nc2 + ig;
140 g[2 * ic2 + Nc2 * ic1 + ig] = mult_Gnn_r(&g1[jg1], &g2[jg2], Nc);
141 g[2 * ic2 + 1 + Nc2 * ic1 + ig] = mult_Gnn_i(&g1[jg1], &g2[jg2], Nc);
150 const Field_G& U1,
const int ex1,
151 const Field_G& U2,
const int ex2)
153 assert(ex < W.
nex());
154 assert(ex1 < U1.
nex());
155 assert(ex2 < U2.
nex());
161 const int Nthread = 1;
162 const int i_thread = 0;
164 const int is = W.
nvol() * i_thread / Nthread;
165 const int ns = W.
nvol() * (i_thread + 1) / Nthread - is;
167 double *g = W.
ptr(0, is, ex);
168 const double *g1 = U1.
ptr(0, is, ex1);
169 const double *g2 = U2.
ptr(0, is, ex2);
171 const int Nc = W.
nc();
172 const int Nc2 = 2 * Nc;
173 const int Ndf = Nc2 * Nc;
175 for (
int site = 0; site < ns; ++site) {
178 for (
int ic2 = 0; ic2 < Nc; ++ic2) {
179 for (
int ic1 = 0; ic1 < Nc; ++ic1) {
180 int jg2 = ic2 * 2 + ig;
181 int jg1 = ic1 * 2 + ig;
182 g[2 * ic2 + Nc2 * ic1 + ig] = mult_Gdn_r(&g1[jg1], &g2[jg2], Nc);
183 g[2 * ic2 + 1 + Nc2 * ic1 + ig] = mult_Gdn_i(&g1[jg1], &g2[jg2], Nc);
192 const Field_G& U1,
const int ex1,
193 const Field_G& U2,
const int ex2)
195 assert(ex < W.
nex());
196 assert(ex1 < U1.
nex());
197 assert(ex2 < U2.
nex());
203 const int Nthread = 1;
204 const int i_thread = 0;
206 const int is = W.
nvol() * i_thread / Nthread;
207 const int ns = W.
nvol() * (i_thread + 1) / Nthread - is;
209 double *g = W.
ptr(0, is, ex);
210 const double *g1 = U1.
ptr(0, is, ex1);
211 const double *g2 = U2.
ptr(0, is, ex2);
213 const int Nc = W.
nc();
214 const int Nc2 = 2 * Nc;
215 const int Ndf = Nc2 * Nc;
217 for (
int site = 0; site < ns; ++site) {
220 for (
int ic2 = 0; ic2 < Nc; ++ic2) {
221 for (
int ic1 = 0; ic1 < Nc; ++ic1) {
222 int jg2 = ic2 * Nc2 + ig;
223 int jg1 = ic1 * Nc2 + ig;
224 g[2 * ic2 + Nc2 * ic1 + ig] = mult_Gnd_r(&g1[jg1], &g2[jg2], Nc);
225 g[2 * ic2 + 1 + Nc2 * ic1 + ig] = mult_Gnd_i(&g1[jg1], &g2[jg2], Nc);
234 const Field_G& U1,
const int ex1,
235 const Field_G& U2,
const int ex2)
237 assert(ex < W.
nex());
238 assert(ex1 < U1.
nex());
239 assert(ex2 < U2.
nex());
245 const int Nthread = 1;
246 const int i_thread = 0;
248 const int is = W.
nvol() * i_thread / Nthread;
249 const int ns = W.
nvol() * (i_thread + 1) / Nthread - is;
251 double *g = W.
ptr(0, is, ex);
252 const double *g1 = U1.
ptr(0, is, ex1);
253 const double *g2 = U2.
ptr(0, is, ex2);
255 const int Nc = W.
nc();
256 const int Nc2 = 2 * Nc;
257 const int Ndf = Nc2 * Nc;
259 for (
int site = 0; site < ns; ++site) {
262 for (
int ic2 = 0; ic2 < Nc; ++ic2) {
263 for (
int ic1 = 0; ic1 < Nc; ++ic1) {
264 int jg2 = ic2 * Nc2 + ig;
265 int jg1 = ic1 * 2 + ig;
266 g[2 * ic2 + Nc2 * ic1 + ig] = mult_Gdd_r(&g1[jg1], &g2[jg2], Nc);
267 g[2 * ic2 + 1 + Nc2 * ic1 + ig] = mult_Gdd_i(&g1[jg1], &g2[jg2], Nc);
276 const Field_G& U1,
const int ex1,
277 const Field_G& U2,
const int ex2,
280 assert(ex < W.
nex());
281 assert(ex1 < U1.
nex());
282 assert(ex2 < U2.
nex());
288 const int Nthread = 1;
289 const int i_thread = 0;
291 const int is = W.
nvol() * i_thread / Nthread;
292 const int ns = W.
nvol() * (i_thread + 1) / Nthread - is;
294 double *g = W.
ptr(0, is, ex);
295 const double *g1 = U1.
ptr(0, is, ex1);
296 const double *g2 = U2.
ptr(0, is, ex2);
298 const int Nc = W.
nc();
299 const int Nc2 = 2 * Nc;
300 const int Ndf = Nc2 * Nc;
302 for (
int site = 0; site < ns; ++site) {
305 for (
int ic2 = 0; ic2 < Nc; ++ic2) {
306 for (
int ic1 = 0; ic1 < Nc; ++ic1) {
307 int jg2 = ic2 * 2 + ig;
308 int jg1 = ic1 * Nc2 + ig;
309 g[2 * ic2 + Nc2 * ic1 + ig] +=
310 ff * mult_Gnn_r(&g1[jg1], &g2[jg2], Nc);
311 g[2 * ic2 + 1 + Nc2 * ic1 + ig] +=
312 ff * mult_Gnn_i(&g1[jg1], &g2[jg2], Nc);
321 const Field_G& U1,
const int ex1,
322 const Field_G& U2,
const int ex2,
325 assert(ex < W.
nex());
326 assert(ex1 < U1.
nex());
327 assert(ex2 < U2.
nex());
333 const int Nthread = 1;
334 const int i_thread = 0;
336 const int is = W.
nvol() * i_thread / Nthread;
337 const int ns = W.
nvol() * (i_thread + 1) / Nthread - is;
339 double *g = W.
ptr(0, is, ex);
340 const double *g1 = U1.
ptr(0, is, ex1);
341 const double *g2 = U2.
ptr(0, is, ex2);
343 const int Nc = W.
nc();
344 const int Nc2 = 2 * Nc;
345 const int Ndf = Nc2 * Nc;
347 for (
int site = 0; site < ns; ++site) {
350 for (
int ic2 = 0; ic2 < Nc; ++ic2) {
351 for (
int ic1 = 0; ic1 < Nc; ++ic1) {
352 int jg2 = ic2 * 2 + ig;
353 int jg1 = ic1 * 2 + ig;
354 g[2 * ic2 + Nc2 * ic1 + ig] +=
355 ff * mult_Gdn_r(&g1[jg1], &g2[jg2], Nc);
356 g[2 * ic2 + 1 + Nc2 * ic1 + ig] +=
357 ff * mult_Gdn_i(&g1[jg1], &g2[jg2], Nc);
366 const Field_G& U1,
const int ex1,
367 const Field_G& U2,
const int ex2,
370 assert(ex < W.
nex());
371 assert(ex1 < U1.
nex());
372 assert(ex2 < U2.
nex());
378 const int Nthread = 1;
379 const int i_thread = 0;
381 const int is = W.
nvol() * i_thread / Nthread;
382 const int ns = W.
nvol() * (i_thread + 1) / Nthread - is;
384 double *g = W.
ptr(0, is, ex);
385 const double *g1 = U1.
ptr(0, is, ex1);
386 const double *g2 = U2.
ptr(0, is, ex2);
388 const int Nc = W.
nc();
389 const int Nc2 = 2 * Nc;
390 const int Ndf = Nc2 * Nc;
392 for (
int site = 0; site < ns; ++site) {
395 for (
int ic2 = 0; ic2 < Nc; ++ic2) {
396 for (
int ic1 = 0; ic1 < Nc; ++ic1) {
397 int jg2 = ic2 * Nc2 + ig;
398 int jg1 = ic1 * Nc2 + ig;
399 g[2 * ic2 + Nc2 * ic1 + ig] +=
400 ff * mult_Gnd_r(&g1[jg1], &g2[jg2], Nc);
401 g[2 * ic2 + 1 + Nc2 * ic1 + ig]
402 += ff * mult_Gnd_i(&g1[jg1], &g2[jg2], Nc);
411 const Field_G& U1,
const int ex1,
412 const Field_G& U2,
const int ex2,
415 assert(ex < W.
nex());
416 assert(ex1 < U1.
nex());
417 assert(ex2 < U2.
nex());
423 const int Nthread = 1;
424 const int i_thread = 0;
426 const int is = W.
nvol() * i_thread / Nthread;
427 const int ns = W.
nvol() * (i_thread + 1) / Nthread - is;
429 double *g = W.
ptr(0, is, ex);
430 const double *g1 = U1.
ptr(0, is, ex1);
431 const double *g2 = U2.
ptr(0, is, ex2);
433 const int Nc = W.
nc();
434 const int Nc2 = 2 * Nc;
435 const int Ndf = Nc2 * Nc;
437 for (
int site = 0; site < ns; ++site) {
440 for (
int ic2 = 0; ic2 < Nc; ++ic2) {
441 for (
int ic1 = 0; ic1 < Nc; ++ic1) {
442 int jg2 = ic2 * Nc2 + ig;
443 int jg1 = ic1 * 2 + ig;
444 g[2 * ic2 + Nc2 * ic1 + ig] +=
445 ff * mult_Gdd_r(&g1[jg1], &g2[jg2], Nc);
446 g[2 * ic2 + 1 + Nc2 * ic1 + ig] +=
447 ff * mult_Gdd_i(&g1[jg1], &g2[jg2], Nc);
457 assert(ex < W.
nex());
461 const int Nthread = 1;
462 const int i_thread = 0;
464 const int is = W.
nvol() * i_thread / Nthread;
465 const int ns = W.
nvol() * (i_thread + 1) / Nthread - is;
467 double *g = W.
ptr(0, is, ex);
469 const int Nc = W.
nc();
470 const int Ndf = 2 * Nc * Nc;
472 for (
int site = 0; site < ns; ++site) {
475 for (
int a = 0; a < Nc; ++a) {
476 for (
int b = a + 1; b < Nc; ++b) {
477 double re = g[2 * (Nc * a + b) + ig] - g[2 * (Nc * b + a) + ig];
478 double im = g[2 * (Nc * a + b) + 1 + ig] + g[2 * (Nc * b + a) + 1 + ig];
480 g[2 * (Nc * a + b) + ig] = 0.5 * re;
481 g[2 * (Nc * a + b) + 1 + ig] = 0.5 * im;
483 g[2 * (Nc * b + a) + ig] = -0.5 * re;
484 g[2 * (Nc * b + a) + 1 + ig] = 0.5 * im;
488 for (
int cc = 0; cc < Nc; ++cc) {
489 tr += g[2 * (Nc * cc + cc) + 1 + ig];
492 for (
int cc = 0; cc < Nc; ++cc) {
493 g[2 * (Nc * cc + cc) + ig] = 0.0;
494 g[2 * (Nc * cc + cc) + 1 + ig] -= tr;
503 assert(ex < W.
nex());
507 const int Nthread = 1;
508 const int i_thread = 0;
510 const int is = W.
nvol() * i_thread / Nthread;
511 const int ns = W.
nvol() * (i_thread + 1) / Nthread - is;
513 double *g = W.
ptr(0, is, ex);
515 const int Nc = W.
nc();
516 const int Ndf = 2 * Nc * Nc;
518 for (
int site = 0; site < ns; ++site) {
521 for (
int a = 0; a < Nc; ++a) {
522 for (
int b = a; b < Nc; ++b) {
523 double re = g[2 * (Nc * a + b) + ig] - g[2 * (Nc * b + a) + ig];
524 double im = g[2 * (Nc * a + b) + 1 + ig] + g[2 * (Nc * b + a) + 1 + ig];
526 g[2 * (Nc * a + b) + ig] = 0.5 * re;
527 g[2 * (Nc * a + b) + 1 + ig] = 0.5 * im;
529 g[2 * (Nc * b + a) + ig] = -0.5 * re;
530 g[2 * (Nc * b + a) + 1 + ig] = 0.5 * im;
539 const double alpha,
const Field_G& iP,
const Field_G& U,
const int Nprec)
545 const int Nvol = U.
nvol();
546 const int Nex = U.
nex();
551 for (
int ex = 0; ex < Nex; ++ex) {
552 for (
int site = 0; site < Nvol; ++site) {
553 u0 = U.
mat(site, ex);
554 v0 = iP.
mat(site, ex);
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)
const double * ptr(const int jin, const int site, const int jex) const
void at_Field_G(Field_G &W, const int ex)
void multadd_Field_Gnn(Field_G &W, const int ex, const Field_G &U1, const int ex1, const Field_G &U2, const int ex2, const double ff)
void check()
check of assumptions for performance implementation.
void mult_Field_Gnn(Field_G &W, const int ex, const Field_G &U1, const int ex1, const Field_G &U2, const int ex2)
void ah_Field_G(Field_G &W, const int ex)
virtual void gauss_lex_global(Field &)
gaussian random number defined on global lattice.
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)
void set_random(RandomNumbers *rand)
void multadd_Field_Gdd(Field_G &W, const int ex, const Field_G &U1, const int ex1, const Field_G &U2, const int ex2, const double ff)
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_Field_Gdd(Field_G &W, const int ex, const Field_G &U1, const int ex1, const Field_G &U2, const int ex2)
void mult_Field_Gdn(Field_G &W, const int ex, const Field_G &U1, const int ex1, const Field_G &U2, const int ex2)
Base class of random number generators.
Mat_SU_N mat_exp(const double alpha, const Mat_SU_N &iv, const Mat_SU_N &u, const int Nprec)
void set_mat(const int site, const int mn, const Mat_SU_N &U)
void mult_exp_Field_G(Field_G &W, const double alpha, const Field_G &iP, const Field_G &U, const int Nprec)
Mat_SU_N mat(const int site, const int mn=0) const