#ifndef GRID_QCD_H #define GRID_QCD_H namespace Grid{ namespace QCD { static const int Nc=3; static const int Ns=4; static const int CbRed =0; static const int CbBlack=1; // QCD iMatrix types template using iSinglet = iScalar > ; template using iSpinMatrix = iMatrix, Ns>; template using iSpinColourMatrix = iMatrix, Ns>; template using iColourMatrix = iScalar> ; template using iSpinVector = iVector, Ns>; template using iColourVector = iScalar >; template using iSpinColourVector = iVector, Ns>; typedef iSinglet TComplex; // This is painful. Tensor singlet complex type. typedef iSinglet vTComplex; typedef iSinglet TReal; // This is painful. Tensor singlet complex type. typedef iSinglet vTIntegerF; typedef iSinglet vTIntegerD; typedef iSinglet vTIntegerC; typedef iSinglet vTIntegerZ; typedef iSpinMatrix SpinMatrix; typedef iColourMatrix ColourMatrix; typedef iSpinColourMatrix SpinColourMatrix; typedef iSpinVector SpinVector; typedef iColourVector ColourVector; typedef iSpinColourVector SpinColourVector; typedef iSpinMatrix vSpinMatrix; typedef iColourMatrix vColourMatrix; typedef iSpinColourMatrix vSpinColourMatrix; typedef iSpinVector vSpinVector; typedef iColourVector vColourVector; typedef iSpinColourVector vSpinColourVector; typedef Lattice LatticeComplex; typedef Lattice LatticeIntegerF; // Predicates for "where" typedef Lattice LatticeIntegerD; typedef Lattice LatticeIntegerC; typedef Lattice LatticeIntegerZ; typedef Lattice LatticeColourMatrix; typedef Lattice LatticeSpinMatrix; typedef Lattice LatticePropagator; typedef LatticePropagator LatticeSpinColourMatrix; typedef Lattice LatticeFermion; typedef Lattice LatticeSpinColourVector; typedef Lattice LatticeSpinVector; typedef Lattice LatticeColourVector; // localNorm2, template inline LatticeComplex localNorm2 (const Lattice &rhs) { LatticeComplex ret(rhs._grid); #pragma omp parallel for for(int ss=0;ssoSites(); ss++){ ret._odata[ss]=trace(adj(rhs)*rhs); } return ret; } // localInnerProduct template inline LatticeComplex localInnerProduct (const Lattice &lhs,const Lattice &rhs) { LatticeComplex ret(rhs._grid); #pragma omp parallel for for(int ss=0;ssoSites(); ss++){ ret._odata[ss]=localInnerProduct(lhs._odata[ss],rhs._odata[ss]); } return ret; } // outerProduct Scalar x Scalar -> Scalar // Vector x Vector -> Matrix template inline auto outerProduct (const Lattice &lhs,const Lattice &rhs) -> Lattice { Lattice ret(rhs._grid); #pragma omp parallel for for(int ss=0;ssoSites(); ss++){ ret._odata[ss]=outerProduct(lhs._odata[ss],rhs._odata[ss]); } return ret; } } //namespace QCD } // Grid #endif