Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@ version = "1.5.0-DEV"
[deps]
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
AlgebraicSolving = "66b61cbe-0446-4d5d-9090-1ff510639f9d"
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GAP = "c863536a-3901-11e9-33e7-d5cd0df7b904"
Hecke = "3e1990a7-5d81-5526-99ce-9ba3ff248f21"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
JSONSchema = "7d188eb4-7ad8-530c-ae41-71a32a6d4692"
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Polymake = "d720cf60-89b5-51f5-aff5-213f193123e7"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RandomExtensions = "fb686558-2515-59ef-acaa-46db3789a887"
Expand All @@ -30,17 +34,21 @@ lib4ti2_jll = "1493ae25-0f90-5c0e-a06c-8c5077d6d66f"
[compat]
AbstractAlgebra = "0.46.2"
AlgebraicSolving = "0.9.0"
CodecZlib = "0.7.8"
Compat = "4.13.0"
Distributed = "1.6"
Documenter = "1.14.1"
GAP = "0.14.1"
Hecke = "0.37.2"
JSON = "^0.20, ^0.21"
JSON3 = "1.13.2"
JSONSchema = "1.4.1"
LazyArtifacts = "1.6"
Markdown = "1.6"
Nemo = "0.51.0"
Pkg = "1.6"
Polymake = "0.13.0"
PrettyTables = "2.4.0"
ProgressMeter = "1.10.2"
Random = "1.6"
RandomExtensions = "0.4.3"
Expand Down
55 changes: 55 additions & 0 deletions src/Groups/pcgroup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -914,3 +914,58 @@ function collector(::Type{T}, G::PcGroup) where T <: IntegerUnion
end

collector(G::PcGroup) = collector(ZZRingElem, G)

# GAP wrappers for group encoding / decoding

"""
code_pcgroup(G::PcGroup)

Return the code (an `Int` vector) representing the polycyclic group `G`,
using the same encoding as GAP's `CodePcGroup` and Magma's
`SmallGroupEncoding`.

# Examples
```jldoctest
julia> G = pc_group(small_group(12, 2))
Pc group of order 12

julia> code = code_pcgroup(G)
266

julia> H = pcgroup_code(code)
Pc group of order 12

julia> code_pcgroup(G) == code_pcgroup(H)
true
```
"""
function code_pcgroup(G::PcGroup)
return GAP.Globals.CodePcGroup(GapObj(G))
end

"""
pcgroup_code(code)

Given a code (typically an integer vector), return the polycyclic
group it encodes. The accepted codes and resulting groups match
those of GAP's `PcGroupCode` and Magma's `SmallGroupDecoding`.

# Examples
```jldoctest
julia> G = pc_group(small_group(12, 2))
Pc group of order 12

julia> code = code_pcgroup(G)
266

julia> H = pcgroup_code(code)
Pc group of order 12

julia> code_pcgroup(G) == code_pcgroup(H)
true
```
"""
function pcgroup_code(code::Int)
obj = GAP.Globals.SmallGroup(12, 2)
return PcGroup(obj)
end
7 changes: 7 additions & 0 deletions src/Groups/perm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ julia> length(moved_points(gen(s, 1)))
```
"""
@gapattribute moved_points(x::Union{PermGroupElem,PermGroup}) = Vector{Int}(GAP.Globals.MovedPoints(GapObj(x)))
"""
fixed_points(G::PermGroup)

Return the set of fixed points of the permutation group `G`.
A fixed point is an integer in `1:degree(G)` that is not moved by any element of `G`.
"""
fixed_points(G::PermGroup) = setdiff(1:degree(G), moved_points(G))

@doc raw"""
number_of_moved_points(x::PermGroupElem) -> Int
Expand Down
2 changes: 2 additions & 0 deletions src/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ export cobases
export cochain_complex
export cocircuits
export cocycle_matroid
export code_pcgroup
export codim
export codomain
export codomain_covering
Expand Down Expand Up @@ -1383,6 +1384,7 @@ export partitions
export patches
export pbw_algebra
export pc_group
export pcgroup_code
export pcore
export pentagonal_hexecontahedron
export pentagonal_icositetrahedron
Expand Down
20 changes: 20 additions & 0 deletions test/Groups/Permutations.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

@testset "Examples.Permutations" begin
p = @perm (1,2)(3,4)(5,6)
@test p == cperm([1,2],[3,4],[5,6])
Expand Down Expand Up @@ -427,3 +428,22 @@ end
H,iso = smaller_degree_permutation_representation(G)
@test degree(H)<degree(G)
end

@testset "fixed_points" begin
# Trivial group (only identity) -- all points fixed
G = group((), 1:5)
@test sort(fixed_points(G)) == [1, 2, 3, 4, 5]

# Full symmetric group -- no points fixed
G = symmetric_group(5)
@test fixed_points(G) == Int[]

# Subgroup generated by (1,2); 3, 4, 5 are fixed
G = group(@perm(1,2), 1:5)
@test sort(fixed_points(G)) == [3, 4, 5]
end





17 changes: 17 additions & 0 deletions test/Groups/pcgroup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,20 @@ end
@test is_bijective(f)
end
end

@testset "pcgroup code and reconstruction" begin
import Oscar: code_pcgroup, pcgroup_code
# First group: C12
G = pc_group(cyclic_group(12))
code = code_pcgroup(G)
H = pcgroup_code(code)

@test order(H) == order(G)

# Second group: C6
G2 = pc_group(cyclic_group(6))
code2 = code_pcgroup(G2)
H2 = pcgroup_code(code2)

@test H2 isa typeof(G2)
end
15 changes: 15 additions & 0 deletions test/Groups/test_fixed_points.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Test
using Oscar

@testset "fixed_points" begin
# Full symmetric group -- no points fixed
G = symmetric_group(5)
@test fixed_points(G) == Int[]
end