Skip to content

Commit

Permalink
Show method of toric divisor shows details of the toric ambient space
Browse files Browse the repository at this point in the history
  • Loading branch information
HereAround committed Nov 29, 2021
1 parent 289241a commit 5f19d06
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 16 deletions.
1 change: 1 addition & 0 deletions docs/src/ToricVarieties/ToricDivisors.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ isvery_ample(td::ToricDivisor)
```@docs
coefficients(td::ToricDivisor)
polyhedron(td::ToricDivisor)
toricvariety(td::ToricDivisor)
```
11 changes: 11 additions & 0 deletions src/ToricVarieties/ToricDivisors/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,14 @@ function coefficients(td::ToricDivisor)
return td.attributes[coefficients]
end
export coefficients


@doc Markdown.doc"""
toricvariety(td::ToricDivisor)
Return the toric variety of a torus invariant Weil divisor.
"""
function toricvariety(td::ToricDivisor)
return td.attributes[toricvariety]
end
export toricvariety
2 changes: 1 addition & 1 deletion src/ToricVarieties/ToricDivisors/auxilliary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function output_string(td::ToricDivisor)
if last(out_string) == ','
out_string = chop(out_string)
end
out_string = out_string * "divisor on a normal toric variety";
out_string = out_string * "divisor on a" * chop(output_string(toricvariety(td)), head = 1, tail = 0)

# return result
return out_string
Expand Down
10 changes: 5 additions & 5 deletions src/ToricVarieties/ToricDivisors/constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Construct the torus invariant divisor on the normal toric variety `v` as linear
# Examples
```jldoctest
julia> show(ToricDivisor(toric_projective_space(2), [1,1,2]))
A torus invariant divisor on a normal toric variety
julia> ToricDivisor(toric_projective_space(2), [1,1,2])
A torus invariant divisor on a normal non-affine, smooth, projective, gorenstein, q-gorenstein, fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
```
"""
function ToricDivisor(v::AbstractNormalToricVariety, coeffs::Vector{Int})
Expand All @@ -36,7 +36,7 @@ function ToricDivisor(v::AbstractNormalToricVariety, coeffs::Vector{Int})
pmntv = pm_object(v)
ptd = Polymake.fulton.TDivisor(COEFFICIENTS=coeffs)
Polymake.add(pmntv, "DIVISOR", ptd)
attributes = Dict(coefficients=>coeffs)
attributes = Dict(coefficients=>coeffs, toricvariety=>v)
return ToricDivisor(ptd, Dict{Any,Bool}(), attributes)
end
export ToricDivisor
Expand All @@ -53,8 +53,8 @@ Construct the torus invariant divisor associated to a character of the normal to
# Examples
```jldoctest
julia> show(DivisorOfCharacter(toric_projective_space(2), [1,2]))
A torus invariant divisor on a normal toric variety
julia> DivisorOfCharacter(toric_projective_space(2), [1,2])
A torus invariant divisor on a normal non-affine, smooth, projective, gorenstein, q-gorenstein, fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
```
"""
function DivisorOfCharacter(v::AbstractNormalToricVariety, character::Vector{Int})
Expand Down
20 changes: 10 additions & 10 deletions src/ToricVarieties/ToricDivisors/properties.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ julia> H = hirzebruch_surface(4)
A normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> td = ToricDivisor(H, [1,0,0,0])
A torus invariant divisor on a normal toric variety
A torus invariant divisor on a normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> iscartier(td)
true
Expand All @@ -34,7 +34,7 @@ julia> H = hirzebruch_surface(4)
A normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> td = ToricDivisor(H, [1,0,0,0])
A torus invariant divisor on a normal toric variety
A torus invariant divisor on a normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> isprincipal(td)
false
Expand All @@ -59,7 +59,7 @@ julia> H = hirzebruch_surface(4)
A normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> td = ToricDivisor(H, [1,0,0,0])
A torus invariant divisor on a normal toric variety
A torus invariant divisor on a normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> isbasepoint_free(td)
true
Expand All @@ -84,7 +84,7 @@ julia> H = hirzebruch_surface(4)
A normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> td = ToricDivisor(H, [1,0,0,0])
A torus invariant divisor on a normal toric variety
A torus invariant divisor on a normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> iseffective(td)
true
Expand All @@ -109,7 +109,7 @@ julia> H = hirzebruch_surface(4)
A normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> td = ToricDivisor(H, [1,0,0,0])
A torus invariant divisor on a normal toric variety
A torus invariant divisor on a normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> isintegral(td)
true
Expand All @@ -134,7 +134,7 @@ julia> H = hirzebruch_surface(4)
A normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> td = ToricDivisor(H, [1,0,0,0])
A torus invariant divisor on a normal toric variety
A torus invariant divisor on a normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> isample(td)
false
Expand All @@ -159,7 +159,7 @@ julia> H = hirzebruch_surface(4)
A normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> td = ToricDivisor(H, [1,0,0,0])
A torus invariant divisor on a normal toric variety
A torus invariant divisor on a normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> isvery_ample(td)
false
Expand All @@ -184,7 +184,7 @@ julia> H = hirzebruch_surface(4)
A normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> td = ToricDivisor(H, [1,0,0,0])
A torus invariant divisor on a normal toric variety
A torus invariant divisor on a normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> isnef(td)
true
Expand All @@ -209,7 +209,7 @@ julia> H = hirzebruch_surface(4)
A normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> td = ToricDivisor(H, [1,0,0,0])
A torus invariant divisor on a normal toric variety
A torus invariant divisor on a normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> isq_cartier(td)
true
Expand All @@ -235,7 +235,7 @@ julia> H = hirzebruch_surface(4)
A normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> td = ToricDivisor(H, [1,0,0,0])
A torus invariant divisor on a normal toric variety
A torus invariant divisor on a normal non-affine, smooth, projective, gorenstein, q-gorenstein, non-fano toric variety without torusfactor corresponding to a polyhedral fan in ambient dimension 2
julia> isprime_divisor(td)
true
Expand Down
1 change: 1 addition & 0 deletions test/ToricVarieties/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ D=ToricDivisor(H5, [0,0,0,0])
D2 = DivisorOfCharacter(H5, [1,2])

@testset "Divisors" begin
@test dim(toricvariety(D)) == 2
@test isprime_divisor(D) == false
@test iscartier(D) == true
@test isprincipal(D) == true
Expand Down

0 comments on commit 5f19d06

Please sign in to comment.