54 const std::vector<Field_F>& sq2)
59 std::ofstream log_file;
66 std::vector<dcomplex> corr(Lt);
72 for (
int t = 0; t < corr.size(); ++t) {
74 t, real(corr[t]), imag(corr[t]));
76 const double result = real(corr[0]);
82 for (
int t = 0; t < corr.size(); ++t) {
84 t, real(corr[t]), imag(corr[t]));
91 for (
int t = 0; t < corr.size(); ++t) {
93 t, real(corr[t]), imag(corr[t]));
100 for (
int t = 0; t < corr.size(); ++t) {
102 t, real(corr[t]), imag(corr[t]));
109 for (
int t = 0; t < corr.size(); ++t) {
111 t, real(corr[t]), imag(corr[t]));
118 for (
int t = 0; t < corr.size(); ++t) {
120 t, real(corr[t]), imag(corr[t]));
127 for (
int t = 0; t < corr.size(); ++t) {
129 t, real(corr[t]), imag(corr[t]));
136 for (
int t = 0; t < corr.size(); ++t) {
138 t, real(corr[t]), imag(corr[t]));
145 for (
int t = 0; t < corr.size(); ++t) {
147 t, real(corr[t]), imag(corr[t]));
154 for (
int t = 0; t < corr.size(); ++t) {
156 t, real(corr[t]), imag(corr[t]));
163 for (
int t = 0; t < corr.size(); ++t) {
165 t, real(corr[t]), imag(corr[t]));
172 for (
int t = 0; t < corr.size(); ++t) {
174 t, real(corr[t]), imag(corr[t]));
181 for (
int t = 0; t < corr.size(); ++t) {
183 t, real(corr[t]), imag(corr[t]));
200 const std::vector<Field_F>& sq1,
201 const std::vector<Field_F>& sq2)
208 assert(corr_global.size() == Lt);
214 std::vector<dcomplex> corr_local(Nt, cmplx(0.0, 0.0));
215 for (
int c0 = 0; c0 < Nc; ++c0) {
216 for (
int d0 = 0; d0 < Nd; ++d0) {
217 int d1 = gm_gm5_src.
index(d0);
219 for (
int t = 0; t < Nt; ++t) {
223 sq1[c0 + Nc * d0], sq2[c0 + Nc * d1], t);
225 corr_local[t] += gm_gm5_src.
value(d0) * corr_t;
235 const std::vector<Field_F>& sq2,
236 const std::vector<int>& source_position)
241 const int N_momentum = 10;
243 typedef std::vector<int> MomentumSet;
244 std::vector<MomentumSet> momentum_sink(N_momentum);
245 for (
int i_momentum = 0; i_momentum < N_momentum; i_momentum++) {
246 momentum_sink[i_momentum].resize(Ndim - 1);
251 momentum_sink[i_momentum][0] = 1;
252 momentum_sink[i_momentum][1] = 0;
253 momentum_sink[i_momentum][2] = 0;
257 momentum_sink[i_momentum][0] = 0;
258 momentum_sink[i_momentum][1] = 1;
259 momentum_sink[i_momentum][2] = 0;
263 momentum_sink[i_momentum][0] = 0;
264 momentum_sink[i_momentum][1] = 0;
265 momentum_sink[i_momentum][2] = 1;
269 momentum_sink[i_momentum][0] = 1;
270 momentum_sink[i_momentum][1] = 1;
271 momentum_sink[i_momentum][2] = 0;
275 momentum_sink[i_momentum][0] = 0;
276 momentum_sink[i_momentum][1] = 1;
277 momentum_sink[i_momentum][2] = 1;
281 momentum_sink[i_momentum][0] = 1;
282 momentum_sink[i_momentum][1] = 0;
283 momentum_sink[i_momentum][2] = 1;
287 momentum_sink[i_momentum][0] = 1;
288 momentum_sink[i_momentum][1] = 1;
289 momentum_sink[i_momentum][2] = 1;
293 momentum_sink[i_momentum][0] = 2;
294 momentum_sink[i_momentum][1] = 0;
295 momentum_sink[i_momentum][2] = 0;
299 momentum_sink[i_momentum][0] = 0;
300 momentum_sink[i_momentum][1] = 2;
301 momentum_sink[i_momentum][2] = 0;
305 momentum_sink[i_momentum][0] = 0;
306 momentum_sink[i_momentum][1] = 0;
307 momentum_sink[i_momentum][2] = 2;
311 std::ofstream log_file;
318 std::vector<dcomplex> corr(Lt);
322 for (
int i_momentum = 0; i_momentum < N_momentum; i_momentum++) {
324 momentum_sink[i_momentum][0],
325 momentum_sink[i_momentum][1],
326 momentum_sink[i_momentum][2]);
328 sq1, sq2, source_position);
329 for (
int t = 0; t < corr.size(); ++t) {
331 t, real(corr[t]), imag(corr[t]));
337 for (
int i_momentum = 0; i_momentum < N_momentum; i_momentum++) {
339 momentum_sink[i_momentum][0],
340 momentum_sink[i_momentum][1],
341 momentum_sink[i_momentum][2]);
343 sq1, sq2, source_position);
344 for (
int t = 0; t < corr.size(); ++t) {
346 t, real(corr[t]), imag(corr[t]));
352 for (
int i_momentum = 0; i_momentum < N_momentum; i_momentum++) {
354 momentum_sink[i_momentum][0],
355 momentum_sink[i_momentum][1],
356 momentum_sink[i_momentum][2]);
358 sq1, sq2, source_position);
359 for (
int t = 0; t < corr.size(); ++t) {
361 t, real(corr[t]), imag(corr[t]));
367 for (
int i_momentum = 0; i_momentum < N_momentum; i_momentum++) {
369 momentum_sink[i_momentum][0],
370 momentum_sink[i_momentum][1],
371 momentum_sink[i_momentum][2]);
373 sq1, sq2, source_position);
374 for (
int t = 0; t < corr.size(); ++t) {
376 t, real(corr[t]), imag(corr[t]));
392 const std::vector<int>& momentum_sink,
395 const std::vector<Field_F>& sq1,
396 const std::vector<Field_F>& sq2,
397 const std::vector<int>& source_position)
404 assert(corr_global.size() == Lt);
410 std::vector<dcomplex> corr_local(Nt, cmplx(0.0, 0.0));
411 for (
int c0 = 0; c0 < Nc; ++c0) {
412 for (
int d0 = 0; d0 < Nd; ++d0) {
413 int d1 = gm_gm5_src.
index(d0);
415 for (
int t = 0; t < Nt; ++t) {
418 contract_at_t(corr_t, momentum_sink, gm5_gm_sink, source_position,
419 sq1[c0 + Nc * d0], sq2[c0 + Nc * d1], t);
421 corr_local[t] += gm_gm5_src.
value(d0) * corr_t;
431 const std::vector<Field_F>& sq_d)
436 std::ofstream log_file;
449 std::vector<dcomplex> p_corr_unity(Lt);
452 for (
int t = 0; t < p_corr_unity.size(); t++) {
454 t, real(p_corr_unity[t]), imag(p_corr_unity[t]));
459 std::vector<dcomplex> p_corr_gamma0(Lt);
462 std::vector<dcomplex> p_corr_upper(Lt);
463 for (
int t = 0; t < p_corr_upper.size(); t++) {
464 p_corr_upper[t] = (p_corr_unity[t] + p_corr_gamma0[t]) * 0.5;
466 t, real(p_corr_upper[t]), imag(p_corr_upper[t]));
471 for (
int t = 0; t < p_corr_gamma0.size(); t++) {
473 t, real(p_corr_gamma0[t]), imag(p_corr_gamma0[t]));
482 const double result = real(p_corr_gamma0[0]);
491 const std::vector<Field_F>& sq_u,
492 const std::vector<Field_F>& sq_d)
500 assert(corr_global.size() == Lt);
508 for (
int i = 0; i < Nd; i++) {
509 vout.
general(
m_vl,
"%d:\t %d %e %e \t %d %e %e \t %d %e %e \t %d %e %e \n",
519 const int FactNc = 6;
522 std::vector<dcomplex> corr_local(Nt);
524 for (
int t = 0; t < Nt; t++) {
527 dcomplex sum = cmplx(0.0, 0.0);
528 for (
int i_alpha = 0; i_alpha < Nd; i_alpha++) {
529 int i_alphaP = gm.
index(i_alpha);
530 int i_alpha3 = i_alpha;
531 int i_alpha3P = i_alphaP;
533 for (
int i_alpha1P = 0; i_alpha1P < Nd; i_alpha1P++) {
534 int i_alpha2P = cg5.
index(i_alpha1P);
536 for (
int ic123P = 0; ic123P < FactNc; ic123P++) {
542 dcomplex factor = gm.
value(i_alpha)
543 * cg5.
value(i_alpha1P)
548 sq_u[ic1P + Nc * i_alpha1P],
549 sq_d[ic2P + Nc * i_alpha2P],
550 sq_u[ic3P + Nc * i_alpha3P], t);
554 sq_u[ic3P + Nc * i_alpha3P],
555 sq_d[ic2P + Nc * i_alpha2P],
556 sq_u[ic1P + Nc * i_alpha1P], t);
558 sum += factor * (sum1 - sum2);
575 const std::vector<Field_F>& sq1,
576 const std::vector<Field_F>& sq2)
583 assert(meson.size() == Lx);
587 gm_src = qn_src.
mult(gm5);
588 gm_sink = gm5.
mult(qn_sink);
590 std::vector<dcomplex> corr_local(Nx);
591 for (
int i = 0; i < Nx; ++i) {
595 for (
int c0 = 0; c0 < Nc; ++c0) {
596 for (
int d0 = 0; d0 < Nd; ++d0) {
597 int d1 = gm_src.
index(d0);
599 for (
int x = 0; x < Nx; ++x) {
602 sq1[c0 + Nc * d0], sq2[c0 + Nc * d1], x);
604 corr_local[x] += gm_src.
value(d0) * corr_x;
615 const std::vector<int>& momentum_sink,
618 const std::vector<Field_F>& sq1,
619 const std::vector<Field_F>& sq2,
620 const std::vector<int>& source_position)
627 assert(corr_global.size() == Lx);
631 gm_gm5_src = gm_src.
mult(gm5);
632 gm5_gm_sink = gm5.
mult(gm_sink);
634 std::vector<dcomplex> corr_local(Nx);
636 for (
int c0 = 0; c0 < Nc; ++c0) {
637 for (
int d0 = 0; d0 < Nd; ++d0) {
638 int d1 = gm_gm5_src.
index(d0);
640 for (
int x = 0; x < Nx; ++x) {
643 contract_at_x(corr_x, momentum_sink, gm5_gm_sink, source_position,
644 sq1[c0 + Nc * d0], sq2[c0 + Nc * d1], x);
646 corr_local[x] += gm_gm5_src.
value(d0) * corr_x;
658 const std::vector<Field_F>& squ,
659 const std::vector<Field_F>& sqd)
667 assert(proton.size() == Lx);
679 std::vector<dcomplex> corr_local(Nx);
681 for (
int ix = 0; ix < Nx; ix++) {
685 for (
int ialph = 0; ialph < Nd; ialph++) {
686 int ialphP = gm.
index(ialph);
688 int ialph3P = ialphP;
690 for (
int ialph1P = 0; ialph1P < Nd; ialph1P++) {
691 int ialph2P = cg5.
index(ialph1P);
693 for (
int ic123P = 0; ic123P < FactNc; ic123P++) {
697 dcomplex factor = gm.
value(ialph)
702 squ[ic1P + Nc * ialph1P],
703 sqd[ic2P + Nc * ialph2P],
704 squ[ic3P + Nc * ialph3P], ix);
706 squ[ic3P + Nc * ialph3P],
707 sqd[ic2P + Nc * ialph2P],
708 squ[ic1P + Nc * ialph1P], ix);
709 sum += factor * (sum1 - sum2);
714 corr_local[ix] = sum;