implement the SymmetricGroup interface for SLn and AutFn

This commit is contained in:
kalmarek 2018-08-08 00:21:13 +02:00
parent 7dc95cf93a
commit 1d82aeed8d
2 changed files with 80 additions and 123 deletions

View File

@ -1,27 +1,33 @@
module SpecialAutomorphisms struct SpecialAutomorphismGroup <: SymmetricGroup
args::Dict{String,Any}
group::AutGroup
using AbstractAlgebra function SpecialAutomorphismGroup(args::Dict)
using Groups N = args["N"]
return new(args, AutGroup(FreeGroup(N), special=true))
import AbstractAlgebra.perm end
###############################################################################
#
# Generating set
#
###############################################################################
function generatingset(N::Int)
SAutFN = AutGroup(FreeGroup(N), special=true)
S = gens(SAutFN);
return SAutFN, unique([S; inv.(S)])
end end
function generatingset(parsed_args) function name(G::SpecialAutomorphismGroup)
N = parsed_args["N"] N = G.args["N"]
return generatingset(N)
if G.args["nosymmetry"]
return "SAutF$(N)"
else
return "oSAutF$(N)"
end
end
group(G::SpecialAutomorphismGroup) = G.group
function generatingset(G::SpecialAutomorphismGroup)
S = gens(group(G));
return unique([S; inv.(S)])
end
function autS(G::SpecialAutomorphismGroup)
N = G.args["N"]
return WreathProduct(PermutationGroup(2), PermutationGroup(N))
end end
############################################################################### ###############################################################################
@ -33,8 +39,10 @@ end
function AutFG_emb(A::AutGroup, g::WreathProductElem) function AutFG_emb(A::AutGroup, g::WreathProductElem)
isa(A.objectGroup, FreeGroup) || throw("Not an Aut(Fₙ)") isa(A.objectGroup, FreeGroup) || throw("Not an Aut(Fₙ)")
parent(g).P.n == length(A.objectGroup.gens) || throw("No natural embedding of $(parent(g)) into $A") parent(g).P.n == length(A.objectGroup.gens) || throw("No natural embedding of $(parent(g)) into $A")
powers = [(elt == parent(elt)() ? 0: 1) for elt in g.n.elts] Id = parent(g.n[1])()
elt = reduce(*, [A(Groups.flip_autsymbol(i))^pow for (i,pow) in enumerate(powers)]) powers = ((el == Id ? 0: 1) for el in g.n.elts)
elt = A()
Groups.r_multiply!(elt, [Groups.flip_autsymbol(i, pow=p) for (i,p) in enumerate(powers)], reduced=false)
Groups.r_multiply!(elt, [Groups.perm_autsymbol(g.p)]) Groups.r_multiply!(elt, [Groups.perm_autsymbol(g.p)])
return elt return elt
end end
@ -55,23 +63,4 @@ function (p::perm)(a::Groups.Automorphism)
return g*a*g^-1 return g*a*g^-1
end end
autS(N::Int) = WreathProduct(PermutationGroup(2), PermutationGroup(N))
function autS(parsed_args)
return autS(parsed_args["N"])
end end
###############################################################################
#
# Misc
#
###############################################################################
function groupname(parsed_args)
N = parsed_args["N"]
return groupname(N), N
end
groupname(N::Int) = "SAutF$(N)"
end # of module SpecialAutomorphisms

View File

@ -1,15 +1,39 @@
module SpecialLinear struct SpecialLinearGroup <: SymmetricGroup
args::Dict{String,Any}
group::AbstractAlgebra.Group
using Nemo function SpecialLinearGroup(args::Dict)
using Groups n = args["N"]
p = args["p"]
X = args["X"]
import Nemo.Generic.perm if p == 0
G = MatrixSpace(Nemo.ZZ, n, n)
else
G = MatrixSpace(FiniteField(p), n, n)
end
return new(args, G)
end
end
############################################################################### function name(G::SpecialLinearGroup)
# N = G.args["N"]
# Generating set p = G.args["p"]
# X = G.args["X"]
###############################################################################
if p == 0
R = (X ? "Z[x]" : "Z")
else
R = "F$p"
end
if G.args["nosymmetry"]
return "SL($N,$R)"
else
return "oSL($N,$R)"
end
end
group(G::SpecialLinearGroup) = G.group
function E(i::Int, j::Int, M::MatSpace, val=one(M.base_ring)) function E(i::Int, j::Int, M::MatSpace, val=one(M.base_ring))
@assert i≠j @assert i≠j
@ -18,48 +42,27 @@ function E(i::Int, j::Int, M::MatSpace, val=one(M.base_ring))
return m return m
end end
function SLsize(n,p) function generatingset(G::SpecialLinearGroup)
p == 0 && return Inf n = G.args["N"]
result = BigInt(1) p = G.args["p"]
for k in 0:n-1 X = G.args["X"]
result *= p^n - p^k SL = group(G)
end
return div(result, p-1)
end
function generatingset(n::Int, X::Bool=false)
indexing = [(i,j) for i in 1:n for j in 1:n if i≠j] indexing = [(i,j) for i in 1:n for j in 1:n if i≠j]
G = MatrixSpace(ZZ, n, n)
if X p > 0 && X && throw("SL(n, F_p[x]) not implemented")
S = [E(i,j,G,v) for (i,j) in indexing for v in [1, 100]]
if !X
S = [E(idx[1],idx[2],SL) for idx in indexing]
else else
S = [E(i,j,G,v) for (i,j) in indexing for v in [1]] r = G.args["radius"]
S = [E(i,j,SL,v) for (i,j) in indexing for v in [1, 100*r]]
end end
S = vcat(S, [inv(x) for x in S]) return unique([S; inv.(S)])
return G, unique(S)
end end
function generatingset(n::Int, p::Int, X::Bool=false) function autS(G::SpecialLinearGroup)
(p > 1 && n > 1) || throw("Both n and p should be positive integers!") N = G.args["N"]
info("Size(SL($n,$p)) = $(SLsize(n,p))") return WreathProduct(PermutationGroup(2), PermutationGroup(N))
F = ResidueRing(ZZ, p)
G = MatrixSpace(F, n, n)
indexing = [(i,j) for i in 1:n for j in 1:n if i≠j]
S = [E(i, j, G) for (i,j) in indexing]
S = vcat(S, [inv(x) for x in S])
return G, unique(S)
end
function generatingset(parsed_args)
N = parsed_args["N"]
p = parsed_args["p"]
X = parsed_args["X"]
if p == 0
return generatingset(N, X)
else
return generatingset(N, p, X)
end
end end
############################################################################### ###############################################################################
@ -86,38 +89,3 @@ function (p::perm)(A::MatElem)
R = parent(A) R = parent(A)
return p*A*inv(p) return p*A*inv(p)
end end
autS(N::Int) = WreathProduct(PermutationGroup(2), PermutationGroup(N))
function autS(parsed_args)
return autS(parsed_args["N"])
end
###############################################################################
#
# Misc
#
###############################################################################
function groupname(parsed_args)
N = parsed_args["N"]
p = parsed_args["p"]
X = parsed_args["X"]
return groupname(N, p, X), N
end
function groupname(N::Int, p::Int=0, X::Bool=false)
if p == 0
if X
name = "SL$(N)Z⟨X⟩"
else
name = "SL$(N)Z"
end
else
name = "SL$(N)_$p"
end
return name
end
end # of module SpecialLinear