PropertyT.jl/scripts/SpN_Adj.jl

80 lines
1.8 KiB
Julia
Raw Normal View History

2022-11-17 02:50:48 +01:00
using LinearAlgebra
2024-02-19 18:47:29 +01:00
BLAS.set_num_threads(4)
ENV["OMP_NUM_THREADS"] = 4
include(joinpath(@__DIR__, "../test/optimizers.jl"))
using SCS_MKL_jll
2022-11-17 02:50:48 +01:00
using Groups
import Groups.MatrixGroups
using PropertyT
2024-02-19 18:47:29 +01:00
import PropertyT.SW as SW
using PropertyT.PG
using PropertyT.SA
2022-11-17 02:50:48 +01:00
include(joinpath(@__DIR__, "argparse.jl"))
include(joinpath(@__DIR__, "utils.jl"))
const N = parsed_args["N"]
const HALFRADIUS = parsed_args["halfradius"]
const UPPER_BOUND = parsed_args["upper_bound"]
2024-02-19 18:47:29 +01:00
G = MatrixGroups.SymplecticGroup{2N}(Int8)
@info "Running Adj_C₂ - λ·Δ sum of squares decomposition for " G
2022-11-17 02:50:48 +01:00
2024-02-19 18:47:29 +01:00
@info "computing group algebra structure"
2023-03-20 01:40:40 +01:00
RG, S, sizes = @time PropertyT.group_algebra(G, halfradius = HALFRADIUS)
2022-11-17 02:50:48 +01:00
2024-02-19 18:47:29 +01:00
@info "computing WedderburnDecomposition"
2022-11-17 02:50:48 +01:00
wd = let RG = RG, N = N
G = StarAlgebras.object(RG)
P = PermGroup(perm"(1,2)", Perm(circshift(1:N, -1)))
Σ = Groups.Constructions.WreathProduct(PermGroup(perm"(1,2)"), P)
act = PropertyT.action_by_conjugation(G, Σ)
2024-02-19 18:47:29 +01:00
wdfl = @time SW.WedderburnDecomposition(
2022-11-17 02:50:48 +01:00
Float64,
Σ,
act,
basis(RG),
StarAlgebras.Basis{UInt16}(@view basis(RG)[1:sizes[HALFRADIUS]]),
)
2023-03-20 01:40:40 +01:00
wdfl
2022-11-17 02:50:48 +01:00
end
2024-02-19 18:47:29 +01:00
@info wd
2022-11-17 02:50:48 +01:00
Δ = RG(length(S)) - sum(RG(s) for s in S)
Δs = PropertyT.laplacians(
RG,
S,
x -> (gx = PropertyT.grading(x); Set([gx, -gx])),
)
# elt = Δ^2
elt = PropertyT.Adj(Δs, :C₂)
unit = Δ
@time model, varP = PropertyT.sos_problem_primal(
elt,
unit,
2023-03-20 01:40:40 +01:00
wd;
upper_bound = UPPER_BOUND,
augmented = true,
show_progress = true,
2022-11-17 02:50:48 +01:00
)
solve_in_loop(
model,
wd,
2023-03-20 01:40:40 +01:00
varP;
2023-05-08 17:49:32 +02:00
logdir = "./log/Sp($N,Z)/r=$HALFRADIUS/Adj_C₂-$(UPPER_BOUND)Δ",
2023-03-20 01:40:40 +01:00
optimizer = cosmo_optimizer(;
eps = 1e-10,
2024-02-19 18:47:29 +01:00
max_iters = 50_000,
2023-03-20 01:40:40 +01:00
accel = 50,
alpha = 1.95,
2022-11-17 02:50:48 +01:00
),
2023-03-20 01:40:40 +01:00
data = (elt = elt, unit = unit, halfradius = HALFRADIUS),
2022-11-17 02:50:48 +01:00
)