From 9139e145b8d7b887e1a5cf10ccbf6980654f4622 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Sun, 19 Jan 2020 17:30:27 +0100 Subject: [PATCH] add prototype for load_basis --- src/utils.jl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/utils.jl b/src/utils.jl index 4de3fa3..cb8ce0a 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -34,6 +34,8 @@ function check_propertyT(sett::PropertyT.Settings) end RG = parent(Δ) + load_basis!(RG, sett) + @assert iszero(aug(Δ)) ELT = Δ^2; ELT_NAME = "Δ²" @@ -54,3 +56,23 @@ function check_propertyT(sett::PropertyT.Settings) return PropertyT.interpret_results(sett, certified_λ) end + +function load_basis!(RG::GroupRing, sett::PropertyT.Settings) + basis_fn = joinpath(PropertyT.prepath(sett), "B_$(2sett.halfradius).csv") + return load_basis!(RG, basis_fn) +end + +function load_basis!(RG::GroupRing, basis_file) + G = RG.group; + words = split(readline(basis_file), ", ")[2:end] + + basis_ex = [Meta.parse(w) for w in words] + basis = [@eval begin a,b,c = $(gens(G)); $b_ex end for b_ex in basis_ex] + basis = pushfirst!(basis, one(G)) + basis_dict = GroupRings.reverse_dict(basis) + + RG.basis = basis + RG.basis_dict = basis_dict + + return RG +end