1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-09 23:45:36 +00:00

rename group projections based on determinants

This commit is contained in:
Alessandro Lupo 2023-05-10 14:50:52 +01:00
parent 3953312a93
commit aa9df63a05
5 changed files with 35 additions and 36 deletions

View File

@ -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)

View File

@ -323,37 +323,37 @@ class GaugeGroup {
}
}
template <int N> // reunitarise, resimplectify...
static void ProjectOnGaugeGroup(Lattice<iVector<iScalar<iMatrix<vComplexD, N> >, Nd> > &U) {
template <int N> // Projects on the general groups U(N), Sp(2N)xZ2 i.e. determinant il allowed a complex phase.
static void ProjectOnGeneralGroup(Lattice<iVector<iScalar<iMatrix<vComplexD, N> >, Nd> > &U) {
for (int mu = 0; mu < Nd; mu++) {
auto Umu = PeekIndex<LorentzIndex>(U, mu);
ProjectOnGaugeGroup(Umu);
ProjectOnGeneralGroup(Umu);
}
}
template <int N> // reunitarise, resimplectify...
static void ProjectOnGaugeGroup(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu) {
ProjectOnGaugeGroup(Umu, group_name());
template <int N>
static void ProjectOnGeneralGroup(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu) {
ProjectOnGeneralGroup(Umu, group_name());
}
template <class vtype>
static void ProjectOnGaugeGroup(iScalar<vtype> &r) {
ProjectOnGaugeGroup(r, group_name());
static void ProjectOnGeneralGroup(iScalar<vtype> &r) {
ProjectOnGeneralGroup(r, group_name());
}
template <class vtype, int N>
static void ProjectOnGaugeGroup(iVector<vtype,N> &r) {
ProjectOnGaugeGroup(r, group_name());
static void ProjectOnGeneralGroup(iVector<vtype,N> &r) {
ProjectOnGeneralGroup(r, group_name());
}
template <class vtype,int N, typename std::enable_if< GridTypeMapper<vtype>::TensorLevel == 0 >::type * =nullptr>
static void ProjectOnGaugeGroup(iMatrix<vtype,N> &arg) {
ProjectOnGaugeGroup(arg, group_name());
static void ProjectOnGeneralGroup(iMatrix<vtype,N> &arg) {
ProjectOnGeneralGroup(arg, group_name());
}
template <int N> // reunitarise, resimplectify... previously ProjectSUn
static void ProjectGn(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu) {
ProjectOnGaugeGroup(Umu);
template <int N> // Projects on SU(N), Sp(2N)
static void ProjectOnSpecialGroup(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu) {
ProjectOnGeneralGroup(Umu);
auto det = Determinant(Umu);
det = conjugate(det);
@ -366,11 +366,11 @@ class GaugeGroup {
}
template <int N> // reunitarise, resimplectify... previously ProjectSUn
static void ProjectGn(Lattice<iVector<iScalar<iMatrix<vComplexD, N> >, Nd> > &U) {
static void ProjectOnSpecialGroup(Lattice<iVector<iScalar<iMatrix<vComplexD, N> >, Nd> > &U) {
// Reunitarise
for (int mu = 0; mu < Nd; mu++) {
auto Umu = PeekIndex<LorentzIndex>(U, mu);
ProjectGn(Umu);
ProjectOnSpecialGroup(Umu);
PokeIndex<LorentzIndex>(U, Umu, mu);
}
}

View File

@ -509,22 +509,22 @@ static void testGenerators(GroupName::SU) {
}
template <int N>
static void ProjectOnGaugeGroup(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu, GroupName::SU) {
static void ProjectOnGeneralGroup(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu, GroupName::SU) {
Umu = ProjectOnGroup(Umu);
}
template <class vtype>
static void ProjectOnGaugeGroup(iScalar<vtype> &r, GroupName::SU) {
static void ProjectOnGeneralGroup(iScalar<vtype> &r, GroupName::SU) {
r = ProjectOnGroup(r);
}
template <class vtype, int N>
static void ProjectOnGaugeGroup(iVector<vtype,N> &r, GroupName::SU) {
static void ProjectOnGeneralGroup(iVector<vtype,N> &r, GroupName::SU) {
r = ProjectOnGroup(r);
}
template <class vtype,int N, typename std::enable_if< GridTypeMapper<vtype>::TensorLevel == 0 >::type * =nullptr>
static void ProjectOnGaugeGroup(iMatrix<vtype,N> &arg, GroupName::SU) {
static void ProjectOnGeneralGroup(iMatrix<vtype,N> &arg, GroupName::SU) {
arg = ProjectOnGroup(arg);
}

View File

@ -254,22 +254,22 @@ static void testGenerators(GroupName::Sp) {
}
template <int N>
static void ProjectOnGaugeGroup(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu, GroupName::Sp) {
static void ProjectOnGeneralGroup(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu, GroupName::Sp) {
Umu = ProjectOnSpGroup(Umu);
}
template <class vtype>
static void ProjectOnGaugeGroup(iScalar<vtype> &r, GroupName::Sp) {
static void ProjectOnGeneralGroup(iScalar<vtype> &r, GroupName::Sp) {
r = ProjectOnSpGroup(r);
}
template <class vtype, int N>
static void ProjectOnGaugeGroup(iVector<vtype,N> &r, GroupName::Sp) {
static void ProjectOnGeneralGroup(iVector<vtype,N> &r, GroupName::Sp) {
r = ProjectOnSpGroup(r);
}
template <class vtype,int N, typename std::enable_if< GridTypeMapper<vtype>::TensorLevel == 0 >::type * =nullptr>
static void ProjectOnGaugeGroup(iMatrix<vtype,N> &arg, GroupName::Sp) {
static void ProjectOnGeneralGroup(iMatrix<vtype,N> &arg, GroupName::Sp) {
arg = ProjectOnSpGroup(arg);
}

View File

@ -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<Nc>::ProjectOnGaugeGroup(U);
Sp<Nc>::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<Nc>::ProjectGn(U);
Sp<Nc>::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<int> pseeds({1, 2, 3, 4, 5});
GridParallelRNG pRNG(&Grid);