Skip to content

Commit

Permalink
feat: add regular_character
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma committed Feb 20, 2024
1 parent a73b844 commit a61221d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
26 changes: 24 additions & 2 deletions src/Groups/group_characters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/Groups/group_characters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit a61221d

Please sign in to comment.