1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-14 01:35:36 +00:00

First attempt on #30

This commit is contained in:
Julian Lenz 2023-06-15 15:09:37 +01:00
parent b0646ca187
commit 116d90b0ee
4 changed files with 28 additions and 26 deletions

View File

@ -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::ProjectOnGeneralGroup(U_v[ss](mu)); 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();

View File

@ -324,7 +324,7 @@ class GaugeGroup {
} }
template <int N> // Projects on the general groups U(N), Sp(2N)xZ2 i.e. determinant il allowed a complex phase. 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) { accelerator_inline 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);
ProjectOnGeneralGroup(Umu); ProjectOnGeneralGroup(Umu);
@ -332,23 +332,23 @@ class GaugeGroup {
} }
template <int N> template <int N>
static void ProjectOnGeneralGroup(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu) { accelerator_inline static Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > ProjectOnGeneralGroup(const Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu) {
ProjectOnGeneralGroup(Umu, group_name()); return ProjectOnGeneralGroup(Umu, group_name());
} }
template <class vtype> template <class vtype>
static void ProjectOnGeneralGroup(iScalar<vtype> &r) { accelerator_inline static iScalar<vtype> ProjectOnGeneralGroup(const iScalar<vtype> &r) {
ProjectOnGeneralGroup(r, group_name()); return ProjectOnGeneralGroup(r, group_name());
} }
template <class vtype, int N> template <class vtype, int N>
static void ProjectOnGeneralGroup(iVector<vtype,N> &r) { accelerator_inline static iVector<vtype,N> ProjectOnGeneralGroup(const iVector<vtype,N> &r) {
ProjectOnGeneralGroup(r, group_name()); return 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 ProjectOnGeneralGroup(iMatrix<vtype,N> &arg) { accelerator_inline static iMatrix<vtype,N> ProjectOnGeneralGroup(const iMatrix<vtype,N> &arg) {
ProjectOnGeneralGroup(arg, group_name()); return ProjectOnGeneralGroup(arg, group_name());
} }
template <int N> // Projects on SU(N), Sp(2N) template <int N> // Projects on SU(N), Sp(2N)

View File

@ -509,23 +509,24 @@ static void testGenerators(GroupName::SU) {
} }
template <int N> template <int N>
static void ProjectOnGeneralGroup(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu, GroupName::SU) { accelerator_inline static Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > >
Umu = ProjectOnGroup(Umu); ProjectOnGeneralGroup(const Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu, GroupName::SU) {
return ProjectOnGroup(Umu);
} }
template <class vtype> template <class vtype>
static void ProjectOnGeneralGroup(iScalar<vtype> &r, GroupName::SU) { accelerator_inline static iScalar<vtype> ProjectOnGeneralGroup(const iScalar<vtype> &r, GroupName::SU) {
r = ProjectOnGroup(r); return ProjectOnGroup(r);
} }
template <class vtype, int N> template <class vtype, int N>
static void ProjectOnGeneralGroup(iVector<vtype,N> &r, GroupName::SU) { accelerator_inline static iVector<vtype,N> ProjectOnGeneralGroup(const iVector<vtype,N> &r, GroupName::SU) {
r = ProjectOnGroup(r); return 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 ProjectOnGeneralGroup(iMatrix<vtype,N> &arg, GroupName::SU) { accelerator_inline static iMatrix<vtype,N> ProjectOnGeneralGroup(const iMatrix<vtype,N> &arg, GroupName::SU) {
arg = ProjectOnGroup(arg); return ProjectOnGroup(arg);
} }
template <typename LatticeMatrixType> template <typename LatticeMatrixType>

View File

@ -254,23 +254,24 @@ static void testGenerators(GroupName::Sp) {
} }
template <int N> template <int N>
static void ProjectOnGeneralGroup(Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu, GroupName::Sp) { accelerator_inline static Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > >
Umu = ProjectOnSpGroup(Umu); ProjectOnGeneralGroup(const Lattice<iScalar<iScalar<iMatrix<vComplexD, N> > > > &Umu, GroupName::Sp) {
return ProjectOnSpGroup(Umu);
} }
template <class vtype> template <class vtype>
static void ProjectOnGeneralGroup(iScalar<vtype> &r, GroupName::Sp) { accelerator_inline static iScalar<vtype> ProjectOnGeneralGroup(const iScalar<vtype> &r, GroupName::Sp) {
r = ProjectOnSpGroup(r); return ProjectOnSpGroup(r);
} }
template <class vtype, int N> template <class vtype, int N>
static void ProjectOnGeneralGroup(iVector<vtype,N> &r, GroupName::Sp) { accelerator_inline static iVector<vtype,N> ProjectOnGeneralGroup(const iVector<vtype,N> &r, GroupName::Sp) {
r = ProjectOnSpGroup(r); return 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 ProjectOnGeneralGroup(iMatrix<vtype,N> &arg, GroupName::Sp) { accelerator_inline static iMatrix<vtype,N> ProjectOnGeneralGroup(const iMatrix<vtype,N> &arg, GroupName::Sp) {
arg = ProjectOnSpGroup(arg); return ProjectOnSpGroup(arg);
} }
template <typename LatticeMatrixType> template <typename LatticeMatrixType>