add -X flag for computations over SL(3,Z[X])

This commit is contained in:
kalmar 2017-08-01 15:07:05 +02:00
parent 85841c9399
commit aa2d0083d3

View File

@ -38,10 +38,10 @@ end
#
###############################################################################
function E(i::Int, j::Int, M::MatSpace)
function E(i::Int, j::Int, M::MatSpace, val=one(M.base_ring))
@assert i≠j
m = one(M)
m[i,j] = m[1,1]
m[i,j] = val
return m
end
@ -53,24 +53,26 @@ function SLsize(n,p)
return div(result, p-1)
end
function SL_generatingset(n::Int)
function SL_generatingset(n::Int, X::Bool=false)
indexing = [(i,j) for i in 1:n for j in 1:n if i≠j]
G = MatrixSpace(ZZ, n, n)
S = [E(i,j,G) for (i,j) in indexing]
S = vcat(S, [transpose(x) for x in S])
if X
S = [E(i,j,G,v) for (i,j) in indexing for v in [1, 100]]
else
S = [E(i,j,G,v) for (i,j) in indexing for v in [1]]
end
S = vcat(S, [inv(x) for x in S])
return G, unique(S)
end
function SL_generatingset(n::Int, p::Int)
p == 0 && return SL_generatingset(n)
function SL_generatingset(n::Int, p::Int, X::Bool=false)
p == 0 && return SL_generatingset(n, X)
(p > 1 && n > 1) || throw("Both n and p should be positive integers!")
info("Size(SL($n,$p)) = $(SLsize(n,p))")
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, [transpose(x) for x in S])
S = [E(i, j, G, v) for (i,j) in indexing]
S = vcat(S, [inv(x) for x in S])
return G, unique(S)
end
@ -113,6 +115,9 @@ function parse_commandline()
help = "Find the decomposition over B_r(e,S)"
arg_type = Int
default = 2
"-X"
help = "Matrices are over ZZ⟨X⟩"
action = :store_true
end
return parse_args(settings)
@ -131,7 +136,11 @@ function main()
p = parsed_args["p"]
if p == 0
if parsed_args["X"]
dirname = "oSL$(N)Z⟨X⟩"
else
dirname = "oSL$(N)Z"
end
else
dirname = "oSL$(N)_$p"
end
@ -151,7 +160,7 @@ function main()
info(logger, "Precision: $tol")
info(logger, "Upper bound: $upper_bound")
G, S = SL_generatingset(N, p)
G, S = SL_generatingset(N, p, parsed_args["X"])
info(logger, G)
info(logger, "Symmetric generating set of size $(length(S))")
info(logger, S)