From e3cd93a5b264e6c7353aa0a4f7f8aa6f0c47426e Mon Sep 17 00:00:00 2001 From: kalmar Date: Sun, 26 Mar 2017 16:08:49 +0200 Subject: [PATCH] More flexible S^n generation --- SL.jl | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/SL.jl b/SL.jl index dc723f2..79ed04f 100644 --- a/SL.jl +++ b/SL.jl @@ -45,16 +45,22 @@ function products{T}(U::AbstractVector{T}, V::AbstractVector{T}) return unique(result) end -function ΔandSDPconstraints{T<:Number}(identity::Array{T,2}, S::Vector{Array{T,2}}) - B₁ = vcat([identity], S) - B₂ = products(B₁, B₁); - B₃ = products(B₁, B₂); - B₄ = products(B₁, B₃); - @assert B₄[1:length(B₂)] == B₂ +function ΔandSDPconstraints(Id, S; radius::Int=4) + k = div(radius,2) + lengths = Vector{Int}() + S = vcat([Id], S) + B = S + 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₂)); - sdp_constraints = PropertyT.constraints_from_pm(product_matrix, length(B₄)) - L_coeff = PropertyT.splaplacian_coeff(S, B₂, length(B₄)); + product_matrix = PropertyT.create_product_matrix(B,lengths[k]); + sdp_constraints = PropertyT.constraints_from_pm(product_matrix, length(B)) + L_coeff = PropertyT.splaplacian_coeff(S, basis, length(B)); Δ = GroupAlgebraElement(L_coeff, product_matrix) return Δ, sdp_constraints