From 11e0f7eed17673695177b9efb533c3e1d3e27791 Mon Sep 17 00:00:00 2001 From: Martin Bies Date: Mon, 7 Oct 2024 12:54:52 +0200 Subject: [PATCH] [FTheoryTools] Serialization sets cox rings of base and ambient space correctly --- Artifacts.toml | 6 +++--- .../src/Serialization/hypersurface_models.jl | 5 +++-- .../FTheoryTools/src/Serialization/qsm_models.jl | 10 +++++----- .../FTheoryTools/src/Serialization/tate_models.jl | 6 +++--- .../src/Serialization/weierstrass_models.jl | 6 +++--- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index 6d7efc9b9c99..c8571fbf238b 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -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" diff --git a/experimental/FTheoryTools/src/Serialization/hypersurface_models.jl b/experimental/FTheoryTools/src/Serialization/hypersurface_models.jl index 0dbbc0480181..cd180af29643 100644 --- a/experimental/FTheoryTools/src/Serialization/hypersurface_models.jl +++ b/experimental/FTheoryTools/src/Serialization/hypersurface_models.jl @@ -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 diff --git a/experimental/FTheoryTools/src/Serialization/qsm_models.jl b/experimental/FTheoryTools/src/Serialization/qsm_models.jl index e9e2bb532752..97b77f963f14 100644 --- a/experimental/FTheoryTools/src/Serialization/qsm_models.jl +++ b/experimental/FTheoryTools/src/Serialization/qsm_models.jl @@ -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, diff --git a/experimental/FTheoryTools/src/Serialization/tate_models.jl b/experimental/FTheoryTools/src/Serialization/tate_models.jl index c1090616ff44..5dcb34dfb7aa 100644 --- a/experimental/FTheoryTools/src/Serialization/tate_models.jl +++ b/experimental/FTheoryTools/src/Serialization/tate_models.jl @@ -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) @@ -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 diff --git a/experimental/FTheoryTools/src/Serialization/weierstrass_models.jl b/experimental/FTheoryTools/src/Serialization/weierstrass_models.jl index 302f03f163e5..e1340fb5ab0d 100644 --- a/experimental/FTheoryTools/src/Serialization/weierstrass_models.jl +++ b/experimental/FTheoryTools/src/Serialization/weierstrass_models.jl @@ -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) @@ -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