Skip to content

Commit

Permalink
[ToricVarieties] Assert coordinate names from cox ring
Browse files Browse the repository at this point in the history
  • Loading branch information
HereAround committed Oct 24, 2024
1 parent 5c30f3a commit 5f1c880
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ julia> qsm_model = literature_model(arxiv_id = "1903.00009", model_parameters =
Hypersurface model over a concrete base
julia> zero_section_class(qsm_model)
Cohomology class on a normal toric variety given by x32 + 2*x33 + 3*x34 + x35 - x36
Cohomology class on a normal toric variety given by e2 + 2*u + 3*e4 + e1 - w
```
"""
function zero_section_class(m::AbstractFTheoryModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ julia> coordinate_names(antv)
```
"""
@attr Vector{String} function coordinate_names(v::NormalToricVarietyType)
return ["x$(i)" for i in 1:torsion_free_rank(torusinvariant_weil_divisor_group(v))]
if has_attribute(v, :cox_ring)
return string.(gens(cox_ring(v)))
end
return ["x$(i)" for i in 1:torsion_free_rank(torusinvariant_weil_divisor_group(v))]
end


Expand Down
3 changes: 3 additions & 0 deletions test/Serialization/ToricGeometry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@
test_save_load_roundtrip(path, pp; with_attrs=false, check_func=!check) do loaded
@test rays(pp) == rays(loaded)
@test ray_indices(maximal_cones(pp)) == ray_indices(maximal_cones(loaded))
@test coordinate_names(pp) == coordinate_names(loaded)
end

test_save_load_roundtrip(path, pp; with_attrs=true, check_func=check) do loaded
@test rays(pp) == rays(loaded)
@test ray_indices(maximal_cones(pp)) == ray_indices(maximal_cones(loaded))
@test coordinate_names(pp) == coordinate_names(loaded)
end

test_save_load_roundtrip(path, pp; check_func=check) do loaded
@test rays(pp) == rays(loaded)
@test ray_indices(maximal_cones(pp)) == ray_indices(maximal_cones(loaded))
@test coordinate_names(pp) == coordinate_names(loaded)
end
end

Expand Down

0 comments on commit 5f1c880

Please sign in to comment.