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

DimensionHelper for 2index irreps

This commit is contained in:
Alessandro Lupo 2023-05-21 16:56:06 +01:00
parent 3c1e5e9517
commit af091e0881
2 changed files with 21 additions and 11 deletions

View File

@ -31,15 +31,27 @@ enum TwoIndexSymmetry { Symmetric = 1, AntiSymmetric = -1 };
inline Real delta(int a, int b) { return (a == b) ? 1.0 : 0.0; }
template <int nc, TwoIndexSymmetry S, class group_name>
struct DimensionHelper;
template <int nc, TwoIndexSymmetry S>
struct DimensionHelper<nc, S, GroupName::SU> {
static const int Dimension = nc * (nc + S) + S;
};
template <int nc>
struct DimensionHelper<nc, Symmetric, GroupName::Sp> {
static const int Dimension = nc * (nc + 1) / 2;
};
template <int nc>
struct DimensionHelper<nc, AntiSymmetric, GroupName::Sp> {
static const int Dimension = (nc / 2) * (nc - 1) - 1;
};
template <int ncolour, TwoIndexSymmetry S, class group_name>
class GaugeGroupTwoIndex : public GaugeGroup<ncolour, group_name> {
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
// 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
@ -47,9 +59,8 @@ class GaugeGroupTwoIndex : public GaugeGroup<ncolour, group_name> {
"ngroup is only implemented for SU and Sp currently.");
static const int ngroup =
std::is_same<group_name, GroupName::SU>::value ? ncolour : ncolour / 2;
static const int Dimension = std::is_same<group_name, GroupName::SU>::value
? ncolour * (ncolour + S) / 2
: ngroup * (ncolour + S) + S;
static const int Dimension =
DimensionHelper<ncolour, S, group_name>::Dimension;
static const int NumGenerators =
GaugeGroup<ncolour, group_name>::AlgebraDimension;

View File

@ -32,8 +32,7 @@ int main(int argc, char** argv) {
std::cout << GridLogMessage << "2as dimension is " << this_irrep_dim << std::endl;
std::cout << GridLogMessage << "algebra dimension is " << this_algebra_dim << std::endl;
realA = Sp_TwoIndex<this_nc, AntiSymmetric>::Dimension + Sp_TwoIndex<this_nc, Symmetric>::Dimension;
realB = Sp<this_nc>::Dimension*Sp<this_nc>::Dimension;
assert ( realA == realB);
assert ( realA == this_nc * this_nc - 1); // Nc x Nc = dim(2indxS) + dim(2indxAS) + dim(singlet)
std::cout << GridLogMessage << "checking base is antisymmetric " << std::endl;
for (int a=0; a < this_irrep_dim; a++)