Skip to content

Commit

Permalink
Make ideal sheaves on toric varieties work
Browse files Browse the repository at this point in the history
  • Loading branch information
HereAround committed Aug 29, 2023
1 parent 51f4dd0 commit e07e5e3
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions experimental/Schemes/IdealSheaves.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1216,17 +1216,53 @@ end
Create a sheaf of ideals on a toric variety ``X`` from a homogeneous ideal
`I` in its `cox_ring`.
# Examples
```jldoctest
julia> P3 = projective_space(NormalToricVariety, 3)
Normal, non-affine, smooth, projective, gorenstein, fano, 3-dimensional toric variety without torusfactor
julia> (x1,x2,x3,x4) = gens(cox_ring(P3))
4-element Vector{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}}:
x1
x2
x3
x4
julia> I = ideal([x2,x3])
ideal(x2, x3)
julia> IdealSheaf(P3, I)
```
"""
function IdealSheaf(X::NormalToricVariety, I::MPolyIdeal)
@req base_ring(I) === cox_ring(X) "ideal must live in the cox ring of the variety"

# We currently only support this provided that the following conditions are met:
# 1. All maximal cones are smooth, i.e. the fan is smooth/X is smooth.
# 2. The dimension of all maximal cones matches the dimension of the fan.
@req is_smooth(X) "Currently, ideal sheaves are only supported for smooth toric varieties"
@req all(m -> dim(m) == dim(X), maximal_cones(X)) "Currently, ideal sheaves require that all maximal cones have the dimension of the variety"

# TODO: In the long run we should think about making the creation of the
# following dictionary lazy. But this requires partial rewriting of the
# ideal sheaves as a whole, so we postpone it for the moment.

ideal_dict = IdDict{AbsSpec, Ideal}()
for U in affine_charts(X)
ideal_dict[U] = _dehomogenize(I, U) # Method to be written!!!
for (k, U) in enumerate(affine_charts(X))
R = base_ring(toric_ideal(U))
indices = ray_indices(maximal_cones(X))[k,:]
imgs = [one(R) for k in 1:nrays(X)]
count = 1
for l in 1:nrays(X)
if indices[l]
imgs[l] = gens(R)[count]
count += 1
end
end
map = hom(cox_ring(X), R, imgs)
ideal_dict[U] = map(I)
end

return IdealSheaf(X, ideal_dict)
Expand Down

0 comments on commit e07e5e3

Please sign in to comment.