diff --git a/src/1712.07167.jl b/src/1712.07167.jl index 36abe6c..7e2cdba 100644 --- a/src/1712.07167.jl +++ b/src/1712.07167.jl @@ -51,8 +51,8 @@ filename(sett::Settings, ::Type{Val{:solverlog}}; kwargs...) = filename(sett::Settings, ::Type{Val{:Δ}}; kwargs...) = filename(prepath(sett), "delta", "jld"; kwargs...) -filename(sett::Settings, ::Type{Val{:OrbitData}}; kwargs...) = - filename(prepath(sett), "OrbitData", "jld"; kwargs...) +filename(sett::Settings, ::Type{Val{:BlockDecomposition}}; kwargs...) = + filename(prepath(sett), "BlockDecomposition", "jld"; kwargs...) filename(sett::Settings, ::Type{Val{:solution}}; kwargs...) = filename(fullpath(sett), "solution", "jld"; kwargs...) @@ -125,7 +125,7 @@ function approximate_by_SOS(sett::Symmetrized, isdir(fullpath(sett)) || mkpath(fullpath(sett)) orbit_data = try - orbit_data = load(filename(sett, :OrbitData), "OrbitData") + orbit_data = load(filename(sett, :BlockDecomposition), "BlockDecomposition") @info "Loaded orbit data." orbit_data catch ex @@ -133,8 +133,8 @@ function approximate_by_SOS(sett::Symmetrized, GroupRings.hasbasis(parent(orderunit)) || throw("You need to define basis of Group Ring to compute orbit decomposition!") @info "Computing orbit and Wedderburn decomposition..." - orbit_data = OrbitData(parent(orderunit), sett.autS) - save(filename(sett, :OrbitData), "OrbitData", orbit_data) + orbit_data = BlockDecomposition(parent(orderunit), sett.autS) + save(filename(sett, :BlockDecomposition), "BlockDecomposition", orbit_data) orbit_data end diff --git a/src/PropertyT.jl b/src/PropertyT.jl index 8c405ce..2ea9c30 100644 --- a/src/PropertyT.jl +++ b/src/PropertyT.jl @@ -16,7 +16,7 @@ import AbstractAlgebra: Group, NCRing include("laplacians.jl") include("RGprojections.jl") -include("orbitdata.jl") +include("blockdecomposition.jl") include("sos_sdps.jl") include("checksolution.jl") diff --git a/src/orbitdata.jl b/src/blockdecomposition.jl similarity index 95% rename from src/orbitdata.jl rename to src/blockdecomposition.jl index 1bf278e..01178fb 100644 --- a/src/orbitdata.jl +++ b/src/blockdecomposition.jl @@ -1,17 +1,17 @@ ############################################################################### # -# OrbitData +# BlockDecomposition # ############################################################################### -struct OrbitData{T<:AbstractArray{Float64, 2}, GEl<:GroupElem, P<:Generic.Perm} +struct BlockDecomposition{T<:AbstractArray{Float64, 2}, GEl<:GroupElem, P<:Generic.Perm} orbits::Vector{Vector{Int}} preps::Dict{GEl, P} Uπs::Vector{T} dims::Vector{Int} end -function OrbitData(RG::GroupRing, autS::Group, verbose=true) +function BlockDecomposition(RG::GroupRing, autS::Group, verbose=true) verbose && @info "Decomposing basis of RG into orbits of" autS @time orbs = orbit_decomposition(autS, RG.basis, RG.basis_dict) @assert sum(length(o) for o in orbs) == length(RG.basis) @@ -38,17 +38,17 @@ function OrbitData(RG::GroupRing, autS::Group, verbose=true) end @assert dot(multiplicities, dimensions) == size(RG.pm,1) - return OrbitData(orbs, preps, Uπs, dimensions) + return BlockDecomposition(orbs, preps, Uπs, dimensions) end -function decimate(od::OrbitData, verbose=true) +function decimate(od::BlockDecomposition, verbose=true) nzros = [i for i in 1:length(od.Uπs) if !isempty(od.Uπs[i])] Us = sparsify!.(od.Uπs, eps(Float64) * 1e4, verbose = verbose)[nzros] #dimensions of the corresponding Uπs: dims = od.dims[nzros] - return OrbitData(od.orbits, od.preps, Array{Float64}.(Us), dims) + return BlockDecomposition(od.orbits, od.preps, Array{Float64}.(Us), dims) end function orthSVD(M::AbstractMatrix{T}) where {T<:AbstractFloat} diff --git a/src/sos_sdps.jl b/src/sos_sdps.jl index 2853c8f..ea2e20b 100644 --- a/src/sos_sdps.jl +++ b/src/sos_sdps.jl @@ -104,7 +104,7 @@ end # ############################################################################### -function SOS_problem_primal(X::GroupRingElem, orderunit::GroupRingElem, data::OrbitData; upper_bound::Float64=Inf) +function SOS_problem_primal(X::GroupRingElem, orderunit::GroupRingElem, data::BlockDecomposition; upper_bound::Float64=Inf) Ns = size.(data.Uπs, 2) m = JuMP.Model(); @@ -137,7 +137,7 @@ end function addconstraints!(m::JuMP.Model, P::Vector{Matrix{JuMP.VariableRef}}, - X::GroupRingElem, orderunit::GroupRingElem, data::OrbitData) + X::GroupRingElem, orderunit::GroupRingElem, data::BlockDecomposition) orderunit_orb = orbit_spvector(orderunit.coeffs, data.orbits) X_orb = orbit_spvector(X.coeffs, data.orbits) @@ -163,7 +163,7 @@ function addconstraints!(m::JuMP.Model, return m end -function reconstruct(Ps::Vector{Matrix{F}}, data::OrbitData) where F +function reconstruct(Ps::Vector{Matrix{F}}, data::BlockDecomposition) where F return reconstruct(Ps, data.preps, data.Uπs, data.dims) end diff --git a/test/1812.03456.jl b/test/1812.03456.jl index 78acc7e..bc31c74 100644 --- a/test/1812.03456.jl +++ b/test/1812.03456.jl @@ -123,7 +123,7 @@ end S = PropertyT.generating_set(M) Δ = PropertyT.Laplacian(S, halfradius) RG = parent(Δ) - orbit_data = PropertyT.OrbitData(RG, WreathProduct(SymmetricGroup(2), SymmetricGroup(N))) + orbit_data = PropertyT.BlockDecomposition(RG, WreathProduct(SymmetricGroup(2), SymmetricGroup(N))) orbit_data = PropertyT.decimate(orbit_data); @testset "Sq₃ is SOS" begin @@ -170,7 +170,7 @@ end S = PropertyT.generating_set(M) Δ = PropertyT.Laplacian(S, halfradius) RG = parent(Δ) - orbit_data = PropertyT.OrbitData(RG, WreathProduct(SymmetricGroup(2), SymmetricGroup(N))) + orbit_data = PropertyT.BlockDecomposition(RG, WreathProduct(SymmetricGroup(2), SymmetricGroup(N))) orbit_data = PropertyT.decimate(orbit_data); @testset "Sq₄ is SOS" begin @@ -228,7 +228,7 @@ end # S = PropertyT.generating_set(M) # Δ = PropertyT.Laplacian(S, halfradius) # RG = parent(Δ) - # orbit_data = PropertyT.OrbitData(RG, WreathProduct(SymmetricGroup(2), SymmetricGroup(N))) + # orbit_data = PropertyT.BlockDecomposition(RG, WreathProduct(SymmetricGroup(2), SymmetricGroup(N))) # orbit_data = PropertyT.decimate(orbit_data); # # @time elt = PropertyT.Adj(RG) + 100PropertyT.Op(RG)