54 const std::vector<Field_F>& sq2)
64 std::vector<dcomplex> corr(Lt);
70 for (
int t = 0; t < corr.size(); ++t) {
72 t, real(corr[t]), imag(corr[t]));
74 const double result = real(corr[0]);
80 for (
int t = 0; t < corr.size(); ++t) {
82 t, real(corr[t]), imag(corr[t]));
89 for (
int t = 0; t < corr.size(); ++t) {
91 t, real(corr[t]), imag(corr[t]));
98 for (
int t = 0; t < corr.size(); ++t) {
100 t, real(corr[t]), imag(corr[t]));
107 for (
int t = 0; t < corr.size(); ++t) {
109 t, real(corr[t]), imag(corr[t]));
116 for (
int t = 0; t < corr.size(); ++t) {
118 t, real(corr[t]), imag(corr[t]));
125 for (
int t = 0; t < corr.size(); ++t) {
127 t, real(corr[t]), imag(corr[t]));
134 for (
int t = 0; t < corr.size(); ++t) {
136 t, real(corr[t]), imag(corr[t]));
143 for (
int t = 0; t < corr.size(); ++t) {
145 t, real(corr[t]), imag(corr[t]));
152 for (
int t = 0; t < corr.size(); ++t) {
154 t, real(corr[t]), imag(corr[t]));
161 for (
int t = 0; t < corr.size(); ++t) {
163 t, real(corr[t]), imag(corr[t]));
170 for (
int t = 0; t < corr.size(); ++t) {
172 t, real(corr[t]), imag(corr[t]));
179 for (
int t = 0; t < corr.size(); ++t) {
181 t, real(corr[t]), imag(corr[t]));
185 if (use_outputfile) {
197 const std::vector<Field_F>& sq1,
198 const std::vector<Field_F>& sq2)
205 assert(corr_global.size() == Lt);
211 std::vector<dcomplex> corr_local(Nt, cmplx(0.0, 0.0));
212 for (
int c0 = 0; c0 < Nc; ++c0) {
213 for (
int d0 = 0; d0 < Nd; ++d0) {
214 int d1 = gm_gm5_src.
index(d0);
216 for (
int t = 0; t < Nt; ++t) {
220 sq1[c0 + Nc * d0], sq2[c0 + Nc * d1], t);
222 corr_local[t] += gm_gm5_src.
value(d0) * corr_t;
232 const std::vector<Field_F>& sq2,
233 const std::vector<int>& source_position)
238 const int N_momentum = 10;
240 typedef std::vector<int> MomentumSet;
241 std::vector<MomentumSet> momentum_sink(N_momentum);
242 for (
int i_momentum = 0; i_momentum < N_momentum; i_momentum++) {
243 momentum_sink[i_momentum].resize(Ndim - 1);
248 momentum_sink[i_momentum][0] = 1;
249 momentum_sink[i_momentum][1] = 0;
250 momentum_sink[i_momentum][2] = 0;
254 momentum_sink[i_momentum][0] = 0;
255 momentum_sink[i_momentum][1] = 1;
256 momentum_sink[i_momentum][2] = 0;
260 momentum_sink[i_momentum][0] = 0;
261 momentum_sink[i_momentum][1] = 0;
262 momentum_sink[i_momentum][2] = 1;
266 momentum_sink[i_momentum][0] = 1;
267 momentum_sink[i_momentum][1] = 1;
268 momentum_sink[i_momentum][2] = 0;
272 momentum_sink[i_momentum][0] = 0;
273 momentum_sink[i_momentum][1] = 1;
274 momentum_sink[i_momentum][2] = 1;
278 momentum_sink[i_momentum][0] = 1;
279 momentum_sink[i_momentum][1] = 0;
280 momentum_sink[i_momentum][2] = 1;
284 momentum_sink[i_momentum][0] = 1;
285 momentum_sink[i_momentum][1] = 1;
286 momentum_sink[i_momentum][2] = 1;
290 momentum_sink[i_momentum][0] = 2;
291 momentum_sink[i_momentum][1] = 0;
292 momentum_sink[i_momentum][2] = 0;
296 momentum_sink[i_momentum][0] = 0;
297 momentum_sink[i_momentum][1] = 2;
298 momentum_sink[i_momentum][2] = 0;
302 momentum_sink[i_momentum][0] = 0;
303 momentum_sink[i_momentum][1] = 0;
304 momentum_sink[i_momentum][2] = 2;
308 if (use_outputfile) {
313 std::vector<dcomplex> corr(Lt);
317 for (
int i_momentum = 0; i_momentum < N_momentum; i_momentum++) {
319 momentum_sink[i_momentum][0],
320 momentum_sink[i_momentum][1],
321 momentum_sink[i_momentum][2]);
323 sq1, sq2, source_position);
324 for (
int t = 0; t < corr.size(); ++t) {
326 t, real(corr[t]), imag(corr[t]));
332 for (
int i_momentum = 0; i_momentum < N_momentum; i_momentum++) {
334 momentum_sink[i_momentum][0],
335 momentum_sink[i_momentum][1],
336 momentum_sink[i_momentum][2]);
338 sq1, sq2, source_position);
339 for (
int t = 0; t < corr.size(); ++t) {
341 t, real(corr[t]), imag(corr[t]));
347 for (
int i_momentum = 0; i_momentum < N_momentum; i_momentum++) {
349 momentum_sink[i_momentum][0],
350 momentum_sink[i_momentum][1],
351 momentum_sink[i_momentum][2]);
353 sq1, sq2, source_position);
354 for (
int t = 0; t < corr.size(); ++t) {
356 t, real(corr[t]), imag(corr[t]));
362 for (
int i_momentum = 0; i_momentum < N_momentum; i_momentum++) {
364 momentum_sink[i_momentum][0],
365 momentum_sink[i_momentum][1],
366 momentum_sink[i_momentum][2]);
368 sq1, sq2, source_position);
369 for (
int t = 0; t < corr.size(); ++t) {
371 t, real(corr[t]), imag(corr[t]));
376 if (use_outputfile) {
386 const std::vector<int>& momentum_sink,
389 const std::vector<Field_F>& sq1,
390 const std::vector<Field_F>& sq2,
391 const std::vector<int>& source_position)
398 assert(corr_global.size() == Lt);
404 std::vector<dcomplex> corr_local(Nt, cmplx(0.0, 0.0));
405 for (
int c0 = 0; c0 < Nc; ++c0) {
406 for (
int d0 = 0; d0 < Nd; ++d0) {
407 int d1 = gm_gm5_src.
index(d0);
409 for (
int t = 0; t < Nt; ++t) {
412 contract_at_t(corr_t, momentum_sink, gm5_gm_sink, source_position,
413 sq1[c0 + Nc * d0], sq2[c0 + Nc * d1], t);
415 corr_local[t] += gm_gm5_src.
value(d0) * corr_t;
425 const std::vector<Field_F>& sq_d)
430 if (use_outputfile) {
441 std::vector<dcomplex> p_corr_unity(Lt);
444 for (
int t = 0; t < p_corr_unity.size(); t++) {
446 t, real(p_corr_unity[t]), imag(p_corr_unity[t]));
451 std::vector<dcomplex> p_corr_gamma0(Lt);
454 std::vector<dcomplex> p_corr_upper(Lt);
455 for (
int t = 0; t < p_corr_upper.size(); t++) {
456 p_corr_upper[t] = (p_corr_unity[t] + p_corr_gamma0[t]) * 0.5;
458 t, real(p_corr_upper[t]), imag(p_corr_upper[t]));
463 for (
int t = 0; t < p_corr_gamma0.size(); t++) {
465 t, real(p_corr_gamma0[t]), imag(p_corr_gamma0[t]));
469 if (use_outputfile) {
473 const double result = real(p_corr_gamma0[0]);
482 const std::vector<Field_F>& sq_u,
483 const std::vector<Field_F>& sq_d)
491 assert(corr_global.size() == Lt);
499 for (
int i = 0; i < Nd; i++) {
500 vout.
general(
m_vl,
"%d:\t %d %e %e \t %d %e %e \t %d %e %e \t %d %e %e \n",
510 const int FactNc = 6;
513 std::vector<dcomplex> corr_local(Nt);
515 for (
int t = 0; t < Nt; t++) {
518 dcomplex sum = cmplx(0.0, 0.0);
519 for (
int i_alpha = 0; i_alpha < Nd; i_alpha++) {
520 int i_alphaP = gm.
index(i_alpha);
521 int i_alpha3 = i_alpha;
522 int i_alpha3P = i_alphaP;
524 for (
int i_alpha1P = 0; i_alpha1P < Nd; i_alpha1P++) {
525 int i_alpha2P = cg5.
index(i_alpha1P);
527 for (
int ic123P = 0; ic123P < FactNc; ic123P++) {
533 dcomplex factor = gm.
value(i_alpha)
534 * cg5.
value(i_alpha1P)
539 sq_u[ic1P + Nc * i_alpha1P],
540 sq_d[ic2P + Nc * i_alpha2P],
541 sq_u[ic3P + Nc * i_alpha3P], t);
545 sq_u[ic3P + Nc * i_alpha3P],
546 sq_d[ic2P + Nc * i_alpha2P],
547 sq_u[ic1P + Nc * i_alpha1P], t);
549 sum += factor * (sum1 - sum2);
566 const std::vector<Field_F>& sq1,
567 const std::vector<Field_F>& sq2)
574 assert(meson.size() == Lx);
578 gm_src = qn_src.
mult(gm5);
579 gm_sink = gm5.
mult(qn_sink);
581 std::vector<dcomplex> corr_local(Nx);
582 for (
int i = 0; i < Nx; ++i) {
586 for (
int c0 = 0; c0 < Nc; ++c0) {
587 for (
int d0 = 0; d0 < Nd; ++d0) {
588 int d1 = gm_src.
index(d0);
590 for (
int x = 0; x < Nx; ++x) {
593 sq1[c0 + Nc * d0], sq2[c0 + Nc * d1], x);
595 corr_local[x] += gm_src.
value(d0) * corr_x;
606 const std::vector<int>& momentum_sink,
609 const std::vector<Field_F>& sq1,
610 const std::vector<Field_F>& sq2,
611 const std::vector<int>& source_position)
618 assert(corr_global.size() == Lx);
622 gm_gm5_src = gm_src.
mult(gm5);
623 gm5_gm_sink = gm5.
mult(gm_sink);
625 std::vector<dcomplex> corr_local(Nx);
627 for (
int c0 = 0; c0 < Nc; ++c0) {
628 for (
int d0 = 0; d0 < Nd; ++d0) {
629 int d1 = gm_gm5_src.
index(d0);
631 for (
int x = 0; x < Nx; ++x) {
634 contract_at_x(corr_x, momentum_sink, gm5_gm_sink, source_position,
635 sq1[c0 + Nc * d0], sq2[c0 + Nc * d1], x);
637 corr_local[x] += gm_gm5_src.
value(d0) * corr_x;
649 const std::vector<Field_F>& squ,
650 const std::vector<Field_F>& sqd)
658 assert(proton.size() == Lx);
670 std::vector<dcomplex> corr_local(Nx);
672 for (
int ix = 0; ix < Nx; ix++) {
676 for (
int ialph = 0; ialph < Nd; ialph++) {
677 int ialphP = gm.
index(ialph);
679 int ialph3P = ialphP;
681 for (
int ialph1P = 0; ialph1P < Nd; ialph1P++) {
682 int ialph2P = cg5.
index(ialph1P);
684 for (
int ic123P = 0; ic123P < FactNc; ic123P++) {
688 dcomplex factor = gm.
value(ialph)
693 squ[ic1P + Nc * ialph1P],
694 sqd[ic2P + Nc * ialph2P],
695 squ[ic3P + Nc * ialph3P], ix);
697 squ[ic3P + Nc * ialph3P],
698 sqd[ic2P + Nc * ialph2P],
699 squ[ic1P + Nc * ialph1P], ix);
700 sum += factor * (sum1 - sum2);
705 corr_local[ix] = sum;