Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision |
tutorial:lattice_polytopes_tutorial [2017/04/20 15:49] – removed trailing command prompts oroehrig | user_guide:tutorials:lattice_polytopes_tutorial [2019/01/25 09:38] – ↷ Page moved from user_guide:lattice_polytopes_tutorial to user_guide:tutorials:lattice_polytopes_tutorial oroehrig |
---|
====== Tutorial for Lattice Polytopes ====== | ====== Tutorial for Lattice Polytopes ====== |
| |
This page gives a small introduction to lattice polytopes in ''polymake'', some useful external software, and usage hints for it. For a list of methods and properties applicable to lattice polytopes see [[tutorial:lattice_polytopes_doc|here]]. For an introduction to the ''polymake'' package see [[tutorial/start|here]]. \\ | This page gives a small introduction to lattice polytopes in ''polymake'', some useful external software, and usage hints for it. For a list of methods and properties applicable to lattice polytopes see [[user_guide:lattice_polytopes_doc|here]]. For an introduction to the ''polymake'' package see [[user_guide:start|here]]. \\ |
''polymake'' always assumes that the lattice used to define a lattice polytope is the standard lattice Z<sup>d</sup>. Some rules also require that the polytope is full dimensional. There are user functions that transform a polytope sitting in some affine subspace of R<sup>d</sup> into a full dimensional polytope, either in the induced lattice or the lattice spanned by the vertices, see below. \\ | ''polymake'' always assumes that the lattice used to define a lattice polytope is the standard lattice Z<sup>d</sup>. Some rules also require that the polytope is full dimensional. There are user functions that transform a polytope sitting in some affine subspace of R<sup>d</sup> into a full dimensional polytope, either in the induced lattice or the lattice spanned by the vertices, see below. \\ |
| |
The result is no surprise, being very ample is inherited by faces. We could also be interested in the facet width of the polytope $f. This is the minimum over the maximal distance of a facet to any other vertex. ''polymake'' knows how to compute this: | The result is no surprise, being very ample is inherited by faces. We could also be interested in the facet width of the polytope $f. This is the minimum over the maximal distance of a facet to any other vertex. ''polymake'' knows how to compute this: |
<code> | <code> |
polytope > print $f->FACET_WIDTH; | polytope > print $f->FACET_WIDTH; |
polymake: WARNING: could not compute 'FACET_WIDTH' probably because of unsatisfied preconditions: | polymake: WARNING: could not compute 'FACET_WIDTH' probably because of unsatisfied preconditions: |
precondition : FULL_DIM ( FACET_WIDTHS : VERTICES , FACETS , CONE_AMBIENT_DIM ) | precondition : FULL_DIM ( FACET_WIDTHS : VERTICES , FACETS , CONE_AMBIENT_DIM ) |
</code> | </code> |
The output may look similar to the following. \\ | The output may look similar to the following. \\ |
{{:tutorial:cube-in-lattice.gif?298}} | {{user_guide:cube-in-lattice.gif?298}} |
| |
The command ''LATTICE_COLORED'' sorted the lattice points into three classes before visualization: lattice points in the interior of the polytope, lattice points on the boundary, and vertices that are not in the lattice. These classes are then visualized with different colors (where we only see two in the above picture, as all vertices of the cube are in the lattice). If you don't need this distinction, ''VISUAL->LATTICE'' avoids the additional computations. | The command ''LATTICE_COLORED'' sorted the lattice points into three classes before visualization: lattice points in the interior of the polytope, lattice points on the boundary, and vertices that are not in the lattice. These classes are then visualized with different colors (where we only see two in the above picture, as all vertices of the cube are in the lattice). If you don't need this distinction, ''VISUAL->LATTICE'' avoids the additional computations. |
<code> | <code> |
polytope > $p = cube(3); | polytope > $p = cube(3); |
polytope > $p->provide("HILBERT_BASIS","H_STAR_VECTOR"); | polytope > $p->provide("HILBERT_BASIS_GENERATORS","H_STAR_VECTOR"); |
polymake: running norm64: norm64 -h /tmp/poly7175Taaaa0021 | |
polytope > print join ", ",$p->list_properties(); | polytope > print join ", ",$p->list_properties(); |
AMBIENT_DIM, DIM, FACETS, VERTICES_IN_FACETS, BOUNDED, AFFINE_HULL, VERTICES, LATTICE, HILBERT_BASIS, N_LATTICE_POINTS, NORMAL, LATTICE_VOLUME, EHRHART_POLYNOMIAL_COEFF, H_STAR_VECTOR | CONE_AMBIENT_DIM, CONE_DIM, FACETS, AFFINE_HULL, VERTICES_IN_FACETS, BOUNDED, POINTED, FEASIBLE, N_FACETS, FULL_DIM, N_VERTICES, MONOID_GRADING, VERTICES, LINEALITY_SPACE, HILBERT_BASIS_GENERATORS, H_STAR_VECTOR, HILBERT_SERIES |
</code> | </code> |