mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-11-03 21:44:33 +00:00 
			
		
		
		
	Hadrons: Momentum projection in meson module.
This commit is contained in:
		@@ -6,6 +6,7 @@ Source file: extras/Hadrons/Modules/MContraction/Meson.hpp
 | 
			
		||||
 | 
			
		||||
Copyright (C) 2015
 | 
			
		||||
Copyright (C) 2016
 | 
			
		||||
Copyright (C) 2017
 | 
			
		||||
 | 
			
		||||
Author: Antonin Portelli <antonin.portelli@me.com>
 | 
			
		||||
        Andrew Lawson    <andrew.lawson1991@gmail.com>
 | 
			
		||||
@@ -66,7 +67,8 @@ BEGIN_HADRONS_NAMESPACE
 | 
			
		||||
           in a sequence (e.g. "[15 7][7 15][7 7]").
 | 
			
		||||
 | 
			
		||||
           Special values: "all" - perform all possible contractions.
 | 
			
		||||
 
 | 
			
		||||
 - mom: momentum insertion, space-separated float sequence (e.g ".1 .2 1. 0."),
 | 
			
		||||
        given as multiples of (2*pi) / L.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/******************************************************************************
 | 
			
		||||
@@ -83,6 +85,7 @@ public:
 | 
			
		||||
                                    std::string, q1,
 | 
			
		||||
                                    std::string, q2,
 | 
			
		||||
                                    std::string, gammas,
 | 
			
		||||
                                    std::string, mom,
 | 
			
		||||
                                    std::string, output);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -182,6 +185,18 @@ void TMeson<FImpl1, FImpl2>::execute(void)
 | 
			
		||||
    std::vector<GammaPair> gammaList;
 | 
			
		||||
    std::vector<TComplex>  buf;
 | 
			
		||||
    std::vector<Result>    result;
 | 
			
		||||
    std::vector<Real>      p;
 | 
			
		||||
 | 
			
		||||
    p  = strToVec<Real>(par().mom);
 | 
			
		||||
    LatticeComplex         ph(env().getGrid()), coor(env().getGrid());
 | 
			
		||||
    Complex                i(0.0,1.0);
 | 
			
		||||
    ph = zero;
 | 
			
		||||
    for(unsigned int mu = 0; mu < env().getNd(); mu++)
 | 
			
		||||
    {
 | 
			
		||||
        LatticeCoordinate(coor, mu);
 | 
			
		||||
        ph = ph + p[mu]*coor*((1./(env().getGrid()->_fdimensions[mu])));
 | 
			
		||||
    }
 | 
			
		||||
    ph = exp(-2*M_PI*i*ph);
 | 
			
		||||
    
 | 
			
		||||
    g5 = makeGammaProd(Ns*Ns - 1);
 | 
			
		||||
    for (int i = 0; i < Ns*Ns; ++i)
 | 
			
		||||
@@ -193,7 +208,7 @@ void TMeson<FImpl1, FImpl2>::execute(void)
 | 
			
		||||
    result.resize(gammaList.size());
 | 
			
		||||
    for (unsigned int i = 0; i < result.size(); ++i)
 | 
			
		||||
    {
 | 
			
		||||
        c = trace(g[gammaList[i].first]*q1*g[gammaList[i].second]*g5*adj(q2)*g5);
 | 
			
		||||
        c = trace(g[gammaList[i].first]*q1*g[gammaList[i].second]*g5*adj(q2)*g5*ph);
 | 
			
		||||
        sliceSum(c, buf, Tp);
 | 
			
		||||
 | 
			
		||||
        result[i].gamma_snk = gammaList[i].first;
 | 
			
		||||
 
 | 
			
		||||
@@ -131,6 +131,7 @@ int main(int argc, char *argv[])
 | 
			
		||||
            mesPar.q1     = qName[i];
 | 
			
		||||
            mesPar.q2     = qName[j];
 | 
			
		||||
            mesPar.gammas = "all";
 | 
			
		||||
            mesPar.mom    = "0. 0. 0. 0.";
 | 
			
		||||
            application.createModule<MContraction::Meson>("meson_Z2_"
 | 
			
		||||
                                                          + std::to_string(t)
 | 
			
		||||
                                                          + "_"
 | 
			
		||||
@@ -149,6 +150,7 @@ int main(int argc, char *argv[])
 | 
			
		||||
            mesPar.q1     = qName[i];
 | 
			
		||||
            mesPar.q2     = seqName[j][mu];
 | 
			
		||||
            mesPar.gammas = "all";
 | 
			
		||||
            mesPar.mom    = "0. 0. 0. 0.";
 | 
			
		||||
            application.createModule<MContraction::Meson>("3pt_Z2_"
 | 
			
		||||
                                                          + std::to_string(t)
 | 
			
		||||
                                                          + "_"
 | 
			
		||||
 
 | 
			
		||||
@@ -97,6 +97,7 @@ int main(int argc, char *argv[])
 | 
			
		||||
        mesPar.q1     = "Qpt_" + flavour[i];
 | 
			
		||||
        mesPar.q2     = "Qpt_" + flavour[j];
 | 
			
		||||
        mesPar.gammas = "all";
 | 
			
		||||
        mesPar.mom    = "0. 0. 0. 0.";
 | 
			
		||||
        application.createModule<MContraction::Meson>("meson_pt_"
 | 
			
		||||
                                                      + flavour[i] + flavour[j],
 | 
			
		||||
                                                      mesPar);
 | 
			
		||||
@@ -104,6 +105,7 @@ int main(int argc, char *argv[])
 | 
			
		||||
        mesPar.q1     = "QZ2_" + flavour[i];
 | 
			
		||||
        mesPar.q2     = "QZ2_" + flavour[j];
 | 
			
		||||
        mesPar.gammas = "all";
 | 
			
		||||
        mesPar.mom    = "0. 0. 0. 0.";
 | 
			
		||||
        application.createModule<MContraction::Meson>("meson_Z2_"
 | 
			
		||||
                                                      + flavour[i] + flavour[j],
 | 
			
		||||
                                                      mesPar);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user