From 536542c3a6a27e8f15131c650bf24c4403a58252 Mon Sep 17 00:00:00 2001 From: kalmar Date: Thu, 27 Jul 2017 22:05:15 +0200 Subject: [PATCH] Introduce {Perm,DirectProd}Character <: AbstractCharacter <: Function --- src/Projections.jl | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/Projections.jl b/src/Projections.jl index 3a88bdd..d1cd5e2 100644 --- a/src/Projections.jl +++ b/src/Projections.jl @@ -1,11 +1,28 @@ ############################################################################### # -# Character of DirectProducts +# Characters of Symmetric Group and DirectProduct # ############################################################################### -function epsilon(i, g::DirectProductGroupElem) - return reduce(*, 1, ((-1)^isone(g.elts[j]) for j in 1:i)) +abstract AbstractCharacter <: Function + +immutable PermCharacter <: AbstractCharacter + p::Partition +end + +immutable DirectProdCharacter <: AbstractCharacter + i::Int +end + +function (chi::PermCharacter)(g::Nemo.perm) + R = Nemo.partitionseq(chi.p) + p = Partition(Nemo.permtype(g)) + return Int(Nemo.MN1inner(R, p, 1, Nemo._charvalsTable)) +end + +## NOTE: this works only for Z/2!!!! +function (chi::DirectProdCharacter)(g::DirectProductGroupElem) + return reduce(*, 1, ((-1)^isone(g.elts[j]) for j in 1:chi.i)) end ###############################################################################