From 435653490e39ba50d5bcd15bc4426551013039af Mon Sep 17 00:00:00 2001 From: Felix Erben Date: Fri, 17 May 2019 10:50:15 +0100 Subject: [PATCH] fixed contraction issue --- Grid/qcd/utils/A2Autils.h | 10 +++++++++- Hadrons/Modules/MDistil/Baryon2pt.hpp | 24 ++++++++++-------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/Grid/qcd/utils/A2Autils.h b/Grid/qcd/utils/A2Autils.h index 9e2bd7e2..81c53800 100644 --- a/Grid/qcd/utils/A2Autils.h +++ b/Grid/qcd/utils/A2Autils.h @@ -183,7 +183,8 @@ void A2Autils::NucleonFieldMom(Eigen::Tensor &mat, for(int j=0;j C gamma_5 = - i gamma_1 gamma_3 //auto v2g = v2*Gamma(Gamma::Algebra::SigmaXZ); //auto v2g=v2; @@ -209,6 +210,13 @@ void A2Autils::NucleonFieldMom(Eigen::Tensor &mat, + pv1()(s1)(2) * v2()(s2)(0) * gv3()(s2)(1) - pv1()(s1)(2) * v2()(s2)(1) * gv3()(s2)(0); }} + + /*if (i+j+k == 0) { + Serializable::WriteMember(std::cout, pv1); + Serializable::WriteMember(std::cout, v2); + Serializable::WriteMember(std::cout, gv3); + Serializable::WriteMember(std::cout, vv); + }*/ // After getting the sitewise product do the mom phase loop int base = Nmom*i+Nmom*oneBlock*j+Nmom*oneBlock*twoBlock*k+Nmom*oneBlock*twoBlock*threeBlock*r; diff --git a/Hadrons/Modules/MDistil/Baryon2pt.hpp b/Hadrons/Modules/MDistil/Baryon2pt.hpp index 02ac892a..d4420ecc 100644 --- a/Hadrons/Modules/MDistil/Baryon2pt.hpp +++ b/Hadrons/Modules/MDistil/Baryon2pt.hpp @@ -186,20 +186,16 @@ void TBaryon2pt::execute(void) Eigen::array, 3> product_dims = { Eigen::IndexPair(0,epsilon[pairs[ipair]][0]),Eigen::IndexPair(1,epsilon[pairs[ipair]][1]) ,Eigen::IndexPair(2,epsilon[pairs[ipair]][2]) }; for (int imom=0 ; imom < Nmom ; imom++){ std::cout << imom << std::endl; - Eigen::Tensor B6L = BFieldL.BField.chip(imom,0); - Eigen::Tensor B6R = BFieldR.BField.chip(imom,0); - for (int ig=0 ; ig < Ngamma ; ig++){ - Eigen::Tensor B5L = B6L.chip(ig,0); - Eigen::Tensor B5R = B6R.chip(ig,0); - for (int t=0 ; t < Nt ; t++){ - Eigen::Tensor B4L = B5L.chip(t,0); - Eigen::Tensor B4R = B5R.chip(tsrc,0); - for (int is=0 ; is < 4 ; is++){ - Eigen::Tensor B3L = B4L.chip(is,0); - Eigen::Tensor B3R = B4R.chip(is,0); - Eigen::Tensor C2 = B3L.contract(B3R,product_dims); - corr(imom,t) += static_cast(epsilon_sgn[pairs[ipair]])*C2(0); - } + Eigen::Tensor B5L = BFieldL.BField.chip(imom,0); + Eigen::Tensor B5R = BFieldR.BField.chip(imom,0); + for (int t=0 ; t < Nt ; t++){ + Eigen::Tensor B4L = B5L.chip(t,0); + Eigen::Tensor B4R = B5R.chip(tsrc,0); + for (int is=0 ; is < 4 ; is++){ + Eigen::Tensor B3L = B4L.chip(is,0); + Eigen::Tensor B3R = B4R.chip(is,0); + Eigen::Tensor C2 = B3L.contract(B3R,product_dims); + corr(imom,t) += static_cast(epsilon_sgn[pairs[ipair]])*C2(0); } } }