Toric Lattices

One often begins to study toric geometry by considering a `lattice' L=(Z)n and discussing polygons or cones in its overlying rational (or real) vector space LQ = L tensor (Q) whose vertices lie on L; these are examples of so-called `lattice polytopes'. Anybody who has given a seminar on toric geometry will know the constant frustration of distinguishing between L and LQ (or worse, a bit later in the story, the duals of these). In Magma, we bind these two spaces together in a single object, a toric lattice. These spaces lie underneath all the combinatorics. It is not often necessary to be explicit about them, since the package handles them invisibly in the background, but they are useful for the usual parent and data typing purposes: when one creates an empty sequence intended to house elements of a toric lattice, it should be properly typed from the outset, for instance. Toric lattices created as duals record that relationship.

Toric lattices are of type TorLat and their elements are of type TorLatElt.

Contents

Toric Lattices

A toric lattice is a finite-dimensional rational vector space with a distinguished free Z-module L that spans it: it is the pair L tensor Q ⊃L where L isomorphic to Zn. We usually refer to the toric lattice as L, and although the feeling of using L is that it is simply the given Z-module, the covering vector space allows fluent working with non-integral points of L.

ToricLattice(n) : RngIntElt -> TorLat
Create an n-dimensional toric lattice Qn ⊃Zn. The integer n must be non-negative.
ScalarLattice() : -> TorLat
The unique one-dimensional toric lattice of scalars Q⊃Z.

Example Polyhedra_empty-toric-lattice-sequence (H152E16)

A properly typed sequence of points of a toric lattice can be summed with the usual convention.
> L := ToricLattice(3);
> nopoints := [ L | ];
> &+ nopoints;
(0, 0, 0)
A toric lattice is really a vector space marked with a finitely-generated Z-module that spans it. In particular, its points may well have rational coefficients, although those with integral coefficients are distinguished.
> somepoints := [ L | [1/2,2/3,3/4], [1,2,3] ];
> [ IsIntegral(v) : v in somepoints ];
[ false, true ]
Dual(L) : TorLat -> TorLat
The dual lattice of the toric lattice L.

Example Polyhedra_dual-toric-lattice (H152E17)

The dual of a toric lattice is also a toric lattice: integrality of dual points is clear.
> L := ToricLattice(2);
> L;
2-dimensional toric lattice L = Z^2
> M := Dual(L);
> M;
2-dimensional toric lattice M = (Z^2)^*
Magma's default printing for toric lattices tries to help keep track of which lattice is which---this becomes more useful when working with toric varieties. The relationship between L and M is preserved, and double-dual returns L.
> M eq L;
false
> L eq Dual(M);
true
L + M : TorLat,TorLat -> TorLat,TorLatMap,TorLatMap,TorLatMap,TorLatMap
DirectSum(L,M) : TorLat,TorLat -> TorLat,TorLatMap,TorLatMap,TorLatMap,TorLatMap
DirectSum(Q) : SeqEnum -> TorLat,TorLatMap,TorLatMap,TorLatMap,TorLatMap
The direct sum of the two toric lattices L and M. The following natural maps are also returned: the embedding of L into the sum, the embedding of M, the projection of the sum onto L, and the projection onto M.

The argument can also be a sequence Q of toric lattices. In this case, there are three return values: the direct sum of all lattices in Q, a sequence of inclusion maps of lattices in Q into the sum, and a sequence of projection maps from the sum onto each of the elements of Q in turn.

L ^ n : TorLat,RngIntElt -> TorLat,SeqEnum,SeqEnum
The direct sum of the toric lattice L with itself n times. Also return are a sequence of injections of L as factors into the sum and a sequence of projections of the sum onto its factors. This is identical to DirectSum([L,L,...,L]) where the sequence has length n.
Dimension(L) : TorLat -> RngIntElt
The dimension of the toric lattice L.

Points of Toric Lattices

Points of L are interpreted to mean points of L tensor Q. If the coefficients of a point are in fact integral, then this is recognised: so it is possible to tell whether a point is in fact a point of L, not just the rational span.

The usual rational vector space arithmetic operates on these lattice points.

