#ifndef GRID_QCD_H #define GRID_QCD_H namespace Grid{ namespace QCD { static const int Xp = 0; static const int Yp = 1; static const int Zp = 2; static const int Tp = 3; static const int Xm = 4; static const int Ym = 5; static const int Zm = 6; static const int Tm = 7; static const int Nc=3; static const int Ns=4; static const int Nd=4; static const int Nhs=2; // half spinor static const int Nds=8; // double stored gauge field ////////////////////////////////////////////////////////////////////////////// // QCD iMatrix types // Index conventions: Lorentz x Spin x Colour ////////////////////////////////////////////////////////////////////////////// static const int ColourIndex = 2; static const int SpinIndex = 1; static const int LorentzIndex= 0; // ChrisK very keen to add extra space for Gparity doubling. // // Also add domain wall index, in a way where Wilson operator // naturally distributes across the 5th dimensions. // // That probably makes for GridRedBlack4dCartesian grid. // s,sp,c,spc,lc template using iSinglet = iScalar > >; template using iSpinMatrix = iScalar, Ns> >; template using iColourMatrix = iScalar > > ; template using iSpinColourMatrix = iScalar, Ns> >; template using iLorentzColourMatrix = iVector >, Nd > ; template using iDoubleStoredColourMatrix = iVector >, Nds > ; template using iSpinVector = iScalar, Ns> >; template using iColourVector = iScalar > >; template using iSpinColourVector = iScalar, Ns> >; template using iHalfSpinVector = iScalar, Nhs> >; template using iHalfSpinColourVector = iScalar, Nhs> >; // Spin matrix typedef iSpinMatrix SpinMatrix; typedef iSpinMatrix SpinMatrixF; typedef iSpinMatrix SpinMatrixD; typedef iSpinMatrix vSpinMatrix; typedef iSpinMatrix vSpinMatrixF; typedef iSpinMatrix vSpinMatrixD; // Colour Matrix typedef iColourMatrix ColourMatrix; typedef iColourMatrix ColourMatrixF; typedef iColourMatrix ColourMatrixD; typedef iColourMatrix vColourMatrix; typedef iColourMatrix vColourMatrixF; typedef iColourMatrix vColourMatrixD; // SpinColour matrix typedef iSpinColourMatrix SpinColourMatrix; typedef iSpinColourMatrix SpinColourMatrixF; typedef iSpinColourMatrix SpinColourMatrixD; typedef iSpinColourMatrix vSpinColourMatrix; typedef iSpinColourMatrix vSpinColourMatrixF; typedef iSpinColourMatrix vSpinColourMatrixD; // LorentzColour typedef iLorentzColourMatrix LorentzColourMatrix; typedef iLorentzColourMatrix LorentzColourMatrixF; typedef iLorentzColourMatrix LorentzColourMatrixD; typedef iLorentzColourMatrix vLorentzColourMatrix; typedef iLorentzColourMatrix vLorentzColourMatrixF; typedef iLorentzColourMatrix vLorentzColourMatrixD; // DoubleStored gauge field typedef iDoubleStoredColourMatrix DoubleStoredColourMatrix; typedef iDoubleStoredColourMatrix DoubleStoredColourMatrixF; typedef iDoubleStoredColourMatrix DoubleStoredColourMatrixD; typedef iDoubleStoredColourMatrix vDoubleStoredColourMatrix; typedef iDoubleStoredColourMatrix vDoubleStoredColourMatrixF; typedef iDoubleStoredColourMatrix vDoubleStoredColourMatrixD; // Spin vector typedef iSpinVector SpinVector; typedef iSpinVector SpinVectorF; typedef iSpinVector SpinVectorD; typedef iSpinVector vSpinVector; typedef iSpinVector vSpinVectorF; typedef iSpinVector vSpinVectorD; // Colour vector typedef iColourVector ColourVector; typedef iColourVector ColourVectorF; typedef iColourVector ColourVectorD; typedef iColourVector vColourVector; typedef iColourVector vColourVectorF; typedef iColourVector vColourVectorD; // SpinColourVector typedef iSpinColourVector SpinColourVector; typedef iSpinColourVector SpinColourVectorF; typedef iSpinColourVector SpinColourVectorD; typedef iSpinColourVector vSpinColourVector; typedef iSpinColourVector vSpinColourVectorF; typedef iSpinColourVector vSpinColourVectorD; // HalfSpin vector typedef iHalfSpinVector HalfSpinVector; typedef iHalfSpinVector HalfSpinVectorF; typedef iHalfSpinVector HalfSpinVectorD; typedef iHalfSpinVector vHalfSpinVector; typedef iHalfSpinVector vHalfSpinVectorF; typedef iHalfSpinVector vHalfSpinVectorD; // HalfSpinColour vector typedef iHalfSpinColourVector HalfSpinColourVector; typedef iHalfSpinColourVector HalfSpinColourVectorF; typedef iHalfSpinColourVector HalfSpinColourVectorD; typedef iHalfSpinColourVector vHalfSpinColourVector; typedef iHalfSpinColourVector vHalfSpinColourVectorF; typedef iHalfSpinColourVector vHalfSpinColourVectorD; // singlets typedef iSinglet TComplex; // FIXME This is painful. Tensor singlet complex type. typedef iSinglet TComplexF; // FIXME This is painful. Tensor singlet complex type. typedef iSinglet TComplexD; // FIXME This is painful. Tensor singlet complex type. typedef iSinglet vTComplex ; // what if we don't know the tensor structure typedef iSinglet vTComplexF; // what if we don't know the tensor structure typedef iSinglet vTComplexD; // what if we don't know the tensor structure typedef iSinglet TReal; // Shouldn't need these; can I make it work without? typedef iSinglet TRealF; // Shouldn't need these; can I make it work without? typedef iSinglet TRealD; // Shouldn't need these; can I make it work without? typedef iSinglet vTReal; typedef iSinglet vTRealF; typedef iSinglet vTRealD; typedef iSinglet vTInteger; typedef iSinglet TInteger; // Lattices of these typedef Lattice LatticeColourMatrix; typedef Lattice LatticeColourMatrixF; typedef Lattice LatticeColourMatrixD; typedef Lattice LatticeSpinMatrix; typedef Lattice LatticeSpinMatrixF; typedef Lattice LatticeSpinMatrixD; typedef Lattice LatticeSpinColourMatrix; typedef Lattice LatticeSpinColourMatrixF; typedef Lattice LatticeSpinColourMatrixD; typedef Lattice LatticeLorentzColourMatrix; typedef Lattice LatticeLorentzColourMatrixF; typedef Lattice LatticeLorentzColourMatrixD; // DoubleStored gauge field typedef Lattice LatticeDoubleStoredColourMatrix; typedef Lattice LatticeDoubleStoredColourMatrixF; typedef Lattice LatticeDoubleStoredColourMatrixD; typedef Lattice LatticeSpinVector; typedef Lattice LatticeSpinVectorF; typedef Lattice LatticeSpinVectorD; typedef Lattice LatticeColourVector; typedef Lattice LatticeColourVectorF; typedef Lattice LatticeColourVectorD; typedef Lattice LatticeSpinColourVector; typedef Lattice LatticeSpinColourVectorF; typedef Lattice LatticeSpinColourVectorD; typedef Lattice LatticeHalfSpinVector; typedef Lattice LatticeHalfSpinVectorF; typedef Lattice LatticeHalfSpinVectorD; typedef Lattice LatticeHalfSpinColourVector; typedef Lattice LatticeHalfSpinColourVectorF; typedef Lattice LatticeHalfSpinColourVectorD; typedef Lattice LatticeReal; typedef Lattice LatticeRealF; typedef Lattice LatticeRealD; typedef Lattice LatticeComplex; typedef Lattice LatticeComplexF; typedef Lattice LatticeComplexD; typedef Lattice LatticeInteger; // Predicates for "where" /////////////////////////////////////////// // Physical names for things /////////////////////////////////////////// typedef LatticeHalfSpinColourVector LatticeHalfFermion; typedef LatticeHalfSpinColourVectorF LatticeHalfFermionF; typedef LatticeHalfSpinColourVectorF LatticeHalfFermionD; typedef LatticeSpinColourVector LatticeFermion; typedef LatticeSpinColourVectorF LatticeFermionF; typedef LatticeSpinColourVectorD LatticeFermionD; typedef LatticeSpinColourMatrix LatticePropagator; typedef LatticeSpinColourMatrixF LatticePropagatorF; typedef LatticeSpinColourMatrixD LatticePropagatorD; typedef LatticeLorentzColourMatrix LatticeGaugeField; typedef LatticeLorentzColourMatrixF LatticeGaugeFieldF; typedef LatticeLorentzColourMatrixD LatticeGaugeFieldD; typedef LatticeDoubleStoredColourMatrix LatticeDoubledGaugeField; typedef LatticeDoubleStoredColourMatrixF LatticeDoubledGaugeFieldF; typedef LatticeDoubleStoredColourMatrixD LatticeDoubledGaugeFieldD; // Uhgg... typing this hurt ;) // (my keyboard got burning hot when I typed this, must be the anti-Fermion) typedef Lattice LatticeStaggeredFermion; typedef Lattice LatticeStaggeredFermionF; typedef Lattice LatticeStaggeredFermionD; typedef Lattice LatticeStaggeredPropagator; typedef Lattice LatticeStaggeredPropagatorF; typedef Lattice LatticeStaggeredPropagatorD; ////////////////////////////////////////////////////////////////////////////// // Peek and Poke named after physics attributes ////////////////////////////////////////////////////////////////////////////// //spin template auto peekSpin(const vobj &rhs,int i) -> decltype(peekIndex(rhs,0)) { return peekIndex(rhs,i); } template auto peekSpin(const vobj &rhs,int i,int j) -> decltype(peekIndex(rhs,0,0)) { return peekIndex(rhs,i,j); } template auto peekSpin(const Lattice &rhs,int i) -> decltype(peekIndex(rhs,0)) { return peekIndex(rhs,i); } template auto peekSpin(const Lattice &rhs,int i,int j) -> decltype(peekIndex(rhs,0,0)) { return peekIndex(rhs,i,j); } //colour template auto peekColour(const vobj &rhs,int i) -> decltype(peekIndex(rhs,0)) { return peekIndex(rhs,i); } template auto peekColour(const vobj &rhs,int i,int j) -> decltype(peekIndex(rhs,0,0)) { return peekIndex(rhs,i,j); } template auto peekColour(const Lattice &rhs,int i) -> decltype(peekIndex(rhs,0)) { return peekIndex(rhs,i); } template auto peekColour(const Lattice &rhs,int i,int j) -> decltype(peekIndex(rhs,0,0)) { return peekIndex(rhs,i,j); } //lorentz template auto peekLorentz(const vobj &rhs,int i) -> decltype(peekIndex(rhs,0)) { return peekIndex(rhs,i); } template auto peekLorentz(const Lattice &rhs,int i) -> decltype(peekIndex(rhs,0)) { return peekIndex(rhs,i); } ////////////////////////////////////////////// // Poke lattice ////////////////////////////////////////////// template void pokeColour(Lattice &lhs, const Lattice(lhs._odata[0],0))> & rhs, int i) { pokeIndex(lhs,rhs,i); } template void pokeColour(Lattice &lhs, const Lattice(lhs._odata[0],0,0))> & rhs, int i,int j) { pokeIndex(lhs,rhs,i,j); } template void pokeSpin(Lattice &lhs, const Lattice(lhs._odata[0],0))> & rhs, int i) { pokeIndex(lhs,rhs,i); } template void pokeSpin(Lattice &lhs, const Lattice(lhs._odata[0],0,0))> & rhs, int i,int j) { pokeIndex(lhs,rhs,i,j); } template void pokeLorentz(Lattice &lhs, const Lattice(lhs._odata[0],0))> & rhs, int i) { pokeIndex(lhs,rhs,i); } ////////////////////////////////////////////// // Poke scalars ////////////////////////////////////////////// template void pokeSpin(vobj &lhs,const decltype(peekIndex(lhs,0)) & rhs,int i) { pokeIndex(lhs,rhs,i); } template void pokeSpin(vobj &lhs,const decltype(peekIndex(lhs,0,0)) & rhs,int i,int j) { pokeIndex(lhs,rhs,i,j); } template void pokeColour(vobj &lhs,const decltype(peekIndex(lhs,0)) & rhs,int i) { pokeIndex(lhs,rhs,i); } template void pokeColour(vobj &lhs,const decltype(peekIndex(lhs,0,0)) & rhs,int i,int j) { pokeIndex(lhs,rhs,i,j); } template void pokeLorentz(vobj &lhs,const decltype(peekIndex(lhs,0)) & rhs,int i) { pokeIndex(lhs,rhs,i); } ////////////////////////////////////////////// // transpose array and scalar ////////////////////////////////////////////// template inline Lattice transposeSpin(const Lattice &lhs){ return transposeIndex(lhs); } template inline Lattice transposeColour(const Lattice &lhs){ return transposeIndex(lhs); } template inline vobj transposeSpin(const vobj &lhs){ return transposeIndex(lhs); } template inline vobj transposeColour(const vobj &lhs){ return transposeIndex(lhs); } ////////////////////////////////////////// // Trace lattice and non-lattice ////////////////////////////////////////// template inline auto traceSpin(const Lattice &lhs) -> Lattice(lhs._odata[0]))> { return traceIndex(lhs); } template inline auto traceColour(const Lattice &lhs) -> Lattice(lhs._odata[0]))> { return traceIndex(lhs); } template inline auto traceSpin(const vobj &lhs) -> Lattice(lhs))> { return traceIndex(lhs); } template inline auto traceColour(const vobj &lhs) -> Lattice(lhs))> { return traceIndex(lhs); } } //namespace QCD } // Grid #include #include #include #include #include #include #include #include #endif