Lattice - Maple Help

PolyhedralSets[ZPolyhedralSets]

 Lattice
 construct an integer lattice

 Calling Sequence Lattice(matrix, vector) Lattice(lattice)

Parameters

 matrix - a matrix with only integer entries vector - a vector with only integer entries lattice - lattice to copy

Description

 • Lattice(matrix, vector) returns the integer lattice generated by matrix and vector. The lattice generated by matrix and vector is the set of all integer points obtained by multiplying matrix on the right by an integer vector and adding vector to that product.
 • The number of rows of matrix must match the number of entries of vector. Otherwise, an error is raised.
 • In some literature, a lattice of the d-dimensional Euclidean space consists of all linear combinations with integer coefficients of a basis of that space. In some other literature, see the reference below, the notion of a lattice precisely matches that of this command.
 • By default, matrix and vector are copied after creating the lattice.

Examples

 > $\mathrm{with}\left(\mathrm{PolyhedralSets}\right):$
 > $\mathrm{with}\left(\mathrm{ZPolyhedralSets}\right):$
 > $\mathrm{with}\left(\mathrm{plots}\right):$
 > $\mathrm{with}\left(\mathrm{LinearAlgebra}\right):$

Create the two-dimensional integer lattice, that is, all couples of integers

 > $L≔\mathrm{Lattice}\left(\mathrm{Matrix}\left(\left[\left[1,0\right],\left[0,1\right]\right]\right),\mathrm{Vector}\left(\left[0,0\right]\right)\right)$
 ${L}{≔}{\mathrm{Lattice}}{}\left(\left[\begin{array}{cc}{1}& {0}\\ {0}& {1}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {0}\end{array}\right]\right)$ (1)

Plot the two-dimensional integer lattice

 > $\mathrm{plots}:-\mathrm{pointplot}\left(\left[\mathrm{seq}\left(\mathrm{seq}\left(\left[x,y\right],x=-5..5\right),y=-5..5\right)\right]\right)$

Create another two-dimensional lattice,

 > $A≔\mathrm{Matrix}\left(\left[\left[2,0\right],\left[0,-1\right]\right]\right);$$V≔\mathrm{Vector}\left(\left[0,0\right]\right);$$L≔\mathrm{Lattice}\left(A,V\right)$
 ${A}{≔}\left[\begin{array}{cc}{2}& {0}\\ {0}& {-1}\end{array}\right]$
 ${V}{≔}\left[\begin{array}{c}{0}\\ {0}\end{array}\right]$
 ${L}{≔}{\mathrm{Lattice}}{}\left(\left[\begin{array}{cc}{2}& {0}\\ {0}& {-1}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {0}\end{array}\right]\right)$ (2)

Access the data of the lattice

 > $\mathrm{GetMatrix}\left(L\right);$$\mathrm{GetVector}\left(L\right)$
 $\left[\begin{array}{cc}{2}& {0}\\ {0}& {-1}\end{array}\right]$
 $\left[\begin{array}{c}{0}\\ {0}\end{array}\right]$ (3)