L ! [a,b,...] : TorLat,[RngIntElt] -> TorLatElt
LatticeVector(L,Q) : TorLat,[RngIntElt] -> TorLatElt
LatticeVector(Q) : [RngIntElt] -> TorLatElt
The point (a, b, ... ) as an element of the toric lattice L, where Q=[a, b, ... ] is a sequence of rational numbers or integers. (If the toric lattice L is omitted, then it will be created.)
L . i : TorLat,RngIntElt -> TorLatElt
Basis(L,i) : TorLat,RngIntElt -> TorLatElt
The ith standard basis element of the toric lattice L.
Basis(L) : TorLat -> TorLatElt
The standard basis element of the toric lattice L as a sequence of points of L.
Form(L,Q) : TorLat,[RngIntElt] -> TorLatElt
The point (a, b, ... ) as an element of the dual of the toric lattice L, where Q=[a, b, ... ] is a sequence of rational numbers or integers.
Zero(L) : TorLat -> TorLatElt
The zero vector in the toric lattice L.
P + Q : TorLatElt,TorLatElt -> TorLatElt
P - Q : TorLatElt,TorLatElt -> TorLatElt
n * P : FldRatElt,TorLatElt -> TorLatElt
P / n : TorLatElt,FldRatElt -> TorLatElt
The sum and difference of toric lattice points P and Q (or points of the dual), the rational multiple nP and quotient P/n, where n∈Q.
P eq Q : TorLatElt,TorLatElt -> BoolElt
Return true if and only if the toric lattice points P and Q are the same point of the same lattice.
AreProportional(P,Q) : TorLatElt,TorLatElt -> BoolElt, FldRatElt
Return true if and only if the toric lattice points P and Q are rational multiples of one another; the factor Q/P is returned in that case.
P / Q : TorLatElt,TorLatElt -> FldRatElt
The rational factor P/Q in the case that the toric lattice points P and Q are rational multiples of one another.

Example Polyhedra_toric-example-pt (H152E18)

This simple example builds some points in a toric lattice and performs arithmetic on them.
> L := ToricLattice(3);
> a := L ! [1,2,3];
> a;
(1, 2, 3)
> L eq Parent(a);
true
> b := L ! [1/2,1,3/2];
> a + b;
(3/2, 3, 9/2)
> a eq b;
false
> a eq 2*b;
true
> b/a;
1/2
v in L : TorLatElt,TorLat -> BoolElt
Return true if and only if the toric lattice point v lies in the toric lattice L.
Matrix(R,S) : Rng, [TorLatElt] -> ModMatRngElt
Matrix(S) : [TorLatElt] -> ModMatRngElt
The matrix whose rows are given by the lattice points in the sequence S.
Vector(v) : TorLatElt -> ModTupFldElt
The toric lattice point v realised as a vector.
IsZero(v) : TorLatElt -> BoolElt
Return true if and only if the toric lattice point v is the zero vector.
IsIntegral(v) : TorLatElt -> BoolElt
Return true if and only if the coefficients of the toric lattice point v are integral.
IsPrimitive(v) : TorLatElt -> BoolElt
Return true if and only if the toric lattice point v is a primitive integral vector; that is, v is not divisible as an integral vector in its ambient toric lattice.
PrimitiveLatticeVector(v) : TorLatElt -> TorLatElt
The first toric lattice point on the ray spanned by v.

Example Polyhedra_toric-primitive-pt (H152E19)

A point of a sublattice may be primitive in the sublattice even though it is not primitive in the bigger lattice: treating sublattices as the images of embeddings makes this point transparent. First build a sublattice K of L together with the embedding map.
> L := ToricLattice(2);
> K,emb := Sublattice([L | [2,0],[0,2]]);
Construct a point in L that is clearly not primitive.
> vL := L ! [2,2];
> IsPrimitive(vL);
false
Pulling this point back to K shows that it is obviously primitive in K.
> vK := vL @@ emb;
> vK;
(1, 1)
> IsPrimitive(vK);
true
But notice that coercion of the point of L into K is not the same thing: it simply works with the coefficients of the point and gives an answer that is not what is wanted in this case.
> K ! vL;
(2, 2)
> IsPrimitive(K ! vL);
false

