/************************************************************************************* Grid physics library, www.github.com/paboyle/Grid Source file: Hadrons/Modules/MNPR/FourQuark.hpp Copyright (C) 2015-2019 Author: Antonin Portelli Author: Julia Kettle J.R.Kettle-2@sms.ed.ac.uk Author: Peter Boyle This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ #ifndef Hadrons_FourQuark_hpp_ #define Hadrons_FourQuark_hpp_ #include #include #include #include #include BEGIN_HADRONS_NAMESPACE /****************************************************************************** * TFourQuark * Performs fourquark contractions of the type tr[g5*adj(Sout)*g5*G*Sin] Suitable for non exceptional momenta ******************************************************************************/ BEGIN_MODULE_NAMESPACE(MNPR) class FourQuarkPar: Serializable { public: GRID_SERIALIZABLE_CLASS_MEMBERS(FourQuarkPar, std::string, Sin, //need to make this a propogator type? std::string, Sout, //same std::string, pin, std::string, pout, bool, fullbasis, std::string, output); }; template class TFourQuark: public Module { public: FERM_TYPE_ALIASES(FImpl1, 1); FERM_TYPE_ALIASES(FImpl2, 2); class Result: Serializable { public: GRID_SERIALIZABLE_CLASS_MEMBERS(Result, std::vector, fourquark); }; public: // constructor TFourQuark(const std::string name); // destructor virtual ~TFourQuark(void) {}; // dependencies/products virtual std::vector getInput(void); virtual std::vector getOutput(void); // setup virtual void tensorprod(LatticeSpinColourSpinColourMatrix &lret, LatticeSpinColourMatrix a, LatticeSpinColourMatrix b); virtual void setup(void); // execution virtual void execute(void); }; MODULE_REGISTER_TMP(FourQuark, ARG(TFourQuark), MNPR); /****************************************************************************** * TFourQuark implementation * ******************************************************************************/ // constructor ///////////////////////////////////////////////////////////////// template TFourQuark::TFourQuark(const std::string name) : Module(name) {} // dependencies/products /////////////////////////////////////////////////////// template std::vector TFourQuark::getInput(void) { std::vector input = {par().Sin, par().Sout}; return input; } template std::vector TFourQuark::getOutput(void) { std::vector output = {getName()}; return output; } template void TFourQuark::tensorprod(LatticeSpinColourSpinColourMatrix &lret, LatticeSpinColourMatrix a, LatticeSpinColourMatrix b) { #if 0 parallel_for(auto site=lret.begin();site void TFourQuark::setup(void) { envCreateLat(LatticeSpinColourMatrix, getName()); } // execution /////////////////////////////////////////////////////////////////// template void TFourQuark::execute(void) { /********************************************************************************* TFourQuark : Creates the four quark vertex required for the NPR of four-quark ops V_{Gamma_1,Gamma_2} = sum_x [ ( g5 * adj(S'(x,p2)) * g5 * G1 * S'(x,p1) )_ci,cj;si,sj x ( g5 * adj(S'(x,p2)) * g5 * G2 S'(x,p1) )_ck,cl;sk,cl ] Create a bilinear vertex for G1 and G2 the spin and colour indices are kept free. Where there are 16 potential Gs. We then find the outer product of V1 and V2, keeping the spin and colour indices uncontracted Then this is summed over the lattice coordinate Result is a SpinColourSpinColourMatrix - with 4 colour and 4 spin indices. We have up to 256 of these including the offdiag (G1 != G2). \ / \p1 p1/ \ / \ / G1 * * G2 / \ / \ /p2 p2\ / \ *********************************************************************************/ LOG(Message) << "Computing fourquark contractions '" << getName() << "' using" << " momentum '" << par().Sin << "' and '" << par().Sout << "'" << std::endl; BinaryWriter writer(par().output); PropagatorField1 &Sin = *env().template getObject(par().Sin); PropagatorField2 &Sout = *env().template getObject(par().Sout); std::vector pin = strToVec(par().pin), pout = strToVec(par().pout); bool fullbasis = par().fullbasis; Gamma g5(Gamma::Algebra::Gamma5); Result result; std::vector latt_size(pin.begin(), pin.end()); LatticeComplex pdotxin(env().getGrid()), pdotxout(env().getGrid()), coor(env().getGrid()); LatticeSpinColourMatrix bilinear_mu(env().getGrid()), bilinear_nu(env().getGrid()); LatticeSpinColourSpinColourMatrix lret(env().getGrid()); Complex Ci(0.0,1.0); //Phase propagators //Sin = Grid::QCD::PropUtils::PhaseProps(Sin,pin); //Sout = Grid::QCD::PropUtils::PhaseProps(Sout,pout); //find p.x for in and out so phase can be accounted for in propagators pdotxin=zero; pdotxout=zero; for (unsigned int mu = 0; mu < 4; ++mu) { Real TwoPiL = M_PI * 2.0/ latt_size[mu]; LatticeCoordinate(coor,mu); pdotxin = pdotxin +(TwoPiL * pin[mu]) * coor; pdotxout= pdotxout +(TwoPiL * pout[mu]) * coor; } Sin = Sin*exp(-Ci*pdotxin); //phase corrections Sout = Sout*exp(-Ci*pdotxout); //Set up Gammas std::vector gammavector; for( int i=1; i