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

Merge pull request #24 from LupoA/sp2n/fix_static_assert_symmetric

Move static_assert inside of function
This commit is contained in:
Alessandro Lupo 2023-05-26 11:13:50 +01:00 committed by GitHub
commit 92a282f2d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,12 +34,6 @@ inline Real delta(int a, int b) { return (a == b) ? 1.0 : 0.0; }
template <int ncolour, TwoIndexSymmetry S, class group_name> template <int ncolour, TwoIndexSymmetry S, class group_name>
class GaugeGroupTwoIndex : public GaugeGroup<ncolour, group_name> { class GaugeGroupTwoIndex : public GaugeGroup<ncolour, group_name> {
public: public:
static_assert(
std::is_same<group_name, GroupName::Sp>::value ? S != Symmetric : true,
"The symmetric two-index representation of Sp(2N) does not work "
"currently. If you want to use it, you need to implement the equivalent "
"of Eq. (27) and (28) from https://doi.org/10.48550/arXiv.2202.05516.");
// The chosen convention is that we are taking ncolour to be N in SU<N> but 2N // The chosen convention is that we are taking ncolour to be N in SU<N> but 2N
// in Sp(2N). ngroup is equal to N for SU but 2N/2 = N for Sp(2N). // in Sp(2N). ngroup is equal to N for SU but 2N/2 = N for Sp(2N).
static_assert(std::is_same<group_name, GroupName::SU>::value or static_assert(std::is_same<group_name, GroupName::SU>::value or
@ -84,6 +78,17 @@ class GaugeGroupTwoIndex : public GaugeGroup<ncolour, group_name> {
template <class cplx> template <class cplx>
static void base(int Index, iGroupMatrix<cplx> &eij) { static void base(int Index, iGroupMatrix<cplx> &eij) {
// This is inside of this function because you can't use this class without
// this function but you can still use its static constants because as a
// template the following static_assert is only triggered if this function
// is instantiated which in turn happens only when it's used.
static_assert(
std::is_same<group_name, GroupName::Sp>::value ? S != Symmetric : true,
"The symmetric two-index representation of Sp(2N) does not work "
"currently. If you want to use it, you need to implement the "
"equivalent of Eq. (27) and (28) from "
"https://doi.org/10.48550/arXiv.2202.05516.");
// returns (e)^(ij)_{kl} necessary for change of base U_F -> U_R // returns (e)^(ij)_{kl} necessary for change of base U_F -> U_R
assert(Index < Dimension); assert(Index < Dimension);
eij = Zero(); eij = Zero();
@ -96,10 +101,9 @@ class GaugeGroupTwoIndex : public GaugeGroup<ncolour, group_name> {
for (int i = 1; i < ncolour; i++) { for (int i = 1; i < ncolour; i++) {
for (int j = 0; j < i; j++) { for (int j = 0; j < i; j++) {
a[counter][0] = i; a[counter][0] = i;
if (j==0 && ngroup == ncolour/2 && i==ngroup+j) { if (j == 0 && ngroup == ncolour / 2 && i == ngroup + j) {
//std::cout << "skipping" << std::endl; // for Sp2n this vanishes identically. j = j + 1;
j = j+1; }
}
a[counter][1] = j; a[counter][1] = j;
counter++; counter++;
} }