We describe a package to work quite generally with toric geometry within the scope of Magma's scheme machinery. From that point of view, we regard toric varieties as a vast array of possible ambient spaces for schemes, generalising the affine and projective spaces already available. But of course toric geometry is a large topic in its own right, and in the first place we present it for its own sake.
There are many different points of view on toric geometry. We model our approach on several sources: the primary ones are Danilov [Dan78] and Cox [Cox95], but also Fulton [Ful93] and Oda [Oda88].
One of the primary points of view, exemplified by Danilov [Dan78], is to regard the two-way relationship between a part of scheme theory and the combinatorics of polyhedra as foundational. This package can operate from that point of view.
Another, more recent, point of view is that of the Cox ring, introduced by Cox [Cox95], a (multi-)graded polynomial ring that works as a homogeneous coordinate ring for a toric variety (or indeed any variety with finitely-generated Picard group) in much the same way as the coordinate ring of affine or projective space. This package can also operate from this point of view, and indeed this is the central object in its design. Again, this is bound to impose practical restrictions on the dimensions in which calculations can reasonably be expected to work: we use these `Cox coordinates' to define subschemes of toric varieties, which often leads to Gröbner basis calculations, and these are famously intolerant of the number of variables involved.
The projective plane is the toric variety corresponding to the fan with three maximal cones lying in the Euclidean plane:
< (0, 1), (1, 0) >,
< (1, 0), ( - 1, - 1) >,
< ( - 1, - 1), (0, 1) >.
> rays := [ [0,1], [1,0], [-1,-1] ]; > cones := [ [1,2], [1,3], [2,3] ]; > F := Fan(rays,cones); > F; Fan F with 3 rays: ( 0, 1), ( 1, 0), (-1, -1) and 3 cones with indices: [ 1, 2 ], [ 1, 3 ], [ 2, 3 ]This is enough to determine a toric variety; we name its natural (Cox) coordinates as x, y, z during the definition. (Since this is a scheme, it needs to have a base ring assigned.)
> X<x,y,z> := ToricVariety(Rationals(),F); > X; Toric variety of dimension 2 Variables: x, y, z The irrelevant ideal is: (z, y, x) The grading is: 1, 1, 1As with all schemes in Magma, points can be created by coercing sequences of coefficients (either from the given base field or from an extension of that) into the scheme.
> X ! [1,2,3]; (1 : 2 : 3)When working over an extension k of the base field, one must coerce into the point set (of k-valued points of X).
> k<i> := QuadraticField(-1); > X(k); Set of points of X with coordinates in k > X(k) ! [1,i,2*i]; (1 : i : 2*i)The irrelevant ideal (described in the display of X above) describes the locus of coordinates that do not represent points; in this case, the irrelevant ideal records the fact that (0:0:0) is not a point of projective space.
> X ! [0,0,0]; >> X ! [0,0,0]; ^ Runtime error in '!': Illegal coercion > Y<u,v,w> := ProjectiveSpace(Rationals(),2); > Y; Projective Space of dimension 2 Variables: u, v, w > IrrelevantIdeal(Y); Ideal of Polynomial ring of rank 3 over Rational Field Order: Graded Reverse Lexicographical Variables: u, v, w Homogeneous Basis: [ u, v, w ] > Gradings(Y); [ [ 1, 1, 1 ] ] > Fan(Y); Fan with 3 rays: ( 1, 0), ( 0, 1), (-1, -1) and 3 cones with indices: [ 1, 2 ], [ 1, 3 ], [ 2, 3 ]
Danilov translated the projectivity of a toric variety into properties of the fan. In geometry, projectivity is equivalent to the existence of an ample line bundle. In the combinatorics of the fan, the requirement is the existence of positive linear functions on each cone that agree on the boundaries and are strictly convex across boundaries. This is one small part of the theory of divisors on toric varieties that we cover in much greater detail in Section Invariant Divisors and Riemann-Roch Spaces.
> rays := [ [0,0,1], [4,0,1], [0,4,1], [1,1,1], [2,1,1], [1,2,1], [-1,-1,-1] ];Now we specify the top-dimensional cones that the fan contains. This is done by naming the rays that generate each cone from the list of rays above. So, for example, the sequence [1,3,6] below refers to the cone generated by the 1st, 3rd and 6th rays, that is by [0, 0, 1], [0, 4, 1] and [1, 2, 1].
> cones := [ [1,3,6], [1,4,6], [1,2,4], [2,4,5], [2,3,5], [3,5,6], [4,5,6], > [1,3,7], [1,2,7], [2,3,7] ];This is enough information to determine a fan. The command below to construct the fan F with this data takes a little time, since it checks that the maximal cones we nominated are indeed maximal and intersect correctly to lie in a fan.
> F := Fan(rays,cones);Finally we move away from the lattice world to the geometry by creating the toric variety corresponding to the fan F.
> X := ToricVariety(Rationals(),F);We can now ask questions of X as we would with any other variety or ambient space.
> Dimension(X); 3 > IsComplete(X); true > IsProjective(X); falseUnfortunately our specimen is flawed: it has singularities.
> IsNonsingular(X); false > Y := Resolution(X); > IsProjective(Y); falseThe last line takes a little time: Magma computes the ample cone of Y and then determines whether or not it is empty. In this case, Y remains non-projective, although there is no reason to expect that: Danilov's original example can be made projective by blowing up a line (or simply flopping a line).
> X<x,y,u,v>:=AbsoluteRationalScroll(Rationals(),[2,0]); > X; Toric variety of dimension 2 over Rational Field Variables: x, y, u, v The components of the irrelevant ideal are: (y, x), (v, u) The 2 gradings are: 1, 1, -2, 0, 0, 0, 1, 1The zero locus is the third toric divisor.
> ray:=Cone(Rays(X)[3]); > form:=IntersectionForm(X,ray); > D:=Weil(Divisor(X,[0,0,1,0])); > phi:=WeilToClassLatticesMap(X); > form * phi(D); -2
> P:=PolytopeSmoothFanoDim3(15); > P; 3-dimensional polytope P with 5 vertices: ( 1, 0, 0), ( 0, 1, 0), ( 0, 0, 1), (-1, -1, 1), ( 0, 0, -1)We convert the polytope P into a toric variety X whose fan is generated by the cones spanning the faces of P:
> X<x,y,u,z,v>:=ToricVariety(Rationals(),SpanningFan(P)); > X; Toric variety of dimension 3 over Rational Field Variables: x, y, u, z, v The components of the irrelevant ideal are: (v, u), (z, y, x) The 2 gradings are: 0, 0, 1, 0, 1, 1, 1, 0, 1, 1 > IsNonsingular(X); true > IsFano(X); trueThe variety X has Fano index 2:
> K:=CanonicalDivisor(X); > phi:=WeilToClassLatticesMap(X); > fano_idx:=GCD(Eltseq(phi(Weil(-K)))); > fano_idx; 2 > half_K:=phi(Weil(-K)) / 2; > A:=Divisor(X,half_K @@ phi); > A; Weil divisor A with coefficients: 0, 0, 0, 1, 1 > IsCartier(A); true > IsAmple(A); true > bool:=AreLinearlyEquivalent(-K, 2 * A); > bool; trueNext we calculate the anti-canonical degree ( - K)2 and first few terms of the Hilbert series (Hilb)(X, - K):
> Degree(-K); 56 > HilbertCoefficients(-K,5); [ 1, 31, 145, 399, 849, 1551 ]We recognise X as 2-35 in the Mori--Mukai classification.
The Cox ring of a toric variety is its natural homogeneous coordinate ring. It is a multigraded ring (with other data besides). It is often easier to construct the gradings for a Cox ring than it is to describe a fan.
A Cox ring requires four pieces of data:
> R<u,v,x,y,z> := PolynomialRing(Rationals(),5); > irrel1 := ideal< R | u,v >; > irrel2 := ideal< R | x,y,z >; > B := [ irrel1, irrel2 ]; > Zwts := [ > [ 1, 1, 0, -1, -3 ], > [ 0, 0, 1, 2, 3 ] ]; > Qwts := []; > C := CoxRing(R,B,Zwts,Qwts); > C; Cox ring C with underlying Polynomial ring of rank 5 over Rational Field Order: Lexicographical Variables: u, v, x, y, z The components of the irrelevant ideal are: (z, y, x), (v, u) The 2 gradings are: 1, 1, 0, -1, -3, 0, 0, 1, 2, 3The pieces of data can be retrieved by Gradings(C), QuotientGradings(C) and so on.
In favourable cases, a Cox ring does indeed arise from a fan using Cox's construction. This fan can be recovered.
> F := Fan(C); > F; Fan F with 5 rays: ( 1, 0, 0), ( 0, 1, 0), ( 1, 1, 3), (-2, -2, -3), ( 1, 1, 1) and 6 cones with indices: [ 1, 3, 4 ], [ 1, 3, 5 ], [ 1, 4, 5 ], [ 2, 3, 4 ], [ 2, 3, 5 ], [ 2, 4, 5 ]Alternatively, one can construct a toric variety from a Cox ring---as in Cox's construction, the Cox ring contains exactly the data required to construct a variety as a torus quotient.
> X := ToricVariety(C); > Dimension(X); 3Sequences of coefficients not lying in the locus of the irrelevant ideal can be interpreted as closed points of X as usual.
> X ! [1,0,1,0,0]; (1 : 0 : 1 : 0 : 0) > X ! [1,0,0,0,0]; >> X ! [1,0,0,0,0]; ^ Runtime error in '!': Illegal coercionThe attempted coercion of the second point fails because its x, y and z coordinates (the 3rd, 4th and 5th coefficients of the vector) are all zero, but the locus x=y=z=0 is defined by a component of the irrelevant ideal and so has been discarded: points of X do not have all three of those coordinates simultaneously equal to zero.
The homogeneous coordinates that the Cox ring provides for X behave in a very similar way to the homogeneous coordinates on projective space. In particular, one can define subschemes of X by the vanishing of polynomials in the Cox ring that are homogeneous with respect to all the Z-gradings (and the quotient gradings too).
> f := x^4*y + u^2*y^3 + v^5*z^2; > Multidegree(X,f); [ -1, 6 ] []The multidegree is returned as two sequences: the first is the sequence of degrees of f with respect to each of the Z-gradings in turn, and the second is that with respect to the quotient gradings (in this case there are none). One defines a scheme as usual in Magma.
> V := Scheme(X, f); > V; Scheme over Rational Field defined by u^2*y^3 + v^5*z^2 + x^4*y > Dimension(V); 2Much of Magma's scheme machinery works for schemes inside toric varieties, although at this stage some does not. (Some functions are missing because of the absence of standard nonsingular affine patches on toric varieties. In some cases these will be replaced by their orbifold analogues in due course.)