19 #if defined USE_GROUP_SU3
29 #elif defined USE_GROUP_SU2
50 assert(Nvol == v1.
nvol());
51 assert(Nvol == v2.
nvol());
55 std::vector<int> gm_index(Nd);
56 std::vector<double> corr_r(Nd), corr_i(Nd);
58 for (
int i = 0; i < Nd; ++i) {
59 gm_index[i] = gm_sink.
index(i);
64 for (
int z = 0; z < Nz; ++z) {
65 for (
int y = 0; y < Ny; ++y) {
66 for (
int x = 0; x < Nx; ++x) {
67 int site = index.
site(x, y, z, time);
69 for (
int s0 = 0; s0 < Nd; ++s0) {
70 int s1 = gm_index[s0];
72 for (
int c1 = 0; c1 < Nc; ++c1) {
73 corr_r[s0] += v1.
cmp_r(c1, s1, site) * v2.
cmp_r(c1, s0, site)
74 + v1.
cmp_i(c1, s1, site) * v2.
cmp_i(c1, s0, site);
76 corr_i[s0] += -v1.
cmp_r(c1, s1, site) * v2.
cmp_i(c1, s0, site)
77 + v1.
cmp_i(c1, s1, site) * v2.
cmp_r(c1, s0, site);
84 corr = cmplx(0.0, 0.0);
85 for (
int s0 = 0; s0 < Nd; ++s0) {
86 corr += gm_sink.
value(s0) * cmplx(corr_r[s0], corr_i[s0]);
99 assert(corr_global.size() == Lt);
101 std::vector<dcomplex> corr_local(Nt, 0.0);
102 for (
int t = 0; t < Nt; ++t) {
105 corr_local[t] += corr_t;
113 const std::vector<int>& momentum_sink,
115 const std::vector<int>& source_position,
131 assert(Nvol == v1.
nvol());
132 assert(Nvol == v2.
nvol());
134 assert(momentum_sink.size() == Ndim - 1);
137 std::vector<int> gm_index(Nd);
138 std::vector<double> corr_r(Nd), corr_i(Nd);
140 for (
int i = 0; i < Nd; ++i) {
141 gm_index[i] = gm_sink.
index(i);
146 static const double PI = 4.0 * atan(1.0);
147 std::vector<double> p_unit(Ndim - 1);
148 p_unit[0] = (2.0 * PI / Lx) * momentum_sink[0];
149 p_unit[1] = (2.0 * PI / Ly) * momentum_sink[1];
150 p_unit[2] = (2.0 * PI / Lz) * momentum_sink[2];
152 std::vector<int> ipe(Ndim - 1);
157 for (
int z = 0; z < Nz; ++z) {
158 for (
int y = 0; y < Ny; ++y) {
159 for (
int x = 0; x < Nx; ++x) {
160 int site = index.site(x, y, z, time);
162 int x_global = x + ipe[0] * Nx;
163 int y_global = y + ipe[1] * Ny;
164 int z_global = z + ipe[2] * Nz;
166 double p_x = p_unit[0] * (x_global - source_position[0]);
167 double p_y = p_unit[1] * (y_global - source_position[1]);
168 double p_z = p_unit[2] * (z_global - source_position[2]);
170 double cos_p_xyz = cos(p_x + p_y + p_z);
171 double sin_p_xyz = sin(p_x + p_y + p_z);
173 for (
int s0 = 0; s0 < Nd; ++s0) {
174 int s1 = gm_index[s0];
176 double v1_v2_r = 0.0;
177 double v1_v2_i = 0.0;
179 for (
int c1 = 0; c1 < Nc; ++c1) {
180 v1_v2_r += v1.
cmp_r(c1, s1, site) * v2.
cmp_r(c1, s0, site)
181 + v1.
cmp_i(c1, s1, site) * v2.
cmp_i(c1, s0, site);
183 v1_v2_i += -v1.
cmp_r(c1, s1, site) * v2.
cmp_i(c1, s0, site)
184 + v1.
cmp_i(c1, s1, site) * v2.
cmp_r(c1, s0, site);
188 corr_r[s0] += v1_v2_r * cos_p_xyz - v1_v2_i * sin_p_xyz;
189 corr_i[s0] += v1_v2_r * sin_p_xyz + v1_v2_i * cos_p_xyz;
195 corr = cmplx(0.0, 0.0);
196 for (
int s0 = 0; s0 < Nd; ++s0) {
197 corr += gm_sink.
value(s0) * cmplx(corr_r[s0], corr_i[s0]);
204 const std::vector<int>& momentum_sink,
206 const std::vector<int>& source_position,
212 assert(corr_global.size() == Lt);
214 std::vector<dcomplex> corr_local(Nt, 0.0);
215 for (
int t = 0; t < Nt; ++t) {
217 contract_at_t(corr_t, momentum_sink, gm_sink, source_position, v1, v2, t);
218 corr_local[t] += corr_t;
226 const std::vector<int>& momentum_sink,
228 const std::vector<int>& source_position,
232 #if defined USE_GROUP_SU_N
235 const int NC2 = 2 *
NC;
236 const int NCD2 = NC2 *
ND;
239 const int Nvol = v1.
nvol();
248 assert(Nvol == v2.
nvol());
249 assert(v1.
nex() == 1);
250 assert(v2.
nex() == 1);
251 assert(momentum_sink.size() ==
NDIM - 1);
253 const double *w1 = v1.
ptr(0);
254 const double *w2 = v2.
ptr(0);
258 for (
int id = 0;
id <
ND; ++id) {
265 for (
int id = 0;
id <
ND; ++id) {
270 static const double PI = 4.0 * atan(1.0);
271 std::vector<double> p_unit(ND - 1);
272 p_unit[0] = (2.0 * PI / Lx) * momentum_sink[0];
273 p_unit[1] = (2.0 * PI / Ly) * momentum_sink[1];
274 p_unit[2] = (2.0 * PI / Lz) * momentum_sink[2];
276 std::vector<int> ipe(ND - 1);
282 for (
int ss = 0; ss < Nvol_s; ++ss) {
283 int site = NCD2 * (ss + time * Nvol_s);
286 int y = ss % (Nx * Ny) / Nx;
287 int z = ss % (Nx * Ny * Nz) / (Nx * Ny);
289 int x_global = x + ipe[0] * Nx;
290 int y_global = y + ipe[1] * Ny;
291 int z_global = z + ipe[2] * Nz;
293 double p_x = p_unit[0] * (x_global - source_position[0]);
294 double p_y = p_unit[1] * (y_global - source_position[1]);
295 double p_z = p_unit[2] * (z_global - source_position[2]);
297 double cos_p_xyz = cos(p_x + p_y + p_z);
299 double sin_p_xyz = 0;
301 for (
int cc = 0; cc <
NC; ++cc) {
302 for (
int id = 0;
id <
ND; ++id) {
303 int ic1_r = 2 * cc + id1[id] + site;
304 int ic2_r = 2 * cc + id2[id] + site;
306 int ic1_i = 2 * cc + 1 + id1[id] + site;
307 int ic2_i = 2 * cc + 1 + id2[id] + site;
309 double w1_w2_r = w1[ic2_r] * w2[ic1_r] + w1[ic2_i] * w2[ic1_i];
310 double w1_w2_i = -w1[ic2_r] * w2[ic1_i] + w1[ic2_i] * w2[ic1_r];
314 c_r[id] += w1_w2_r * cos_p_xyz - w1_w2_i * sin_p_xyz;
315 c_i[id] += w1_w2_r * sin_p_xyz + w1_w2_i * cos_p_xyz;
320 corr = cmplx(0.0, 0.0);
321 for (
int id = 0;
id <
ND; ++id) {
322 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
329 const std::vector<int>& momentum_sink,
331 const std::vector<int>& source_position,
337 assert(corr_global.size() == Lt);
339 std::vector<dcomplex> corr_local(Nt, 0.0);
340 for (
int t = 0; t < Nt; ++t) {
343 corr_local[t] += corr_t;
356 #if defined USE_GROUP_SU3
366 assert(Nvol == v1.
nvol());
367 assert(Nvol == v2.
nvol());
368 assert(Nvol == v3.
nvol());
372 std::vector<int> gm_index(Nd);
373 std::vector<double> c_r(Nd), c_i(Nd);
375 for (
int i = 0; i < Nd; ++i) {
376 gm_index[i] = gm_sink.
index(i);
381 for (
int z = 0; z < Nz; ++z) {
382 for (
int y = 0; y < Ny; ++y) {
383 for (
int x = 0; x < Nx; ++x) {
384 int site = index.
site(x, y, z, time);
386 for (
int d1 = 0; d1 < Nd; ++d1) {
387 int d2 = gm_index[d1];
390 c_r[d1] += (v1.
cmp_r(C1, d1, site) * v2.
cmp_r(C2, d2, site)
391 - v1.
cmp_i(C1, d1, site) * v2.
cmp_i(C2, d2, site)) * v3.
cmp_r(C3, d3, site)
392 - (v1.
cmp_r(C1, d1, site) * v2.
cmp_i(C2, d2, site)
393 + v1.
cmp_i(C1, d1, site) * v2.
cmp_r(C2, d2, site)) * v3.
cmp_i(C3, d3, site);
394 c_i[d1] += (v1.
cmp_r(C1, d1, site) * v2.
cmp_r(C2, d2, site)
395 - v1.
cmp_i(C1, d1, site) * v2.
cmp_i(C2, d2, site)) * v3.
cmp_i(C3, d3, site)
396 + (v1.
cmp_r(C1, d1, site) * v2.
cmp_i(C2, d2, site)
397 + v1.
cmp_i(C1, d1, site) * v2.
cmp_r(C2, d2, site)) * v3.
cmp_r(C3, d3, site);
399 c_r[d1] += (v1.
cmp_r(C2, d1, site) * v2.
cmp_r(C3, d2, site)
400 - v1.
cmp_i(C2, d1, site) * v2.
cmp_i(C3, d2, site)) * v3.
cmp_r(C1, d3, site)
401 - (v1.
cmp_r(C2, d1, site) * v2.
cmp_i(C3, d2, site)
402 + v1.
cmp_i(C2, d1, site) * v2.
cmp_r(C3, d2, site)) * v3.
cmp_i(C1, d3, site);
403 c_i[d1] += (v1.
cmp_r(C2, d1, site) * v2.
cmp_r(C3, d2, site)
404 - v1.
cmp_i(C2, d1, site) * v2.
cmp_i(C3, d2, site)) * v3.
cmp_i(C1, d3, site)
405 + (v1.
cmp_r(C2, d1, site) * v2.
cmp_i(C3, d2, site)
406 + v1.
cmp_i(C2, d1, site) * v2.
cmp_r(C3, d2, site)) * v3.
cmp_r(C1, d3, site);
408 c_r[d1] += (v1.
cmp_r(C3, d1, site) * v2.
cmp_r(C1, d2, site)
409 - v1.
cmp_i(C3, d1, site) * v2.
cmp_i(C1, d2, site)) * v3.
cmp_r(C2, d3, site)
410 - (v1.
cmp_r(C3, d1, site) * v2.
cmp_i(C1, d2, site)
411 + v1.
cmp_i(C3, d1, site) * v2.
cmp_r(C1, d2, site)) * v3.
cmp_i(C2, d3, site);
412 c_i[d1] += (v1.
cmp_r(C3, d1, site) * v2.
cmp_r(C1, d2, site)
413 - v1.
cmp_i(C3, d1, site) * v2.
cmp_i(C1, d2, site)) * v3.
cmp_i(C2, d3, site)
414 + (v1.
cmp_r(C3, d1, site) * v2.
cmp_i(C1, d2, site)
415 + v1.
cmp_i(C3, d1, site) * v2.
cmp_r(C1, d2, site)) * v3.
cmp_r(C2, d3, site);
417 c_r[d1] -= (v1.
cmp_r(C3, d1, site) * v2.
cmp_r(C2, d2, site)
418 - v1.
cmp_i(C3, d1, site) * v2.
cmp_i(C2, d2, site)) * v3.
cmp_r(C1, d3, site)
419 - (v1.
cmp_r(C3, d1, site) * v2.
cmp_i(C2, d2, site)
420 + v1.
cmp_i(C3, d1, site) * v2.
cmp_r(C2, d2, site)) * v3.
cmp_i(C1, d3, site);
421 c_i[d1] -= (v1.
cmp_r(C3, d1, site) * v2.
cmp_r(C2, d2, site)
422 - v1.
cmp_i(C3, d1, site) * v2.
cmp_i(C2, d2, site)) * v3.
cmp_i(C1, d3, site)
423 + (v1.
cmp_r(C3, d1, site) * v2.
cmp_i(C2, d2, site)
424 + v1.
cmp_i(C3, d1, site) * v2.
cmp_r(C2, d2, site)) * v3.
cmp_r(C1, d3, site);
426 c_r[d1] -= (v1.
cmp_r(C2, d1, site) * v2.
cmp_r(C1, d2, site)
427 - v1.
cmp_i(C2, d1, site) * v2.
cmp_i(C1, d2, site)) * v3.
cmp_r(C3, d3, site)
428 - (v1.
cmp_r(C2, d1, site) * v2.
cmp_i(C1, d2, site)
429 + v1.
cmp_i(C2, d1, site) * v2.
cmp_r(C1, d2, site)) * v3.
cmp_i(C3, d3, site);
430 c_i[d1] -= (v1.
cmp_r(C2, d1, site) * v2.
cmp_r(C1, d2, site)
431 - v1.
cmp_i(C2, d1, site) * v2.
cmp_i(C1, d2, site)) * v3.
cmp_i(C3, d3, site)
432 + (v1.
cmp_r(C2, d1, site) * v2.
cmp_i(C1, d2, site)
433 + v1.
cmp_i(C2, d1, site) * v2.
cmp_r(C1, d2, site)) * v3.
cmp_r(C3, d3, site);
435 c_r[d1] -= (v1.
cmp_r(C1, d1, site) * v2.
cmp_r(C3, d2, site)
436 - v1.
cmp_i(C1, d1, site) * v2.
cmp_i(C3, d2, site)) * v3.
cmp_r(C2, d3, site)
437 - (v1.
cmp_r(C1, d1, site) * v2.
cmp_i(C3, d2, site)
438 + v1.
cmp_i(C1, d1, site) * v2.
cmp_r(C3, d2, site)) * v3.
cmp_i(C2, d3, site);
439 c_i[d1] -= (v1.
cmp_r(C1, d1, site) * v2.
cmp_r(C3, d2, site)
440 - v1.
cmp_i(C1, d1, site) * v2.
cmp_i(C3, d2, site)) * v3.
cmp_i(C2, d3, site)
441 + (v1.
cmp_r(C1, d1, site) * v2.
cmp_i(C3, d2, site)
442 + v1.
cmp_i(C1, d1, site) * v2.
cmp_r(C3, d2, site)) * v3.
cmp_r(C2, d3, site);
448 corr = cmplx(0.0, 0.0);
449 for (
int s0 = 0; s0 < Nd; ++s0) {
450 corr += gm_sink.
value(s0) * cmplx(c_r[s0], c_i[s0]);
452 #endif // (USE_GROUP_SU3)
462 #if defined USE_GROUP_SU_N
465 const int NC2 = 2 *
NC;
466 const int NCD2 = NC2 *
ND;
469 const int Nvol = v1.
nvol();
476 assert(Nvol == v2.
nvol());
477 assert(v1.
nex() == 1);
478 assert(v2.
nex() == 1);
480 const double *w1 = v1.
ptr(0);
481 const double *w2 = v2.
ptr(0);
485 for (
int id = 0;
id <
ND; ++id) {
492 for (
int id = 0;
id <
ND; ++id) {
497 for (
int t = 0; t < Nt; ++t) {
498 for (
int z = 0; z < Nz; ++z) {
499 for (
int y = 0; y < Ny; ++y) {
500 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
502 for (
int cc = 0; cc <
NC; ++cc) {
503 for (
int id = 0;
id <
ND; ++id) {
504 int ic1_r = 2 * cc + id1[id] + site;
505 int ic2_r = 2 * cc + id2[id] + site;
507 int ic1_i = 2 * cc + 1 + id1[id] + site;
508 int ic2_i = 2 * cc + 1 + id2[id] + site;
510 c_r[id] += w1[ic2_r] * w2[ic1_r]
511 + w1[ic2_i] * w2[ic1_i];
513 c_i[id] += -w1[ic2_r] * w2[ic1_i]
514 + w1[ic2_i] * w2[ic1_r];
521 corr = cmplx(0.0, 0.0);
522 for (
int id = 0;
id <
ND; ++id) {
523 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
536 assert(corr_global.size() == Lx);
538 std::vector<dcomplex> corr_local(Nx, 0.0);
539 for (
int x = 0; x < Nx; ++x) {
542 corr_local[x] += corr_x;
550 const std::vector<int>& momentum_sink,
552 const std::vector<int>& source_position,
556 #if defined USE_GROUP_SU_N
563 const int Nvol = v1.
nvol();
574 assert(Nvol == v2.
nvol());
575 assert(v1.
nex() == 1);
576 assert(v2.
nex() == 1);
577 assert(momentum_sink.size() ==
NDIM - 1);
578 assert(source_position.size() ==
NDIM);
580 const double *w1 = v1.
ptr(0);
581 const double *w2 = v2.
ptr(0);
585 for (
int id = 0;
id <
ND; ++id) {
592 for (
int id = 0;
id <
ND; ++id) {
597 static const double PI = 4.0 * atan(1.0);
598 std::vector<double> p_unit(ND - 1);
599 p_unit[0] = (2.0 * PI / Ly) * momentum_sink[0];
600 p_unit[1] = (2.0 * PI / Lz) * momentum_sink[1];
601 p_unit[2] = (2.0 * PI / Lt) * momentum_sink[2];
603 std::vector<int> ipe(ND);
609 for (
int t = 0; t < Nt; ++t) {
610 for (
int z = 0; z < Nz; ++z) {
611 for (
int y = 0; y < Ny; ++y) {
612 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
614 int y_global = y + ipe[1] * Ny;
615 int z_global = z + ipe[2] * Nz;
616 int t_global = t + ipe[3] * Nt;
618 double p_y = p_unit[0] * (y_global - source_position[1]);
619 double p_z = p_unit[1] * (z_global - source_position[2]);
620 double p_t = p_unit[2] * (t_global - source_position[3]);
622 double cos_p_yzt = cos(p_t + p_y + p_z);
623 double sin_p_yzt = sin(p_t + p_y + p_z);
625 for (
int cc = 0; cc <
NC; ++cc) {
626 for (
int id = 0;
id <
ND; ++id) {
627 int ic1_r = 2 * cc + id1[id] + site;
628 int ic2_r = 2 * cc + id2[id] + site;
630 int ic1_i = 2 * cc + 1 + id1[id] + site;
631 int ic2_i = 2 * cc + 1 + id2[id] + site;
633 double w1_w2_r = w1[ic2_r] * w2[ic1_r] + w1[ic2_i] * w2[ic1_i];
634 double w1_w2_i = -w1[ic2_r] * w2[ic1_i] + w1[ic2_i] * w2[ic1_r];
637 c_r[id] += w1_w2_r * cos_p_yzt - w1_w2_i * sin_p_yzt;
638 c_i[id] += w1_w2_r * sin_p_yzt + w1_w2_i * cos_p_yzt;
645 corr = cmplx(0.0, 0.0);
646 for (
int id = 0;
id <
ND; ++id) {
647 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
654 const std::vector<int>& momentum_sink,
656 const std::vector<int>& source_position,
662 assert(corr_global.size() == Lx);
664 std::vector<dcomplex> corr_local(Nx, 0.0);
665 for (
int x = 0; x < Nx; ++x) {
667 contract_at_x(corr_x, momentum_sink, gm_sink, source_position, v1, v2, x);
668 corr_local[x] += corr_x;
676 const std::vector<int>& momentum_sink,
678 const std::vector<int>& source_position,
682 #if defined USE_GROUP_SU_N
689 const int Nvol = v1.
nvol();
700 assert(Nvol == v2.
nvol());
701 assert(v1.
nex() == 1);
702 assert(v2.
nex() == 1);
703 assert(momentum_sink.size() ==
NDIM - 1);
704 assert(source_position.size() ==
NDIM);
706 const double *w1 = v1.
ptr(0);
707 const double *w2 = v2.
ptr(0);
711 for (
int id = 0;
id <
ND; ++id) {
718 for (
int id = 0;
id <
ND; ++id) {
723 static const double PI = 4.0 * atan(1.0);
724 std::vector<double> p_unit(ND - 1);
725 p_unit[0] = (2.0 * PI / Ly) * momentum_sink[0];
726 p_unit[1] = (2.0 * PI / Lz) * momentum_sink[1];
727 p_unit[2] = (2.0 * PI / Lt) * momentum_sink[2];
729 std::vector<int> ipe(ND);
736 for (
int t = 0; t < Nt; ++t) {
737 for (
int z = 0; z < Nz; ++z) {
738 for (
int y = 0; y < Ny; ++y) {
739 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
741 int y_global = y + ipe[1] * Ny;
742 int z_global = z + ipe[2] * Nz;
743 int t_global = t + ipe[3] * Nt;
745 double p_y = p_unit[0] * (y_global - source_position[1]);
746 double p_z = p_unit[1] * (z_global - source_position[2]);
747 double p_t = p_unit[2] * (t_global - source_position[3]);
749 double cos_p_yzt = cos(p_t + p_y + p_z);
751 double sin_p_yzt = 0;
753 for (
int cc = 0; cc <
NC; ++cc) {
754 for (
int id = 0;
id <
ND; ++id) {
755 int ic1_r = 2 * cc + id1[id] + site;
756 int ic2_r = 2 * cc + id2[id] + site;
758 int ic1_i = 2 * cc + 1 + id1[id] + site;
759 int ic2_i = 2 * cc + 1 + id2[id] + site;
761 double w1_w2_r = w1[ic2_r] * w2[ic1_r] + w1[ic2_i] * w2[ic1_i];
762 double w1_w2_i = -w1[ic2_r] * w2[ic1_i] + w1[ic2_i] * w2[ic1_r];
766 c_r[id] += w1_w2_r * cos_p_yzt - w1_w2_i * sin_p_yzt;
767 c_i[id] += w1_w2_r * sin_p_yzt + w1_w2_i * cos_p_yzt;
774 corr = cmplx(0.0, 0.0);
775 for (
int id = 0;
id <
ND; ++id) {
776 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
783 const std::vector<int>& momentum_sink,
785 const std::vector<int>& source_position,
791 assert(corr_global.size() == Lx);
793 std::vector<dcomplex> corr_local(Nx, 0.0);
794 for (
int x = 0; x < Nx; ++x) {
797 corr_local[x] += corr_x;
810 #if defined USE_GROUP_SU3
811 const int Nvol = v1.
nvol();
818 assert(Nvol == v2.
nvol());
819 assert(Nvol == v3.
nvol());
820 assert(v1.
nex() == 1);
821 assert(v2.
nex() == 1);
822 assert(v3.
nex() == 1);
824 const double *w1 = v1.
ptr(0);
825 const double *w2 = v2.
ptr(0);
826 const double *w3 = v3.
ptr(0);
830 for (
int id = 0;
id <
ND; ++id) {
834 int id3 = i_alpha *
NC2;
838 for (
int id = 0;
id <
ND; ++id) {
844 for (
int t = 0; t < Nt; ++t) {
845 for (
int z = 0; z < Nz; ++z) {
846 for (
int y = 0; y < Ny; ++y) {
847 int site =
NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
849 for (
int id = 0;
id <
ND; ++id) {
850 int ic11_r = C1 + id1[id] + site;
851 int ic22_r = C2 + id2[id] + site;
852 int ic33_r = C3 + id3 + site;
854 int ic11_i = C1 + 1 + id1[id] + site;
855 int ic22_i = C2 + 1 + id2[id] + site;
856 int ic33_i = C3 + 1 + id3 + site;
858 int ic21_r = C2 + id1[id] + site;
859 int ic32_r = C3 + id2[id] + site;
860 int ic13_r = C1 + id3 + site;
862 int ic21_i = C2 + 1 + id1[id] + site;
863 int ic32_i = C3 + 1 + id2[id] + site;
864 int ic13_i = C1 + 1 + id3 + site;
866 int ic31_r = C3 + id1[id] + site;
867 int ic12_r = C1 + id2[id] + site;
868 int ic23_r = C2 + id3 + site;
870 int ic31_i = C3 + 1 + id1[id] + site;
871 int ic12_i = C1 + 1 + id2[id] + site;
872 int ic23_i = C2 + 1 + id3 + site;
874 c_r[id] += (w1[ic11_r] * w2[ic22_r] - w1[ic11_i] * w2[ic22_i]) * w3[ic33_r]
875 - (w1[ic11_r] * w2[ic22_i] + w1[ic11_i] * w2[ic22_r]) * w3[ic33_i];
876 c_i[id] += (w1[ic11_r] * w2[ic22_r] - w1[ic11_i] * w2[ic22_i]) * w3[ic33_i]
877 + (w1[ic11_r] * w2[ic22_i] + w1[ic11_i] * w2[ic22_r]) * w3[ic33_r];
879 c_r[id] += (w1[ic21_r] * w2[ic32_r] - w1[ic21_i] * w2[ic32_i]) * w3[ic13_r]
880 - (w1[ic21_r] * w2[ic32_i] + w1[ic21_i] * w2[ic32_r]) * w3[ic13_i];
881 c_i[id] += (w1[ic21_r] * w2[ic32_r] - w1[ic21_i] * w2[ic32_i]) * w3[ic13_i]
882 + (w1[ic21_r] * w2[ic32_i] + w1[ic21_i] * w2[ic32_r]) * w3[ic13_r];
884 c_r[id] += (w1[ic31_r] * w2[ic12_r] - w1[ic31_i] * w2[ic12_i]) * w3[ic23_r]
885 - (w1[ic31_r] * w2[ic12_i] + w1[ic31_i] * w2[ic12_r]) * w3[ic23_i];
886 c_i[id] += (w1[ic31_r] * w2[ic12_r] - w1[ic31_i] * w2[ic12_i]) * w3[ic23_i]
887 + (w1[ic31_r] * w2[ic12_i] + w1[ic31_i] * w2[ic12_r]) * w3[ic23_r];
889 c_r[id] -= (w1[ic31_r] * w2[ic22_r] - w1[ic31_i] * w2[ic22_i]) * w3[ic13_r]
890 - (w1[ic31_r] * w2[ic22_i] + w1[ic31_i] * w2[ic22_r]) * w3[ic13_i];
891 c_i[id] -= (w1[ic31_r] * w2[ic22_r] - w1[ic31_i] * w2[ic22_i]) * w3[ic13_i]
892 + (w1[ic31_r] * w2[ic22_i] + w1[ic31_i] * w2[ic22_r]) * w3[ic13_r];
894 c_r[id] -= (w1[ic21_r] * w2[ic12_r] - w1[ic21_i] * w2[ic12_i]) * w3[ic33_r]
895 - (w1[ic21_r] * w2[ic12_i] + w1[ic21_i] * w2[ic12_r]) * w3[ic33_i];
896 c_i[id] -= (w1[ic21_r] * w2[ic12_r] - w1[ic21_i] * w2[ic12_i]) * w3[ic33_i]
897 + (w1[ic21_r] * w2[ic12_i] + w1[ic21_i] * w2[ic12_r]) * w3[ic33_r];
899 c_r[id] -= (w1[ic11_r] * w2[ic32_r] - w1[ic11_i] * w2[ic32_i]) * w3[ic23_r]
900 - (w1[ic11_r] * w2[ic32_i] + w1[ic11_i] * w2[ic32_r]) * w3[ic23_i];
901 c_i[id] -= (w1[ic11_r] * w2[ic32_r] - w1[ic11_i] * w2[ic32_i]) * w3[ic23_i]
902 + (w1[ic11_r] * w2[ic32_i] + w1[ic11_i] * w2[ic32_r]) * w3[ic23_r];
908 corr = cmplx(0.0, 0.0);
909 for (
int id = 0;
id <
ND; ++id) {
910 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
912 #endif // (USE_GROUP_SU3)
923 #if defined USE_GROUP_SU_N
926 const int NC2 = 2 *
NC;
927 const int NCD2 = NC2 *
ND;
930 const int Nvol = v1.
nvol();
936 assert(Nvol == v1.
nvol());
937 assert(Nvol == v2.
nvol());
938 assert(v1.
nex() == 1);
939 assert(v2.
nex() == 1);
942 const double *w1 = v1.
ptr(0);
943 const double *w2 = v2.
ptr(0);
947 for (
int id = 0;
id <
ND; ++id) {
954 for (
int id = 0;
id <
ND; ++id) {
959 for (
int t = 0; t < Nt; ++t) {
960 for (
int z = 0; z < Nz; ++z) {
961 for (
int x = 0; x < Nx; ++x) {
962 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
963 for (
int cc = 0; cc <
NC; ++cc) {
964 for (
int id = 0;
id <
ND; ++id) {
965 int ic1_r = 2 * cc + id1[id] + site;
966 int ic2_r = 2 * cc + id2[id] + site;
968 int ic1_i = 2 * cc + 1 + id1[id] + site;
969 int ic2_i = 2 * cc + 1 + id2[id] + site;
971 c_r[id] += w1[ic2_r] * w2[ic1_r]
972 + w1[ic2_i] * w2[ic1_i];
974 c_i[id] += -w1[ic2_r] * w2[ic1_i]
975 + w1[ic2_i] * w2[ic1_r];
982 corr = cmplx(0.0, 0.0);
983 for (
int id = 0;
id <
ND; ++id) {
984 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
997 assert(corr_global.size() == Ly);
999 std::vector<dcomplex> corr_local(Ny, 0.0);
1000 for (
int y = 0; y < Ny; ++y) {
1003 corr_local[y] += corr_y;
1011 const std::vector<int>& momentum_sink,
1013 const std::vector<int>& source_position,
1017 #if defined USE_GROUP_SU_N
1024 const int Nvol = v1.
nvol();
1035 assert(Nvol == v2.
nvol());
1036 assert(v1.
nex() == 1);
1037 assert(v2.
nex() == 1);
1038 assert(momentum_sink.size() ==
NDIM - 1);
1039 assert(source_position.size() ==
NDIM);
1041 const double *w1 = v1.
ptr(0);
1042 const double *w2 = v2.
ptr(0);
1046 for (
int id = 0;
id <
ND; ++id) {
1053 for (
int id = 0;
id <
ND; ++id) {
1058 static const double PI = 4.0 * atan(1.0);
1059 std::vector<double> p_unit(ND - 1);
1060 p_unit[0] = (2.0 * PI / Ly) * momentum_sink[0];
1061 p_unit[1] = (2.0 * PI / Lz) * momentum_sink[1];
1062 p_unit[2] = (2.0 * PI / Lt) * momentum_sink[2];
1064 std::vector<int> ipe(ND);
1070 for (
int t = 0; t < Nt; ++t) {
1071 for (
int z = 0; z < Nz; ++z) {
1072 for (
int x = 0; x < Nx; ++x) {
1073 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
1075 int x_global = x + ipe[0] * Nx;
1076 int z_global = z + ipe[2] * Nz;
1077 int t_global = t + ipe[3] * Nt;
1079 double p_x = p_unit[0] * (x_global - source_position[0]);
1080 double p_z = p_unit[1] * (z_global - source_position[2]);
1081 double p_t = p_unit[2] * (t_global - source_position[3]);
1083 double cos_p_xzt = cos(p_t + p_x + p_z);
1084 double sin_p_xzt = sin(p_t + p_x + p_z);
1086 for (
int cc = 0; cc <
NC; ++cc) {
1087 for (
int id = 0;
id <
ND; ++id) {
1088 int ic1_r = 2 * cc + id1[id] + site;
1089 int ic2_r = 2 * cc + id2[id] + site;
1091 int ic1_i = 2 * cc + 1 + id1[id] + site;
1092 int ic2_i = 2 * cc + 1 + id2[id] + site;
1094 double w1_w2_r = w1[ic2_r] * w2[ic1_r] + w1[ic2_i] * w2[ic1_i];
1095 double w1_w2_i = -w1[ic2_r] * w2[ic1_i] + w1[ic2_i] * w2[ic1_r];
1098 c_r[id] += w1_w2_r * cos_p_xzt - w1_w2_i * sin_p_xzt;
1099 c_i[id] += w1_w2_r * sin_p_xzt + w1_w2_i * cos_p_xzt;
1106 corr = cmplx(0.0, 0.0);
1107 for (
int id = 0;
id <
ND; ++id) {
1108 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
1115 const std::vector<int>& momentum_sink,
1117 const std::vector<int>& source_position,
1123 assert(corr_global.size() == Ly);
1125 std::vector<dcomplex> corr_local(Ny, 0.0);
1126 for (
int y = 0; y < Ny; ++y) {
1128 contract_at_y(corr_y, momentum_sink, gm_sink, source_position, v1, v2, y);
1129 corr_local[y] += corr_y;
1137 const std::vector<int>& momentum_sink,
1139 const std::vector<int>& source_position,
1143 #if defined USE_GROUP_SU_N
1150 const int Nvol = v1.
nvol();
1161 assert(Nvol == v2.
nvol());
1162 assert(v1.
nex() == 1);
1163 assert(v2.
nex() == 1);
1164 assert(momentum_sink.size() ==
NDIM - 1);
1165 assert(source_position.size() ==
NDIM);
1167 const double *w1 = v1.
ptr(0);
1168 const double *w2 = v2.
ptr(0);
1172 for (
int id = 0;
id <
ND; ++id) {
1179 for (
int id = 0;
id <
ND; ++id) {
1184 static const double PI = 4.0 * atan(1.0);
1185 std::vector<double> p_unit(ND - 1);
1186 p_unit[0] = (2.0 * PI / Ly) * momentum_sink[0];
1187 p_unit[1] = (2.0 * PI / Lz) * momentum_sink[1];
1188 p_unit[2] = (2.0 * PI / Lt) * momentum_sink[2];
1190 std::vector<int> ipe(ND);
1197 for (
int t = 0; t < Nt; ++t) {
1198 for (
int z = 0; z < Nz; ++z) {
1199 for (
int x = 0; x < Nx; ++x) {
1200 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
1202 int x_global = x + ipe[0] * Nx;
1203 int z_global = z + ipe[2] * Nz;
1204 int t_global = t + ipe[3] * Nt;
1206 double p_x = p_unit[0] * (x_global - source_position[0]);
1207 double p_z = p_unit[1] * (z_global - source_position[2]);
1208 double p_t = p_unit[2] * (t_global - source_position[3]);
1210 double cos_p_xzt = cos(p_t + p_x + p_z);
1212 double sin_p_xzt = 0;
1214 for (
int cc = 0; cc <
NC; ++cc) {
1215 for (
int id = 0;
id <
ND; ++id) {
1216 int ic1_r = 2 * cc + id1[id] + site;
1217 int ic2_r = 2 * cc + id2[id] + site;
1219 int ic1_i = 2 * cc + 1 + id1[id] + site;
1220 int ic2_i = 2 * cc + 1 + id2[id] + site;
1222 double w1_w2_r = w1[ic2_r] * w2[ic1_r] + w1[ic2_i] * w2[ic1_i];
1223 double w1_w2_i = -w1[ic2_r] * w2[ic1_i] + w1[ic2_i] * w2[ic1_r];
1227 c_r[id] += w1_w2_r * cos_p_xzt - w1_w2_i * sin_p_xzt;
1228 c_i[id] += w1_w2_r * sin_p_xzt + w1_w2_i * cos_p_xzt;
1235 corr = cmplx(0.0, 0.0);
1236 for (
int id = 0;
id <
ND; ++id) {
1237 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
1244 const std::vector<int>& momentum_sink,
1246 const std::vector<int>& source_position,
1252 assert(corr_global.size() == Ly);
1254 std::vector<dcomplex> corr_local(Ny, 0.0);
1255 for (
int y = 0; y < Ny; ++y) {
1258 corr_local[y] += corr_y;
1271 #if defined USE_GROUP_SU_N
1274 const int NC2 = 2 *
NC;
1275 const int NCD2 = NC2 *
ND;
1282 const int Nvol = v1.
nvol();
1284 assert(Nvol == v1.
nvol());
1285 assert(Nvol == v2.
nvol());
1286 assert(v1.
nex() == 1);
1287 assert(v2.
nex() == 1);
1290 const double *w1 = v1.
ptr(0);
1291 const double *w2 = v2.
ptr(0);
1295 for (
int id = 0;
id <
ND; ++id) {
1302 for (
int id = 0;
id <
ND; ++id) {
1307 for (
int t = 0; t < Nt; ++t) {
1308 for (
int y = 0; y < Ny; ++y) {
1309 for (
int x = 0; x < Nx; ++x) {
1310 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
1311 for (
int cc = 0; cc <
NC; ++cc) {
1312 for (
int id = 0;
id <
ND; ++id) {
1313 int ic1_r = 2 * cc + id1[id] + site;
1314 int ic2_r = 2 * cc + id2[id] + site;
1316 int ic1_i = 2 * cc + 1 + id1[id] + site;
1317 int ic2_i = 2 * cc + 1 + id2[id] + site;
1319 c_r[id] += w1[ic2_r] * w2[ic1_r]
1320 + w1[ic2_i] * w2[ic1_i];
1322 c_i[id] += -w1[ic2_r] * w2[ic1_i]
1323 + w1[ic2_i] * w2[ic1_r];
1330 corr = cmplx(0.0, 0.0);
1331 for (
int id = 0;
id <
ND; ++id) {
1332 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
1345 assert(corr_global.size() == Lz);
1347 std::vector<dcomplex> corr_local(Nz, 0.0);
1348 for (
int z = 0; z < Nz; ++z) {
1351 corr_local[z] += corr_z;
1359 const std::vector<int>& momentum_sink,
1361 const std::vector<int>& source_position,
1365 #if defined USE_GROUP_SU_N
1372 const int Nvol = v1.
nvol();
1383 assert(Nvol == v2.
nvol());
1384 assert(v1.
nex() == 1);
1385 assert(v2.
nex() == 1);
1386 assert(momentum_sink.size() ==
NDIM - 1);
1387 assert(source_position.size() ==
NDIM);
1389 const double *w1 = v1.
ptr(0);
1390 const double *w2 = v2.
ptr(0);
1394 for (
int id = 0;
id <
ND; ++id) {
1401 for (
int id = 0;
id <
ND; ++id) {
1406 static const double PI = 4.0 * atan(1.0);
1407 std::vector<double> p_unit(ND - 1);
1408 p_unit[0] = (2.0 * PI / Ly) * momentum_sink[0];
1409 p_unit[1] = (2.0 * PI / Lz) * momentum_sink[1];
1410 p_unit[2] = (2.0 * PI / Lt) * momentum_sink[2];
1412 std::vector<int> ipe(ND);
1418 for (
int t = 0; t < Nt; ++t) {
1419 for (
int y = 0; y < Ny; ++y) {
1420 for (
int x = 0; x < Nx; ++x) {
1421 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
1423 int x_global = x + ipe[0] * Nx;
1424 int y_global = y + ipe[1] * Ny;
1425 int t_global = t + ipe[3] * Nt;
1427 double p_x = p_unit[0] * (x_global - source_position[0]);
1428 double p_y = p_unit[1] * (y_global - source_position[1]);
1429 double p_t = p_unit[2] * (t_global - source_position[3]);
1431 double cos_p_xyt = cos(p_t + p_x + p_y);
1432 double sin_p_xyt = sin(p_t + p_x + p_y);
1434 for (
int cc = 0; cc <
NC; ++cc) {
1435 for (
int id = 0;
id <
ND; ++id) {
1436 int ic1_r = 2 * cc + id1[id] + site;
1437 int ic2_r = 2 * cc + id2[id] + site;
1439 int ic1_i = 2 * cc + 1 + id1[id] + site;
1440 int ic2_i = 2 * cc + 1 + id2[id] + site;
1442 double w1_w2_r = w1[ic2_r] * w2[ic1_r] + w1[ic2_i] * w2[ic1_i];
1443 double w1_w2_i = -w1[ic2_r] * w2[ic1_i] + w1[ic2_i] * w2[ic1_r];
1446 c_r[id] += w1_w2_r * cos_p_xyt - w1_w2_i * sin_p_xyt;
1447 c_i[id] += w1_w2_r * sin_p_xyt + w1_w2_i * cos_p_xyt;
1454 corr = cmplx(0.0, 0.0);
1455 for (
int id = 0;
id <
ND; ++id) {
1456 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
1463 const std::vector<int>& momentum_sink,
1465 const std::vector<int>& source_position,
1471 assert(corr_global.size() == Lz);
1473 std::vector<dcomplex> corr_local(Nz, 0.0);
1474 for (
int z = 0; z < Nz; ++z) {
1476 contract_at_z(corr_z, momentum_sink, gm_sink, source_position, v1, v2, z);
1477 corr_local[z] += corr_z;
1485 const std::vector<int>& momentum_sink,
1487 const std::vector<int>& source_position,
1491 #if defined USE_GROUP_SU_N
1498 const int Nvol = v1.
nvol();
1509 assert(Nvol == v2.
nvol());
1510 assert(v1.
nex() == 1);
1511 assert(v2.
nex() == 1);
1512 assert(momentum_sink.size() ==
NDIM - 1);
1513 assert(source_position.size() ==
NDIM);
1515 const double *w1 = v1.
ptr(0);
1516 const double *w2 = v2.
ptr(0);
1520 for (
int id = 0;
id <
ND; ++id) {
1527 for (
int id = 0;
id <
ND; ++id) {
1532 static const double PI = 4.0 * atan(1.0);
1533 std::vector<double> p_unit(ND - 1);
1534 p_unit[0] = (2.0 * PI / Ly) * momentum_sink[0];
1535 p_unit[1] = (2.0 * PI / Lz) * momentum_sink[1];
1536 p_unit[2] = (2.0 * PI / Lt) * momentum_sink[2];
1538 std::vector<int> ipe(ND);
1545 for (
int t = 0; t < Nt; ++t) {
1546 for (
int y = 0; y < Ny; ++y) {
1547 for (
int x = 0; x < Nx; ++x) {
1548 int site = NCD2 * (x + Nx * (y + Ny * (z + Nz * t)));
1550 int x_global = x + ipe[0] * Nx;
1551 int y_global = y + ipe[1] * Ny;
1552 int t_global = t + ipe[3] * Nt;
1554 double p_x = p_unit[0] * (x_global - source_position[0]);
1555 double p_y = p_unit[1] * (y_global - source_position[1]);
1556 double p_t = p_unit[2] * (t_global - source_position[2]);
1558 double cos_p_xyt = cos(p_t + p_x + p_y);
1560 double sin_p_xyt = 0;
1562 for (
int cc = 0; cc <
NC; ++cc) {
1563 for (
int id = 0;
id <
ND; ++id) {
1564 int ic1_r = 2 * cc + id1[id] + site;
1565 int ic2_r = 2 * cc + id2[id] + site;
1567 int ic1_i = 2 * cc + 1 + id1[id] + site;
1568 int ic2_i = 2 * cc + 1 + id2[id] + site;
1570 double w1_w2_r = w1[ic2_r] * w2[ic1_r] + w1[ic2_i] * w2[ic1_i];
1571 double w1_w2_i = -w1[ic2_r] * w2[ic1_i] + w1[ic2_i] * w2[ic1_r];
1575 c_r[id] += w1_w2_r * cos_p_xyt - w1_w2_i * sin_p_xyt;
1576 c_i[id] += w1_w2_r * sin_p_xyt + w1_w2_i * cos_p_xyt;
1583 corr = cmplx(0.0, 0.0);
1584 for (
int id = 0;
id <
ND; ++id) {
1585 corr += gm_sink.
value(
id) * cmplx(c_r[
id], c_i[
id]);
1592 const std::vector<int>& momentum_sink,
1594 const std::vector<int>& source_position,
1600 assert(corr_global.size() == Lz);
1602 std::vector<dcomplex> corr_local(Nz, 0.0);
1603 for (
int z = 0; z < Nz; ++z) {
1606 corr_local[z] += corr_z;
1614 std::vector<dcomplex>& corr_local)
1619 assert(corr_global.size() == Lx);
1620 assert(corr_local.size() == Nx);
1622 std::vector<dcomplex> corr_tmp(Lx, 0);
1626 for (
int x = 0; x < Nx; ++x) {
1627 int x2 = x + ipex * Nx;
1628 corr_tmp[x2] = corr_local[x];
1631 for (
int x = 0; x < Lx; ++x) {
1634 corr_global[x] = cmplx(crr, cri);
1641 std::vector<dcomplex>& corr_local)
1646 assert(corr_global.size() == Ly);
1647 assert(corr_local.size() == Ny);
1649 std::vector<dcomplex> corr_tmp(Ly, 0);
1653 for (
int y = 0; y < Ny; ++y) {
1654 int y2 = y + ipey * Ny;
1655 corr_tmp[y2] = corr_local[y];
1658 for (
int y = 0; y < Ly; ++y) {
1661 corr_global[y] = cmplx(crr, cri);
1668 std::vector<dcomplex>& corr_local)
1673 assert(corr_global.size() == Lz);
1674 assert(corr_local.size() == Nz);
1676 std::vector<dcomplex> corr_tmp(Lz);
1680 for (
int z = 0; z < Nz; ++z) {
1681 int z2 = z + ipez * Nz;
1682 corr_tmp[z2] = corr_local[z];
1685 for (
int z = 0; z < Lz; ++z) {
1688 corr_global[z] = cmplx(crr, cri);
1695 std::vector<dcomplex>& corr_local)
1700 assert(corr_global.size() == Lt);
1701 assert(corr_local.size() == Nt);
1703 std::vector<dcomplex> corr_tmp(Lt, 0);
1707 for (
int t = 0; t < Nt; ++t) {
1708 int t_global = t + ipe_t * Nt;
1709 corr_tmp[t_global] = corr_local[t];
1712 for (
int t_global = 0; t_global < Lt; ++t_global) {
1715 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.
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)
static int reduce_sum(int count, double *recv_buf, double *send_buf, int pattern=0)
make a global sum of an array of double over the communicator. pattern specifies the dimensions to be...
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