# matrix(ToricMap) -- get the underlying map of lattices

## Description

Every toric map $f : X \to Y$ corresponds to a unique map $g : N_X \to N_Y$ of lattices such that, for every cone $\sigma$ in the fan of $X$, there is a cone in the fan of $Y$ that contains the image $g(\sigma)$. For more information on this correspondence, see Theorem 3.3.4 in Cox-Little-Schenck's Toric Varieties. This method returns an integer matrix representing $g$.

We illustrate how to access this defining feature of a toric map with the projection from the second Hirzebruch surface to the projective line.

 i1 : X = hirzebruchSurface 2; i2 : Y = toricProjectiveSpace 1; i3 : f = map(Y, X, matrix {{1, 0}}) o3 = | 1 0 | o3 : ToricMap Y <--- X i4 : g = matrix f o4 = | 1 0 | 1 2 o4 : Matrix ZZ <--- ZZ i5 : assert (isWellDefined f and ring g === ZZ)

An inclusion map into the Cartesian square of a normal toric variety corresponds to matrix having identity and zero blocks.

 i6 : X2 = X ** X; i7 : iota0 = X2_ o7 = | 1 0 | | 0 1 | | 0 0 | | 0 0 | o7 : ToricMap X2 <--- X i8 : assert (isWellDefined iota0 and source iota0 === X) i9 : iota1 = X2_ o9 = | 0 0 | | 0 0 | | 1 0 | | 0 1 | o9 : ToricMap X2 <--- X i10 : assert (isWellDefined iota1 and source iota1 === X)

In a well-defined toric map, the number of rows in the underlying matrix must equal the dimension of the target and the number of columns must equal the dimension of the source.

 i11 : assert (numColumns g == dim X) i12 : assert (numRows g == dim Y)

The output display for toric maps is inherited the underlying map of lattices.

 i13 : code (net, ToricMap) o13 = -- code for method: net(ToricMap) /usr/share/Macaulay2/NormalToricVarieties/ ToricMaps.m2:10:18-10:32: --source code: net ToricMap := f -> net matrix f

Since this is a defining attribute of a toric map, no computation is required.