Macaulay2 » Documentation
Packages » PALPInterface :: palpMVertices
next | previous | forward | backward | up | index | toc

palpMVertices -- the vertices and the lattice points of a lattice polytope

Description

These work for every full dimensional lattice polytope $P$; it need not contain the origin, or any lattice point, in its interior. A matrix over QQ with integer entries, such as the vertices of a polyhedron from Polyhedra, is accepted as well.

i1 : ws = {10, 1, 2, 3, 4};
i2 : palpMVertices ws

o2 = | -1 4  1  -1 -1 -1 0  |
     | -1 -1 1  2  1  -1 -1 |
     | -1 -1 -1 -1 0  1  1  |

              3       7
o2 : Matrix ZZ  <-- ZZ
i3 : numColumns palpMPoints ws

o3 = 23

The columns of a matrix need not be vertices: they may include other points of $P$, and may repeat.

i4 : A = matrix{{0, 2, 0, 2, 1, 1}, {0, 0, 2, 2, 1, 1}}

o4 = | 0 2 0 2 1 1 |
     | 0 0 2 2 1 1 |

              2       6
o4 : Matrix ZZ  <-- ZZ
i5 : palpMVertices A

o5 = | 0 2 0 2 |
     | 0 0 2 2 |

              2       4
o5 : Matrix ZZ  <-- ZZ
i6 : palpMPoints A

o6 = | 0 2 0 2 1 0 1 1 2 |
     | 0 0 2 2 1 1 0 2 1 |

              2       9
o6 : Matrix ZZ  <-- ZZ

The points come in the order PALP chooses, so compare results as sets, or with palpNormalForm. They agree with Polyhedra.

i7 : P = convexHull palpMVertices ws;
i8 : numColumns palpMPoints ws == #latticePoints P

o8 = true

Caveat

Finding lattice points slows down quickly with the dimension, even when there are few of them: on the standard simplex palpMPoints takes a few seconds in dimension eight and more than a minute in dimension nine. palpMVertices stays fast.

See also

Ways to use palpMVertices:

  • palpMVertices(List)
  • palpMVertices(Matrix)
  • palpMVertices(WeightSystem)

For the programmer

The object palpMVertices is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.26.11+ds/M2/Macaulay2/packages/PALPInterface.m2:1673:0.