From 4a45c06dd77eb8402cf1ee6b37702e966a6ac14c Mon Sep 17 00:00:00 2001 From: Lanny91 Date: Mon, 6 Feb 2017 20:12:30 +0000 Subject: [PATCH] Code cleaning and addition of Weak Hamiltonian contraction log message --- .../MContraction/WeakHamiltonianEye.cc | 22 ++++++++----------- .../MContraction/WeakHamiltonianEye.hpp | 2 +- .../MContraction/WeakHamiltonianNonEye.cc | 22 ++++++++----------- .../MContraction/WeakHamiltonianNonEye.hpp | 2 +- 4 files changed, 20 insertions(+), 28 deletions(-) diff --git a/extras/Hadrons/Modules/MContraction/WeakHamiltonianEye.cc b/extras/Hadrons/Modules/MContraction/WeakHamiltonianEye.cc index 758f2164..0df6ec2f 100644 --- a/extras/Hadrons/Modules/MContraction/WeakHamiltonianEye.cc +++ b/extras/Hadrons/Modules/MContraction/WeakHamiltonianEye.cc @@ -88,6 +88,11 @@ void TWeakHamiltonianEye::setup(void) // execution /////////////////////////////////////////////////////////////////// void TWeakHamiltonianEye::execute(void) { + LOG(Message) << "Computing Weak Hamiltonian (Eye type) contractions '" + << getName() << "' using quarks '" << par().q1 << "', '" + << par().q2 << ", '" << par().q3 << "' and '" << par().q4 + << "'." << std::endl; + XmlWriter writer(par().output); PropagatorField &q1 = *env().template getObject(par().q1); PropagatorField &q2 = *env().template getObject(par().q2); @@ -106,22 +111,13 @@ void TWeakHamiltonianEye::execute(void) std::vector E_body(ndim, tmp2); std::vector E_loop(ndim, tmp2); - std::vector> gL = {{Gamma(Gamma::Algebra::GammaX), - Gamma(Gamma::Algebra::GammaY), - Gamma(Gamma::Algebra::GammaZ), - Gamma(Gamma::Algebra::GammaT)}, - {Gamma(Gamma::Algebra::GammaXGamma5), - Gamma(Gamma::Algebra::GammaYGamma5), - Gamma(Gamma::Algebra::GammaZGamma5), - Gamma(Gamma::Algebra::GammaTGamma5)}}; - // Setup for S-type contractions. for (int mu = 0; mu < ndim; ++mu) { - S_body[mu] = MAKE_SE_BODY(q1, q2, q3, gL[i_V][mu]) - - MAKE_SE_BODY(q1, q2, q3, gL[i_A][mu]); - S_loop[mu] = MAKE_SE_LOOP(q4, gL[i_V][mu]) - - MAKE_SE_LOOP(q4, gL[i_A][mu]); + S_body[mu] = MAKE_SE_BODY(q1, q2, q3, Gamma::gmu[mu]) - + MAKE_SE_BODY(q1, q2, q3, Gamma::gmu[mu]*g5); + S_loop[mu] = MAKE_SE_LOOP(q4, Gamma::gmu[mu]) - + MAKE_SE_LOOP(q4, Gamma::gmu[mu]*g5); } // Perform S-type contractions. diff --git a/extras/Hadrons/Modules/MContraction/WeakHamiltonianEye.hpp b/extras/Hadrons/Modules/MContraction/WeakHamiltonianEye.hpp index 2b4c8c31..6f5a95c0 100644 --- a/extras/Hadrons/Modules/MContraction/WeakHamiltonianEye.hpp +++ b/extras/Hadrons/Modules/MContraction/WeakHamiltonianEye.hpp @@ -45,7 +45,7 @@ enum }; // Saucer and Eye subdiagram contractions. -#define MAKE_SE_BODY(Q_1, Q_2, Q_3, gamma) (Q_3*g5*Q_1*adj(Q_2)*g5*gamma) +#define MAKE_SE_BODY(Q_1, Q_2, Q_3, gamma) (Q_3*g5*Q_1*adj(Q_2)*(g5*gamma)) #define MAKE_SE_LOOP(Q_loop, gamma) (Q_loop*gamma) class TWeakHamiltonianEye: public Module diff --git a/extras/Hadrons/Modules/MContraction/WeakHamiltonianNonEye.cc b/extras/Hadrons/Modules/MContraction/WeakHamiltonianNonEye.cc index fed2e701..148b9afa 100644 --- a/extras/Hadrons/Modules/MContraction/WeakHamiltonianNonEye.cc +++ b/extras/Hadrons/Modules/MContraction/WeakHamiltonianNonEye.cc @@ -90,6 +90,11 @@ void TWeakHamiltonianNonEye::setup(void) // execution /////////////////////////////////////////////////////////////////// void TWeakHamiltonianNonEye::execute(void) { + LOG(Message) << "Computing Weak Hamiltonian (Non-Eye type) contractions '" + << getName() << "' using quarks '" << par().q1 << "', '" + << par().q2 << ", '" << par().q3 << "' and '" << par().q4 + << "'." << std::endl; + XmlWriter writer(par().output); PropagatorField &q1 = *env().template getObject(par().q1); PropagatorField &q2 = *env().template getObject(par().q2); @@ -108,22 +113,13 @@ void TWeakHamiltonianNonEye::execute(void) std::vector W_i_side_loop(ndim, tmp2); std::vector W_f_side_loop(ndim, tmp2); - std::vector> gL = {{Gamma(Gamma::Algebra::GammaX), - Gamma(Gamma::Algebra::GammaY), - Gamma(Gamma::Algebra::GammaZ), - Gamma(Gamma::Algebra::GammaT)}, - {Gamma(Gamma::Algebra::GammaXGamma5), - Gamma(Gamma::Algebra::GammaYGamma5), - Gamma(Gamma::Algebra::GammaZGamma5), - Gamma(Gamma::Algebra::GammaTGamma5)}}; - // Setup for C-type contractions. for (int mu = 0; mu < ndim; ++mu) { - C_i_side_loop[mu] = MAKE_CW_SUBDIAG(q1, q2, gL[i_V][mu]) - - MAKE_CW_SUBDIAG(q1, q2, gL[i_A][mu]); - C_f_side_loop[mu] = MAKE_CW_SUBDIAG(q3, q4, gL[i_V][mu]) - - MAKE_CW_SUBDIAG(q3, q4, gL[i_A][mu]); + C_i_side_loop[mu] = MAKE_CW_SUBDIAG(q1, q2, Gamma::gmu[mu]) - + MAKE_CW_SUBDIAG(q1, q2, Gamma::gmu[mu]*g5); + C_f_side_loop[mu] = MAKE_CW_SUBDIAG(q3, q4, Gamma::gmu[mu]) - + MAKE_CW_SUBDIAG(q3, q4, Gamma::gmu[mu]*g5); } // Perform C-type contractions. diff --git a/extras/Hadrons/Modules/MContraction/WeakHamiltonianNonEye.hpp b/extras/Hadrons/Modules/MContraction/WeakHamiltonianNonEye.hpp index 8541df9e..f0d26b54 100644 --- a/extras/Hadrons/Modules/MContraction/WeakHamiltonianNonEye.hpp +++ b/extras/Hadrons/Modules/MContraction/WeakHamiltonianNonEye.hpp @@ -45,7 +45,7 @@ enum }; // Wing and Connected subdiagram contractions -#define MAKE_CW_SUBDIAG(Q_1, Q_2, gamma) (Q_1*adj(Q_2)*g5*gamma) +#define MAKE_CW_SUBDIAG(Q_1, Q_2, gamma) (Q_1*adj(Q_2)*(g5*gamma)) class TWeakHamiltonianNonEye: public Module {