mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-11-04 14:04:32 +00:00 
			
		
		
		
	@@ -109,11 +109,10 @@ 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,13 +83,14 @@ class TWeakMesonDecayKl2: public Module<WeakMesonDecayKl2Par>
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
    FERM_TYPE_ALIASES(FImpl,);
 | 
					    FERM_TYPE_ALIASES(FImpl,);
 | 
				
			||||||
    typedef typename SpinMatrixField::vector_object::scalar_object SpinMatrix;
 | 
					    class Metadata: Serializable
 | 
				
			||||||
    class Result: Serializable
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
    public:
 | 
					    public:
 | 
				
			||||||
        GRID_SERIALIZABLE_CLASS_MEMBERS(Result,
 | 
					        GRID_SERIALIZABLE_CLASS_MEMBERS(Metadata,
 | 
				
			||||||
                                        std::vector<SpinMatrix>, corr);
 | 
					                                        int, spinidx1,
 | 
				
			||||||
 | 
					                                        int, spinidx2);
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					    typedef Correlator<Metadata> Result;
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
    // constructor
 | 
					    // constructor
 | 
				
			||||||
    TWeakMesonDecayKl2(const std::string name);
 | 
					    TWeakMesonDecayKl2(const std::string name);
 | 
				
			||||||
@@ -137,10 +138,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(ComplexField, "c");
 | 
					    envTmpLat(LatticeComplex, "c");
 | 
				
			||||||
    envTmpLat(PropagatorField, "prop_buf");
 | 
					    envTmpLat(PropagatorField, "prop_buf");
 | 
				
			||||||
    envCreateLat(PropagatorField, getName());
 | 
					    envCreateLat(PropagatorField, getName());
 | 
				
			||||||
    envTmpLat(SpinMatrixField, "buf");
 | 
					    envTmpLat(LatticeComplex, "buf");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// execution ///////////////////////////////////////////////////////////////////
 | 
					// execution ///////////////////////////////////////////////////////////////////
 | 
				
			||||||
@@ -149,33 +150,57 @@ 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;
 | 
				
			||||||
    auto &q1     = envGet(PropagatorField, par().q1);
 | 
					    Gamma                  g5(Gamma::Algebra::Gamma5);
 | 
				
			||||||
    auto &q2     = envGet(PropagatorField, par().q2);
 | 
					    int                    nt = env().getDim(Tp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    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(SpinMatrixField, buf);
 | 
					    envGetTmp(LatticeComplex, buf);
 | 
				
			||||||
    envGetTmp(ComplexField, c);
 | 
					    std::vector<TComplex>  res_summed;
 | 
				
			||||||
 | 
					    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);
 | 
					
 | 
				
			||||||
    sliceSum(buf, r.corr, Tp);
 | 
					    //loop over spinor index of lepton part
 | 
				
			||||||
    saveResult(par().output, "weakdecay", r);
 | 
					    unsigned int i = 0;
 | 
				
			||||||
 | 
					    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
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user