Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
tutorial:apps_tropical [2015/10/05 11:47] – hampe | user_guide:apps_tropical [2019/01/25 09:27] – ↷ Page moved from tutorial:apps_tropical to user_guide:apps_tropical oroehrig | ||
---|---|---|---|
Line 5: | Line 5: | ||
* Tropical convex hull computations | * Tropical convex hull computations | ||
* Tropical cycles and hypersurfaces. | * Tropical cycles and hypersurfaces. | ||
+ | |||
+ | To use the full palette of tools for tropical geometry, switch to the corresponding application by typing the following in the '' | ||
+ | < | ||
+ | > application ' | ||
+ | </ | ||
=== Disclaimer: Min or Max - you have to choose! === | === Disclaimer: Min or Max - you have to choose! === | ||
Most objects and data types related to tropical computations have a template parameter which tells it whether Min or Max is used as tropical addition. There is **no default** for this, so you have to choose! | Most objects and data types related to tropical computations have a template parameter which tells it whether Min or Max is used as tropical addition. There is **no default** for this, so you have to choose! | ||
+ | |||
+ | === Disclaimer 2: Newest version required === | ||
+ | |||
+ | Most of the features described here only work in polymake version 3.0 or newer. | ||
==== Tropical arithmetics ==== | ==== Tropical arithmetics ==== | ||
Line 40: | Line 49: | ||
</ | </ | ||
- | Finally, you can also create tropical polynomials. This can either | + | Finally, you can also create tropical polynomials. This can be done with the special |
< | < | ||
- | tropical > $r = new Ring< | ||
- | tropical > ($x, $y, $z) = $r-> | ||
- | tropical > $p = $x*$x + $y * $z; | ||
- | tropical > print $p; | ||
- | x0^2 + x1*x2 | ||
tropical > $q = toTropicalPolynomial(" | tropical > $q = toTropicalPolynomial(" | ||
tropical > print $q; | tropical > print $q; | ||
x0^2 + x1*x2 | x0^2 + x1*x2 | ||
</ | </ | ||
+ | |||
+ | ==== Tropical convex hull computations ==== | ||
+ | |||
+ | The basic object for tropical convex hull computations is '' | ||
+ | |||
+ | A tropical polytope should always be created via '' | ||
+ | < | ||
+ | tropical > $c = new Polytope< | ||
+ | tropical > print $c-> | ||
+ | 0 0 0 | ||
+ | 0 2 1 | ||
+ | tropical > print rows_labeled($c-> | ||
+ | 0:0 0 1 1 | ||
+ | 1:0 0 -1 0 | ||
+ | 2:0 0 0 -1 | ||
+ | 3:1 0 0 0 | ||
+ | 4:1 0 1 1 | ||
+ | 5:1 0 2 1 | ||
+ | tropical > print $c-> | ||
+ | {0 1 4} | ||
+ | {0 2 5} | ||
+ | {0 4 5} | ||
+ | {1 2 3} | ||
+ | {1 3 4} | ||
+ | {2 3 4} | ||
+ | {2 4 5} | ||
+ | tropical > print $c-> | ||
+ | {3 4} | ||
+ | {4 5} | ||
+ | tropical > $c-> | ||
+ | </ | ||
+ | |||
+ | 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 '' | ||
+ | < | ||
+ | tropical > $t = $c-> | ||
+ | tropical > $p = $c-> | ||
+ | tropical > print $p-> | ||
+ | 1 0 0 | ||
+ | 1 1 1 | ||
+ | 1 2 1 | ||
+ | tropical > print $p-> | ||
+ | {0 1} | ||
+ | {1 2} | ||
+ | </ | ||
+ | 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 '' | ||
+ | |||
+ | Polymake computes the full subdivision of both the torus and the polytope as a '' | ||
+ | < | ||
+ | tropical > $c-> | ||
+ | tropical > $c-> | ||
+ | </ | ||
+ | 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 '' | ||
+ | |||
+ | ==== Tropical cycles ==== | ||
+ | |||
+ | The main object here is '' | ||
+ | |||
+ | A tropical cycle can be created, like a '' | ||
+ | < | ||
+ | tropical > $x = new Cycle< | ||
+ | </ | ||
+ | This creates the standard tropical (max-)line in the plane. There are two caveats to observe here: | ||
+ | - The use of '' | ||
+ | - You can also define a cycle using '' | ||
+ | |||
+ | Entering projective coordinates can be a little tedious, since it usually just means adding a zero in front of your affine coordinates. There is a convenience function that does this for you. The following creates the excact same cycle as above: | ||
+ | < | ||
+ | tropical > $x = new Cycle< | ||
+ | </ | ||
+ | |||
+ | One can now ask for basic properties of the cycle, e.g., if it's balanced: | ||
+ | < | ||
+ | tropical > print is_balanced($x); | ||
+ | 1 | ||
+ | </ | ||
+ | |||
+ | === Hypersurfaces === | ||
+ | |||
+ | Most of the time you probably won't want to input your tropical cycle directly as above. Polymake has a special data type '' | ||
+ | < | ||
+ | tropical > $H = new Hypersurface< | ||
+ | tropical > print $H-> | ||
+ | 0 0 -1 -1 | ||
+ | 0 0 1 0 | ||
+ | 0 0 0 1 | ||
+ | 1 0 0 0 | ||
+ | tropical > print $H-> | ||
+ | {2 3} | ||
+ | {1 3} | ||
+ | {0 3} | ||
+ | tropical > print $H-> | ||
+ | 1 1 1 | ||
+ | </ | ||
+ | |||
+ | === Tropical intersection theory (and much more): a-tint === | ||
+ | |||
+ | As of version 2.15-beta3, polymake comes bundled with the extension [[https:// | ||
+ | |||
+ | ==== A note on coordinates ==== | ||
+ | |||
+ | Coordinates of tropical cones and cycles all live in //tropical projective space//, i.e. TP< | ||
+ | |||
+ | When describing polyhedral complexes in tropical projective space, polymake uses vectors in TP< | ||