1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-14 22:07:05 +01:00

gammas: adjoint implemented as a symbolic operation

This commit is contained in:
2017-01-24 18:07:43 -08:00
parent 0432e30256
commit 05cb6d318a
5 changed files with 190 additions and 233 deletions

View File

@ -44,12 +44,24 @@ class Gamma {
MinusSigmaZT , 30,
SigmaZT , 31);
static constexpr unsigned int nGamma = 32;
static const std::array<const char *, nGamma> name;
static const std::array<const char *, nGamma> name;
static const std::array<std::array<Algebra, nGamma>, nGamma> mul;
static const std::array<Algebra, nGamma> adj;
Algebra g;
public:
Gamma(Algebra initg): g(initg) {}
};
inline Gamma operator*(const Gamma &g1, const Gamma &g2)
{
return Gamma(Gamma::mul[g1.g][g2.g]);
}
inline Gamma adj(const Gamma &g)
{
return Gamma(Gamma::adj[g.g]);
}
template<class vtype>
inline void multMinusGamma5(iVector<vtype, Ns> &ret, const iVector<vtype, Ns> &rhs)
{
@ -1403,11 +1415,6 @@ inline auto operator*(const iMatrix<vtype, Ns> &arg, const Gamma &G)
return ret;
}
inline Gamma operator*(const Gamma &g1, const Gamma &g2)
{
return Gamma(Gamma::mul[g1.g][g2.g]);
}
}}
#endif