diff --git a/src/Groups/group_characters.jl b/src/Groups/group_characters.jl index 4d9530f965ac..71de62111621 100644 --- a/src/Groups/group_characters.jl +++ b/src/Groups/group_characters.jl @@ -1673,7 +1673,7 @@ function class_function(tbl::GAPGroupCharacterTable, values::GapObj) return GAPGroupClassFunction(tbl, values) end -function class_function(tbl::GAPGroupCharacterTable, values::Vector{<:QQAbElem}) +function class_function(tbl::GAPGroupCharacterTable, values::Vector{<:Union{Integer, ZZRingElem, Rational, QQFieldElem, QQAbElem}}) gapvalues = GapObj([GAP.Obj(x) for x in values]) return GAPGroupClassFunction(tbl, GAPWrap.ClassFunction(GAPTable(tbl), gapvalues)) end @@ -1683,7 +1683,7 @@ function class_function(G::GAPGroup, values::GapObj) return GAPGroupClassFunction(character_table(G), values) end -function class_function(G::GAPGroup, values::Vector{<:QQAbElem}) +function class_function(G::GAPGroup, values::Vector{<:Union{Integer, ZZRingElem, Rational, QQFieldElem, QQAbElem}}) return class_function(character_table(G), values) end @@ -1724,6 +1724,28 @@ function trivial_character(G::GAPGroup) return class_function(G, [val for i in 1:Int(number_of_conjugacy_classes(G))]) end +@doc raw""" + regular_character(G::GAPGroup) + +Return the regular character of `G`. + +# Examples +```jldoctest +julia> G = symmetric_group(3); + +julia> values(regular_character(G)) +3-element Vector{QQAbElem{AbsSimpleNumFieldElem}}: + 6 + 0 + 0 +``` +""" +function regular_character(G::GAPGroup) + ccl = conjugacy_classes(character_table(G)) + val = ZZRingElem[is_one(representative(c)) ? order(G) : zero(ZZ) for c in ccl] + return class_function(G, val) +end + @doc raw""" natural_character(G::PermGroup) diff --git a/src/exports.jl b/src/exports.jl index 6c764fdbddb7..3f58a807edb0 100644 --- a/src/exports.jl +++ b/src/exports.jl @@ -1264,6 +1264,7 @@ export register_morphism! export regular_120_cell export regular_24_cell export regular_600_cell +export regular_character export regular_triangulation export regular_triangulations export relations diff --git a/test/Groups/group_characters.jl b/test/Groups/group_characters.jl index 1b03f38d7f71..ad02b87a4b0e 100644 --- a/test/Groups/group_characters.jl +++ b/test/Groups/group_characters.jl @@ -844,6 +844,8 @@ end @test tr == t[end] @test tr == trivial_character(g) @test !is_faithful(tr) + re = regular_character(g) + @test coordinates(re) == degree.(t) chi = t[2] @test chi isa Oscar.GAPGroupClassFunction @test chi[4] == t[2,4]