Differences
This shows you the differences between two versions of the page.
— | user_guide:tutorials:latest:apps_fan [2023/11/06 10:57] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Getting started with the application fan ====== | ||
+ | |||
+ | Besides the name giving polyhedral fans this application covers a few other big objects and related functions. An overview can be found in the [[documentation: | ||
+ | |||
+ | However, this tutorial focuses on [[documentation: | ||
+ | |||
+ | Most of the following code snippets will only work in your polymake shell after switching to the application '' | ||
+ | |||
+ | <code perl> | ||
+ | > application ' | ||
+ | </ | ||
+ | ===== Polyhedral fans ===== | ||
+ | |||
+ | ==== Construction from scratch ==== | ||
+ | |||
+ | A primal description containing rays and rays-cones incidence relations can be passed to the constructor like this: | ||
+ | |||
+ | <code perl> | ||
+ | > $f = new PolyhedralFan(INPUT_RAYS=> | ||
+ | </ | ||
+ | Former are assigned to [[documentation: | ||
+ | |||
+ | <code perl> | ||
+ | > print $f-> | ||
+ | <{0} | ||
+ | {1} | ||
+ | {2} | ||
+ | {3} | ||
+ | > | ||
+ | <{0 1} | ||
+ | {1 2} | ||
+ | {2 3} | ||
+ | {0 3} | ||
+ | > | ||
+ | </ | ||
+ | You can specify a fan with lineality by additionally passing [[documentation: | ||
+ | |||
+ | The properties [[documentation: | ||
+ | |||
+ | <code perl> | ||
+ | > print rows_labeled($f-> | ||
+ | > print $f-> | ||
+ | > print " | ||
+ | 0:1 0 | ||
+ | 1:0 1 | ||
+ | 2:-1 0 | ||
+ | 3:0 -1 | ||
+ | |||
+ | {0 1} | ||
+ | {1 2} | ||
+ | {2 3} | ||
+ | {0 3} | ||
+ | |||
+ | lineality dimensions: 0x2 | ||
+ | </ | ||
+ | Note that, even though '' | ||
+ | |||
+ | Instead of the input properties, you may right away use '' | ||
+ | |||
+ | Unlike input rays and input cones, only providing rays and maximal cones may not describe a fan with lineality. In this case polymake assumes an empty lineality space. All given rays must be non-redundant and in case of non-pointed fans '' | ||
+ | |||
+ | === The dual description === | ||
+ | |||
+ | The following properties give rise to a dual description: | ||
+ | |||
+ | <code perl> | ||
+ | > print rows_labeled($f-> | ||
+ | > print rows_labeled($f-> | ||
+ | 0:1 0 | ||
+ | 1:0 1 | ||
+ | |||
+ | 0:1 1 | ||
+ | 1:-1 1 | ||
+ | 2:-1 -1 | ||
+ | 3:1 -1 | ||
+ | </ | ||
+ | Where '' | ||
+ | |||
+ | The dual description requires additional information on the linear span of each maximal cone. This is stored in '' | ||
+ | |||
+ | <code perl> | ||
+ | > print $f-> | ||
+ | > print $f-> | ||
+ | 0 | ||
+ | |||
+ | {} | ||
+ | {} | ||
+ | {} | ||
+ | {} | ||
+ | </ | ||
+ | ==== Construction from a set of cones ==== | ||
+ | |||
+ | As an example one can extract the second and fourth maximal cone of '' | ||
+ | |||
+ | <code perl> | ||
+ | > $c1 = $f-> | ||
+ | > $c3 = $f-> | ||
+ | </ | ||
+ | and pass them to the user method [[documentation: | ||
+ | |||
+ | <code perl> | ||
+ | > $checkedfan = check_fan_objects($c1, | ||
+ | > print $checkedfan-> | ||
+ | {0 1} | ||
+ | {2 3} | ||
+ | </ | ||
+ | ==== Construction from other objects ==== | ||
+ | |||
+ | Polymake provides several clients doing this job. | ||
+ | |||
+ | === normal_fan === | ||
+ | |||
+ | The inner normal fan of a polytope can be produced with this client. For example the normal fan of the 3-dimensional +/-1 cube: | ||
+ | |||
+ | <code perl> | ||
+ | > $nf = normal_fan(cube(3)); | ||
+ | </ | ||
+ | Normal fans of bounded feasible polytopes always satisfy the following properties: | ||
+ | |||
+ | <code perl> | ||
+ | > foreach my $prop (qw(regular pure complete full_dim)) { | ||
+ | > print ucfirst($prop),": | ||
+ | > } | ||
+ | Regular: true | ||
+ | Pure: true | ||
+ | Complete: true | ||
+ | Full_dim: true | ||
+ | </ | ||
+ | If the given polytope is not full-dimensional, | ||
+ | |||
+ | === face_fan === | ||
+ | |||
+ | Face fans of polytopes are always constructed with respect to a certain point in the polytopes relative interior. Providing it is optional if the polytope is centered. Zero will be used as default. If the polytope is not centered you have to pass such a point as a second argument (in homogeneous coordinates). For example: | ||
+ | |||
+ | <code perl> | ||
+ | > $v = new Vector([1, | ||
+ | > $ff = face_fan(cross(3), | ||
+ | </ | ||
+ | === k_skeleton === | ||
+ | |||
+ | This client can be used to obtain a subfan consisting of all cones up to a certain dimension. As an example we construct the skeleton of '' | ||
+ | |||
+ | <code perl> | ||
+ | > $nf2skel = k_skeleton($nf, | ||
+ | </ | ||
+ | By taking a look at the f-vectors one can see that the latter has no cones of dimension 3. | ||
+ | |||
+ | <code perl> | ||
+ | > print " | ||
+ | > print " | ||
+ | normal fan: 6 12 8 | ||
+ | skeleton: | ||
+ | </ | ||
+ | This can also be seen in the Hasse diagram of the skeleton. | ||
+ | |||
+ | Note that the Hasse diagram of a polyhedral fan will always contain an artifical node at the top which is marked in black and does not correspond to any cone. | ||
+ | |||
+ | <code perl> | ||
+ | > svg($nf2skel-> | ||
+ | </ | ||
+ | {{ tutorials: | ||