Operations on Toric Lattices

L eq K : TorLat,TorLat -> BoolElt
Return true if and only if the toric lattices L and K are the same object in Magma (and not merely isomorphic).
Sublattice(Q) : [TorLatElt] -> TorLat,TorLatMap
A toric lattice L1 isomorphic to the sublattice of a toric lattice L generated by the sequence Q of elements of L together with an embedding map of L1 in L. The Magma subobject constructor sub< L | Q > can also be used, although the sequence Q must be a sequence of elements of L and cannot be interpreted more broadly.
ToricLattice(Q) : [[RngIntElt]] -> TorLat,TorLatMap
The toric sublattice of Qn⊃Zn (regarded as a toric lattice) generated by the sequences of integers of length n of which the sequence Q comprises.
Quotient(C) : TorCon -> TorLat,TorLatMap
Quotient(Q) : [TorLatElt] -> TorLat,TorLatMap
Quotient(v) : TorLatElt -> TorLat,TorLatMap
A toric lattice isomorphic to the toric lattice that is the quotient of a toric lattice L by the linear span of the cone C, or the elements v∈L that comprise the sequence Q or the single primitive vector v∈L. The projection map of L to the quotient is also returned.
AddVectorToLattice(v) : TorLatElt -> TorLat,TorLatMap
AddVectorToLattice(Q) : [TorLatElt] -> TorLat,TorLatMap
A toric lattice L1 isomorphic to the toric lattice generated by a toric lattice L together with the vector v∈L (or by a sequence of vectors of L). The inclusion map of L in L1 is also returned.
AreGenerators(S) : SetEnum -> BoolElt
Returns true iff the set of toric lattice points S⊂L generate the lattice L.
IsSublattice(L) : TorLat -> BoolElt
Return true if and only if the toric lattice L was constructed as a sublattice of another toric lattice.
IsSuperlattice(L) : TorLat -> BoolElt
Return true if and only if the toric lattice L was constructed as a superlattice of another toric lattice (by the addition of a rational vector).
IsDirectSum(L) : TorLat -> BoolElt
Return true if and only if the toric lattice L was constructed as the direct sum of other toric lattices.
IsQuotient(L) : TorLat -> BoolElt
Return true if and only if the toric lattice L was constructed as the quotient of another toric lattice.
Sublattice(L) : TorLat -> TorLat,TorLatMap
If the toric lattice L was constructed as the extension of a toric lattice K by the addition of a vector, then return K.
Superlattice(L) : TorLat -> TorLat,TorLatMap
If the toric lattice L was constructed as a sublattice of a toric lattice K, then return K.
Summands(L) : TorLat -> SeqEnum,SeqEnum,SeqEnum
If the toric lattice L was constructed as a direct sum, return a sequence of the toric lattice summands used (and parallel sequences of their embedding maps in L and the projections from L to them).

Example Polyhedra_toric-example-pt (H152E20)

Construct a sublattice of a toric lattice L and compute its natural basis in the original coordinates of L; the user does not have control over the choice of coordinates and inclusion map.
> L := ToricLattice(2);
> L1,phi1 := Sublattice([L| [1,2],[2,1]]);
> L1;
2-dimensional toric lattice L1 = sub(Z^2)
> phi1(L1.1), phi1(L1.2);
(1, 2)
(0, 3)
A similar calculation for a quotient map.
> L2,phi2 := Quotient(L ! [3/2,2]);
> L2;
1-dimensional toric lattice L2 = (Z^2) / <3, 4>
> phi2(L.1), phi2(L.2);
(-4)
(3)
And again for an extension of L.
> L3,phi3 := AddVectorToLattice(L ! [1/5,2/5]);
> L3;
2-dimensional toric lattice L3 = (Z^2) + <1/5, 2/5>
> phi3(L1.1), phi3(L1.2);
(1, 0)
(2, 5)

Maps of Toric Lattices

Maps between toric lattices are of type TorLatMap. They can be constructed using the hom< L -> K | M > constructor, where M is the matrix of the desired linear map with respect to the standard bases of L and K. The usual evaluation operations @ and @@ can be applied, although there are image and preimage intrinsics too. Basic arithmetic of maps (sum, difference and scalar multiple, each taken pointwise) is available.

