From 0a0856bb517a3972925bcfcf98e3a0da31b19eec Mon Sep 17 00:00:00 2001 From: kalmarek Date: Wed, 5 Sep 2018 17:48:59 +0200 Subject: [PATCH] update groups to the new input format --- groups/autfreegroup.jl | 14 ++++++-------- groups/mappingclassgroup.jl | 24 ++++++++++++------------ groups/speciallinear.jl | 14 ++++++-------- 3 files changed, 24 insertions(+), 28 deletions(-) diff --git a/groups/autfreegroup.jl b/groups/autfreegroup.jl index 3db3ea7..f294104 100644 --- a/groups/autfreegroup.jl +++ b/groups/autfreegroup.jl @@ -1,20 +1,19 @@ struct SpecialAutomorphismGroup <: SymmetrizedGroup args::Dict{String,Any} group::AutGroup + N::Int function SpecialAutomorphismGroup(args::Dict) - N = args["N"] - return new(args, AutGroup(FreeGroup(N), special=true)) + N = args["SAut"] + return new(args, AutGroup(FreeGroup(N), special=true), N) end end function name(G::SpecialAutomorphismGroup) - N = G.args["N"] - if G.args["nosymmetry"] - return "SAutF$(N)" + return "SAutF$(G.N)" else - return "oSAutF$(N)" + return "oSAutF$(G.N)" end end @@ -26,8 +25,7 @@ function generatingset(G::SpecialAutomorphismGroup) end function autS(G::SpecialAutomorphismGroup) - N = G.args["N"] - return WreathProduct(PermutationGroup(2), PermutationGroup(N)) + return WreathProduct(PermutationGroup(2), PermutationGroup(G.N)) end ############################################################################### diff --git a/groups/mappingclassgroup.jl b/groups/mappingclassgroup.jl index 65971d2..cfdc158 100644 --- a/groups/mappingclassgroup.jl +++ b/groups/mappingclassgroup.jl @@ -1,26 +1,26 @@ struct MappingClassGroup <: GAPGroup args::Dict{String,Any} + N::Int + + MappingClassGroup(args) = MappingClassGroup(args, G.args["MCG"]) end -function name(G::MappingClassGroup) - N = G.args["MCG"] - return "MCG($(N))" -end +name(G::MappingClassGroup) = "MCG($(G.N))" function group(G::MappingClassGroup) - N = G.args["MCG"] - if N < 2 + + if G.N < 2 throw("Genus must be at least 2!") - elseif N == 2 + elseif G.N == 2 MCGroup = Groups.FPGroup(["a1","a2","a3","a4","a5"]); S = gens(MCGroup) - N = length(S) + n = length(S) A = prod(reverse(S))*prod(S) relations = [ - [Comm(S[i], S[j]) for i in 1:N for j in 1:N if abs(i-j) > 1]..., - [S[i]*S[i+1]*S[i]*inv(S[i+1]*S[i]*S[i+1]) for i in 1:N-1]..., + [Comm(S[i], S[j]) for i in 1:n for j in 1:n if abs(i-j) > 1]..., + [S[i]*S[i+1]*S[i]*inv(S[i+1]*S[i]*S[i+1]) for i in 1:G.n-1]..., (S[1]*S[2]*S[3])^4*inv(S[5])^2, Comm(A, S[1]), A^2 @@ -31,7 +31,7 @@ function group(G::MappingClassGroup) return MCGroup else - MCGroup = Groups.FPGroup(["a$i" for i in 0:2N]) + MCGroup = Groups.FPGroup(["a$i" for i in 0:2G.N]) S = gens(MCGroup) a0 = S[1] @@ -76,7 +76,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] ) end - # push!(relations, X*n(N)*inv(n(N)*X)) + # push!(relations, X*n(G.N)*inv(n(G.N)*X)) relations = [relations; [inv(rel) for rel in relations]] Groups.add_rels!(MCGroup, Dict(rel => MCGroup() for rel in relations)) diff --git a/groups/speciallinear.jl b/groups/speciallinear.jl index 6642bd4..0d37ba8 100644 --- a/groups/speciallinear.jl +++ b/groups/speciallinear.jl @@ -1,9 +1,10 @@ struct SpecialLinearGroup <: SymmetrizedGroup args::Dict{String,Any} group::AbstractAlgebra.Group + N::Int function SpecialLinearGroup(args::Dict) - n = args["N"] + n = args["SL"] p = args["p"] X = args["X"] @@ -13,12 +14,11 @@ struct SpecialLinearGroup <: SymmetrizedGroup R = Nemo.NmodRing(UInt(p)) G = MatrixSpace(R, n, n) end - return new(args, G) + return new(args, G, n) end end function name(G::SpecialLinearGroup) - N = G.args["N"] p = G.args["p"] X = G.args["X"] @@ -28,9 +28,9 @@ function name(G::SpecialLinearGroup) R = "F$p" end if G.args["nosymmetry"] - return "SL($N,$R)" + return "SL($(G.N),$R)" else - return "oSL($N,$R)" + return "oSL($(G.N),$R)" end end @@ -44,7 +44,6 @@ function E(i::Int, j::Int, M::MatSpace, val=one(M.base_ring)) end function generatingset(G::SpecialLinearGroup) - n = G.args["N"] p = G.args["p"] X = G.args["X"] p > 0 && X && throw("SL(n, F_p[x]) not implemented") @@ -68,8 +67,7 @@ function generatingset(SL::MatSpace, radius::Integer, X::Bool=false) end function autS(G::SpecialLinearGroup) - N = G.args["N"] - return WreathProduct(PermutationGroup(2), PermutationGroup(N)) + return WreathProduct(PermutationGroup(2), PermutationGroup(G.N)) end ###############################################################################