21 #if defined USE_GROUP_SU3
31 #elif defined USE_GROUP_SU2
52 assert(Nvol == v1.
nvol());
53 assert(Nvol == v2.
nvol());
57 std::vector<int> gm_index(Nd);
58 std::vector<double> corr_r(Nd), corr_i(Nd);
60 for (
int i = 0; i < Nd; ++i) {
61 gm_index[i] = gm_sink.
index(i);
66 for (
int z = 0; z < Nz; ++z) {
67 for (
int y = 0; y < Ny; ++y) {
68 for (
int x = 0; x < Nx; ++x) {
69 int site = index.
site(x, y, z, time);
71 for (
int s0 = 0; s0 < Nd; ++s0) {
72 int s1 = gm_index[s0];
74 for (
int c1 = 0; c1 < Nc; ++c1) {
75 corr_r[s0] += v1.
cmp_r(c1, s1, site) * v2.
cmp_r(c1, s0, site)
76 + v1.
cmp_i(c1, s1, site) * v2.
cmp_i(c1, s0, site);
78 corr_i[s0] += -v1.
cmp_r(c1, s1, site) * v2.
cmp_i(c1, s0, site)
79 + v1.
cmp_i(c1, s1, site) * v2.
cmp_r(c1, s0, site);
86 corr = cmplx(0.0, 0.0);
87 for (
int s0 = 0; s0 < Nd; ++s0) {
88 corr += gm_sink.
value(s0) * cmplx(corr_r[s0], corr_i[s0]);
101 assert(corr_global.size() == Lt);
103 std::vector<dcomplex> corr_local(Nt, 0.0);
104 for (
int t = 0; t < Nt; ++t) {
107 corr_local[t] += corr_t;
115 const std::vector<int>& momentum_sink,
117 const std::vector<int>& source_position,
133 assert(Nvol == v1.
nvol());
134 assert(Nvol == v2.
nvol());
136 assert(momentum_sink.size() == Ndim - 1);
139 std::vector<int> gm_index(Nd);
140 std::vector<double> corr_r(Nd), corr_i(Nd);
142 for (
int i = 0; i < Nd; ++i) {
143 gm_index[i] = gm_sink.
index(i);
148 static const double PI = 4.0 * atan(1.0);
149 std::vector<double> p_unit(Ndim - 1);
150 p_unit[0] = (2.0 * PI / Lx) * momentum_sink[0];
151 p_unit[1] = (2.0 * PI / Ly) * momentum_sink[1];
152 p_unit[2] = (2.0 * PI / Lz) * momentum_sink[2];
154 std::vector<int> ipe(Ndim - 1);
159 for (
int z = 0; z < Nz; ++z) {
160 for (
int y = 0; y < Ny; ++y) {
161 for (
int x = 0; x < Nx; ++x) {
162 int site = index.site(x, y, z, time);
164 int x_global = x + ipe[0] * Nx;
165 int y_global = y + ipe[1] * Ny;
166 int z_global = z + ipe[2] * Nz;
168 double p_x = p_unit[0] * (x_global - source_position[0]);
169 double p_y = p_unit[1] * (y_global - source_position[1]);
170 double p_z = p_unit[2] * (z_global - source_position[2]);
172 double cos_p_xyz = cos(p_x + p_y + p_z);
173 double sin_p_xyz = sin(p_x + p_y + p_z);
175 for (
int s0 = 0; s0 < Nd; ++s0) {
176 int s1 = gm_index[s0];
178 double v1_v2_r = 0.0;
179 double v1_v2_i = 0.0;
181 for (
int c1 = 0; c1 < Nc; ++c1) {
182 v1_v2_r += v1.
cmp_r(c1, s1, site) * v2.
cmp_r(c1, s0, site)
183 + v1.
cmp_i(c1, s1, site) * v2.
cmp_i(c1, s0, site);
185 v1_v2_i += -v1.
cmp_r(c1, s1, site) * v2.
cmp_i(c1, s0, site)
186 + v1.
cmp_i(c1, s1, site) * v2.
cmp_r(c1, s0, site);
190 corr_r[s0] += v1_v2_r * cos_p_xyz - v1_v2_i * sin_p_xyz;
191 corr_i[s0] += v1_v2_r * sin_p_xyz + v1_v2_i * cos_p_xyz;
197 corr = cmplx(0.0, 0.0);
198 for (
int s0 = 0; s0 < Nd; ++s0) {
199 corr += gm_sink.
value(s0) * cmplx(corr_r[s0], corr_i[s0]);
206 const std::vector<int>& momentum_sink,
208 const std::vector<int>& source_position,
214 assert(corr_global.size() == Lt);
216 std::vector<dcomplex> corr_local(Nt, 0.0);
217 for (
int t = 0; t < Nt; ++t) {
219 contract_at_t(corr_t, momentum_sink, gm_sink, source_position, v1, v2, t);
220 corr_local[t] += corr_t;
228 const std::vector<int>& momentum_sink,
230 const std::vector<int>& source_position,
234 #if defined USE_GROUP_SU_N
237 const int NC2 = 2 *
NC;
238 const int NCD2 = NC2 *
ND;
241 const int Nvol = v1.
nvol();
250 assert(Nvol == v2.
nvol());
251 assert(v1.
nex() == 1);
252 assert(v2.
nex() == 1);
253 assert(momentum_sink.size() ==
NDIM - 1);
255 const double *w1 = v1.
ptr(0);
256 const double *w2 = v2.
ptr(0);
260 for (
int id = 0;
id <
ND; ++id) {
267 for (
int id = 0;
id <
ND; ++id) {
272 static const double PI = 4.0 * atan(1.0);
273 std::vector<double> p_unit(ND - 1);
274 p_unit[0] = (2.0 * PI / Lx) * momentum_sink[0];
275 p_unit[1] = (2.0 * PI / Ly) * momentum_sink[1];
276 p_unit[2] = (2.0 * PI / Lz) * momentum_sink[2];
278 std::vector<int> ipe(ND - 1);
284 for (
int ss = 0; ss < Nvol_s; ++ss) {
285 int site = NCD2 * (ss + time * Nvol_s);
288 int y = ss % (Nx * Ny) / Nx;
289 int z = ss % (Nx * Ny * Nz) / (Nx * Ny);
291 int x_global = x + ipe[0] * Nx;
292 int y_global = y + ipe[1] * Ny;
293 int z_global = z + ipe[2] * Nz;
295 double p_x = p_unit[0] * (x_global - source_position[0]);
296 double p_y = p_unit[1] * (y_global - source_position[1]);
297 double p_z = p_unit[2] * (z_global - source_position[2]);
299 double cos_p_xyz = cos(p_x + p_y + p_z);
301 double sin_p_xyz = 0;
303 for (
int cc = 0; cc <
NC; ++cc) {
304 for (
int id = 0;
id <
ND; ++id) {
305 int ic1_r = 2 * cc + id1[id] + site;
306 int ic2_r = 2 * cc + id2[id] + site;
308 int ic1_i = 2 * cc + 1 + id1[id] + site;
309 int ic2_i = 2 * cc + 1 + id2[id] + site;
311 double w1_w2_r = w1[ic2_r] * w2[ic1_r] + w1[ic2_i] * w2[ic1_i];
312 double w1_w2_i = -w1[ic2_r] * w2[ic1_i] + w1[ic2_i] * w2[ic1_r];
316 c_r[id] += w1_w2_r * cos_p_xyz - w1_w2_i * sin_p_xyz;
317 c_i[id] += w1_w2_r * sin_p_xyz + w1_w2_i * cos_p_xyz;
322 corr = cmplx(0.0, 0.0);
323 for (
int id = 0;
id <
ND; ++id) {
324 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
331 const std::vector<int>& momentum_sink,
333 const std::vector<int>& source_position,
339 assert(corr_global.size() == Lt);
341 std::vector<dcomplex> corr_local(Nt, 0.0);
342 for (
int t = 0; t < Nt; ++t) {
345 corr_local[t] += corr_t;
358 #if defined USE_GROUP_SU3
368 assert(Nvol == v1.
nvol());
369 assert(Nvol == v2.
nvol());
370 assert(Nvol == v3.
nvol());
374 std::vector<int> gm_index(Nd);
375 std::vector<double> c_r(Nd), c_i(Nd);
377 for (
int i = 0; i < Nd; ++i) {
378 gm_index[i] = gm_sink.
index(i);
383 for (
int z = 0; z < Nz; ++z) {
384 for (
int y = 0; y < Ny; ++y) {
385 for (
int x = 0; x < Nx; ++x) {
386 int site = index.
site(x, y, z, time);
388 for (
int d1 = 0; d1 < Nd; ++d1) {
389 int d2 = gm_index[d1];
392 c_r[d1] += (v1.
cmp_r(C1, d1, site) * v2.
cmp_r(C2, d2, site)
393 - v1.
cmp_i(C1, d1, site) * v2.
cmp_i(C2, d2, site)) * v3.
cmp_r(C3, d3, site)
394 - (v1.
cmp_r(C1, d1, site) * v2.
cmp_i(C2, d2, site)
395 + v1.
cmp_i(C1, d1, site) * v2.
cmp_r(C2, d2, site)) * v3.
cmp_i(C3, d3, site);
396 c_i[d1] += (v1.
cmp_r(C1, d1, site) * v2.
cmp_r(C2, d2, site)
397 - v1.
cmp_i(C1, d1, site) * v2.
cmp_i(C2, d2, site)) * v3.
cmp_i(C3, d3, site)
398 + (v1.
cmp_r(C1, d1, site) * v2.
cmp_i(C2, d2, site)
399 + v1.
cmp_i(C1, d1, site) * v2.
cmp_r(C2, d2, site)) * v3.
cmp_r(C3, d3, site);
401 c_r[d1] += (v1.
cmp_r(C2, d1, site) * v2.
cmp_r(C3, d2, site)
402 - v1.
cmp_i(C2, d1, site) * v2.
cmp_i(C3, d2, site)) * v3.
cmp_r(C1, d3, site)
403 - (v1.
cmp_r(C2, d1, site) * v2.
cmp_i(C3, d2, site)
404 + v1.
cmp_i(C2, d1, site) * v2.
cmp_r(C3, d2, site)) * v3.
cmp_i(C1, d3, site);
405 c_i[d1] += (v1.
cmp_r(C2, d1, site) * v2.
cmp_r(C3, d2, site)
406 - v1.
cmp_i(C2, d1, site) * v2.
cmp_i(C3, d2, site)) * v3.
cmp_i(C1, d3, site)
407 + (v1.
cmp_r(C2, d1, site) * v2.
cmp_i(C3, d2, site)
408 + v1.
cmp_i(C2, d1, site) * v2.
cmp_r(C3, d2, site)) * v3.
cmp_r(C1, d3, site);
410 c_r[d1] += (v1.
cmp_r(C3, d1, site) * v2.
cmp_r(C1, d2, site)
411 - v1.
cmp_i(C3, d1, site) * v2.
cmp_i(C1, d2, site)) * v3.
cmp_r(C2, d3, site)
412 - (v1.
cmp_r(C3, d1, site) * v2.
cmp_i(C1, d2, site)
413 + v1.
cmp_i(C3, d1, site) * v2.
cmp_r(C1, d2, site)) * v3.
cmp_i(C2, d3, site);
414 c_i[d1] += (v1.
cmp_r(C3, d1, site) * v2.
cmp_r(C1, d2, site)
415 - v1.
cmp_i(C3, d1, site) * v2.
cmp_i(C1, d2, site)) * v3.
cmp_i(C2, d3, site)
416 + (v1.
cmp_r(C3, d1, site) * v2.
cmp_i(C1, d2, site)
417 + v1.
cmp_i(C3, d1, site) * v2.
cmp_r(C1, d2, site)) * v3.
cmp_r(C2, d3, site);
419 c_r[d1] -= (v1.
cmp_r(C3, d1, site) * v2.
cmp_r(C2, d2, site)
420 - v1.
cmp_i(C3, d1, site) * v2.
cmp_i(C2, d2, site)) * v3.
cmp_r(C1, d3, site)
421 - (v1.
cmp_r(C3, d1, site) * v2.
cmp_i(C2, d2, site)
422 + v1.
cmp_i(C3, d1, site) * v2.
cmp_r(C2, d2, site)) * v3.
cmp_i(C1, d3, site);
423 c_i[d1] -= (v1.
cmp_r(C3, d1, site) * v2.
cmp_r(C2, d2, site)
424 - v1.
cmp_i(C3, d1, site) * v2.
cmp_i(C2, d2, site)) * v3.
cmp_i(C1, d3, site)
425 + (v1.
cmp_r(C3, d1, site) * v2.
cmp_i(C2, d2, site)
426 + v1.
cmp_i(C3, d1, site) * v2.
cmp_r(C2, d2, site)) * v3.
cmp_r(C1, d3, site);
428 c_r[d1] -= (v1.
cmp_r(C2, d1, site) * v2.
cmp_r(C1, d2, site)
429 - v1.
cmp_i(C2, d1, site) * v2.
cmp_i(C1, d2, site)) * v3.
cmp_r(C3, d3, site)
430 - (v1.
cmp_r(C2, d1, site) * v2.
cmp_i(C1, d2, site)
431 + v1.
cmp_i(C2, d1, site) * v2.
cmp_r(C1, d2, site)) * v3.
cmp_i(C3, d3, site);
432 c_i[d1] -= (v1.
cmp_r(C2, d1, site) * v2.
cmp_r(C1, d2, site)
433 - v1.
cmp_i(C2, d1, site) * v2.
cmp_i(C1, d2, site)) * v3.
cmp_i(C3, d3, site)
434 + (v1.
cmp_r(C2, d1, site) * v2.
cmp_i(C1, d2, site)
435 + v1.
cmp_i(C2, d1, site) * v2.
cmp_r(C1, d2, site)) * v3.
cmp_r(C3, d3, site);
437 c_r[d1] -= (v1.
cmp_r(C1, d1, site) * v2.
cmp_r(C3, d2, site)
438 - v1.
cmp_i(C1, d1, site) * v2.
cmp_i(C3, d2, site)) * v3.
cmp_r(C2, d3, site)
439 - (v1.
cmp_r(C1, d1, site) * v2.
cmp_i(C3, d2, site)
440 + v1.
cmp_i(C1, d1, site) * v2.
cmp_r(C3, d2, site)) * v3.
cmp_i(C2, d3, site);
441 c_i[d1] -= (v1.
cmp_r(C1, d1, site) * v2.
cmp_r(C3, d2, site)
442 - v1.
cmp_i(C1, d1, site) * v2.
cmp_i(C3, d2, site)) * v3.
cmp_i(C2, d3, site)
443 + (v1.
cmp_r(C1, d1, site) * v2.
cmp_i(C3, d2, site)
444 + v1.
cmp_i(C1, d1, site) * v2.
cmp_r(C3, d2, site)) * v3.
cmp_r(C2, d3, site);
450 corr = cmplx(0.0, 0.0);
451 for (
int s0 = 0; s0 < Nd; ++s0) {
452 corr += gm_sink.
value(s0) * cmplx(c_r[s0], c_i[s0]);
454 #endif // (USE_GROUP_SU3)
464 #if defined USE_GROUP_SU_N
467 const int NC2 = 2 *
NC;
468 const int NCD2 = NC2 *
ND;
471 const int Nvol = v1.
nvol();
478 assert(Nvol == v2.
nvol());
479 assert(v1.
nex() == 1);
480 assert(v2.
nex() == 1);
482 const double *w1 = v1.
ptr(0);
483 const double *w2 = v2.
ptr(0);
487 for (
int id = 0;
id <
ND; ++id) {
494 for (
int id = 0;
id <
ND; ++id) {
499 for (
int t = 0; t < Nt; ++t) {
500 for (
int z = 0; z < Nz; ++z) {
501 for (
int y = 0; y < Ny; ++y) {
502 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
504 for (
int cc = 0; cc <
NC; ++cc) {
505 for (
int id = 0;
id <
ND; ++id) {
506 int ic1_r = 2 * cc + id1[id] + site;
507 int ic2_r = 2 * cc + id2[id] + site;
509 int ic1_i = 2 * cc + 1 + id1[id] + site;
510 int ic2_i = 2 * cc + 1 + id2[id] + site;
512 c_r[id] += w1[ic2_r] * w2[ic1_r]
513 + w1[ic2_i] * w2[ic1_i];
515 c_i[id] += -w1[ic2_r] * w2[ic1_i]
516 + w1[ic2_i] * w2[ic1_r];
523 corr = cmplx(0.0, 0.0);
524 for (
int id = 0;
id <
ND; ++id) {
525 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
538 assert(corr_global.size() == Lx);
540 std::vector<dcomplex> corr_local(Nx, 0.0);
541 for (
int x = 0; x < Nx; ++x) {
544 corr_local[x] += corr_x;
552 const std::vector<int>& momentum_sink,
554 const std::vector<int>& source_position,
558 #if defined USE_GROUP_SU_N
565 const int Nvol = v1.
nvol();
576 assert(Nvol == v2.
nvol());
577 assert(v1.
nex() == 1);
578 assert(v2.
nex() == 1);
579 assert(momentum_sink.size() ==
NDIM - 1);
580 assert(source_position.size() ==
NDIM);
582 const double *w1 = v1.
ptr(0);
583 const double *w2 = v2.
ptr(0);
587 for (
int id = 0;
id <
ND; ++id) {
594 for (
int id = 0;
id <
ND; ++id) {
599 static const double PI = 4.0 * atan(1.0);
600 std::vector<double> p_unit(ND - 1);
601 p_unit[0] = (2.0 * PI / Ly) * momentum_sink[0];
602 p_unit[1] = (2.0 * PI / Lz) * momentum_sink[1];
603 p_unit[2] = (2.0 * PI / Lt) * momentum_sink[2];
605 std::vector<int> ipe(ND);
611 for (
int t = 0; t < Nt; ++t) {
612 for (
int z = 0; z < Nz; ++z) {
613 for (
int y = 0; y < Ny; ++y) {
614 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
616 int y_global = y + ipe[1] * Ny;
617 int z_global = z + ipe[2] * Nz;
618 int t_global = t + ipe[3] * Nt;
620 double p_y = p_unit[0] * (y_global - source_position[1]);
621 double p_z = p_unit[1] * (z_global - source_position[2]);
622 double p_t = p_unit[2] * (t_global - source_position[3]);
624 double cos_p_yzt = cos(p_t + p_y + p_z);
625 double sin_p_yzt = sin(p_t + p_y + p_z);
627 for (
int cc = 0; cc <
NC; ++cc) {
628 for (
int id = 0;
id <
ND; ++id) {
629 int ic1_r = 2 * cc + id1[id] + site;
630 int ic2_r = 2 * cc + id2[id] + site;
632 int ic1_i = 2 * cc + 1 + id1[id] + site;
633 int ic2_i = 2 * cc + 1 + id2[id] + site;
635 double w1_w2_r = w1[ic2_r] * w2[ic1_r] + w1[ic2_i] * w2[ic1_i];
636 double w1_w2_i = -w1[ic2_r] * w2[ic1_i] + w1[ic2_i] * w2[ic1_r];
639 c_r[id] += w1_w2_r * cos_p_yzt - w1_w2_i * sin_p_yzt;
640 c_i[id] += w1_w2_r * sin_p_yzt + w1_w2_i * cos_p_yzt;
647 corr = cmplx(0.0, 0.0);
648 for (
int id = 0;
id <
ND; ++id) {
649 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
656 const std::vector<int>& momentum_sink,
658 const std::vector<int>& source_position,
664 assert(corr_global.size() == Lx);
666 std::vector<dcomplex> corr_local(Nx, 0.0);
667 for (
int x = 0; x < Nx; ++x) {
669 contract_at_x(corr_x, momentum_sink, gm_sink, source_position, v1, v2, x);
670 corr_local[x] += corr_x;
678 const std::vector<int>& momentum_sink,
680 const std::vector<int>& source_position,
684 #if defined USE_GROUP_SU_N
691 const int Nvol = v1.
nvol();
702 assert(Nvol == v2.
nvol());
703 assert(v1.
nex() == 1);
704 assert(v2.
nex() == 1);
705 assert(momentum_sink.size() ==
NDIM - 1);
706 assert(source_position.size() ==
NDIM);
708 const double *w1 = v1.
ptr(0);
709 const double *w2 = v2.
ptr(0);
713 for (
int id = 0;
id <
ND; ++id) {
720 for (
int id = 0;
id <
ND; ++id) {
725 static const double PI = 4.0 * atan(1.0);
726 std::vector<double> p_unit(ND - 1);
727 p_unit[0] = (2.0 * PI / Ly) * momentum_sink[0];
728 p_unit[1] = (2.0 * PI / Lz) * momentum_sink[1];
729 p_unit[2] = (2.0 * PI / Lt) * momentum_sink[2];
731 std::vector<int> ipe(ND);
738 for (
int t = 0; t < Nt; ++t) {
739 for (
int z = 0; z < Nz; ++z) {
740 for (
int y = 0; y < Ny; ++y) {
741 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
743 int y_global = y + ipe[1] * Ny;
744 int z_global = z + ipe[2] * Nz;
745 int t_global = t + ipe[3] * Nt;
747 double p_y = p_unit[0] * (y_global - source_position[1]);
748 double p_z = p_unit[1] * (z_global - source_position[2]);
749 double p_t = p_unit[2] * (t_global - source_position[3]);
751 double cos_p_yzt = cos(p_t + p_y + p_z);
753 double sin_p_yzt = 0;
755 for (
int cc = 0; cc <
NC; ++cc) {
756 for (
int id = 0;
id <
ND; ++id) {
757 int ic1_r = 2 * cc + id1[id] + site;
758 int ic2_r = 2 * cc + id2[id] + site;
760 int ic1_i = 2 * cc + 1 + id1[id] + site;
761 int ic2_i = 2 * cc + 1 + id2[id] + site;
763 double w1_w2_r = w1[ic2_r] * w2[ic1_r] + w1[ic2_i] * w2[ic1_i];
764 double w1_w2_i = -w1[ic2_r] * w2[ic1_i] + w1[ic2_i] * w2[ic1_r];
768 c_r[id] += w1_w2_r * cos_p_yzt - w1_w2_i * sin_p_yzt;
769 c_i[id] += w1_w2_r * sin_p_yzt + w1_w2_i * cos_p_yzt;
776 corr = cmplx(0.0, 0.0);
777 for (
int id = 0;
id <
ND; ++id) {
778 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
785 const std::vector<int>& momentum_sink,
787 const std::vector<int>& source_position,
793 assert(corr_global.size() == Lx);
795 std::vector<dcomplex> corr_local(Nx, 0.0);
796 for (
int x = 0; x < Nx; ++x) {
799 corr_local[x] += corr_x;
812 #if defined USE_GROUP_SU3
813 const int Nvol = v1.
nvol();
820 assert(Nvol == v2.
nvol());
821 assert(Nvol == v3.
nvol());
822 assert(v1.
nex() == 1);
823 assert(v2.
nex() == 1);
824 assert(v3.
nex() == 1);
826 const double *w1 = v1.
ptr(0);
827 const double *w2 = v2.
ptr(0);
828 const double *w3 = v3.
ptr(0);
832 for (
int id = 0;
id <
ND; ++id) {
836 int id3 = i_alpha *
NC2;
840 for (
int id = 0;
id <
ND; ++id) {
846 for (
int t = 0; t < Nt; ++t) {
847 for (
int z = 0; z < Nz; ++z) {
848 for (
int y = 0; y < Ny; ++y) {
849 int site =
NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
851 for (
int id = 0;
id <
ND; ++id) {
852 int ic11_r = C1 + id1[id] + site;
853 int ic22_r = C2 + id2[id] + site;
854 int ic33_r = C3 + id3 + site;
856 int ic11_i = C1 + 1 + id1[id] + site;
857 int ic22_i = C2 + 1 + id2[id] + site;
858 int ic33_i = C3 + 1 + id3 + site;
860 int ic21_r = C2 + id1[id] + site;
861 int ic32_r = C3 + id2[id] + site;
862 int ic13_r = C1 + id3 + site;
864 int ic21_i = C2 + 1 + id1[id] + site;
865 int ic32_i = C3 + 1 + id2[id] + site;
866 int ic13_i = C1 + 1 + id3 + site;
868 int ic31_r = C3 + id1[id] + site;
869 int ic12_r = C1 + id2[id] + site;
870 int ic23_r = C2 + id3 + site;
872 int ic31_i = C3 + 1 + id1[id] + site;
873 int ic12_i = C1 + 1 + id2[id] + site;
874 int ic23_i = C2 + 1 + id3 + site;
876 c_r[id] += (w1[ic11_r] * w2[ic22_r] - w1[ic11_i] * w2[ic22_i]) * w3[ic33_r]
877 - (w1[ic11_r] * w2[ic22_i] + w1[ic11_i] * w2[ic22_r]) * w3[ic33_i];
878 c_i[id] += (w1[ic11_r] * w2[ic22_r] - w1[ic11_i] * w2[ic22_i]) * w3[ic33_i]
879 + (w1[ic11_r] * w2[ic22_i] + w1[ic11_i] * w2[ic22_r]) * w3[ic33_r];
881 c_r[id] += (w1[ic21_r] * w2[ic32_r] - w1[ic21_i] * w2[ic32_i]) * w3[ic13_r]
882 - (w1[ic21_r] * w2[ic32_i] + w1[ic21_i] * w2[ic32_r]) * w3[ic13_i];
883 c_i[id] += (w1[ic21_r] * w2[ic32_r] - w1[ic21_i] * w2[ic32_i]) * w3[ic13_i]
884 + (w1[ic21_r] * w2[ic32_i] + w1[ic21_i] * w2[ic32_r]) * w3[ic13_r];
886 c_r[id] += (w1[ic31_r] * w2[ic12_r] - w1[ic31_i] * w2[ic12_i]) * w3[ic23_r]
887 - (w1[ic31_r] * w2[ic12_i] + w1[ic31_i] * w2[ic12_r]) * w3[ic23_i];
888 c_i[id] += (w1[ic31_r] * w2[ic12_r] - w1[ic31_i] * w2[ic12_i]) * w3[ic23_i]
889 + (w1[ic31_r] * w2[ic12_i] + w1[ic31_i] * w2[ic12_r]) * w3[ic23_r];
891 c_r[id] -= (w1[ic31_r] * w2[ic22_r] - w1[ic31_i] * w2[ic22_i]) * w3[ic13_r]
892 - (w1[ic31_r] * w2[ic22_i] + w1[ic31_i] * w2[ic22_r]) * w3[ic13_i];
893 c_i[id] -= (w1[ic31_r] * w2[ic22_r] - w1[ic31_i] * w2[ic22_i]) * w3[ic13_i]
894 + (w1[ic31_r] * w2[ic22_i] + w1[ic31_i] * w2[ic22_r]) * w3[ic13_r];
896 c_r[id] -= (w1[ic21_r] * w2[ic12_r] - w1[ic21_i] * w2[ic12_i]) * w3[ic33_r]
897 - (w1[ic21_r] * w2[ic12_i] + w1[ic21_i] * w2[ic12_r]) * w3[ic33_i];
898 c_i[id] -= (w1[ic21_r] * w2[ic12_r] - w1[ic21_i] * w2[ic12_i]) * w3[ic33_i]
899 + (w1[ic21_r] * w2[ic12_i] + w1[ic21_i] * w2[ic12_r]) * w3[ic33_r];
901 c_r[id] -= (w1[ic11_r] * w2[ic32_r] - w1[ic11_i] * w2[ic32_i]) * w3[ic23_r]
902 - (w1[ic11_r] * w2[ic32_i] + w1[ic11_i] * w2[ic32_r]) * w3[ic23_i];
903 c_i[id] -= (w1[ic11_r] * w2[ic32_r] - w1[ic11_i] * w2[ic32_i]) * w3[ic23_i]
904 + (w1[ic11_r] * w2[ic32_i] + w1[ic11_i] * w2[ic32_r]) * w3[ic23_r];
910 corr = cmplx(0.0, 0.0);
911 for (
int id = 0;
id <
ND; ++id) {
912 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
914 #endif // (USE_GROUP_SU3)
925 #if defined USE_GROUP_SU_N
928 const int NC2 = 2 *
NC;
929 const int NCD2 = NC2 *
ND;
932 const int Nvol = v1.
nvol();
938 assert(Nvol == v1.
nvol());
939 assert(Nvol == v2.
nvol());
940 assert(v1.
nex() == 1);
941 assert(v2.
nex() == 1);
944 const double *w1 = v1.
ptr(0);
945 const double *w2 = v2.
ptr(0);
949 for (
int id = 0;
id <
ND; ++id) {
956 for (
int id = 0;
id <
ND; ++id) {
961 for (
int t = 0; t < Nt; ++t) {
962 for (
int z = 0; z < Nz; ++z) {
963 for (
int x = 0; x < Nx; ++x) {
964 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
965 for (
int cc = 0; cc <
NC; ++cc) {
966 for (
int id = 0;
id <
ND; ++id) {
967 int ic1_r = 2 * cc + id1[id] + site;
968 int ic2_r = 2 * cc + id2[id] + site;
970 int ic1_i = 2 * cc + 1 + id1[id] + site;
971 int ic2_i = 2 * cc + 1 + id2[id] + site;
973 c_r[id] += w1[ic2_r] * w2[ic1_r]
974 + w1[ic2_i] * w2[ic1_i];
976 c_i[id] += -w1[ic2_r] * w2[ic1_i]
977 + w1[ic2_i] * w2[ic1_r];
984 corr = cmplx(0.0, 0.0);
985 for (
int id = 0;
id <
ND; ++id) {
986 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
999 assert(corr_global.size() == Ly);
1001 std::vector<dcomplex> corr_local(Ny, 0.0);
1002 for (
int y = 0; y < Ny; ++y) {
1005 corr_local[y] += corr_y;
1013 const std::vector<int>& momentum_sink,
1015 const std::vector<int>& source_position,
1019 #if defined USE_GROUP_SU_N
1026 const int Nvol = v1.
nvol();
1037 assert(Nvol == v2.
nvol());
1038 assert(v1.
nex() == 1);
1039 assert(v2.
nex() == 1);
1040 assert(momentum_sink.size() ==
NDIM - 1);
1041 assert(source_position.size() ==
NDIM);
1043 const double *w1 = v1.
ptr(0);
1044 const double *w2 = v2.
ptr(0);
1048 for (
int id = 0;
id <
ND; ++id) {
1055 for (
int id = 0;
id <
ND; ++id) {
1060 static const double PI = 4.0 * atan(1.0);
1061 std::vector<double> p_unit(ND - 1);
1062 p_unit[0] = (2.0 * PI / Ly) * momentum_sink[0];
1063 p_unit[1] = (2.0 * PI / Lz) * momentum_sink[1];
1064 p_unit[2] = (2.0 * PI / Lt) * momentum_sink[2];
1066 std::vector<int> ipe(ND);
1072 for (
int t = 0; t < Nt; ++t) {
1073 for (
int z = 0; z < Nz; ++z) {
1074 for (
int x = 0; x < Nx; ++x) {
1075 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
1077 int x_global = x + ipe[0] * Nx;
1078 int z_global = z + ipe[2] * Nz;
1079 int t_global = t + ipe[3] * Nt;
1081 double p_x = p_unit[0] * (x_global - source_position[0]);
1082 double p_z = p_unit[1] * (z_global - source_position[2]);
1083 double p_t = p_unit[2] * (t_global - source_position[3]);
1085 double cos_p_xzt = cos(p_t + p_x + p_z);
1086 double sin_p_xzt = sin(p_t + p_x + p_z);
1088 for (
int cc = 0; cc <
NC; ++cc) {
1089 for (
int id = 0;
id <
ND; ++id) {
1090 int ic1_r = 2 * cc + id1[id] + site;
1091 int ic2_r = 2 * cc + id2[id] + site;
1093 int ic1_i = 2 * cc + 1 + id1[id] + site;
1094 int ic2_i = 2 * cc + 1 + id2[id] + site;
1096 double w1_w2_r = w1[ic2_r] * w2[ic1_r] + w1[ic2_i] * w2[ic1_i];
1097 double w1_w2_i = -w1[ic2_r] * w2[ic1_i] + w1[ic2_i] * w2[ic1_r];
1100 c_r[id] += w1_w2_r * cos_p_xzt - w1_w2_i * sin_p_xzt;
1101 c_i[id] += w1_w2_r * sin_p_xzt + w1_w2_i * cos_p_xzt;
1108 corr = cmplx(0.0, 0.0);
1109 for (
int id = 0;
id <
ND; ++id) {
1110 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
1117 const std::vector<int>& momentum_sink,
1119 const std::vector<int>& source_position,
1125 assert(corr_global.size() == Ly);
1127 std::vector<dcomplex> corr_local(Ny, 0.0);
1128 for (
int y = 0; y < Ny; ++y) {
1130 contract_at_y(corr_y, momentum_sink, gm_sink, source_position, v1, v2, y);
1131 corr_local[y] += corr_y;
1139 const std::vector<int>& momentum_sink,
1141 const std::vector<int>& source_position,
1145 #if defined USE_GROUP_SU_N
1152 const int Nvol = v1.
nvol();
1163 assert(Nvol == v2.
nvol());
1164 assert(v1.
nex() == 1);
1165 assert(v2.
nex() == 1);
1166 assert(momentum_sink.size() ==
NDIM - 1);
1167 assert(source_position.size() ==
NDIM);
1169 const double *w1 = v1.
ptr(0);
1170 const double *w2 = v2.
ptr(0);
1174 for (
int id = 0;
id <
ND; ++id) {
1181 for (
int id = 0;
id <
ND; ++id) {
1186 static const double PI = 4.0 * atan(1.0);
1187 std::vector<double> p_unit(ND - 1);
1188 p_unit[0] = (2.0 * PI / Ly) * momentum_sink[0];
1189 p_unit[1] = (2.0 * PI / Lz) * momentum_sink[1];
1190 p_unit[2] = (2.0 * PI / Lt) * momentum_sink[2];
1192 std::vector<int> ipe(ND);
1199 for (
int t = 0; t < Nt; ++t) {
1200 for (
int z = 0; z < Nz; ++z) {
1201 for (
int x = 0; x < Nx; ++x) {
1202 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
1204 int x_global = x + ipe[0] * Nx;
1205 int z_global = z + ipe[2] * Nz;
1206 int t_global = t + ipe[3] * Nt;
1208 double p_x = p_unit[0] * (x_global - source_position[0]);
1209 double p_z = p_unit[1] * (z_global - source_position[2]);
1210 double p_t = p_unit[2] * (t_global - source_position[3]);
1212 double cos_p_xzt = cos(p_t + p_x + p_z);
1214 double sin_p_xzt = 0;
1216 for (
int cc = 0; cc <
NC; ++cc) {
1217 for (
int id = 0;
id <
ND; ++id) {
1218 int ic1_r = 2 * cc + id1[id] + site;
1219 int ic2_r = 2 * cc + id2[id] + site;
1221 int ic1_i = 2 * cc + 1 + id1[id] + site;
1222 int ic2_i = 2 * cc + 1 + id2[id] + site;
1224 double w1_w2_r = w1[ic2_r] * w2[ic1_r] + w1[ic2_i] * w2[ic1_i];
1225 double w1_w2_i = -w1[ic2_r] * w2[ic1_i] + w1[ic2_i] * w2[ic1_r];
1229 c_r[id] += w1_w2_r * cos_p_xzt - w1_w2_i * sin_p_xzt;
1230 c_i[id] += w1_w2_r * sin_p_xzt + w1_w2_i * cos_p_xzt;
1237 corr = cmplx(0.0, 0.0);
1238 for (
int id = 0;
id <
ND; ++id) {
1239 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
1246 const std::vector<int>& momentum_sink,
1248 const std::vector<int>& source_position,
1254 assert(corr_global.size() == Ly);
1256 std::vector<dcomplex> corr_local(Ny, 0.0);
1257 for (
int y = 0; y < Ny; ++y) {
1260 corr_local[y] += corr_y;
1273 #if defined USE_GROUP_SU_N
1276 const int NC2 = 2 *
NC;
1277 const int NCD2 = NC2 *
ND;
1284 const int Nvol = v1.
nvol();
1286 assert(Nvol == v1.
nvol());
1287 assert(Nvol == v2.
nvol());
1288 assert(v1.
nex() == 1);
1289 assert(v2.
nex() == 1);
1292 const double *w1 = v1.
ptr(0);
1293 const double *w2 = v2.
ptr(0);
1297 for (
int id = 0;
id <
ND; ++id) {
1304 for (
int id = 0;
id <
ND; ++id) {
1309 for (
int t = 0; t < Nt; ++t) {
1310 for (
int y = 0; y < Ny; ++y) {
1311 for (
int x = 0; x < Nx; ++x) {
1312 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
1313 for (
int cc = 0; cc <
NC; ++cc) {
1314 for (
int id = 0;
id <
ND; ++id) {
1315 int ic1_r = 2 * cc + id1[id] + site;
1316 int ic2_r = 2 * cc + id2[id] + site;
1318 int ic1_i = 2 * cc + 1 + id1[id] + site;
1319 int ic2_i = 2 * cc + 1 + id2[id] + site;
1321 c_r[id] += w1[ic2_r] * w2[ic1_r]
1322 + w1[ic2_i] * w2[ic1_i];
1324 c_i[id] += -w1[ic2_r] * w2[ic1_i]
1325 + w1[ic2_i] * w2[ic1_r];
1332 corr = cmplx(0.0, 0.0);
1333 for (
int id = 0;
id <
ND; ++id) {
1334 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
1347 assert(corr_global.size() == Lz);
1349 std::vector<dcomplex> corr_local(Nz, 0.0);
1350 for (
int z = 0; z < Nz; ++z) {
1353 corr_local[z] += corr_z;
1361 const std::vector<int>& momentum_sink,
1363 const std::vector<int>& source_position,
1367 #if defined USE_GROUP_SU_N
1374 const int Nvol = v1.
nvol();
1385 assert(Nvol == v2.
nvol());
1386 assert(v1.
nex() == 1);
1387 assert(v2.
nex() == 1);
1388 assert(momentum_sink.size() ==
NDIM - 1);
1389 assert(source_position.size() ==
NDIM);
1391 const double *w1 = v1.
ptr(0);
1392 const double *w2 = v2.
ptr(0);
1396 for (
int id = 0;
id <
ND; ++id) {
1403 for (
int id = 0;
id <
ND; ++id) {
1408 static const double PI = 4.0 * atan(1.0);
1409 std::vector<double> p_unit(ND - 1);
1410 p_unit[0] = (2.0 * PI / Ly) * momentum_sink[0];
1411 p_unit[1] = (2.0 * PI / Lz) * momentum_sink[1];
1412 p_unit[2] = (2.0 * PI / Lt) * momentum_sink[2];
1414 std::vector<int> ipe(ND);
1420 for (
int t = 0; t < Nt; ++t) {
1421 for (
int y = 0; y < Ny; ++y) {
1422 for (
int x = 0; x < Nx; ++x) {
1423 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
1425 int x_global = x + ipe[0] * Nx;
1426 int y_global = y + ipe[1] * Ny;
1427 int t_global = t + ipe[3] * Nt;
1429 double p_x = p_unit[0] * (x_global - source_position[0]);
1430 double p_y = p_unit[1] * (y_global - source_position[1]);
1431 double p_t = p_unit[2] * (t_global - source_position[3]);
1433 double cos_p_xyt = cos(p_t + p_x + p_y);
1434 double sin_p_xyt = sin(p_t + p_x + p_y);
1436 for (
int cc = 0; cc <
NC; ++cc) {
1437 for (
int id = 0;
id <
ND; ++id) {
1438 int ic1_r = 2 * cc + id1[id] + site;
1439 int ic2_r = 2 * cc + id2[id] + site;
1441 int ic1_i = 2 * cc + 1 + id1[id] + site;
1442 int ic2_i = 2 * cc + 1 + id2[id] + site;
1444 double w1_w2_r = w1[ic2_r] * w2[ic1_r] + w1[ic2_i] * w2[ic1_i];
1445 double w1_w2_i = -w1[ic2_r] * w2[ic1_i] + w1[ic2_i] * w2[ic1_r];
1448 c_r[id] += w1_w2_r * cos_p_xyt - w1_w2_i * sin_p_xyt;
1449 c_i[id] += w1_w2_r * sin_p_xyt + w1_w2_i * cos_p_xyt;
1456 corr = cmplx(0.0, 0.0);
1457 for (
int id = 0;
id <
ND; ++id) {
1458 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
1465 const std::vector<int>& momentum_sink,
1467 const std::vector<int>& source_position,
1473 assert(corr_global.size() == Lz);
1475 std::vector<dcomplex> corr_local(Nz, 0.0);
1476 for (
int z = 0; z < Nz; ++z) {
1478 contract_at_z(corr_z, momentum_sink, gm_sink, source_position, v1, v2, z);
1479 corr_local[z] += corr_z;
1487 const std::vector<int>& momentum_sink,
1489 const std::vector<int>& source_position,
1493 #if defined USE_GROUP_SU_N
1500 const int Nvol = v1.
nvol();
1511 assert(Nvol == v2.
nvol());
1512 assert(v1.
nex() == 1);
1513 assert(v2.
nex() == 1);
1514 assert(momentum_sink.size() ==
NDIM - 1);
1515 assert(source_position.size() ==
NDIM);
1517 const double *w1 = v1.
ptr(0);
1518 const double *w2 = v2.
ptr(0);
1522 for (
int id = 0;
id <
ND; ++id) {
1529 for (
int id = 0;
id <
ND; ++id) {
1534 static const double PI = 4.0 * atan(1.0);
1535 std::vector<double> p_unit(ND - 1);
1536 p_unit[0] = (2.0 * PI / Ly) * momentum_sink[0];
1537 p_unit[1] = (2.0 * PI / Lz) * momentum_sink[1];
1538 p_unit[2] = (2.0 * PI / Lt) * momentum_sink[2];
1540 std::vector<int> ipe(ND);
1547 for (
int t = 0; t < Nt; ++t) {
1548 for (
int y = 0; y < Ny; ++y) {
1549 for (
int x = 0; x < Nx; ++x) {
1550 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
1552 int x_global = x + ipe[0] * Nx;
1553 int y_global = y + ipe[1] * Ny;
1554 int t_global = t + ipe[3] * Nt;
1556 double p_x = p_unit[0] * (x_global - source_position[0]);
1557 double p_y = p_unit[1] * (y_global - source_position[1]);
1558 double p_t = p_unit[2] * (t_global - source_position[2]);
1560 double cos_p_xyt = cos(p_t + p_x + p_y);
1562 double sin_p_xyt = 0;
1564 for (
int cc = 0; cc <
NC; ++cc) {
1565 for (
int id = 0;
id <
ND; ++id) {
1566 int ic1_r = 2 * cc + id1[id] + site;
1567 int ic2_r = 2 * cc + id2[id] + site;
1569 int ic1_i = 2 * cc + 1 + id1[id] + site;
1570 int ic2_i = 2 * cc + 1 + id2[id] + site;
1572 double w1_w2_r = w1[ic2_r] * w2[ic1_r] + w1[ic2_i] * w2[ic1_i];
1573 double w1_w2_i = -w1[ic2_r] * w2[ic1_i] + w1[ic2_i] * w2[ic1_r];
1577 c_r[id] += w1_w2_r * cos_p_xyt - w1_w2_i * sin_p_xyt;
1578 c_i[id] += w1_w2_r * sin_p_xyt + w1_w2_i * cos_p_xyt;
1585 corr = cmplx(0.0, 0.0);
1586 for (
int id = 0;
id <
ND; ++id) {
1587 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
1594 const std::vector<int>& momentum_sink,
1596 const std::vector<int>& source_position,
1602 assert(corr_global.size() == Lz);
1604 std::vector<dcomplex> corr_local(Nz, 0.0);
1605 for (
int z = 0; z < Nz; ++z) {
1608 corr_local[z] += corr_z;
1616 std::vector<dcomplex>& corr_local)
1621 assert(corr_global.size() == Lx);
1622 assert(corr_local.size() == Nx);
1624 std::vector<dcomplex> corr_tmp(Lx, 0);
1628 for (
int x = 0; x < Nx; ++x) {
1629 int x2 = x + ipex * Nx;
1630 corr_tmp[x2] = corr_local[x];
1633 for (
int x = 0; x < Lx; ++x) {
1636 corr_global[x] = cmplx(crr, cri);
1643 std::vector<dcomplex>& corr_local)
1648 assert(corr_global.size() == Ly);
1649 assert(corr_local.size() == Ny);
1651 std::vector<dcomplex> corr_tmp(Ly, 0);
1655 for (
int y = 0; y < Ny; ++y) {
1656 int y2 = y + ipey * Ny;
1657 corr_tmp[y2] = corr_local[y];
1660 for (
int y = 0; y < Ly; ++y) {
1663 corr_global[y] = cmplx(crr, cri);
1670 std::vector<dcomplex>& corr_local)
1675 assert(corr_global.size() == Lz);
1676 assert(corr_local.size() == Nz);
1678 std::vector<dcomplex> corr_tmp(Lz);
1682 for (
int z = 0; z < Nz; ++z) {
1683 int z2 = z + ipez * Nz;
1684 corr_tmp[z2] = corr_local[z];
1687 for (
int z = 0; z < Lz; ++z) {
1690 corr_global[z] = cmplx(crr, cri);
1697 std::vector<dcomplex>& corr_local)
1702 assert(corr_global.size() == Lt);
1703 assert(corr_local.size() == Nt);
1705 std::vector<dcomplex> corr_tmp(Lt, 0);
1709 for (
int t = 0; t < Nt; ++t) {
1710 int t_global = t + ipe_t * Nt;
1711 corr_tmp[t_global] = corr_local[t];
1714 for (
int t_global = 0; t_global < Lt; ++t_global) {
1717 corr_global[t_global] = cmplx(cr_r, cr_i);
double cmp_i(const int cc, const int s, const int site, const int e=0) const
const double * ptr(const int jin, const int site, const int jex) const
void global_corr_z(std::vector< dcomplex > &corr_global, std::vector< dcomplex > &corr_local)
transform node-local correlator in z to global.
int site(const int &x, const int &y, const int &z, const int &t) const
void global_corr_x(std::vector< dcomplex > &corr_global, std::vector< dcomplex > &corr_local)
transform node-local correlator in x to global.
void contract_at_t(dcomplex &corr, const GammaMatrix &gm_sink, const Field_F &v1, const Field_F &v2, const int time)
Contraction of hadron for 4-spinor fermion.
void contract_at_x_cos(dcomplex &corr, const std::vector< int > &momentum_sink, const GammaMatrix &gm_sink, const std::vector< int > &source_position, const Field_F &v1, const Field_F &v2, const int x)
contraction for meson at a given x with Fourier transformation, where (p_y,p_z,p_t) is given by momen...
static int ipe(const int dir)
logical coordinate of current proc.
static int reduce_sum(int count, dcomplex *recv_buf, dcomplex *send_buf, int pattern=0)
make a global sum of an array of dcomplex over the communicator. pattern specifies the dimensions to ...
void contract_at_y_cos(dcomplex &corr, const std::vector< int > &momentum_sink, const GammaMatrix &gm_sink, const std::vector< int > &source_position, const Field_F &v1, const Field_F &v2, const int y)
contraction for meson at a given y with Fourier transformation, where (p_x,p_z,p_t) is given by momen...
void contract_at_z_cos(dcomplex &corr, const std::vector< int > &momentum_sink, const GammaMatrix &gm_sink, const std::vector< int > &source_position, const Field_F &v1, const Field_F &v2, const int z)
contraction for meson at a given z with Fourier transformation, where (p_x,p_y,p_t) is given by momen...
Wilson-type fermion field.
void contract_at_z(dcomplex &corr, const GammaMatrix &gm_sink, const Field_F &v1, const Field_F &v2, const int z)
contraction for meson at a given z.
void contract_at_x(dcomplex &corr, const GammaMatrix &gm_sink, const Field_F &v1, const Field_F &v2, int x)
void global_corr_t(std::vector< dcomplex > &corr_global, std::vector< dcomplex > &corr_local)
transform node-local correlator in t to global.
void global_corr_y(std::vector< dcomplex > &corr_global, std::vector< dcomplex > &corr_local)
transform node-local correlator in y to global.
void contract_at_t_cos(dcomplex &corr, const std::vector< int > &momentum_sink, const GammaMatrix &gm_sink, const std::vector< int > &source_position, const Field_F &v1, const Field_F &v2, const int time)
dcomplex value(int row) const
void contract_at_y(dcomplex &corr, const GammaMatrix &gm_sink, const Field_F &v1, const Field_F &v2, const int y)
contraction for meson at a given y.
double cmp_r(const int cc, const int s, const int site, const int e=0) const