logging inside OrbAutFN and OrbitDecomposition

This commit is contained in:
kalmar 2017-06-06 18:48:15 +02:00
parent 8dc5577254
commit f3ec2df97d
2 changed files with 16 additions and 16 deletions

View File

@ -204,7 +204,7 @@ function λandP(m::JuMP.Model, data::ProblemData)
return λ, recP
end
function init_data(name::String, N::Int; radius=2)
function init_data(name::String, N::Int, logger; radius=2)
ex(fname) = isfile(joinpath(name, fname))
@ -216,7 +216,7 @@ function init_data(name::String, N::Int; radius=2)
S = [S; [inv(s) for s in S]]
info(logger, "Symmetric generating set of size $(length(S))")
info(logger, S)
compute_orbit_data(name, SOutFN, S, radius=radius)
compute_orbit_data(logger, name, SOutFN, S, radius=radius)
end
return 0
end
@ -240,7 +240,7 @@ function main()
end
init_data(dirname, N, radius=radius)
init_data(dirname, N, logger, radius=radius)
tol = parsed_args["tol"]
iterations = parsed_args["iterations"]

View File

@ -250,47 +250,47 @@ function Uπ_matrices(P_matrices; orth=orthSVD)
return U_p_matrices
end
function compute_orbit_data(name::String, G::Group, S::Vector{GroupElem}; radius=2)
function compute_orbit_data{T<:GroupElem}(logger, name::String, G::Group, S::Vector{T}; radius=2)
isdir(name) || mkdir(name)
info("Generating ball of radius 4")
info(logger, "Generating ball of radius 4")
@time E4, sizes = generate_balls(S, G(), radius=2*radius);
info("Reverse dict")
info(logger, "Reverse dict")
@time E_dict = GroupRings.reverse_dict(E4)
info("Product matrix")
info(logger, "Product matrix")
@time pm = GroupRings.create_pm(E4, E_dict, sizes[radius], twisted=true)
RG = GroupRing(G, E4, E_dict, pm)
Δ = PropertyT.splaplacian(RG, S)
@assert augmentation(Δ) == 0
save(joinpath(name, "delta.jld"), "Δ", Δ.coeffs)
@assert GroupRings.augmentation(Δ) == 0
save(joinpath(name, "delta.jld"), "delta", Δ.coeffs)
save(joinpath(name, "pm.jld"), "pm", pm)
N = length(G.objectGroup.gens)
info("WreathProduct")
info(logger, "WreathProduct")
@time BN = WreathProduct(Nemo.FiniteField(2,1, "a")[1], PermutationGroup(N))
info("Decomposing E into orbits of B$(N)")
info(logger, "Decomposing E into orbits of B$(N)")
@time orbs = orbit_decomposition(BN, E4, E_dict)
@assert sum(length(o) for o in orbs) == length(E4)
save(joinpath(name, "orbits.jld"), "orbits", orbs)
info("Action matrices")
info(logger, "Action matrices")
E2 = E4[1:sizes[radius]]
@time BNactionE_mreps = action_mreps(BN, E2, E_dict)
info("Projections")
info(logger, "Projections")
@time BN_mps = rankOne_projections(BN);
@time π_E_projections = @showprogress [Cstar_repr(p, BNactionE_mreps) for p in BN_mps]
info("Uπs...")
info(logger, "Uπs...")
@time Uπs = Uπ_matrices(π_E_projections);
multiplicities = [size(U,2) for U in Uπs];
@show multiplicities
info(logger, "multiplicities = $multiplicities")
dimensions = [Int(p[BN()]*Int(order(BN))) for p in BN_mps];
@show dimensions
info(logger, "dimensions = $dimensions")
@assert dot(multiplicities, dimensions) == sizes[radius]
save(joinpath(name, "U_pis.jld"), "Uπs", Uπs, "dims", dimensions)