Skip to content

Commit

Permalink
[FTheoryTools] Serialization sets cox rings of base and ambient space…
Browse files Browse the repository at this point in the history
… correctly
  • Loading branch information
HereAround committed Oct 7, 2024
1 parent 1b550a1 commit 11e0f7e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Artifacts.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[QSMDB]
git-tree-sha1 = "5c82e5ff3aa99f2aa660c9ffb3caa57ee535cc21"
git-tree-sha1 = "52686066016440cf2e6e286a923aed887658543c"
lazy = true

[[QSMDB.download]]
sha256 = "3f69aae0fca02d74764f709c622388c564e6e144a8b11347dadef5725a65b0a2"
url = "https://github.com/oscar-system/Oscar.jl/releases/download/archive-tag-1/qsmdb.tar.gz"
sha256 = "2b0a368c07d368f3973352b7f6e856214e25383d2cc3a78c70415afe247a997e"
url = "https://github.com/oscar-system/Oscar.jl/releases/download/archive-tag-1/QSMDB-2.tar.gz"

[gap_extraperfect]
git-tree-sha1 = "084fa12573e5089ceb3299f9d341f244b415da52"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,17 @@ end
##########################################

function load_object(s::DeserializerState, ::Type{<:HypersurfaceModel}, params::Tuple{NormalToricVariety, NormalToricVariety, NormalToricVariety, <:MPolyRing, <:MPolyRing})
base_space, ambient_space, fiber_ambient_space, R1, R2 = params
base_space, amb_space, fiber_ambient_space, R1, R2 = params
defining_equation = load_object(s, MPolyRingElem, R1, :hypersurface_equation)
defining_equation_parametrization = load_object(s, MPolyRingElem, R2, :hypersurface_equation_parametrization)
explicit_model_sections = haskey(s, :explicit_model_sections) ? load_typed_object(s, :explicit_model_sections) : Dict{String, MPolyRingElem}()
defining_classes = haskey(s, :defining_classes) ? load_typed_object(s, :defining_classes) : Dict{String, ToricDivisorClass}()
model = HypersurfaceModel(explicit_model_sections, defining_equation_parametrization, defining_equation, base_space, ambient_space, fiber_ambient_space)
model = HypersurfaceModel(explicit_model_sections, defining_equation_parametrization, defining_equation, base_space, amb_space, fiber_ambient_space)
model.defining_classes = defining_classes
attrs_data = haskey(s, :__attrs) ? load_typed_object(s, :__attrs) : Dict{Symbol, Any}()
for (key, value) in attrs_data
set_attribute!(model, Symbol(key), value)
end
@req cox_ring(ambient_space(model)) == parent(hypersurface_equation(model)) "Hypersurface polynomial not in Cox ring of toric ambient space"
return model
end
10 changes: 5 additions & 5 deletions experimental/FTheoryTools/src/Serialization/qsm_models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ function load_object(s::DeserializerState, ::Type{QSMModel})
:genus_of_components_of_simplified_dual_graph
)

h = hypersurface_equation(hs_model)
S = cox_ring(ambient_space(hs_model))
var_names = symbols(parent(h))
S.R.S = var_names
hs_model.hypersurface_equation = Oscar.eval_poly(string(h), S)
#h = hypersurface_equation(hs_model)
#S = cox_ring(ambient_space(hs_model))
#var_names = symbols(parent(h))
#S.R.S = var_names
#hs_model.hypersurface_equation = Oscar.eval_poly(string(h), S)

return QSMModel(vertices,
poly_index,
Expand Down
6 changes: 3 additions & 3 deletions experimental/FTheoryTools/src/Serialization/tate_models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ function save_type_params(s::SerializerState, gtm::GlobalTateModel)
save_data_dict(s) do
save_object(s, encode_type(GlobalTateModel), :name)
base, ambient, tp_ring = base_space(gtm), ambient_space(gtm), parent(tate_polynomial(gtm))

save_data_dict(s, :params) do
for (obj, key) in [(base, :base_space), (ambient, :ambient_space), (tp_ring, :tate_polynomial_ring)]
if serialize_with_id(obj)
Expand Down Expand Up @@ -68,16 +67,17 @@ end
#########################################

function load_object(s::DeserializerState, ::Type{<: GlobalTateModel}, params::Tuple{NormalToricVariety, NormalToricVariety, MPolyDecRing})
base_space, ambient_space, tp_ring = params
base_space, amb_space, tp_ring = params
pt = load_object(s, MPolyDecRingElem, tp_ring, :tate_polynomial)
explicit_model_sections = haskey(s, :explicit_model_sections) ? load_typed_object(s, :explicit_model_sections) : Dict{String, MPolyRingElem}()
defining_section_parametrization = haskey(s, :defining_section_parametrization) ? load_typed_object(s, :defining_section_parametrization) : Dict{String, MPolyRingElem}()
defining_classes = haskey(s, :defining_classes) ? load_typed_object(s, :defining_classes) : Dict{String, ToricDivisorClass}()
model = GlobalTateModel(explicit_model_sections, defining_section_parametrization, pt, base_space, ambient_space)
model = GlobalTateModel(explicit_model_sections, defining_section_parametrization, pt, base_space, amb_space)
model.defining_classes = defining_classes
attrs_data = haskey(s, :__attrs) ? load_typed_object(s, :__attrs) : Dict{Symbol, Any}()
for (key, value) in attrs_data
set_attribute!(model, Symbol(key), value)
end
@req cox_ring(ambient_space(model)) == parent(tate_polynomial(model)) "Tate polynomial not in Cox ring of toric ambient space"
return model
end
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ function save_type_params(s::SerializerState, w::WeierstrassModel)
save_data_dict(s) do
save_object(s, encode_type(WeierstrassModel), :name)
base, ambient, wp_ring = base_space(w), ambient_space(w), parent(weierstrass_polynomial(w))

save_data_dict(s, :params) do
for (obj, key) in [(base, :base_space), (ambient, :ambient_space), (wp_ring, :weierstrass_polynomial_ring)]
if serialize_with_id(obj)
Expand Down Expand Up @@ -68,16 +67,17 @@ end
#########################################

function load_object(s::DeserializerState, ::Type{<: WeierstrassModel}, params::Tuple{NormalToricVariety, NormalToricVariety, MPolyDecRing})
base_space, ambient_space, wp_ring = params
base_space, amb_space, wp_ring = params
pw = load_object(s, MPolyDecRingElem, wp_ring, :weierstrass_polynomial)
explicit_model_sections = haskey(s, :explicit_model_sections) ? load_typed_object(s, :explicit_model_sections) : Dict{String, MPolyRingElem}()
defining_section_parametrization = haskey(s, :defining_section_parametrization) ? load_typed_object(s, :defining_section_parametrization) : Dict{String, MPolyRingElem}()
defining_classes = haskey(s, :defining_classes) ? load_typed_object(s, :defining_classes) : Dict{String, ToricDivisorClass}()
model = WeierstrassModel(explicit_model_sections, defining_section_parametrization, pw, base_space, ambient_space)
model = WeierstrassModel(explicit_model_sections, defining_section_parametrization, pw, base_space, amb_space)
model.defining_classes = defining_classes
attrs_data = haskey(s, :__attrs) ? load_typed_object(s, :__attrs) : Dict{Symbol, Any}()
for (key, value) in attrs_data
set_attribute!(model, Symbol(key), value)
end
@req cox_ring(ambient_space(model)) == parent(weierstrass_polynomial(model)) "Weierstrass polynomial not in Cox ring of toric ambient space"
return model
end

0 comments on commit 11e0f7e

Please sign in to comment.