Face lattices of polytopes

Questions and problems about using polymake go here.
ren
Posts: 38
Joined: 03 May 2011, 15:21

Face lattices of polytopes

Postby ren » 28 Apr 2017, 11:52

I have a small problem with face lattices of polytopes. The following code from the tutorial (https://polymake.org/doku.php/tutorial/ ... e_tutorial) does not work anymore:

Code: Select all

$p = n_gon(5); $HD = $p->HASSE_DIAGRAM; for (my $k=$HD->DIMS->[1]; $k<$HD->DIMS->[2]; ++$k) { print $HD->FACES->[$k] }
Here is the error that I get from both my local polymake and the web interface:

Code: Select all

polytope > $p = n_gon(5); polytope > $HD = $p->HASSE_DIAGRAM; polymake: used package ppl The Parma Polyhedra Library (PPL): A C++ library for convex polyhedra and other numerical abstractions. http://www.cs.unipr.it/ppl/ polytope > for (my $k=$HD->DIMS->[1]; $k<$HD->DIMS->[2]; ++$k) { print $HD->FACES->[$k] } polymake: WARNING: available properties insufficient to compute 'DIMS' polymake: ERROR: Can't use an undefined value as an ARRAY reference at input line 1.
The face lattice is incredibly useful for computing resolution of certain classes of hypersurface singularities. :)

User avatar
joswig
Main Author
Posts: 280
Joined: 24 Dec 2010, 11:10

Re: Face lattices of polytopes

Postby joswig » 28 Apr 2017, 15:10

Thanks for pointing this out. The tutorial will be corrected.

The property DIMS was sacrificed in the last refactoring. This is now replaced by a more fancy mechanism. E.g., you can do

Code: Select all

print $HD->INVERSE_RANK_MAP->nodes_of_rank(2);
to obtain the indices of the faces of rank 2 (i.e., the edges). The resulting numbers can be applied as indices, i.e., to the DECORATION property.

blorenz
Developer
Posts: 139
Joined: 10 Jan 2011, 17:21

Re: Face lattices of polytopes

Postby blorenz » 28 Apr 2017, 15:21

The tutorial is now updated.

There is also a shortcut to get the nodes of a given dimension (in contrast to the rank):

Code: Select all

print $p->HASSE_DIAGRAM->nodes_of_dim(1);
Or printing the faces (and this should work with both 3.0 and 3.1):

Code: Select all

print map { $p->HASSE_DIAGRAM->FACES->[$_] } @{$p->HASSE_DIAGRAM->nodes_of_dim(1)};

ren
Posts: 38
Joined: 03 May 2011, 15:21

Re: Face lattices of polytopes

Postby ren » 28 Apr 2017, 15:22

Thanks alot, that will make my code even cleaner now. I was wondering how to obtain the decorations... :)


Return to “Helpdesk”