mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-10 07:55:35 +00:00
rename group projections based on determinants
This commit is contained in:
parent
3953312a93
commit
aa9df63a05
@ -145,7 +145,7 @@ public:
|
|||||||
accelerator_for(ss, P.Grid()->oSites(),1,{
|
accelerator_for(ss, P.Grid()->oSites(),1,{
|
||||||
for (int mu = 0; mu < Nd; mu++) {
|
for (int mu = 0; mu < Nd; mu++) {
|
||||||
U_v[ss](mu) = Exponentiate(P_v[ss](mu), ep, Nexp) * U_v[ss](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();
|
//auto end = std::chrono::high_resolution_clock::now();
|
||||||
@ -166,7 +166,7 @@ public:
|
|||||||
|
|
||||||
static inline void Project(Field &U)
|
static inline void Project(Field &U)
|
||||||
{
|
{
|
||||||
Group::ProjectGn(U);
|
Group::ProjectOnSpecialGroup(U);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void HotConfiguration(GridParallelRNG &pRNG, Field &U)
|
static inline void HotConfiguration(GridParallelRNG &pRNG, Field &U)
|
||||||
|
@ -323,37 +323,37 @@ class GaugeGroup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <int N> // reunitarise, resimplectify...
|
template <int N> // Projects on the general groups U(N), Sp(2N)xZ2 i.e. determinant il allowed a complex phase.
|
||||||
static void ProjectOnGaugeGroup(Lattice<iVector<iScalar<iMatrix<vComplexD, N> >, Nd> > &U) {
|
static void ProjectOnGeneralGroup(Lattice<iVector<iScalar<iMatrix<vComplexD, N> >, Nd> > &U) {
|
||||||
for (int mu = 0; mu < Nd; mu++) {
|
for (int mu = 0; mu < Nd; mu++) {
|
||||||
auto Umu = PeekIndex<LorentzIndex>(U, mu);
|
auto Umu = PeekIndex<LorentzIndex>(U, mu);
|
||||||
ProjectOnGaugeGroup(Umu);
|
ProjectOnGeneralGroup(Umu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <int N> // reunitarise, resimplectify...
|
template <int N>
|
||||||
static void ProjectOnGaugeGroup(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu) {
|
static void ProjectOnGeneralGroup(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu) {
|
||||||
ProjectOnGaugeGroup(Umu, group_name());
|
ProjectOnGeneralGroup(Umu, group_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class vtype>
|
template <class vtype>
|
||||||
static void ProjectOnGaugeGroup(iScalar<vtype> &r) {
|
static void ProjectOnGeneralGroup(iScalar<vtype> &r) {
|
||||||
ProjectOnGaugeGroup(r, group_name());
|
ProjectOnGeneralGroup(r, group_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class vtype, int N>
|
template <class vtype, int N>
|
||||||
static void ProjectOnGaugeGroup(iVector<vtype,N> &r) {
|
static void ProjectOnGeneralGroup(iVector<vtype,N> &r) {
|
||||||
ProjectOnGaugeGroup(r, group_name());
|
ProjectOnGeneralGroup(r, group_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class vtype,int N, typename std::enable_if< GridTypeMapper<vtype>::TensorLevel == 0 >::type * =nullptr>
|
template <class vtype,int N, typename std::enable_if< GridTypeMapper<vtype>::TensorLevel == 0 >::type * =nullptr>
|
||||||
static void ProjectOnGaugeGroup(iMatrix<vtype,N> &arg) {
|
static void ProjectOnGeneralGroup(iMatrix<vtype,N> &arg) {
|
||||||
ProjectOnGaugeGroup(arg, group_name());
|
ProjectOnGeneralGroup(arg, group_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <int N> // reunitarise, resimplectify... previously ProjectSUn
|
template <int N> // Projects on SU(N), Sp(2N)
|
||||||
static void ProjectGn(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu) {
|
static void ProjectOnSpecialGroup(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu) {
|
||||||
ProjectOnGaugeGroup(Umu);
|
ProjectOnGeneralGroup(Umu);
|
||||||
auto det = Determinant(Umu);
|
auto det = Determinant(Umu);
|
||||||
|
|
||||||
det = conjugate(det);
|
det = conjugate(det);
|
||||||
@ -366,11 +366,11 @@ class GaugeGroup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <int N> // reunitarise, resimplectify... previously ProjectSUn
|
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
|
// Reunitarise
|
||||||
for (int mu = 0; mu < Nd; mu++) {
|
for (int mu = 0; mu < Nd; mu++) {
|
||||||
auto Umu = PeekIndex<LorentzIndex>(U, mu);
|
auto Umu = PeekIndex<LorentzIndex>(U, mu);
|
||||||
ProjectGn(Umu);
|
ProjectOnSpecialGroup(Umu);
|
||||||
PokeIndex<LorentzIndex>(U, Umu, mu);
|
PokeIndex<LorentzIndex>(U, Umu, mu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -509,22 +509,22 @@ static void testGenerators(GroupName::SU) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <int N>
|
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);
|
Umu = ProjectOnGroup(Umu);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class vtype>
|
template <class vtype>
|
||||||
static void ProjectOnGaugeGroup(iScalar<vtype> &r, GroupName::SU) {
|
static void ProjectOnGeneralGroup(iScalar<vtype> &r, GroupName::SU) {
|
||||||
r = ProjectOnGroup(r);
|
r = ProjectOnGroup(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class vtype, int N>
|
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);
|
r = ProjectOnGroup(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class vtype,int N, typename std::enable_if< GridTypeMapper<vtype>::TensorLevel == 0 >::type * =nullptr>
|
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);
|
arg = ProjectOnGroup(arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,22 +254,22 @@ static void testGenerators(GroupName::Sp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <int N>
|
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);
|
Umu = ProjectOnSpGroup(Umu);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class vtype>
|
template <class vtype>
|
||||||
static void ProjectOnGaugeGroup(iScalar<vtype> &r, GroupName::Sp) {
|
static void ProjectOnGeneralGroup(iScalar<vtype> &r, GroupName::Sp) {
|
||||||
r = ProjectOnSpGroup(r);
|
r = ProjectOnSpGroup(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class vtype, int N>
|
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);
|
r = ProjectOnSpGroup(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class vtype,int N, typename std::enable_if< GridTypeMapper<vtype>::TensorLevel == 0 >::type * =nullptr>
|
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);
|
arg = ProjectOnSpGroup(arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,20 +88,20 @@ void test_group_projections(T U) {
|
|||||||
U = ProjectOnSpGroup(U);
|
U = ProjectOnSpGroup(U);
|
||||||
assert(is_element_of_sp2n_group(U));
|
assert(is_element_of_sp2n_group(U));
|
||||||
|
|
||||||
name = "ProjectOnGaugeGroup";
|
name = "ProjectOnGeneralGroup";
|
||||||
std::cout << GridLogMessage << "Testing " << name << std::endl;
|
std::cout << GridLogMessage << "Testing " << name << std::endl;
|
||||||
std::cout << GridLogMessage << "Apply to deformed matrix" << std::endl;
|
std::cout << GridLogMessage << "Apply to deformed matrix" << std::endl;
|
||||||
|
|
||||||
U = U + Delta * identity;
|
U = U + Delta * identity;
|
||||||
Sp<Nc>::ProjectOnGaugeGroup(U);
|
Sp<Nc>::ProjectOnGeneralGroup(U);
|
||||||
assert(is_element_of_sp2n_group(U));
|
assert(is_element_of_sp2n_group(U));
|
||||||
|
|
||||||
name = "ProjectGn";
|
name = "ProjectOnSpecialGroup";
|
||||||
std::cout << GridLogMessage << "Testing " << name << std::endl;
|
std::cout << GridLogMessage << "Testing " << name << std::endl;
|
||||||
std::cout << GridLogMessage << "Apply to deformed matrix" << std::endl;
|
std::cout << GridLogMessage << "Apply to deformed matrix" << std::endl;
|
||||||
|
|
||||||
U = U + Delta * identity;
|
U = U + Delta * identity;
|
||||||
Sp<Nc>::ProjectGn(U);
|
Sp<Nc>::ProjectOnSpecialGroup(U);
|
||||||
assert(is_element_of_sp2n_group(U));
|
assert(is_element_of_sp2n_group(U));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,11 +213,10 @@ int main(int argc, char** argv) {
|
|||||||
LatticeColourMatrixD U(&Grid);
|
LatticeColourMatrixD U(&Grid);
|
||||||
|
|
||||||
// Will test resimplectification-related functionalities (from
|
// Will test resimplectification-related functionalities (from
|
||||||
// ProjectOnGaugeGroup, ProjectOnSpGroup, ProjectGn) and projection on the
|
// ProjectOnGeneralGroup, ProjectOnSpGroup, ProjectOnSpecialGroup) and projection on the
|
||||||
// algebra (from ProjectSp2nAlgebra) we work with matrices with positive
|
// algebra (from SpTa)
|
||||||
// determinant so detU = 1 even if in principle ProjectOnGaugeGroup and
|
// ProjectOnGeneralGroup, ProjectOnSpGroup project on the non-special group allowi for complex determinants of module 1
|
||||||
// ProjectOnSpGroup allow for detU=-1 so the checks will be the same for the
|
// ProjectOnSpecialGroup projects on the full gauge group providing a determinant equals to 1
|
||||||
// three functions NB only ProjectGn is the proper simplectification function
|
|
||||||
|
|
||||||
std::vector<int> pseeds({1, 2, 3, 4, 5});
|
std::vector<int> pseeds({1, 2, 3, 4, 5});
|
||||||
GridParallelRNG pRNG(&Grid);
|
GridParallelRNG pRNG(&Grid);
|
||||||
|
Loading…
Reference in New Issue
Block a user