From aa9df63a05d9c7c4513236c2fb4a86aee825a85c Mon Sep 17 00:00:00 2001 From: Alessandro Lupo Date: Wed, 10 May 2023 14:50:52 +0100 Subject: [PATCH] rename group projections based on determinants --- Grid/qcd/action/gauge/GaugeImplTypes.h | 4 +-- Grid/qcd/utils/GaugeGroup.h | 34 +++++++++++++------------- Grid/qcd/utils/SUn.impl | 8 +++--- Grid/qcd/utils/Sp2n.impl | 8 +++--- tests/sp2n/Test_project_on_Sp.cc | 17 ++++++------- 5 files changed, 35 insertions(+), 36 deletions(-) diff --git a/Grid/qcd/action/gauge/GaugeImplTypes.h b/Grid/qcd/action/gauge/GaugeImplTypes.h index c3e42f80..1cc5ef05 100644 --- a/Grid/qcd/action/gauge/GaugeImplTypes.h +++ b/Grid/qcd/action/gauge/GaugeImplTypes.h @@ -145,7 +145,7 @@ public: accelerator_for(ss, P.Grid()->oSites(),1,{ for (int mu = 0; mu < Nd; mu++) { U_v[ss](mu) = Exponentiate(P_v[ss](mu), ep, Nexp) * U_v[ss](mu); - Group::ProjectOnGaugeGroup(U_v[ss](mu)); + Group::ProjectOnGeneralGroup(U_v[ss](mu)); } }); //auto end = std::chrono::high_resolution_clock::now(); @@ -166,7 +166,7 @@ public: static inline void Project(Field &U) { - Group::ProjectGn(U); + Group::ProjectOnSpecialGroup(U); } static inline void HotConfiguration(GridParallelRNG &pRNG, Field &U) diff --git a/Grid/qcd/utils/GaugeGroup.h b/Grid/qcd/utils/GaugeGroup.h index 5a8f51c2..825881e2 100644 --- a/Grid/qcd/utils/GaugeGroup.h +++ b/Grid/qcd/utils/GaugeGroup.h @@ -323,37 +323,37 @@ class GaugeGroup { } } - template // reunitarise, resimplectify... - static void ProjectOnGaugeGroup(Lattice >, Nd> > &U) { + template // Projects on the general groups U(N), Sp(2N)xZ2 i.e. determinant il allowed a complex phase. + static void ProjectOnGeneralGroup(Lattice >, Nd> > &U) { for (int mu = 0; mu < Nd; mu++) { auto Umu = PeekIndex(U, mu); - ProjectOnGaugeGroup(Umu); + ProjectOnGeneralGroup(Umu); } } - template // reunitarise, resimplectify... - static void ProjectOnGaugeGroup(Lattice > > > &Umu) { - ProjectOnGaugeGroup(Umu, group_name()); + template + static void ProjectOnGeneralGroup(Lattice > > > &Umu) { + ProjectOnGeneralGroup(Umu, group_name()); } template - static void ProjectOnGaugeGroup(iScalar &r) { - ProjectOnGaugeGroup(r, group_name()); + static void ProjectOnGeneralGroup(iScalar &r) { + ProjectOnGeneralGroup(r, group_name()); } template - static void ProjectOnGaugeGroup(iVector &r) { - ProjectOnGaugeGroup(r, group_name()); + static void ProjectOnGeneralGroup(iVector &r) { + ProjectOnGeneralGroup(r, group_name()); } template ::TensorLevel == 0 >::type * =nullptr> - static void ProjectOnGaugeGroup(iMatrix &arg) { - ProjectOnGaugeGroup(arg, group_name()); + static void ProjectOnGeneralGroup(iMatrix &arg) { + ProjectOnGeneralGroup(arg, group_name()); } - template // reunitarise, resimplectify... previously ProjectSUn - static void ProjectGn(Lattice > > > &Umu) { - ProjectOnGaugeGroup(Umu); + template // Projects on SU(N), Sp(2N) + static void ProjectOnSpecialGroup(Lattice > > > &Umu) { + ProjectOnGeneralGroup(Umu); auto det = Determinant(Umu); det = conjugate(det); @@ -366,11 +366,11 @@ class GaugeGroup { } template // reunitarise, resimplectify... previously ProjectSUn - static void ProjectGn(Lattice >, Nd> > &U) { + static void ProjectOnSpecialGroup(Lattice >, Nd> > &U) { // Reunitarise for (int mu = 0; mu < Nd; mu++) { auto Umu = PeekIndex(U, mu); - ProjectGn(Umu); + ProjectOnSpecialGroup(Umu); PokeIndex(U, Umu, mu); } } diff --git a/Grid/qcd/utils/SUn.impl b/Grid/qcd/utils/SUn.impl index 38337305..07bfc6e7 100644 --- a/Grid/qcd/utils/SUn.impl +++ b/Grid/qcd/utils/SUn.impl @@ -509,22 +509,22 @@ static void testGenerators(GroupName::SU) { } template -static void ProjectOnGaugeGroup(Lattice > > > &Umu, GroupName::SU) { +static void ProjectOnGeneralGroup(Lattice > > > &Umu, GroupName::SU) { Umu = ProjectOnGroup(Umu); } template -static void ProjectOnGaugeGroup(iScalar &r, GroupName::SU) { +static void ProjectOnGeneralGroup(iScalar &r, GroupName::SU) { r = ProjectOnGroup(r); } template -static void ProjectOnGaugeGroup(iVector &r, GroupName::SU) { +static void ProjectOnGeneralGroup(iVector &r, GroupName::SU) { r = ProjectOnGroup(r); } template ::TensorLevel == 0 >::type * =nullptr> -static void ProjectOnGaugeGroup(iMatrix &arg, GroupName::SU) { +static void ProjectOnGeneralGroup(iMatrix &arg, GroupName::SU) { arg = ProjectOnGroup(arg); } diff --git a/Grid/qcd/utils/Sp2n.impl b/Grid/qcd/utils/Sp2n.impl index 2ffb79ad..9cca5d49 100644 --- a/Grid/qcd/utils/Sp2n.impl +++ b/Grid/qcd/utils/Sp2n.impl @@ -254,22 +254,22 @@ static void testGenerators(GroupName::Sp) { } template -static void ProjectOnGaugeGroup(Lattice > > > &Umu, GroupName::Sp) { +static void ProjectOnGeneralGroup(Lattice > > > &Umu, GroupName::Sp) { Umu = ProjectOnSpGroup(Umu); } template -static void ProjectOnGaugeGroup(iScalar &r, GroupName::Sp) { +static void ProjectOnGeneralGroup(iScalar &r, GroupName::Sp) { r = ProjectOnSpGroup(r); } template -static void ProjectOnGaugeGroup(iVector &r, GroupName::Sp) { +static void ProjectOnGeneralGroup(iVector &r, GroupName::Sp) { r = ProjectOnSpGroup(r); } template ::TensorLevel == 0 >::type * =nullptr> -static void ProjectOnGaugeGroup(iMatrix &arg, GroupName::Sp) { +static void ProjectOnGeneralGroup(iMatrix &arg, GroupName::Sp) { arg = ProjectOnSpGroup(arg); } diff --git a/tests/sp2n/Test_project_on_Sp.cc b/tests/sp2n/Test_project_on_Sp.cc index 9f42610f..7737bc09 100644 --- a/tests/sp2n/Test_project_on_Sp.cc +++ b/tests/sp2n/Test_project_on_Sp.cc @@ -88,20 +88,20 @@ void test_group_projections(T U) { U = ProjectOnSpGroup(U); assert(is_element_of_sp2n_group(U)); - name = "ProjectOnGaugeGroup"; + name = "ProjectOnGeneralGroup"; std::cout << GridLogMessage << "Testing " << name << std::endl; std::cout << GridLogMessage << "Apply to deformed matrix" << std::endl; U = U + Delta * identity; - Sp::ProjectOnGaugeGroup(U); + Sp::ProjectOnGeneralGroup(U); assert(is_element_of_sp2n_group(U)); - name = "ProjectGn"; + name = "ProjectOnSpecialGroup"; std::cout << GridLogMessage << "Testing " << name << std::endl; std::cout << GridLogMessage << "Apply to deformed matrix" << std::endl; U = U + Delta * identity; - Sp::ProjectGn(U); + Sp::ProjectOnSpecialGroup(U); assert(is_element_of_sp2n_group(U)); } @@ -213,11 +213,10 @@ int main(int argc, char** argv) { LatticeColourMatrixD U(&Grid); // Will test resimplectification-related functionalities (from - // ProjectOnGaugeGroup, ProjectOnSpGroup, ProjectGn) and projection on the - // algebra (from ProjectSp2nAlgebra) we work with matrices with positive - // determinant so detU = 1 even if in principle ProjectOnGaugeGroup and - // ProjectOnSpGroup allow for detU=-1 so the checks will be the same for the - // three functions NB only ProjectGn is the proper simplectification function + // ProjectOnGeneralGroup, ProjectOnSpGroup, ProjectOnSpecialGroup) and projection on the + // algebra (from SpTa) + // ProjectOnGeneralGroup, ProjectOnSpGroup project on the non-special group allowi for complex determinants of module 1 + // ProjectOnSpecialGroup projects on the full gauge group providing a determinant equals to 1 std::vector pseeds({1, 2, 3, 4, 5}); GridParallelRNG pRNG(&Grid);