GroupsWithPropertyT/groups/speciallinear.jl

94 lines
2.2 KiB
Julia
Raw Normal View History

struct SpecialLinearGroup <: SymmetricGroup
args::Dict{String,Any}
group::AbstractAlgebra.Group
function SpecialLinearGroup(args::Dict)
n = args["N"]
p = args["p"]
X = args["X"]
if p == 0
G = MatrixSpace(Nemo.ZZ, n, n)
else
G = MatrixSpace(FiniteField(p), n, n)
end
return new(args, G)
end
end
2017-11-06 01:58:50 +01:00
function name(G::SpecialLinearGroup)
N = G.args["N"]
p = G.args["p"]
X = G.args["X"]
2017-11-06 01:58:50 +01:00
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
2017-11-06 01:58:50 +01:00
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)
n = G.args["N"]
p = G.args["p"]
X = G.args["X"]
SL = group(G)
2017-11-06 01:58:50 +01:00
indexing = [(i,j) for i in 1:n for j in 1:n if i≠j]
p > 0 && X && throw("SL(n, F_p[x]) not implemented")
2018-01-04 22:09:53 +01:00
if !X
S = [E(idx[1],idx[2],SL) for idx in indexing]
2018-01-04 22:09:53 +01:00
else
r = G.args["radius"]
S = [E(i,j,SL,v) for (i,j) in indexing for v in [1, 100*r]]
2018-01-04 22:09:53 +01:00
end
return unique([S; inv.(S)])
end
function autS(G::SpecialLinearGroup)
N = G.args["N"]
return WreathProduct(PermutationGroup(2), PermutationGroup(N))
2017-11-06 01:58:50 +01:00
end
###############################################################################
#
# Action of WreathProductElems on Nemo.MatElem
#
###############################################################################
2018-08-08 00:24:17 +02:00
function matrix_emb(n::DirectProductGroupElem, p::perm)
Id = parent(n.elts[1])()
elt = diagm([(-1)^(el == Id ? 0 : 1) for el in n.elts])
return elt[:, p.d]
2017-11-06 01:58:50 +01:00
end
function (g::WreathProductElem)(A::MatElem)
2018-08-08 00:24:17 +02:00
g_inv = inv(g)
G = matrix_emb(g.n, g_inv.p)
G_inv = matrix_emb(g_inv.n, g.p)
M = parent(A)
res = M(G_inv)
Nemo.mul!(res, A, res)
return Nemo.mul!(res, M(G), res)
2017-11-06 01:58:50 +01:00
end
function (p::perm)(A::MatElem)
length(p.d) == A.r == A.c || throw("Can't act via $p on matrix of size ($(A.r), $(A.c))")
return p*A*inv(p)
end