Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ToricVarieties] Assert coordinate names from cox ring #4240

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.(symbols(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
Loading