mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-13 01:05:36 +00:00
cleaning up Kl2 contraction
This commit is contained in:
parent
0a71f8bb10
commit
c3d0c176ab
@ -109,10 +109,11 @@ typedef std::vector<typename ComplexField##suffix::vector_object::scalar_object>
|
|||||||
|
|
||||||
#define FERM_TYPE_ALIASES(FImpl, suffix)\
|
#define FERM_TYPE_ALIASES(FImpl, suffix)\
|
||||||
BASIC_TYPE_ALIASES(FImpl, suffix);\
|
BASIC_TYPE_ALIASES(FImpl, suffix);\
|
||||||
typedef FermionOperator<FImpl> FMat##suffix;\
|
typedef FermionOperator<FImpl> FMat##suffix;\
|
||||||
typedef typename FImpl::FermionField FermionField##suffix;\
|
typedef typename FImpl::FermionField FermionField##suffix;\
|
||||||
typedef typename FImpl::GaugeField GaugeField##suffix;\
|
typedef typename FImpl::GaugeField GaugeField##suffix;\
|
||||||
typedef typename FImpl::DoubledGaugeField DoubledGaugeField##suffix;
|
typedef typename FImpl::DoubledGaugeField DoubledGaugeField##suffix;\
|
||||||
|
typedef Lattice<iSpinMatrix<typename FImpl::Simd>> SpinMatrixField##suffix;
|
||||||
|
|
||||||
#define GAUGE_TYPE_ALIASES(GImpl, suffix)\
|
#define GAUGE_TYPE_ALIASES(GImpl, suffix)\
|
||||||
typedef typename GImpl::GaugeField GaugeField##suffix;
|
typedef typename GImpl::GaugeField GaugeField##suffix;
|
||||||
|
@ -64,7 +64,7 @@ BEGIN_HADRONS_NAMESPACE
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* TWeakMesonDecayKl2 *
|
* TWeakMesonDecayKl2 *
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
BEGIN_MODULE_NAMESPACE(MContraction)
|
BEGIN_MODULE_NAMESPACE(MContraction)
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ public:
|
|||||||
std::string, q1,
|
std::string, q1,
|
||||||
std::string, q2,
|
std::string, q2,
|
||||||
std::string, lepton,
|
std::string, lepton,
|
||||||
std::string, output);
|
std::string, output);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
@ -83,14 +83,13 @@ class TWeakMesonDecayKl2: public Module<WeakMesonDecayKl2Par>
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FERM_TYPE_ALIASES(FImpl,);
|
FERM_TYPE_ALIASES(FImpl,);
|
||||||
class Metadata: Serializable
|
typedef typename SpinMatrixField::vector_object::scalar_object SpinMatrix;
|
||||||
|
class Result: Serializable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GRID_SERIALIZABLE_CLASS_MEMBERS(Metadata,
|
GRID_SERIALIZABLE_CLASS_MEMBERS(Result,
|
||||||
int, spinidx1,
|
std::vector<SpinMatrix>, corr);
|
||||||
int, spinidx2);
|
|
||||||
};
|
};
|
||||||
typedef Correlator<Metadata> Result;
|
|
||||||
public:
|
public:
|
||||||
// constructor
|
// constructor
|
||||||
TWeakMesonDecayKl2(const std::string name);
|
TWeakMesonDecayKl2(const std::string name);
|
||||||
@ -138,10 +137,10 @@ std::vector<std::string> TWeakMesonDecayKl2<FImpl>::getOutput(void)
|
|||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
void TWeakMesonDecayKl2<FImpl>::setup(void)
|
void TWeakMesonDecayKl2<FImpl>::setup(void)
|
||||||
{
|
{
|
||||||
envTmpLat(LatticeComplex, "c");
|
envTmpLat(ComplexField, "c");
|
||||||
envTmpLat(PropagatorField, "prop_buf");
|
envTmpLat(PropagatorField, "prop_buf");
|
||||||
envCreateLat(PropagatorField, getName());
|
envCreateLat(PropagatorField, getName());
|
||||||
envTmpLat(LatticeComplex, "buf");
|
envTmpLat(SpinMatrixField, "buf");
|
||||||
}
|
}
|
||||||
|
|
||||||
// execution ///////////////////////////////////////////////////////////////////
|
// execution ///////////////////////////////////////////////////////////////////
|
||||||
@ -150,57 +149,33 @@ void TWeakMesonDecayKl2<FImpl>::execute(void)
|
|||||||
{
|
{
|
||||||
LOG(Message) << "Computing QED Kl2 contractions '" << getName() << "' using"
|
LOG(Message) << "Computing QED Kl2 contractions '" << getName() << "' using"
|
||||||
<< " quarks '" << par().q1 << "' and '" << par().q2 << "' and"
|
<< " quarks '" << par().q1 << "' and '" << par().q2 << "' and"
|
||||||
<< "lepton '" << par().lepton << "'" << std::endl;
|
<< "lepton '" << par().lepton << "'" << std::endl;
|
||||||
|
|
||||||
|
Gamma g5(Gamma::Algebra::Gamma5);
|
||||||
|
int nt = env().getDim(Tp);
|
||||||
|
std::vector<SpinMatrix> res_summed;
|
||||||
|
Result r;
|
||||||
|
|
||||||
auto &res = envGet(PropagatorField, getName()); res = zero;
|
auto &res = envGet(PropagatorField, getName()); res = zero;
|
||||||
Gamma g5(Gamma::Algebra::Gamma5);
|
auto &q1 = envGet(PropagatorField, par().q1);
|
||||||
int nt = env().getDim(Tp);
|
auto &q2 = envGet(PropagatorField, par().q2);
|
||||||
|
|
||||||
auto &q1 = envGet(PropagatorField, par().q1);
|
|
||||||
auto &q2 = envGet(PropagatorField, par().q2);
|
|
||||||
auto &lepton = envGet(PropagatorField, par().lepton);
|
auto &lepton = envGet(PropagatorField, par().lepton);
|
||||||
envGetTmp(LatticeComplex, buf);
|
envGetTmp(SpinMatrixField, buf);
|
||||||
std::vector<TComplex> res_summed;
|
envGetTmp(ComplexField, c);
|
||||||
envGetTmp(LatticeComplex, c);
|
|
||||||
envGetTmp(PropagatorField, prop_buf);
|
envGetTmp(PropagatorField, prop_buf);
|
||||||
|
|
||||||
std::vector<Result> result;
|
|
||||||
Result r;
|
|
||||||
|
|
||||||
for (unsigned int mu = 0; mu < 4; ++mu)
|
for (unsigned int mu = 0; mu < 4; ++mu)
|
||||||
{
|
{
|
||||||
c = zero;
|
c = zero;
|
||||||
//hadronic part: trace(q1*adj(q2)*g5*gL[mu])
|
//hadronic part: trace(q1*adj(q2)*g5*gL[mu])
|
||||||
c = trace(q1*adj(q2)*g5*GammaL(Gamma::gmu[mu]));
|
c = trace(q1*adj(q2)*g5*GammaL(Gamma::gmu[mu]));
|
||||||
prop_buf = 1.;
|
prop_buf = 1.;
|
||||||
//multiply lepton part
|
//multiply lepton part
|
||||||
res += c * prop_buf * GammaL(Gamma::gmu[mu]) * lepton;
|
res += c * prop_buf * GammaL(Gamma::gmu[mu]) * lepton;
|
||||||
}
|
}
|
||||||
|
buf = peekColour(res, 0, 0);
|
||||||
//loop over spinor index of lepton part
|
sliceSum(buf, r.corr, Tp);
|
||||||
unsigned int i = 0;
|
saveResult(par().output, "weakdecay", r);
|
||||||
for (unsigned int s1 = 0; s1 < Ns ; ++s1)
|
|
||||||
for (unsigned int s2 = 0; s2 < Ns ; ++s2)
|
|
||||||
{
|
|
||||||
buf = peekColour(peekSpin(res,s1,s2),0,0);
|
|
||||||
|
|
||||||
sliceSum(buf, res_summed, Tp);
|
|
||||||
|
|
||||||
r.corr.clear();
|
|
||||||
for (unsigned int t = 0; t < nt; ++t)
|
|
||||||
{
|
|
||||||
r.corr.push_back(TensorRemove(res_summed[t]));
|
|
||||||
}
|
|
||||||
|
|
||||||
r.info.spinidx1 = s1;
|
|
||||||
r.info.spinidx2 = s2;
|
|
||||||
result.push_back(r);
|
|
||||||
|
|
||||||
i+=1;
|
|
||||||
}
|
|
||||||
|
|
||||||
saveResult(par().output, "weakdecay", result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
END_MODULE_NAMESPACE
|
END_MODULE_NAMESPACE
|
||||||
|
Loading…
Reference in New Issue
Block a user