Plot this two-dimensional lattice

 > $L≔\left[\mathrm{seq}\left(\mathrm{seq}\left(\mathrm{VectorAdd}\left(\mathrm{MatrixVectorMultiply}\left(A,\mathrm{Vector}\left(\left[x,y\right]\right)\right),V\right),x=-5..5\right),y=-5..5\right)\right]$
 ${L}{≔}\left[\left[\begin{array}{c}{-10}\\ {5}\end{array}\right]{,}\left[\begin{array}{c}{-8}\\ {5}\end{array}\right]{,}\left[\begin{array}{c}{-6}\\ {5}\end{array}\right]{,}\left[\begin{array}{c}{-4}\\ {5}\end{array}\right]{,}\left[\begin{array}{c}{-2}\\ {5}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {5}\end{array}\right]{,}\left[\begin{array}{c}{2}\\ {5}\end{array}\right]{,}\left[\begin{array}{c}{4}\\ {5}\end{array}\right]{,}\left[\begin{array}{c}{6}\\ {5}\end{array}\right]{,}\left[\begin{array}{c}{8}\\ {5}\end{array}\right]{,}\left[\begin{array}{c}{10}\\ {5}\end{array}\right]{,}\left[\begin{array}{c}{-10}\\ {4}\end{array}\right]{,}\left[\begin{array}{c}{-8}\\ {4}\end{array}\right]{,}\left[\begin{array}{c}{-6}\\ {4}\end{array}\right]{,}\left[\begin{array}{c}{-4}\\ {4}\end{array}\right]{,}\left[\begin{array}{c}{-2}\\ {4}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {4}\end{array}\right]{,}\left[\begin{array}{c}{2}\\ {4}\end{array}\right]{,}\left[\begin{array}{c}{4}\\ {4}\end{array}\right]{,}\left[\begin{array}{c}{6}\\ {4}\end{array}\right]{,}\left[\begin{array}{c}{8}\\ {4}\end{array}\right]{,}\left[\begin{array}{c}{10}\\ {4}\end{array}\right]{,}\left[\begin{array}{c}{-10}\\ {3}\end{array}\right]{,}\left[\begin{array}{c}{-8}\\ {3}\end{array}\right]{,}\left[\begin{array}{c}{-6}\\ {3}\end{array}\right]{,}\left[\begin{array}{c}{-4}\\ {3}\end{array}\right]{,}\left[\begin{array}{c}{-2}\\ {3}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {3}\end{array}\right]{,}\left[\begin{array}{c}{2}\\ {3}\end{array}\right]{,}\left[\begin{array}{c}{4}\\ {3}\end{array}\right]{,}\left[\begin{array}{c}{6}\\ {3}\end{array}\right]{,}\left[\begin{array}{c}{8}\\ {3}\end{array}\right]{,}\left[\begin{array}{c}{10}\\ {3}\end{array}\right]{,}\left[\begin{array}{c}{-10}\\ {2}\end{array}\right]{,}\left[\begin{array}{c}{-8}\\ {2}\end{array}\right]{,}\left[\begin{array}{c}{-6}\\ {2}\end{array}\right]{,}\left[\begin{array}{c}{-4}\\ {2}\end{array}\right]{,}\left[\begin{array}{c}{-2}\\ {2}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {2}\end{array}\right]{,}\left[\begin{array}{c}{2}\\ {2}\end{array}\right]{,}\left[\begin{array}{c}{4}\\ {2}\end{array}\right]{,}\left[\begin{array}{c}{6}\\ {2}\end{array}\right]{,}\left[\begin{array}{c}{8}\\ {2}\end{array}\right]{,}\left[\begin{array}{c}{10}\\ {2}\end{array}\right]{,}\left[\begin{array}{c}{-10}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}{-8}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}{-6}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}{-4}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}{-2}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}{2}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}{4}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}{6}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}{8}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}{10}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}{-10}\\ {0}\end{array}\right]{,}\left[\begin{array}{c}{-8}\\ {0}\end{array}\right]{,}\left[\begin{array}{c}{-6}\\ {0}\end{array}\right]{,}\left[\begin{array}{c}{-4}\\ {0}\end{array}\right]{,}\left[\begin{array}{c}{-2}\\ {0}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {0}\end{array}\right]{,}\left[\begin{array}{c}{2}\\ {0}\end{array}\right]{,}\left[\begin{array}{c}{4}\\ {0}\end{array}\right]{,}\left[\begin{array}{c}{6}\\ {0}\end{array}\right]{,}\left[\begin{array}{c}{8}\\ {0}\end{array}\right]{,}\left[\begin{array}{c}{10}\\ {0}\end{array}\right]{,}\left[\begin{array}{c}{-10}\\ {-1}\end{array}\right]{,}\left[\begin{array}{c}{-8}\\ {-1}\end{array}\right]{,}\left[\begin{array}{c}{-6}\\ {-1}\end{array}\right]{,}\left[\begin{array}{c}{-4}\\ {-1}\end{array}\right]{,}\left[\begin{array}{c}{-2}\\ {-1}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {-1}\end{array}\right]{,}\left[\begin{array}{c}{2}\\ {-1}\end{array}\right]{,}\left[\begin{array}{c}{4}\\ {-1}\end{array}\right]{,}\left[\begin{array}{c}{6}\\ {-1}\end{array}\right]{,}\left[\begin{array}{c}{8}\\ {-1}\end{array}\right]{,}\left[\begin{array}{c}{10}\\ {-1}\end{array}\right]{,}\left[\begin{array}{c}{-10}\\ {-2}\end{array}\right]{,}\left[\begin{array}{c}{-8}\\ {-2}\end{array}\right]{,}\left[\begin{array}{c}{-6}\\ {-2}\end{array}\right]{,}\left[\begin{array}{c}{-4}\\ {-2}\end{array}\right]{,}\left[\begin{array}{c}{-2}\\ {-2}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {-2}\end{array}\right]{,}\left[\begin{array}{c}{2}\\ {-2}\end{array}\right]{,}\left[\begin{array}{c}{4}\\ {-2}\end{array}\right]{,}\left[\begin{array}{c}{6}\\ {-2}\end{array}\right]{,}\left[\begin{array}{c}{8}\\ {-2}\end{array}\right]{,}\left[\begin{array}{c}{10}\\ {-2}\end{array}\right]{,}\left[\begin{array}{c}{-10}\\ {-3}\end{array}\right]{,}\left[\begin{array}{c}{-8}\\ {-3}\end{array}\right]{,}\left[\begin{array}{c}{-6}\\ {-3}\end{array}\right]{,}\left[\begin{array}{c}{-4}\\ {-3}\end{array}\right]{,}\left[\begin{array}{c}{-2}\\ {-3}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {-3}\end{array}\right]{,}\left[\begin{array}{c}{2}\\ {-3}\end{array}\right]{,}\left[\begin{array}{c}{4}\\ {-3}\end{array}\right]{,}\left[\begin{array}{c}{6}\\ {-3}\end{array}\right]{,}\left[\begin{array}{c}{8}\\ {-3}\end{array}\right]{,}\left[\begin{array}{c}{10}\\ {-3}\end{array}\right]{,}\left[\begin{array}{c}{-10}\\ {-4}\end{array}\right]{,}\left[\begin{array}{c}{-8}\\ {-4}\end{array}\right]{,}\left[\begin{array}{c}{-6}\\ {-4}\end{array}\right]{,}\left[\begin{array}{c}{-4}\\ {-4}\end{array}\right]{,}\left[\begin{array}{c}{-2}\\ {-4}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {-4}\end{array}\right]{,}\left[\begin{array}{c}{2}\\ {-4}\end{array}\right]{,}\left[\begin{array}{c}{4}\\ {-4}\end{array}\right]{,}\left[\begin{array}{c}{6}\\ {-4}\end{array}\right]{,}\left[\begin{array}{c}{8}\\ {-4}\end{array}\right]{,}\left[\begin{array}{c}{10}\\ {-4}\end{array}\right]{,}\left[\begin{array}{c}{-10}\\ {-5}\end{array}\right]{,}\left[\begin{array}{c}{-8}\\ {-5}\end{array}\right]{,}\left[\begin{array}{c}{-6}\\ {-5}\end{array}\right]{,}\left[\begin{array}{c}{-4}\\ {-5}\end{array}\right]{,}\left[\begin{array}{c}{-2}\\ {-5}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {-5}\end{array}\right]{,}\left[\begin{array}{c}{2}\\ {-5}\end{array}\right]{,}\left[\begin{array}{c}{4}\\ {-5}\end{array}\right]{,}\left[\begin{array}{c}{6}\\ {-5}\end{array}\right]{,}\left[\begin{array}{c}{8}\\ {-5}\end{array}\right]{,}\left[\begin{array}{c}{10}\\ {-5}\end{array}\right]\right]$ (4)
 > $\mathrm{plots}:-\mathrm{pointplot}\left(L,\mathrm{color}=\mathrm{blue}\right)$

