Both sides previous revision Previous revision | Last revisionBoth sides next revision |
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 | user_guide:tutorials:lattice_polytopes_tutorial [2019/01/25 11:09] – added section on groebner bases from the lattice_polytopes_doc oroehrig |
---|
1 4 4 | 1 4 4 |
</code> | </code> |
| |
| ==== Groebner Bases ==== |
| |
| ''polymake'' can compute Groebner bases for the toric ideals associated to the lattice points in the polytope using any term order. Currently, ''polymake'' uses ''4ti2'' for the computation. |
| |
| The ideal is defined in a polynomial ring that has one variable for each lattice point in the polytope. These variables are labeled in the same order as the lattice points listed in the ''LATTICE_POINTS'' section. The result of the computation will be a list of vectors each representing a Groebner basis element. The Groebner basis element corresponding to a vector ''v'' in the list is a binomial ''g=g<sup>+</sup>-g<sup>-</sup>'' obtained as follows. First, one has to split the vector into its positive part ''v<sup>+</sup>'' and negative part ''v<sup>-</sup>'', i.e. ''v<sup>+</sup>-v<sup>-</sup>=v'' and ''v<sup>+</sup>, v<sup>-</sup>'' both non-negative. Then ''v<sup>+</sup>'' is the exponent vector of the leading term ''g<sup>+</sup>'' and ''v<sup>-</sup>'' the exponent vector of the trailing term ''g<sup>-</sup>''. |
| |
| ''GROEBNER_BASIS'' is a multiple object that can hold a term order and the corresponding Groebner basis. This reflects the fact that the basis depends on the choice of a term order. There are two different ways to enter a term order in ''polymake''. You can either give a sequence of weight vectors as rows of a matrix, or you can enter one of the predefined term orders. Currently, there are three term orders defined. |
| |
| ^ Name ^ Term Order ^ |
| | ''lex'' | lexicographic order | |
| | ''deglex'' | degree lexicographic order | |
| | ''degrevlex'' | degree reverse lexicographic order | |
| |
| Note however, that these names are internally converted into square matrices, so it may be more efficient to define the term order by a weight vector. |
| |
| We explain the use with an example: |
| <code> |
| polytope > $p=new Polytope<Rational>(POINTS=>[[1,0,0],[1,1,0],[1,0,1],[1,1,1]]); |
| polytope > print $p->LATTICE_POINTS; |
| 1 1 0 |
| 1 0 1 |
| 1 0 0 |
| 1 1 1 |
| polytope > $g=new GroebnerBasis("gb1", TERM_ORDER_MATRIX=>[[1,2,1,2]]); |
| polytope > $p->add("GROEBNER_BASIS",$g); |
| polytope > print $p->GROEBNER_BASIS("gb1")->BASIS; |
| polymake: used package 4ti2 |
| 4ti2 -- A software package for algebraic, geometric and combinatorial problems on linear spaces. |
| Copyright by 4ti2 team. |
| http://www.4ti2.de/ |
| |
| -1 1 1 -1 |
| polytope >$h=new GroebnerBasis("gb2", TERM_ORDER_NAME=>"deglex"); |
| polytope > $p->add("GROEBNER_BASIS",$h); |
| polytope > print $p->GROEBNER_BASIS("gb2")->BASIS; |
| 1 1 -1 -1 |
| </code> |
| |
| Note again, that the result of the Groebner basis computation has to be interpreted using the ''LATTICE_POINTS'' section of the polytope. So the binomial for the deglex order in the last computation is ''x<sub>1</sub>x<sub>2</sub>-x<sub>3</sub>x<sub>4</sub>'', where the variables ''x<sub>1</sub>'' and ''x<sub>2</sub>'' correspond to the standard basis vectors, ''x<sub>3</sub>'' to the origin and ''x<sub>4</sub>'' to the point ''(1,1)''. |
| |
| |