diff --git a/docs/src/Groups/group_characters.md b/docs/src/Groups/group_characters.md index f7618467996..5f0f6dcafd2 100644 --- a/docs/src/Groups/group_characters.md +++ b/docs/src/Groups/group_characters.md @@ -140,6 +140,7 @@ orders_centralizers orders_class_representatives ordinary_table(tbl::GAPGroupCharacterTable) trivial_character(tbl::GAPGroupCharacterTable) +regular_character(tbl::GAPGroupCharacterTable) ``` ## Construct group characters from groups @@ -150,6 +151,7 @@ natural_character(G::Union{MatrixGroup{QQFieldElem}, MatrixGroup{AbsSimpleNumFie natural_character(G::MatrixGroup{T, MT}) where T <: FinFieldElem where MT natural_character(rho::GAPGroupHomomorphism) trivial_character(G::GAPGroup) +regular_character(G::GAPGroup) ``` ## Operations for group characters diff --git a/src/Groups/group_characters.jl b/src/Groups/group_characters.jl index 4d9530f965a..57032202148 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,48 @@ 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) + return regular_character(character_table(G)) +end + +@doc raw""" + regular_character(tbl::GAPGroupCharacterTable) + +Return the regular character of `tbl`. + +# Examples +```jldoctest +julia> tbl = character_table(symmetric_group(3)); + +julia> values(regular_character(tbl)) +3-element Vector{QQAbElem{AbsSimpleNumFieldElem}}: + 6 + 0 + 0 +``` +""" +function regular_character(tbl::GAPGroupCharacterTable) + val = ZZRingElem[0 for i in 1:length(tbl)] + val[1] = order(group(tbl)) + return class_function(tbl, val) +end + @doc raw""" natural_character(G::PermGroup) diff --git a/src/exports.jl b/src/exports.jl index 6c764fdbddb..3f58a807edb 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 1b03f38d7f7..a14c037dd8c 100644 --- a/test/Groups/group_characters.jl +++ b/test/Groups/group_characters.jl @@ -844,6 +844,10 @@ end @test tr == t[end] @test tr == trivial_character(g) @test !is_faithful(tr) + re = regular_character(g) + @test coordinates(re) == degree.(t) + re = regular_character(t) + @test coordinates(re) == degree.(t) chi = t[2] @test chi isa Oscar.GAPGroupClassFunction @test chi[4] == t[2,4]