1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-18 15:57:05 +01:00

add projection on sp2n algebra

This commit is contained in:
Alessandro Lupo
2021-10-26 10:20:44 +01:00
parent 4d8ae6221c
commit 4044536eea
3 changed files with 134 additions and 83 deletions

View File

@ -140,8 +140,38 @@ public:
PokeIndex<LorentzIndex>(P, Pmu, mu);
}
}
static inline Field projectForce(Field &P) { return Ta(P); }
static inline Field projectForce(Field &P)
{
if (isSp2n == true)
{
P = Ta(P);
const int nsp = Nc / 2;
Sp<nsp>::iSp2nMatrix<Complex> gen;
auto Psum = P;
Psum = Zero();
for (int a = 0; a < Sp<nsp>::AlgebraDimension; a++)
{
Sp<nsp>::generator(a, gen);
auto coeff = 2. * trace(P * gen);
Psum += coeff * gen;
}
return Psum;
} else
{
return Ta(P);
}
}
static inline void update_field(Field& P, Field& U, double ep){
//static std::chrono::duration<double> diff;