From fd2a63701049beb17f6fa518f3eda8415bb6d421 Mon Sep 17 00:00:00 2001 From: Alessandro Lupo Date: Tue, 16 May 2023 14:10:39 +0100 Subject: [PATCH] test 2index --- Grid/qcd/utils/GaugeGroupTwoIndex.h | 9 +++++++-- tests/sp2n/Test_sp2n_lie_gen.cc | 14 +++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Grid/qcd/utils/GaugeGroupTwoIndex.h b/Grid/qcd/utils/GaugeGroupTwoIndex.h index 465b461c..fc5879c0 100644 --- a/Grid/qcd/utils/GaugeGroupTwoIndex.h +++ b/Grid/qcd/utils/GaugeGroupTwoIndex.h @@ -238,6 +238,13 @@ class GaugeGroupTwoIndex : public GaugeGroup { Complex Tr = -TensorRemove(trace(i2indTa * i2indTb)); std::cout << GridLogMessage << "a=" << a << "b=" << b << "Tr=" << Tr << std::endl; + if (a==b) { + assert(imag(Tr) < 1e-8); + assert(real(Tr) - 1 < 1e-8); + } else { + assert(imag(Tr) < 1e-8); + assert(real(Tr) < 1e-8); + } } } std::cout << GridLogMessage << std::endl; @@ -313,7 +320,6 @@ typedef SU_TwoIndex<3, Symmetric> SU3TwoIndexSymm; typedef SU_TwoIndex<4, Symmetric> SU4TwoIndexSymm; typedef SU_TwoIndex<5, Symmetric> SU5TwoIndexSymm; -typedef SU_TwoIndex<2, AntiSymmetric> SU2TwoIndexAntiSymm; typedef SU_TwoIndex<3, AntiSymmetric> SU3TwoIndexAntiSymm; typedef SU_TwoIndex<4, AntiSymmetric> SU4TwoIndexAntiSymm; typedef SU_TwoIndex<5, AntiSymmetric> SU5TwoIndexAntiSymm; @@ -327,7 +333,6 @@ typedef Sp_TwoIndex SpTwoIndexAntiSymmMatrices; typedef Sp_TwoIndex<2, Symmetric> Sp2TwoIndexSymm; typedef Sp_TwoIndex<4, Symmetric> Sp4TwoIndexSymm; -typedef Sp_TwoIndex<2, AntiSymmetric> Sp2TwoIndexAntiSymm; typedef Sp_TwoIndex<4, AntiSymmetric> Sp4TwoIndexAntiSymm; diff --git a/tests/sp2n/Test_sp2n_lie_gen.cc b/tests/sp2n/Test_sp2n_lie_gen.cc index bac7d084..17e10184 100644 --- a/tests/sp2n/Test_sp2n_lie_gen.cc +++ b/tests/sp2n/Test_sp2n_lie_gen.cc @@ -5,11 +5,6 @@ using namespace Grid; int main(int argc, char** argv) { Grid_init(&argc, &argv); - //std::vector latt({4, 4, 4, 8}); - //GridCartesian* grid = SpaceTimeGrid::makeFourDimGrid( - //latt, GridDefaultSimd(Nd, vComplex::Nsimd()), GridDefaultMpi()); - //GridRedBlackCartesian* rbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(grid); - std::cout << GridLogMessage << "*********************************************" << std::endl; std::cout << GridLogMessage << "* Generators for Sp(2)" << std::endl; @@ -46,5 +41,14 @@ int main(int argc, char** argv) { Sp8::printGenerators(); Sp8::testGenerators(); + std::cout << GridLogMessage << "*********************************************" + << std::endl; + std::cout << GridLogMessage << "* Generators for Sp(4) TwoIndex AntiSymmetric" << std::endl; + std::cout << GridLogMessage << "*********************************************" + << std::endl; + + Sp4TwoIndexAntiSymm::printGenerators(); + Sp4TwoIndexAntiSymm::testGenerators(); + Grid_finalize(); }