diff --git a/lib/qcd/LatticeTheories.h b/lib/qcd/LatticeTheories.h new file mode 100644 index 00000000..981c7577 --- /dev/null +++ b/lib/qcd/LatticeTheories.h @@ -0,0 +1,119 @@ + /************************************************************************************* + + Grid physics library, www.github.com/paboyle/Grid + + Source file: ./lib/qcd/QCD.h + + Copyright (C) 2015 + +Author: Azusa Yamaguchi +Author: Peter Boyle +Author: Peter Boyle +Author: neo +Author: paboyle + + 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 GRID_LT_H +#define GRID_LT_H +namespace Grid{ + +// First steps in the complete generalization of the Physics part +namespace LatticeTheories { + +template +struct LatticeTheory { + static const int Nd = Dimensions; + static const int Nds = Dimensions * 2; // double stored field + template + using iSinglet = iScalar > >; +}; + +template +struct LatticeGaugeTheory : public LatticeTheory { + static const int Nds = Dimensions * 2; + static const int Nd = Dimensions; + static const int Nc = Colours; + + template + using iColourMatrix = iScalar > >; + template + using iLorentzColourMatrix = iVector >, Nd>; + template + using iDoubleStoredColourMatrix = iVector >, Nds>; + template + using iColourVector = iScalar > >; +}; + +template +struct FermionicLatticeGaugeTheory + : public LatticeGaugeTheory { + static const int Nd = Dimensions; + static const int Nds = Dimensions * 2; + static const int Nc = Colours; + static const int Ns = Spin; + + template + using iSpinMatrix = iScalar, Ns> >; + template + using iSpinColourMatrix = iScalar, Ns> >; + template + using iSpinVector = iScalar, Ns> >; + template + using iSpinColourVector = iScalar, Ns> >; + // These 2 only if Spin is a multiple of 2 + static const int Nhs = Spin / 2; + template + using iHalfSpinVector = iScalar, Nhs> >; + template + using iHalfSpinColourVector = iScalar, Nhs> >; +}; + +// Examples, not complete now. +struct QCD : public FermionicLatticeGaugeTheory<4, 3, 4> { + 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; + + typedef FermionicLatticeGaugeTheory FLGT; + + typedef FLGT::iColourMatrix ColourMatrix; + typedef FLGT::iColourMatrix ColourMatrixF; + typedef FLGT::iColourMatrix ColourMatrixD; + + typedef FLGT::iSpinMatrix SpinMatrix; + typedef FLGT::iSpinMatrix SpinMatrixF; + typedef FLGT::iSpinMatrix SpinMatrixD; + +}; +struct QED : public FermionicLatticeGaugeTheory<4, 1, 4> {//fill +}; + +template +struct Scalar : public LatticeTheory {}; + +}; // LatticeTheories + +} // Grid + +#endif diff --git a/lib/qcd/QCD.h b/lib/qcd/QCD.h index 61313f33..e08c3dc8 100644 --- a/lib/qcd/QCD.h +++ b/lib/qcd/QCD.h @@ -32,72 +32,6 @@ Author: paboyle #ifndef GRID_QCD_H #define GRID_QCD_H namespace Grid{ - -// First steps in the complete generalization of the Physics part -namespace LatticeTheories { - -template -struct LatticeTheory { - static const int Nd = Dimensions; - static const int Nds = Dimensions * 2; // double stored field - template - using iSinglet = iScalar > >; -}; - -template -struct LatticeGaugeTheory : public LatticeTheory { - static const int Nds = Dimensions * 2; - static const int Nd = Dimensions; - static const int Nc = Colours; - - template - using iColourMatrix = iScalar > >; - template - using iLorentzColourMatrix = iVector >, Nd>; - template - using iDoubleStoredColourMatrix = iVector >, Nds>; - template - using iColourVector = iScalar > >; -}; - -template -struct FermionicLatticeGaugeTheory - : public LatticeGaugeTheory { - static const int Nd = Dimensions; - static const int Nds = Dimensions * 2; - static const int Nc = Colours; - static const int Ns = Spin; - - template - using iSpinMatrix = iScalar, Ns> >; - template - using iSpinColourMatrix = iScalar, Ns> >; - template - using iSpinVector = iScalar, Ns> >; - template - using iSpinColourVector = iScalar, Ns> >; - // These 2 only is Spin is a multiple of 2 - static const int Nhs = Spin / 2; - template - using iHalfSpinVector = iScalar, Nhs> >; - template - using iHalfSpinColourVector = iScalar, Nhs> >; -}; - -struct QCD : public FermionicLatticeGaugeTheory<4, 3, 4> { - typedef FermionicLatticeGaugeTheory FLGT; - typedef FLGT::iSpinMatrix SpinMatrix; - typedef FLGT::iSpinMatrix SpinMatrixF; - typedef FLGT::iSpinMatrix SpinMatrixD; - -}; -struct QED : public FermionicLatticeGaugeTheory<4, 1, 4> {}; - -template -struct Scalar : public LatticeTheory {}; - -} // LatticeTheories - namespace QCD {