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 1, 2024
1 parent 75d5d22 commit 45d2216
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Artifacts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ git-tree-sha1 = "5c82e5ff3aa99f2aa660c9ffb3caa57ee535cc21"
lazy = true

[[QSMDB.download]]
sha256 = "3f69aae0fca02d74764f709c622388c564e6e144a8b11347dadef5725a65b0a2"
url = "https://github.com/oscar-system/Oscar.jl/releases/download/archive-tag-1/qsmdb.tar.gz"
sha256 = "69097d0855cfd2d5e71d5ebf709cf120b42203ff8e74f494be515f98570a55ac"
url = "https://martinbies.github.io/Materials/QSMDB/qsmdb.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
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 45d2216

Please sign in to comment.