mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-11-19 07:20:28 +01:00
rename OrbitData → BlockDecomposition
This commit is contained in:
parent
0d48ff698c
commit
1e14380942
@ -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
|
||||
|
||||
|
@ -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")
|
||||
|
||||
|
@ -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}
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user