26template <
class cplx, ONLY_IF_Sp>
30 const int nsp = ncolour/2;
32 int aIndex, bIndex, cIndex, dIndex;
34 const int mod = nsp * (nsp - 1) * 0.5;
37 const int wmod = 4 *
mod;
38 const int zmod = wmod + nsp;
39 if (lieIndex >= offdiag) {
40 diagIndex = lieIndex - offdiag;
45 if ((lieIndex >= wmod) && (lieIndex < zmod)) {
47 wIndex = lieIndex - wmod;
51 if ((lieIndex >= zmod) && (lieIndex < offdiag)) {
55 zIndex = lieIndex - zmod;
66 if ((lieIndex >=
mod) && lieIndex < 2 *
mod) {
68 bIndex = lieIndex -
mod;
72 if ((lieIndex >= 2 *
mod) &&
75 cIndex = lieIndex - 2 *
mod;
79 if ((lieIndex >= 3 *
mod) &&
82 dIndex = lieIndex - 3 *
mod;
89template <
class cplx, ONLY_IF_Sp>
93 const int nsp=ncolour/2;
97 ta()()(diagIndex, diagIndex) = nrm;
98 ta()()(diagIndex + nsp, diagIndex + nsp) = -nrm;
101template <
class cplx, ONLY_IF_Sp>
107 const int nsp=ncolour/2;
109 RealD nrm = 1 / (2 * std::sqrt(2));
114 ta()()(i1 + nsp, i2 + nsp) = -1;
115 ta()()(i2 + nsp, i1 + nsp) = -1;
120template <
class cplx, ONLY_IF_Sp>
126 const int nsp=ncolour/2;
130 RealD nrm = 1 / (2 * std::sqrt(2));
135 ta()()(i1 + nsp, i2 + nsp) = i;
136 ta()()(i2 + nsp, i1 + nsp) = -i;
141template <
class cplx, ONLY_IF_Sp>
145 const int nsp=ncolour/2;
148 RealD nrm = 1 / (2 * std::sqrt(2));
151 ta()()(i1, i2 + nsp) = 1;
152 ta()()(i2, i1 + nsp) = 1;
153 ta()()(i1 + nsp, i2) = 1;
154 ta()()(i2 + nsp, i1) = 1;
159template <
class cplx, ONLY_IF_Sp>
163 const int nsp=ncolour/2;
167 RealD nrm = 1 / (2 * std::sqrt(2));
170 ta()()(i1, i2 + nsp) = i;
171 ta()()(i2, i1 + nsp) = i;
172 ta()()(i1 + nsp, i2) = -i;
173 ta()()(i2 + nsp, i1) = -i;
178template <
class cplx, ONLY_IF_Sp>
182 const int nsp=ncolour/2;
186 ta()()(wIndex, wIndex + nsp) = 1;
187 ta()()(wIndex + nsp, wIndex) = 1;
192template <
class cplx, ONLY_IF_Sp>
196 const int nsp=ncolour/2;
200 ta()()(zIndex, zIndex + nsp) = i;
201 ta()()(zIndex + nsp, zIndex) = -i;
211 const int nsp=ncolour/2;
212 assert((su2_index >= 0) && (su2_index < (nsp * (nsp - 1)) / 2));
214 int spare = su2_index;
215 for (i1 = 0; spare >= (nsp - 1 - i1); i1++) {
216 spare = spare - (nsp - 1 - i1);
225 <<
"Fundamental - Checking trace ta tb is 0.5 delta_ab "
227 for (
int a = 0; a < AlgebraDimension; a++) {
228 for (
int b = 0; b < AlgebraDimension; b++) {
232 std::cout <<
GridLogMessage <<
"(" << a <<
"," << b <<
") = " << tr
234 if (a == b) assert(
abs(tr -
Complex(0.5)) < 1.0e-6);
235 if (a != b) assert(
abs(tr) < 1.0e-6);
239 std::cout <<
GridLogMessage <<
"Fundamental - Checking if hermitian"
241 for (
int a = 0; a < AlgebraDimension; a++) {
244 assert(
norm2(ta -
adj(ta)) < 1.0e-6);
247 std::cout <<
GridLogMessage <<
"Fundamental - Checking if traceless"
249 for (
int a = 0; a < AlgebraDimension; a++) {
253 assert(
abs(tr) < 1.0e-6);
263template <
class vtype>
268template <
class vtype,
int N>
273template <class vtype,int N, typename std::enable_if< GridTypeMapper<vtype>::TensorLevel == 0 >
::type * =
nullptr>
278template <
typename LatticeMatrixType>
287 const int nsp=ncolour/2;
296 for (
int i = 0; i < nsp; i++) {
297 Omega()()(i, nsp + i) = 1.;
298 Omega()()(nsp + i, i) = -1;
300 OmegaLatt = OmegaLatt + (identity *
Omega);
304template <ONLY_IF_Sp,
class vtype,
int N>
306 const int nsp=ncolour/2;
311 for (
int i = 0; i < nsp; i++) {
312 Omega()()(i, nsp + i) = 1.;
313 Omega()()(nsp + i, i) = -1;
#define accelerator_inline
accelerator_inline Grid_simd2< S, V > trace(const Grid_simd2< S, V > &arg)
accelerator_inline Grid_simd< S, V > abs(const Grid_simd< S, V > &r)
Lattice< vobj > adj(const Lattice< vobj > &lhs)
RealD norm2(const Lattice< vobj > &arg)
Lattice< obj > mod(const Lattice< obj > &rhs_i, Integer y)
GridLogger GridLogMessage(1, "Message", GridLogColours, "NORMAL")
iColourMatrix< Complex > ColourMatrix
Lattice< vColourMatrixD > LatticeColourMatrixD
std::complex< Real > Complex
static int su2subgroups(GroupName::Sp)
static void taProj(const LatticeMatrixType &in, LatticeMatrixType &out, GroupName::Sp)
static void generator(int lieIndex, iGroupMatrix< cplx > &ta, GroupName::Sp)
static void generatorDiagtype(int diagIndex, iGroupMatrix< cplx > &ta)
static void Omega(LatticeColourMatrixD &in)
static void generatorAtype(int aIndex, iGroupMatrix< cplx > &ta)
static void generatorDtype(int dIndex, iGroupMatrix< cplx > &ta)
static void testGenerators(GroupName::Sp)
static Lattice< iScalar< iScalar< iMatrix< vComplexD, N > > > > ProjectOnGeneralGroup(const Lattice< iScalar< iScalar< iMatrix< vComplexD, N > > > > &Umu, GroupName::Sp)
static void generatorBtype(int bIndex, iGroupMatrix< cplx > &ta)
static void generatorCtype(int cIndex, iGroupMatrix< cplx > &ta)
static void generatorWtype(int wIndex, iGroupMatrix< cplx > &ta)
static void generatorZtype(int zIndex, iGroupMatrix< cplx > &ta)
static accelerator_inline void su2SubGroupIndex(int &i1, int &i2, int su2_index, GroupName::Sp)
accelerator_inline iScalar< vtype > ProjectOnSpGroup(const iScalar< vtype > &r)
accelerator_inline iScalar< vtype > SpTa(const iScalar< vtype > &r)
accelerator_inline std::enable_if<!isGridTensor< T >::value, T >::type TensorRemove(T arg)
GridBase * Grid(void) const