More flexible S^n generation

This commit is contained in:
kalmar 2017-03-26 16:08:49 +02:00
parent a3091f7166
commit e3cd93a5b2

24
SL.jl
View File

@ -45,16 +45,22 @@ function products{T}(U::AbstractVector{T}, V::AbstractVector{T})
return unique(result) return unique(result)
end end
function ΔandSDPconstraints{T<:Number}(identity::Array{T,2}, S::Vector{Array{T,2}}) function ΔandSDPconstraints(Id, S; radius::Int=4)
B₁ = vcat([identity], S) k = div(radius,2)
B₂ = products(B₁, B₁); lengths = Vector{Int}()
B₃ = products(B₁, B₂); S = vcat([Id], S)
B₄ = products(B₁, B₃); B = S
@assert B₄[1:length(B₂)] == B₂ push!(lengths,length(B))
for i in 2:radius
B = products(S, B);
push!(lengths, length(B))
end
k = div(radius,2)
basis = B[1:lengths[k]]
product_matrix = PropertyT.create_product_matrix(B₄,length(B₂)); product_matrix = PropertyT.create_product_matrix(B,lengths[k]);
sdp_constraints = PropertyT.constraints_from_pm(product_matrix, length(B₄)) sdp_constraints = PropertyT.constraints_from_pm(product_matrix, length(B))
L_coeff = PropertyT.splaplacian_coeff(S, B₂, length(B₄)); L_coeff = PropertyT.splaplacian_coeff(S, basis, length(B));
Δ = GroupAlgebraElement(L_coeff, product_matrix) Δ = GroupAlgebraElement(L_coeff, product_matrix)
return Δ, sdp_constraints return Δ, sdp_constraints