21 #if defined USE_GROUP_SU3
23 #elif defined USE_GROUP_SU2
25 #elif defined USE_GROUP_SU_N
46 set_threadtask(ith, nth, is, ns,
m_Nvol);
48 for (
int mu = 0; mu <
m_Nex; ++mu) {
49 for (
int site = is; site < ns; ++site) {
64 set_threadtask(ith, nth, is, ns,
m_Nvol);
66 for (
int mu = 0; mu <
m_Nex; ++mu) {
67 for (
int site = is; site <
m_Nvol; ++site) {
68 this->
mat(ut, site, mu);
82 set_threadtask(ith, nth, is, ns,
m_Nvol);
84 for (
int mu = 0; mu <
m_Nex; ++mu) {
85 for (
int site = is; site < ns; ++site) {
96 const Field_G& U1,
const int ex1,
97 const Field_G& U2,
const int ex2)
101 assert(ex < W.
nex());
102 assert(ex1 < U1.
nex());
103 assert(ex2 < U2.
nex());
107 int ith, nth, is, ns;
108 set_threadtask(ith, nth, is, ns, Nvol);
110 double *g = W.
ptr(0, 0, ex);
111 const double *g1 = U1.
ptr(0, 0, ex1);
112 const double *g2 = U2.
ptr(0, 0, ex2);
114 const int Nc = W.
nc();
115 const int Nc2 = 2 * Nc;
116 const int Ndf = Nc2 * Nc;
118 for (
int site = is; site < ns; ++site) {
121 for (
int ic2 = 0; ic2 < Nc; ++ic2) {
122 for (
int ic1 = 0; ic1 < Nc; ++ic1) {
123 int jg2 = ic2 * 2 + ig;
124 int jg1 = ic1 * Nc2 + ig;
125 g[2 * ic2 + Nc2 * ic1 + ig] = mult_Gnn_r(&g1[jg1], &g2[jg2], Nc);
126 g[2 * ic2 + 1 + Nc2 * ic1 + ig] = mult_Gnn_i(&g1[jg1], &g2[jg2], Nc);
135 const Field_G& U1,
const int ex1,
136 const Field_G& U2,
const int ex2)
140 assert(ex < W.
nex());
141 assert(ex1 < U1.
nex());
142 assert(ex2 < U2.
nex());
146 int ith, nth, is, ns;
147 set_threadtask(ith, nth, is, ns, Nvol);
149 double *g = W.
ptr(0, 0, ex);
150 const double *g1 = U1.
ptr(0, 0, ex1);
151 const double *g2 = U2.
ptr(0, 0, ex2);
153 const int Nc = W.
nc();
154 const int Nc2 = 2 * Nc;
155 const int Ndf = Nc2 * Nc;
157 for (
int site = is; site < ns; ++site) {
160 for (
int ic2 = 0; ic2 < Nc; ++ic2) {
161 for (
int ic1 = 0; ic1 < Nc; ++ic1) {
162 int jg2 = ic2 * 2 + ig;
163 int jg1 = ic1 * 2 + ig;
164 g[2 * ic2 + Nc2 * ic1 + ig] = mult_Gdn_r(&g1[jg1], &g2[jg2], Nc);
165 g[2 * ic2 + 1 + Nc2 * ic1 + ig] = mult_Gdn_i(&g1[jg1], &g2[jg2], Nc);
174 const Field_G& U1,
const int ex1,
175 const Field_G& U2,
const int ex2)
179 assert(ex < W.
nex());
180 assert(ex1 < U1.
nex());
181 assert(ex2 < U2.
nex());
185 int ith, nth, is, ns;
186 set_threadtask(ith, nth, is, ns, Nvol);
188 double *g = W.
ptr(0, 0, ex);
189 const double *g1 = U1.
ptr(0, 0, ex1);
190 const double *g2 = U2.
ptr(0, 0, ex2);
192 const int Nc = W.
nc();
193 const int Nc2 = 2 * Nc;
194 const int Ndf = Nc2 * Nc;
196 for (
int site = is; site < ns; ++site) {
199 for (
int ic2 = 0; ic2 < Nc; ++ic2) {
200 for (
int ic1 = 0; ic1 < Nc; ++ic1) {
201 int jg2 = ic2 * Nc2 + ig;
202 int jg1 = ic1 * Nc2 + ig;
203 g[2 * ic2 + Nc2 * ic1 + ig] = mult_Gnd_r(&g1[jg1], &g2[jg2], Nc);
204 g[2 * ic2 + 1 + Nc2 * ic1 + ig] = mult_Gnd_i(&g1[jg1], &g2[jg2], Nc);
213 const Field_G& U1,
const int ex1,
214 const Field_G& U2,
const int ex2)
218 assert(ex < W.
nex());
219 assert(ex1 < U1.
nex());
220 assert(ex2 < U2.
nex());
224 int ith, nth, is, ns;
225 set_threadtask(ith, nth, is, ns, Nvol);
227 double *g = W.
ptr(0, 0, ex);
228 const double *g1 = U1.
ptr(0, 0, ex1);
229 const double *g2 = U2.
ptr(0, 0, ex2);
231 const int Nc = W.
nc();
232 const int Nc2 = 2 * Nc;
233 const int Ndf = Nc2 * Nc;
235 for (
int site = is; site < ns; ++site) {
238 for (
int ic2 = 0; ic2 < Nc; ++ic2) {
239 for (
int ic1 = 0; ic1 < Nc; ++ic1) {
240 int jg2 = ic2 * Nc2 + ig;
241 int jg1 = ic1 * 2 + ig;
242 g[2 * ic2 + Nc2 * ic1 + ig] = mult_Gdd_r(&g1[jg1], &g2[jg2], Nc);
243 g[2 * ic2 + 1 + Nc2 * ic1 + ig] = mult_Gdd_i(&g1[jg1], &g2[jg2], Nc);
252 const Field_G& U1,
const int ex1,
253 const Field_G& U2,
const int ex2,
258 assert(ex < W.
nex());
259 assert(ex1 < U1.
nex());
260 assert(ex2 < U2.
nex());
264 int ith, nth, is, ns;
265 set_threadtask(ith, nth, is, ns, Nvol);
267 double *g = W.
ptr(0, 0, ex);
268 const double *g1 = U1.
ptr(0, 0, ex1);
269 const double *g2 = U2.
ptr(0, 0, ex2);
271 const int Nc = W.
nc();
272 const int Nc2 = 2 * Nc;
273 const int Ndf = Nc2 * Nc;
275 for (
int site = is; site < ns; ++site) {
278 for (
int ic2 = 0; ic2 < Nc; ++ic2) {
279 for (
int ic1 = 0; ic1 < Nc; ++ic1) {
280 int jg2 = ic2 * 2 + ig;
281 int jg1 = ic1 * Nc2 + ig;
282 g[2 * ic2 + Nc2 * ic1 + ig] +=
283 ff * mult_Gnn_r(&g1[jg1], &g2[jg2], Nc);
284 g[2 * ic2 + 1 + Nc2 * ic1 + ig] +=
285 ff * mult_Gnn_i(&g1[jg1], &g2[jg2], Nc);
294 const Field_G& U1,
const int ex1,
295 const Field_G& U2,
const int ex2,
300 int ith, nth, is, ns;
301 set_threadtask(ith, nth, is, ns, Nvol);
303 assert(ex < W.
nex());
304 assert(ex1 < U1.
nex());
305 assert(ex2 < U2.
nex());
309 double *g = W.
ptr(0, 0, ex);
310 const double *g1 = U1.
ptr(0, 0, ex1);
311 const double *g2 = U2.
ptr(0, 0, ex2);
313 const int Nc = W.
nc();
314 const int Nc2 = 2 * Nc;
315 const int Ndf = Nc2 * Nc;
317 for (
int site = is; site < ns; ++site) {
320 for (
int ic2 = 0; ic2 < Nc; ++ic2) {
321 for (
int ic1 = 0; ic1 < Nc; ++ic1) {
322 int jg2 = ic2 * 2 + ig;
323 int jg1 = ic1 * 2 + ig;
324 g[2 * ic2 + Nc2 * ic1 + ig] +=
325 ff * mult_Gdn_r(&g1[jg1], &g2[jg2], Nc);
326 g[2 * ic2 + 1 + Nc2 * ic1 + ig] +=
327 ff * mult_Gdn_i(&g1[jg1], &g2[jg2], Nc);
336 const Field_G& U1,
const int ex1,
337 const Field_G& U2,
const int ex2,
342 assert(ex < W.
nex());
343 assert(ex1 < U1.
nex());
344 assert(ex2 < U2.
nex());
348 int ith, nth, is, ns;
349 set_threadtask(ith, nth, is, ns, Nvol);
351 double *g = W.
ptr(0, 0, ex);
352 const double *g1 = U1.
ptr(0, 0, ex1);
353 const double *g2 = U2.
ptr(0, 0, ex2);
355 const int Nc = W.
nc();
356 const int Nc2 = 2 * Nc;
357 const int Ndf = Nc2 * Nc;
359 for (
int site = is; site < ns; ++site) {
362 for (
int ic2 = 0; ic2 < Nc; ++ic2) {
363 for (
int ic1 = 0; ic1 < Nc; ++ic1) {
364 int jg2 = ic2 * Nc2 + ig;
365 int jg1 = ic1 * Nc2 + ig;
366 g[2 * ic2 + Nc2 * ic1 + ig] +=
367 ff * mult_Gnd_r(&g1[jg1], &g2[jg2], Nc);
368 g[2 * ic2 + 1 + Nc2 * ic1 + ig]
369 += ff * mult_Gnd_i(&g1[jg1], &g2[jg2], Nc);
378 const Field_G& U1,
const int ex1,
379 const Field_G& U2,
const int ex2,
384 assert(ex < W.
nex());
385 assert(ex1 < U1.
nex());
386 assert(ex2 < U2.
nex());
390 int ith, nth, is, ns;
391 set_threadtask(ith, nth, is, ns, Nvol);
393 double *g = W.
ptr(0, 0, ex);
394 const double *g1 = U1.
ptr(0, 0, ex1);
395 const double *g2 = U2.
ptr(0, 0, ex2);
397 const int Nc = W.
nc();
398 const int Nc2 = 2 * Nc;
399 const int Ndf = Nc2 * Nc;
401 for (
int site = is; site < ns; ++site) {
404 for (
int ic2 = 0; ic2 < Nc; ++ic2) {
405 for (
int ic1 = 0; ic1 < Nc; ++ic1) {
406 int jg2 = ic2 * Nc2 + ig;
407 int jg1 = ic1 * 2 + ig;
408 g[2 * ic2 + Nc2 * ic1 + ig] +=
409 ff * mult_Gdd_r(&g1[jg1], &g2[jg2], Nc);
410 g[2 * ic2 + 1 + Nc2 * ic1 + ig] +=
411 ff * mult_Gdd_i(&g1[jg1], &g2[jg2], Nc);
423 assert(ex < W.
nex());
425 int ith, nth, is, ns;
426 set_threadtask(ith, nth, is, ns, Nvol);
428 double *g = W.
ptr(0, 0, ex);
430 const int Nc = W.
nc();
431 const int Ndf = 2 * Nc * Nc;
433 for (
int site = is; site < ns; ++site) {
436 for (
int a = 0; a < Nc; ++a) {
437 for (
int b = a + 1; b < Nc; ++b) {
438 double re = g[2 * (Nc * a + b) + ig] - g[2 * (Nc * b + a) + ig];
439 double im = g[2 * (Nc * a + b) + 1 + ig] + g[2 * (Nc * b + a) + 1 + ig];
441 g[2 * (Nc * a + b) + ig] = 0.5 * re;
442 g[2 * (Nc * a + b) + 1 + ig] = 0.5 * im;
444 g[2 * (Nc * b + a) + ig] = -0.5 * re;
445 g[2 * (Nc * b + a) + 1 + ig] = 0.5 * im;
449 for (
int cc = 0; cc < Nc; ++cc) {
450 tr += g[2 * (Nc * cc + cc) + 1 + ig];
453 for (
int cc = 0; cc < Nc; ++cc) {
454 g[2 * (Nc * cc + cc) + ig] = 0.0;
455 g[2 * (Nc * cc + cc) + 1 + ig] -= tr;
466 assert(ex < W.
nex());
468 int ith, nth, is, ns;
469 set_threadtask(ith, nth, is, ns, Nvol);
471 double *g = W.
ptr(0, 0, ex);
473 const int Nc = W.
nc();
474 const int Ndf = 2 * Nc * Nc;
476 for (
int site = is; site < ns; ++site) {
479 for (
int a = 0; a < Nc; ++a) {
480 for (
int b = a; b < Nc; ++b) {
481 double re = g[2 * (Nc * a + b) + ig] - g[2 * (Nc * b + a) + ig];
482 double im = g[2 * (Nc * a + b) + 1 + ig] + g[2 * (Nc * b + a) + 1 + ig];
484 g[2 * (Nc * a + b) + ig] = 0.5 * re;
485 g[2 * (Nc * a + b) + 1 + ig] = 0.5 * im;
487 g[2 * (Nc * b + a) + ig] = -0.5 * re;
488 g[2 * (Nc * b + a) + 1 + ig] = 0.5 * im;
497 const double alpha,
const Field_G& iP,
498 const Field_G& U,
const int Nprec)
503 const int Nvol = U.
nvol();
504 const int Nex = U.
nex();
507 int ith, nth, is, ns;
508 set_threadtask(ith, nth, is, ns, Nvol);
514 for (
int ex = 0; ex < Nex; ++ex) {
515 for (
int site = is; site < ns; ++site) {
516 u0 = U.
mat(site, ex);
517 v0 = iP.
mat(site, ex);