From c698b16d75f6ddcee79067c6088b85f87361da1f Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Sun, 1 May 2016 18:30:35 -0700 Subject: [PATCH] function to generate Chroma-style gamma matrix products --- lib/qcd/spin/Dirac.cc | 25 +++++++++++++++++++++++++ lib/qcd/spin/Dirac.h | 5 ++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/qcd/spin/Dirac.cc b/lib/qcd/spin/Dirac.cc index 51c06348..8279a4a7 100644 --- a/lib/qcd/spin/Dirac.cc +++ b/lib/qcd/spin/Dirac.cc @@ -60,6 +60,31 @@ namespace Grid { "-Gamma5 ", " " }; + + SpinMatrix makeGammaProd(const unsigned int i) + { + SpinMatrix g; + + g = 1.; + if (i & 0x1) + { + g = g*Gamma(Gamma::GammaMatrix::GammaX); + } + if (i & 0x2) + { + g = g*Gamma(Gamma::GammaMatrix::GammaY); + } + if (i & 0x4) + { + g = g*Gamma(Gamma::GammaMatrix::GammaZ); + } + if (i & 0x8) + { + g = g*Gamma(Gamma::GammaMatrix::GammaT); + } + + return g; + } // void sprojMul( vHalfSpinColourVector &out,vColourMatrix &u, vSpinColourVector &in){ // vHalfSpinColourVector hspin; diff --git a/lib/qcd/spin/Dirac.h b/lib/qcd/spin/Dirac.h index 8654b5a8..00bd519c 100644 --- a/lib/qcd/spin/Dirac.h +++ b/lib/qcd/spin/Dirac.h @@ -82,7 +82,10 @@ namespace QCD { GammaMatrix _g; }; - + + // Make gamma products (Chroma convention) + SpinMatrix makeGammaProd(const unsigned int i); + /* Gx * 0 0 0 i * 0 0 i 0