Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision |
tutorial:apps_tropical [2017/06/12 18:29] – [Tropical arithmetics] removed faulty polynomial syntax oroehrig | tutorial:apps_tropical [2017/07/06 20:43] – [Tropical convex hull computations] renamed CONE_COVECTOR_DECOMP into POLYTOPE_... oroehrig |
---|
==== Tropical convex hull computations ==== | ==== Tropical convex hull computations ==== |
| |
The basic object for tropical convex hull computations is ''Cone'' (**Careful:** If you're not in application tropical, be sure to use the namespace identifier ''tropical::Cone'' to distinguish it from the ''polytope::Cone''). | The basic object for tropical convex hull computations is ''Polytope'' (**Careful:** If you're not in application tropical, be sure to use the namespace identifier ''tropical::Polytope'' to distinguish it from the ''polytope::Polytope''). |
| |
A tropical cone should always be created via ''POINTS'' (i.e. not ''VERTICES''), since they determine the combinatorial structure. The following creates a tropical line segment in the tropical projective plane. Note that the point (0,1,1) is not a vertex, as it is in the tropical convex hull of the other two points. However, it does play a role when computing the corresponding subdivision of the tropical projective torus into covector cells (see the [[apps_tropical#A note on coordinates|note]] below to understand the different coordinates): | A tropical polytope should always be created via ''POINTS'' (i.e. not ''VERTICES''), since they determine the combinatorial structure. The following creates a tropical line segment in the tropical projective plane. Note that the point (0,1,1) is not a vertex, as it is in the tropical convex hull of the other two points. However, it does play a role when computing the corresponding subdivision of the tropical projective torus into covector cells (see the [[apps_tropical#A note on coordinates|note]] below to understand the different coordinates): |
<code> | <code> |
tropical > $c = new Cone<Min>(POINTS=>[[0,0,0],[0,1,1],[0,2,1]]); | tropical > $c = new Polytope<Min>(POINTS=>[[0,0,0],[0,1,1],[0,2,1]]); |
tropical > print $c->VERTICES; | tropical > print $c->VERTICES; |
0 0 0 | 0 0 0 |
{2 3 4} | {2 3 4} |
{2 4 5} | {2 4 5} |
tropical > print $c->CONE_MAXIMAL_COVECTOR_CELLS; | tropical > print $c->POLYTOPE_MAXIMAL_COVECTOR_CELLS; |
{3 4} | {3 4} |
{4 5} | {4 5} |
</code> | </code> |
| |
In case you're just interested in either the subdivision of the full torus, or the polyhedral structure of the tropical cone, the following will give you those structures as ''fan::PolyhedralComplex'' objects in //affine// coordinates: | In case you're just interested in either the subdivision of the full torus, or the polyhedral structure of the tropical polytope, the following will give you those structures as ''fan::PolyhedralComplex'' objects in //affine// coordinates: |
<code> | <code> |
tropical > $t = $c->torus_subdivision_as_complex; | tropical > $t = $c->torus_subdivision_as_complex; |
tropical > $p = $c->cone_subdivision_as_complex; | tropical > $p = $c->polytope_subdivision_as_complex; |
tropical > print $p->VERTICES; | tropical > print $p->VERTICES; |
1 0 0 | 1 0 0 |
Note that by default, the affine chart is {x_0 = 0}. You can choose any chart {x_i = 0} by passing i as an argument to ''.._subdivision_as_complex''. | Note that by default, the affine chart is {x_0 = 0}. You can choose any chart {x_i = 0} by passing i as an argument to ''.._subdivision_as_complex''. |
| |
Polymake computes the full subdivision of both the torus and the cone as a ''CovectorLattice'', which is just a ''FaceLattice'' with an additional map that attaches to each cell in the subdivision its covector. For more details on this data structure see the [[http://polymake.org/release_docs/snapshot/tropical.html | reference documentation]]. You can visualize the covector lattice with | Polymake computes the full subdivision of both the torus and the polytope as a ''CovectorLattice'', which is just a ''FaceLattice'' with an additional map that attaches to each cell in the subdivision its covector. For more details on this data structure see the [[http://polymake.org/release_docs/snapshot/tropical.html | reference documentation]]. You can visualize the covector lattice with |
<code> | <code> |
tropical > $c->TORUS_COVECTOR_DECOMPOSITION->VISUAL; | tropical > $c->TORUS_COVECTOR_DECOMPOSITION->VISUAL; |
tropical > $c->CONE_COVECTOR_DECOMPOSITION->VISUAL; | tropical > $c->POLYTOPE_COVECTOR_DECOMPOSITION->VISUAL; |
</code> | </code> |
Each node in the lattice is a cell of the subdivision. The top row describes the vertices and rays of the subdivision. The bottom row is the covector of that cell with respect to the ''POINTS''. | Each node in the lattice is a cell of the subdivision. The top row describes the vertices and rays of the subdivision. The bottom row is the covector of that cell with respect to the ''POINTS''. |