Create the three-dimensional integer lattice, that is, all triples of integers

 > $L≔\mathrm{Lattice}\left(\mathrm{Matrix}\left(\left[\left[1,0,0\right],\left[0,1,0\right],\left[0,0,1\right]\right]\right),\mathrm{Vector}\left(\left[0,0,0\right]\right)\right)$
 ${L}{≔}{\mathrm{Lattice}}{}\left(\left[\begin{array}{ccc}{1}& {0}& {0}\\ {0}& {1}& {0}\\ {0}& {0}& {1}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {0}\\ {0}\end{array}\right]\right)$ (5)

Plot the three-dimensional integer lattice

 > $\mathrm{plots}:-\mathrm{pointplot3d}\left(\left[\mathrm{seq}\left(\mathrm{seq}\left(\mathrm{seq}\left(\left[x,y,z\right],x=-5..5\right),y=-5..5\right),z=-5..5\right)\right]\right)$

References

 Rachid Seghir, Vincent Loechner, and Benoı̂t Meister. "Integer affine transformations of parametric Z-polytopes and applications to loop nest optimization." Proceedings of TACO, Vol. 9(2):8:1–8:27, 2012.

Compatibility

 • The PolyhedralSets:-ZPolyhedralSets:-Lattice package was introduced in Maple 2023.