parametrize PropertyTGroups types by N

This commit is contained in:
kalmarek 2018-09-09 13:05:49 +02:00
parent 8a2aa6542e
commit 1b6793f37c
3 changed files with 40 additions and 61 deletions

View File

@ -1,21 +1,12 @@
struct SpecialAutomorphismGroup <: SymmetrizedGroup struct SpecialAutomorphismGroup{N} <: SymmetrizedGroup
args::Dict{String,Any}
group::AutGroup group::AutGroup
N::Int
function SpecialAutomorphismGroup(args::Dict) function SpecialAutomorphismGroup(args::Dict)
N = args["SAut"] return new{args["SAut"]}(AutGroup(FreeGroup(N), special=true))
return new(args, AutGroup(FreeGroup(N), special=true), N)
end end
end end
function name(G::SpecialAutomorphismGroup) name(G::SpecialAutomorphismGroup{N}) where N = "SAutF$(N)"
if haskey(G.args, "nosymmetry") && G.args["nosymmetry"]
return "SAutF$(G.N)"
else
return "oSAutF$(G.N)"
end
end
group(G::SpecialAutomorphismGroup) = G.group group(G::SpecialAutomorphismGroup) = G.group
@ -24,8 +15,8 @@ function generatingset(G::SpecialAutomorphismGroup)
return unique([S; inv.(S)]) return unique([S; inv.(S)])
end end
function autS(G::SpecialAutomorphismGroup) function autS(G::SpecialAutomorphismGroup{N}) where N
return WreathProduct(PermutationGroup(2), PermutationGroup(G.N)) return WreathProduct(PermutationGroup(2), PermutationGroup(N))
end end
############################################################################### ###############################################################################

View File

@ -1,17 +1,14 @@
struct MappingClassGroup <: GAPGroup struct MappingClassGroup{N} <: GAPGroup end
args::Dict{String,Any}
N::Int
MappingClassGroup(args) = new(args, args["MCG"]) MappingClassGroup(args::Dict) = MappingClassGroup{args["MCG"]}()
end
name(G::MappingClassGroup) = "MCG($(G.N))" name(G::MappingClassGroup{N}) where N = "MCG(N)"
function group(G::MappingClassGroup) function group(G::MappingClassGroup{N}) where N
if G.N < 2 if N < 2
throw("Genus must be at least 2!") throw("Genus must be at least 2!")
elseif G.N == 2 elseif N == 2
MCGroup = Groups.FPGroup(["a1","a2","a3","a4","a5"]); MCGroup = Groups.FPGroup(["a1","a2","a3","a4","a5"]);
S = gens(MCGroup) S = gens(MCGroup)
@ -31,7 +28,7 @@ function group(G::MappingClassGroup)
return MCGroup return MCGroup
else else
MCGroup = Groups.FPGroup(["a$i" for i in 0:2G.N]) MCGroup = Groups.FPGroup(["a$i" for i in 0:2N])
S = gens(MCGroup) S = gens(MCGroup)
a0 = S[1] a0 = S[1]
@ -76,7 +73,7 @@ function group(G::MappingClassGroup)
(A[2i+3]*A[2i+2]*A[2i+4]*A[2i+3])*( n(i+1)*A[2i+2]*A[2i+1]*A[2i] ) (A[2i+3]*A[2i+2]*A[2i+4]*A[2i+3])*( n(i+1)*A[2i+2]*A[2i+1]*A[2i] )
end end
# push!(relations, X*n(G.N)*inv(n(G.N)*X)) # push!(relations, X*n(N)*inv(n(N)*X))
relations = [relations; [inv(rel) for rel in relations]] relations = [relations; [inv(rel) for rel in relations]]
Groups.add_rels!(MCGroup, Dict(rel => MCGroup() for rel in relations)) Groups.add_rels!(MCGroup, Dict(rel => MCGroup() for rel in relations))

View File

@ -1,60 +1,44 @@
struct SpecialLinearGroup <: SymmetrizedGroup struct SpecialLinearGroup{N} <: SymmetrizedGroup
args::Dict{String,Any}
group::AbstractAlgebra.Group group::AbstractAlgebra.Group
N::Int p::Int
X::Bool
function SpecialLinearGroup(args::Dict) function SpecialLinearGroup(args::Dict)
n = args["SL"] N = args["SL"]
p = args["p"] p = args["p"]
X = args["X"] X = args["X"]
if p == 0 if p == 0
G = MatrixSpace(Nemo.ZZ, n, n) G = MatrixSpace(Nemo.ZZ, N, N)
else else
R = Nemo.NmodRing(UInt(p)) R = Nemo.NmodRing(UInt(p))
G = MatrixSpace(R, n, n) G = MatrixSpace(R, N, N)
end end
return new(args, G, n) return new{N}(G, p, X)
end end
end end
function name(G::SpecialLinearGroup) function name(G::SpecialLinearGroup{N}) where N
p = G.args["p"] if G.p == 0
X = G.args["X"] R = (G.X ? "Z[x]" : "Z")
if p == 0
R = (X ? "Z[x]" : "Z")
else else
R = "F$p" R = "F$(G.p)"
end
if haskey(G.args, "nosymmetry") && G.args["nosymmetry"]
return "SL($(G.N),$R)"
else
return "oSL($(G.N),$R)"
end end
return SL($(G.N),$R)
end end
group(G::SpecialLinearGroup) = G.group group(G::SpecialLinearGroup) = G.group
function E(i::Int, j::Int, M::MatSpace, val=one(M.base_ring)) function generatingset(G::SpecialLinearGroup{N}) where N
@assert i≠j G.p > 0 && G.X && throw("SL(n, F_p[x]) not implemented")
m = one(M)
m[i,j] = val
return m
end
function generatingset(G::SpecialLinearGroup)
p = G.args["p"]
X = G.args["X"]
p > 0 && X && throw("SL(n, F_p[x]) not implemented")
SL = group(G) SL = group(G)
r = G.args["radius"] return generatingset(SL, G.X)
return generatingset(SL, r, X)
end end
# r is the injectivity radius of
# SL(n, Z[X]) -> SL(n, Z) induced by X -> 100
function generatingset(SL::MatSpace, radius::Integer, X::Bool=false) function generatingset(SL::MatSpace, X::Bool=false, r=5)
n = SL.cols n = SL.cols
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]
@ -66,8 +50,15 @@ function generatingset(SL::MatSpace, radius::Integer, X::Bool=false)
return unique([S; inv.(S)]) return unique([S; inv.(S)])
end end
function autS(G::SpecialLinearGroup) function E(i::Int, j::Int, M::MatSpace, val=one(M.base_ring))
return WreathProduct(PermutationGroup(2), PermutationGroup(G.N)) @assert i≠j
m = one(M)
m[i,j] = val
return m
end
function autS(G::SpecialLinearGroup{N}) where N
return WreathProduct(PermutationGroup(2), PermutationGroup(N))
end end
############################################################################### ###############################################################################