diff --git a/Grid/qcd/utils/BaryonUtils.h b/Grid/qcd/utils/BaryonUtils.h index 7fcc4502..580f91ef 100644 --- a/Grid/qcd/utils/BaryonUtils.h +++ b/Grid/qcd/utils/BaryonUtils.h @@ -131,7 +131,18 @@ public: robj &result); public: template - static void Sigma_to_Nucleon(const PropagatorField &qq_xi, + static void Sigma_to_Nucleon_Eye(const PropagatorField &qq_loop, + const mobj &Du_spec, + const PropagatorField &qd_xf, + const PropagatorField &qs_xi, + const Gamma Gamma_H, + const Gamma GammaB_sigma, + const Gamma GammaB_nucl, + const int parity, + const std::string op, + SpinMatrixField &stn_corr); + template + static void Sigma_to_Nucleon_NonEye(const PropagatorField &qq_xi, const PropagatorField &qq_xf, const mobj &Du_spec, const PropagatorField &qd_xf, @@ -505,10 +516,48 @@ void BaryonUtils::Sigma_to_Nucleon_Q2_NonEye_site(const mobj &Du_xi, } } +template +template +void BaryonUtils::Sigma_to_Nucleon_Eye(const PropagatorField &qq_loop, + const mobj &Du_spec, + const PropagatorField &qd_xf, + const PropagatorField &qs_xi, + const Gamma Gamma_H, + const Gamma GammaB_sigma, + const Gamma GammaB_nucl, + const int parity, + const std::string op, + SpinMatrixField &stn_corr) +{ + assert(parity==1 || parity == -1 && "Parity must be +1 or -1"); + + GridBase *grid = qs_xi.Grid(); + + auto vcorr= stn_corr.View(); + auto vq_loop = qq_loop.View(); + auto vd_xf = qd_xf.View(); + auto vs_xi = qs_xi.View(); + + // accelerator_for(ss, grid->oSites(), grid->Nsimd(), { + thread_for(ss,grid->oSites(),{ + auto Dq_loop = vq_loop[ss]; + auto Dd_xf = vd_xf[ss]; + auto Ds_xi = vs_xi[ss]; + sobj result=Zero(); + if(op == "Q1"){ + Sigma_to_Nucleon_Q1_Eye_site(Dq_loop,Du_spec,Dd_xf,Ds_xi,Gamma_H,GammaB_sigma,GammaB_nucl,parity,result); + } else if(op == "Q2"){ + Sigma_to_Nucleon_Q2_Eye_site(Dq_loop,Du_spec,Dd_xf,Ds_xi,Gamma_H,GammaB_sigma,GammaB_nucl,parity,result); + } else { + assert(0 && "Weak Operator not correctly specified"); + } + vcorr[ss] = result; + } );//end loop over lattice sites +} template template -void BaryonUtils::Sigma_to_Nucleon(const PropagatorField &qq_xi, +void BaryonUtils::Sigma_to_Nucleon_NonEye(const PropagatorField &qq_xi, const PropagatorField &qq_xf, const mobj &Du_spec, const PropagatorField &qd_xf, @@ -537,14 +586,10 @@ void BaryonUtils::Sigma_to_Nucleon(const PropagatorField &qq_xi, auto Dd_xf = vd_xf[ss]; auto Ds_xi = vs_xi[ss]; sobj result=Zero(); - if(op == "Q1_NonEye"){ + if(op == "Q1"){ Sigma_to_Nucleon_Q1_NonEye_site(Dq_xi,Dq_xf,Du_spec,Dd_xf,Ds_xi,Gamma_H,GammaB_sigma,GammaB_nucl,parity,result); - } else if(op == "Q1_Eye"){ - Sigma_to_Nucleon_Q1_Eye_site(Dq_xi,Du_spec,Dd_xf,Ds_xi,Gamma_H,GammaB_sigma,GammaB_nucl,parity,result); - } else if(op == "Q2_NonEye"){ + } else if(op == "Q2"){ Sigma_to_Nucleon_Q2_NonEye_site(Dq_xi,Dq_xf,Du_spec,Dd_xf,Ds_xi,Gamma_H,GammaB_sigma,GammaB_nucl,parity,result); - } else if(op == "Q2_Eye"){ - Sigma_to_Nucleon_Q2_Eye_site(Dq_xi,Du_spec,Dd_xf,Ds_xi,Gamma_H,GammaB_sigma,GammaB_nucl,parity,result); } else { assert(0 && "Weak Operator not correctly specified"); } diff --git a/Hadrons/Modules/MContraction/SigmaToNucleonEye.hpp b/Hadrons/Modules/MContraction/SigmaToNucleonEye.hpp index e4189f7c..99f74fcd 100644 --- a/Hadrons/Modules/MContraction/SigmaToNucleonEye.hpp +++ b/Hadrons/Modules/MContraction/SigmaToNucleonEye.hpp @@ -186,7 +186,7 @@ void TSigmaToNucleonEye::execute(void) r.info.gamma_H = G.g; //Operator Q1, equivalent to the two-trace case in the rare-kaons module c=Zero(); - BaryonUtils::Sigma_to_Nucleon(qq_loop,qq_loop,qut,qd_xf,qs_xi,G,GammaB,GammaB,parity,"Q1_Eye",c); + BaryonUtils::Sigma_to_Nucleon_Eye(qq_loop,qut,qd_xf,qs_xi,G,GammaB,GammaB,parity,"Q1",c); sliceSum(c,buf,Tp); r.corr.clear(); for (unsigned int t = 0; t < buf.size(); ++t) @@ -197,7 +197,7 @@ void TSigmaToNucleonEye::execute(void) result.push_back(r); //Operator Q2, equivalent to the one-trace case in the rare-kaons module c=Zero(); - BaryonUtils::Sigma_to_Nucleon(qq_loop,qq_loop,qut,qd_xf,qs_xi,G,GammaB,GammaB,parity,"Q2_Eye",c); + BaryonUtils::Sigma_to_Nucleon_Eye(qq_loop,qut,qd_xf,qs_xi,G,GammaB,GammaB,parity,"Q2",c); sliceSum(c,buf,Tp); r.corr.clear(); for (unsigned int t = 0; t < buf.size(); ++t) diff --git a/Hadrons/Modules/MContraction/SigmaToNucleonNonEye.hpp b/Hadrons/Modules/MContraction/SigmaToNucleonNonEye.hpp index 15dc5eaa..c74a5f58 100644 --- a/Hadrons/Modules/MContraction/SigmaToNucleonNonEye.hpp +++ b/Hadrons/Modules/MContraction/SigmaToNucleonNonEye.hpp @@ -192,7 +192,7 @@ void TSigmaToNucleonNonEye::execute(void) r.info.gamma_H = G.g; //Operator Q1, equivalent to the two-trace case in the rare-kaons module c=Zero(); - BaryonUtils::Sigma_to_Nucleon(qu_xi,qu_xf,qut,qd_xf,qs_xi,G,GammaB,GammaB,parity,"Q1_NonEye",c); + BaryonUtils::Sigma_to_Nucleon_NonEye(qu_xi,qu_xf,qut,qd_xf,qs_xi,G,GammaB,GammaB,parity,"Q1",c); sliceSum(c,buf,Tp); r.corr.clear(); for (unsigned int t = 0; t < buf.size(); ++t) @@ -203,7 +203,7 @@ void TSigmaToNucleonNonEye::execute(void) result.push_back(r); //Operator Q2, equivalent to the one-trace case in the rare-kaons module c=Zero(); - BaryonUtils::Sigma_to_Nucleon(qu_xi,qu_xf,qut,qd_xf,qs_xi,G,GammaB,GammaB,parity,"Q2_NonEye",c); + BaryonUtils::Sigma_to_Nucleon_NonEye(qu_xi,qu_xf,qut,qd_xf,qs_xi,G,GammaB,GammaB,parity,"Q2",c); sliceSum(c,buf,Tp); r.corr.clear(); for (unsigned int t = 0; t < buf.size(); ++t)