ZeroMap(L,K) : TorLat,TorLat -> TorLatMap
The zero map between toric lattices L and K.
IdentityMap(L) : TorLat -> TorLatMap
The identity map on the toric lattice L.
hom< L -> K | M > : TorLat,TorLat,Mtrx -> TorLatMap
LatticeMap(L,K,M) : TorLat,TorLat,Mtrx -> TorLatMap
The map between toric lattices L and K determined by the matrix M (with respect to the standard bases of L and M).
LatticeMap(L,Q) : TorLat,[TorLatElt] -> TorLatMap
The toric lattice map from toric lattice L to the toric lattice M determined by the sequence Q of toric lattice points, where M is the toric lattice containing the points of Q.
DefiningMatrix(f) : TorLatMap -> ModMatRngElt
The defining matrix of the lattice map f.
Image(f,C) : TorLatMap,TorCon -> TorCon
Image(f,P) : TorLatMap,TorPol -> TorPol
Image(f,v) : TorLatMap,TorLatElt -> TorLatElt
The image of the cone C or polyhedron P or lattice element v under the toric lattice map f; the type of the object is preserved under the map.
Preimage(f,C) : TorLatMap,TorCon -> TorCon
Preimage(f,P) : TorLatMap,TorPol -> TorPol
Preimage(f,v) : TorLatMap,TorLatElt -> TorLatElt
The preimage of the cone C or polyhedron P or lattice element v by the toric lattice map f; the type of the object is preserved.
KernelEmbedding(f) : TorLatMap -> Map
KernelEmbedding(v) : TorLatElt -> Map
The inclusion of the kernel of the toric lattice map f, regarded as a distinct toric lattice, into the domain of f; or the same for the dual subspace annihilated by lattice element v.
KernelBasis(f) : TorLatMap -> SeqEnum
KernelBasis(v) : TorLatElt -> SeqEnum
A basis for the kernel of the toric lattice map f or the dual of the sublattice annihilated by the lattice element v.
ImageBasis(f) : TorLatMap -> SeqEnum
A basis for the image of the toric lattice map f.
IsCokernelTorsionFree(f) : TorLatMap -> BoolElt
Return true if and only if the cokernel of the toric lattice map f is torsion free.
ChangeBasis(v) : TorLatElt -> Map
Given a primitive form v∈Lv in the lattice dual to L, returns a change of basis of L such that (ker)(v) maps to the standard codimension 1 lattice.

Example Polyhedra_toric-change-basis-example (H152E21)

We start by constructing a polytope P of lattice width two:
> P:=Polytope([
>     [ 1, 0, -1 ],
>     [ 0, 0, 1 ],
>     [ 0, -1, 3 ],
>     [ -1, 1, 0 ],
>     [ 0, 0, -1 ]
> ]);
> width,ws:=Width(P);
> width;
2
We wish to construct a change of basis to make this explicit: we want to construct Q isomorphic to P such that Q is of width two with respect to (0, 0, 1).
> phi:=ChangeBasis(Representative(ws));
> Q:=Image(phi,P);
> Q;
3-dimensional polytope Q with 5 vertices:
    ( 1,  0,  1),
    ( 0,  0,  1),
    ( 0, -1,  1),
    (-1,  1,  0),
    ( 0,  0, -1)
> w:=Dual(Ambient(Q)).3;
> [w * v : v in Vertices(Q)];
[ 1, 1, 1, 0, -1 ]
We conclude by taking slices through Q at each height:
> Polyhedron(Q,w,-1);
0-dimensional polytope with one vertex:
    (0,  0, -1)
> Polyhedron(Q,w,0);
2-dimensional polytope with 3 vertices:
    ( -1,    1,   0),
    (  0, -1/2,   0),
    (1/2,    0,   0)
> Polyhedron(Q,w,1);
2-dimensional polytope with 3 vertices:
    (0, -1,  1),
    (0,  0,  1),
    (1,  0,  1)
V2.28, 13 July 2023