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

View File

@ -1,17 +1,14 @@
struct MappingClassGroup <: GAPGroup
args::Dict{String,Any}
N::Int
struct MappingClassGroup{N} <: GAPGroup end
MappingClassGroup(args) = new(args, args["MCG"])
end
MappingClassGroup(args::Dict) = MappingClassGroup{args["MCG"]}()
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!")
elseif G.N == 2
elseif N == 2
MCGroup = Groups.FPGroup(["a1","a2","a3","a4","a5"]);
S = gens(MCGroup)
@ -31,7 +28,7 @@ function group(G::MappingClassGroup)
return MCGroup
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)
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] )
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]]
Groups.add_rels!(MCGroup, Dict(rel => MCGroup() for rel in relations))

View File

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