1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-07-12 01:35:29 +02:00

And function to create generating set and products

This commit is contained in:
kalmar 2017-03-13 11:45:23 +01:00
parent 9641f72b05
commit 3118c8b4fe

21
SL3Z.jl
View File

@ -79,6 +79,27 @@ function inv(M::Array{Mod,2})
return adjugate(M)
end
function SL_generatingset(n::Int, p::Int)
(p > 1 && n > 1) || throw(ArgumentError("Both n and p should be integers!"))
isprime(p) || throw(ArgumentError("p should be a prime number!"))
indexing = [(i,j) for i in 1:n for j in 1:n if i≠j]
S = [E(i,j, N=n, mod=p) for (i,j) in indexing]
S = vcat(S, [inv(s) for s in S])
S = vcat(S, [permutedims(x, [2,1]) for x in S]);
return unique(S)
end
function products{T}(U::AbstractVector{T}, V::AbstractVector{T})
result = Vector{T}()
for u in U
for v in V
push!(result, u*v)
end
end
return unique(result)
end
function ΔandSDPconstraints(identity, S)
B₁ = vcat([identity], S)