Skip to content

Commit e86fe09

Browse files
authored
support group properties for character tables (oscar-system#3449)
and character value access by class names
1 parent f468cca commit e86fe09

File tree

4 files changed

+257
-10
lines changed

4 files changed

+257
-10
lines changed

docs/src/Groups/basics.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ is_finite(G::GAPGroup)
7070
is_trivial(G::GAPGroup)
7171
is_cyclic(G::GAPGroup)
7272
is_abelian(G::GAPGroup)
73-
is_elementary_abelian
74-
is_pgroup
75-
is_pgroup_with_prime
76-
is_nilpotent
77-
is_supersolvable
78-
is_solvable
79-
is_perfect
73+
is_elementary_abelian(G::GAPGroup)
74+
is_pgroup(G::GAPGroup)
75+
is_pgroup_with_prime(::Type{T}, G::GAPGroup) where T <: IntegerUnion
76+
is_nilpotent(G::GAPGroup)
77+
is_supersolvable(G::GAPGroup)
78+
is_solvable(G::GAPGroup)
79+
is_perfect(G::GAPGroup)
8080
is_simple(G::GAPGroup)
8181
is_almost_simple(G::GAPGroup)
82-
is_quasisimple
83-
is_sporadic_simple
82+
is_quasisimple(G::GAPGroup)
83+
is_sporadic_simple(G::GAPGroup)
8484
is_finitely_generated(G::GAPGroup)
8585
```
8686

docs/src/Groups/group_characters.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,24 @@ trivial_character(tbl::GAPGroupCharacterTable)
143143
regular_character(tbl::GAPGroupCharacterTable)
144144
```
145145

146+
The following properties of a group can be read off from its
147+
character table.
148+
Therefore it is supported to call these functions with a character table.
149+
150+
```@docs
151+
is_abelian(tbl::GAPGroupCharacterTable)
152+
is_almost_simple(tbl::GAPGroupCharacterTable)
153+
is_cyclic(tbl::GAPGroupCharacterTable)
154+
is_elementary_abelian(tbl::GAPGroupCharacterTable)
155+
is_nilpotent(tbl::GAPGroupCharacterTable)
156+
is_perfect(tbl::GAPGroupCharacterTable)
157+
is_quasisimple(tbl::GAPGroupCharacterTable)
158+
is_simple(tbl::GAPGroupCharacterTable)
159+
is_solvable(tbl::GAPGroupCharacterTable)
160+
is_sporadic_simple(tbl::GAPGroupCharacterTable)
161+
is_supersolvable(tbl::GAPGroupCharacterTable)
162+
```
163+
146164
## Construct group characters from groups
147165

148166
```@docs

src/Groups/group_characters.jl

Lines changed: 214 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1642,6 +1642,212 @@ function known_class_fusions(tbl::GAPGroupCharacterTable)
16421642
end
16431643

16441644

1645+
##############################################################################
1646+
##
1647+
## mathematical properties of a group that can be read off from its
1648+
## character table
1649+
##
1650+
1651+
"""
1652+
is_abelian(tbl::GAPGroupCharacterTable)
1653+
1654+
Return whether `tbl` is the ordinary character table of an abelian group,
1655+
see [`is_abelian(G::GAPGroup)`](@ref).
1656+
1657+
# Examples
1658+
```jldoctest
1659+
julia> is_abelian(character_table("A5"))
1660+
false
1661+
1662+
julia> is_abelian(character_table("C2"))
1663+
true
1664+
```
1665+
"""
1666+
@gapattribute is_abelian(tbl::GAPGroupCharacterTable) = GAP.Globals.IsAbelian(GAPTable(tbl))::Bool
1667+
1668+
1669+
"""
1670+
is_almost_simple(tbl::GAPGroupCharacterTable)
1671+
1672+
Return whether `tbl` is the ordinary character table of an almost simple group,
1673+
see [`is_almost_simple(G::GAPGroup)`](@ref).
1674+
1675+
# Examples
1676+
```jldoctest
1677+
julia> is_almost_simple(character_table("S5"))
1678+
true
1679+
1680+
julia> is_almost_simple(character_table("S4"))
1681+
false
1682+
```
1683+
"""
1684+
@gapattribute is_almost_simple(tbl::GAPGroupCharacterTable) = GAP.Globals.IsAlmostSimple(GAPTable(tbl))::Bool
1685+
1686+
1687+
"""
1688+
is_cyclic(tbl::GAPGroupCharacterTable)
1689+
1690+
Return whether `tbl` is the ordinary character table of a cyclic group,
1691+
see [`is_cyclic(G::GAPGroup)`](@ref).
1692+
1693+
# Examples
1694+
```jldoctest
1695+
julia> is_cyclic(character_table("C2"))
1696+
true
1697+
1698+
julia> is_cyclic(character_table("S4"))
1699+
false
1700+
```
1701+
"""
1702+
@gapattribute is_cyclic(tbl::GAPGroupCharacterTable) = GAP.Globals.IsCyclic(GAPTable(tbl))::Bool
1703+
1704+
1705+
"""
1706+
is_elementary_abelian(tbl::GAPGroupCharacterTable)
1707+
1708+
Return whether `tbl` is the ordinary character table of
1709+
an elementary abelian group,
1710+
see [`is_elementary_abelian(G::GAPGroup)`](@ref).
1711+
1712+
# Examples
1713+
```jldoctest
1714+
julia> is_elementary_abelian(character_table("C2"))
1715+
true
1716+
1717+
julia> is_elementary_abelian(character_table("S4"))
1718+
false
1719+
```
1720+
"""
1721+
@gapattribute is_elementary_abelian(tbl::GAPGroupCharacterTable) = GAP.Globals.IsElementaryAbelian(GAPTable(tbl))::Bool
1722+
1723+
1724+
"""
1725+
is_nilpotent(tbl::GAPGroupCharacterTable)
1726+
1727+
Return whether `tbl` is the ordinary character table of a nilpotent group,
1728+
see [`is_nilpotent(G::GAPGroup)`](@ref).
1729+
1730+
# Examples
1731+
```jldoctest
1732+
julia> is_nilpotent(character_table("C2"))
1733+
true
1734+
1735+
julia> is_nilpotent(character_table("S4"))
1736+
false
1737+
```
1738+
"""
1739+
@gapattribute is_nilpotent(tbl::GAPGroupCharacterTable) = GAP.Globals.IsNilpotent(GAPTable(tbl))::Bool
1740+
1741+
1742+
"""
1743+
is_perfect(tbl::GAPGroupCharacterTable)
1744+
1745+
Return whether `tbl` is the ordinary character table of a perfect group,
1746+
see [`is_perfect(G::GAPGroup)`](@ref).
1747+
1748+
# Examples
1749+
```jldoctest
1750+
julia> is_perfect(character_table("A5"))
1751+
true
1752+
1753+
julia> is_perfect(character_table("S4"))
1754+
false
1755+
```
1756+
"""
1757+
@gapattribute is_perfect(tbl::GAPGroupCharacterTable) = GAP.Globals.IsPerfect(GAPTable(tbl))::Bool
1758+
1759+
1760+
"""
1761+
is_quasisimple(tbl::GAPGroupCharacterTable)
1762+
1763+
Return whether `tbl` is the ordinary character table of a quasisimple group,
1764+
see [`is_quasisimple(G::GAPGroup)`](@ref).
1765+
1766+
# Examples
1767+
```jldoctest
1768+
julia> is_quasisimple(character_table("A5"))
1769+
true
1770+
1771+
julia> is_quasisimple(character_table("S4"))
1772+
false
1773+
```
1774+
"""
1775+
@gapattribute is_quasisimple(tbl::GAPGroupCharacterTable) = GAP.Globals.IsQuasisimple(GAPTable(tbl))::Bool
1776+
1777+
1778+
"""
1779+
is_simple(tbl::GAPGroupCharacterTable)
1780+
1781+
Return whether `tbl` is the ordinary character table of a simple group,
1782+
see [`is_simple(G::GAPGroup)`](@ref).
1783+
1784+
# Examples
1785+
```jldoctest
1786+
julia> is_simple(character_table("A5"))
1787+
true
1788+
1789+
julia> is_simple(character_table("S4"))
1790+
false
1791+
```
1792+
"""
1793+
@gapattribute is_simple(tbl::GAPGroupCharacterTable) = GAP.Globals.IsSimple(GAPTable(tbl))::Bool
1794+
1795+
1796+
"""
1797+
is_solvable(tbl::GAPGroupCharacterTable)
1798+
1799+
Return whether `tbl` is the ordinary character table of a solvable group,
1800+
see [`is_solvable(G::GAPGroup)`](@ref).
1801+
1802+
# Examples
1803+
```jldoctest
1804+
julia> is_solvable(character_table("A5"))
1805+
false
1806+
1807+
julia> is_solvable(character_table("S4"))
1808+
true
1809+
```
1810+
"""
1811+
@gapattribute is_solvable(tbl::GAPGroupCharacterTable) = GAP.Globals.IsSolvable(GAPTable(tbl))::Bool
1812+
1813+
1814+
"""
1815+
is_sporadic_simple(tbl::GAPGroupCharacterTable)
1816+
1817+
Return whether `tbl` is the ordinary character table of
1818+
a sporadic simple group,
1819+
see [`is_sporadic_simple(G::GAPGroup)`](@ref).
1820+
1821+
# Examples
1822+
```jldoctest
1823+
julia> is_sporadic_simple(character_table("A5"))
1824+
false
1825+
1826+
julia> is_sporadic_simple(character_table("M11"))
1827+
true
1828+
```
1829+
"""
1830+
@gapattribute is_sporadic_simple(tbl::GAPGroupCharacterTable) = GAP.Globals.IsSporadicSimple(GAPTable(tbl))::Bool
1831+
1832+
1833+
"""
1834+
is_supersolvable(tbl::GAPGroupCharacterTable)
1835+
1836+
Return whether `tbl` is the ordinary character table of a supersolvable group,
1837+
see [`is_supersolvable(G::GAPGroup)`](@ref).
1838+
1839+
# Examples
1840+
```jldoctest
1841+
julia> is_supersolvable(character_table("A5"))
1842+
false
1843+
1844+
julia> is_supersolvable(character_table("S3"))
1845+
true
1846+
```
1847+
"""
1848+
@gapattribute is_supersolvable(tbl::GAPGroupCharacterTable) = GAP.Globals.IsSupersolvable(GAPTable(tbl))::Bool
1849+
1850+
16451851
#############################################################################
16461852
##
16471853
## class functions (and characters)
@@ -2061,12 +2267,19 @@ Nemo.degree(::Type{QQAbElem}, chi::GAPGroupClassFunction) = values(chi)[1]::QQAb
20612267

20622268
Nemo.degree(::Type{T}, chi::GAPGroupClassFunction) where T <: IntegerUnion = T(Nemo.degree(ZZRingElem, chi))::T
20632269

2064-
# access character values
2270+
# access character values by position
20652271
function Base.getindex(chi::GAPGroupClassFunction, i::Int)
20662272
vals = GAPWrap.ValuesOfClassFunction(chi.values)
20672273
return QQAbElem(vals[i])
20682274
end
20692275

2276+
# access character values by class name
2277+
function Base.getindex(chi::GAPGroupClassFunction, nam::String)
2278+
i = findfirst(is_equal(nam), class_names(parent(chi)))
2279+
@req i != nothing "$nam is not a class name"
2280+
return chi[i]
2281+
end
2282+
20702283
# arithmetic with class functions
20712284
function Base.:(==)(chi::GAPGroupClassFunction, psi::GAPGroupClassFunction)
20722285
@req parent(chi) === parent(psi) "character tables must be identical"

test/Groups/group_characters.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,7 @@ end
852852
@test chi isa Oscar.GAPGroupClassFunction
853853
@test chi[4] == t[2,4]
854854
@test [chi[i] for i in 1:5] == values(chi)
855+
@test [chi[nam] for nam in class_names(t)] == values(chi)
855856
@test [2*chi[i] for i in 1:5] == values(chi + chi)
856857
@test [chi[i]^2 for i in 1:5] == values(chi * chi)
857858
@test [chi[i]^2 for i in 1:5] == values(chi^2)
@@ -1281,3 +1282,18 @@ end
12811282
end
12821283
end
12831284
end
1285+
1286+
@testset "read off group properties from character tables" begin
1287+
t = character_table("A5")
1288+
@test ! is_abelian(t)
1289+
@test is_almost_simple(t)
1290+
@test ! is_cyclic(t)
1291+
@test ! is_elementary_abelian(t)
1292+
@test ! is_nilpotent(t)
1293+
@test is_perfect(t)
1294+
@test is_quasisimple(t)
1295+
@test is_simple(t)
1296+
@test ! is_solvable(t)
1297+
@test ! is_sporadic_simple(t)
1298+
@test ! is_supersolvable(t)
1299+
end

0 commit comments

Comments
 (0)