#ifndef Hadrons_MDistil_g5_multiply_hpp_ #define Hadrons_MDistil_g5_multiply_hpp_ #include #include #include #include #include #include #include // These are members of Distillation #include BEGIN_HADRONS_NAMESPACE /****************************************************************************** * g5_multiply * ******************************************************************************/ BEGIN_MODULE_NAMESPACE(MDistil) class g5_multiplyPar: Serializable { public: GRID_SERIALIZABLE_CLASS_MEMBERS(g5_multiplyPar, std::string, input, int, nnoise, int, LI, int, Ns, int, Nt_inv); }; template class Tg5_multiply: public Module { public: FERM_TYPE_ALIASES(FImpl,); public: // constructor Tg5_multiply(const std::string name); // destructor virtual ~Tg5_multiply(void) {}; // dependency relation virtual std::vector getInput(void); virtual std::vector getOutput(void); // setup virtual void setup(void); // execution virtual void execute(void); }; MODULE_REGISTER_TMP(g5_multiply, Tg5_multiply, MDistil); /****************************************************************************** * Tg5_multiply implementation * ******************************************************************************/ // constructor ///////////////////////////////////////////////////////////////// template Tg5_multiply::Tg5_multiply(const std::string name) : Module(name) {} // dependencies/products /////////////////////////////////////////////////////// template std::vector Tg5_multiply::getInput(void) { std::vector in; in.push_back(par().input); return in; } template std::vector Tg5_multiply::getOutput(void) { std::vector out = {getName()}; return out; } // setup /////////////////////////////////////////////////////////////////////// template void Tg5_multiply::setup(void) { int nnoise=par().nnoise; int LI=par().LI; int Ns=par().Ns; int Nt_inv=par().Nt_inv; envCreate(std::vector, getName(), 1, nnoise*LI*Ns*Nt_inv, envGetGrid(FermionField)); } // execution /////////////////////////////////////////////////////////////////// template void Tg5_multiply::execute(void) { auto &input_vector = envGet(std::vector, par().input); auto &output_vector = envGet(std::vector, getName()); Gamma g5(Gamma::Algebra::Gamma5); int nnoise=par().nnoise; int LI=par().LI; int Ns=par().Ns; int Nt_inv=par().Nt_inv; int Ntot = nnoise*LI*Ns*Nt_inv; for (int i =0; i