Quick reference for polyhedra in Sage¶
Author: JeanPhilippe Labbé <labbe@math.fuberlin.de> Vincent Delecroix <vincent.delecroix@ubordeaux.fr>
List of Polyhedron methods¶
H and Vrepresentation
ring on which the polyhedron is defined 

ambient vector space or free module 

vector space or free module used for the vectors of the Hrepresentation 

vector space or free module used for the vectors of the Vrepresentation 

number of elements in the Hrepresentation (sum of the number of equations and inequalities) 

number of elements in the Vrepresentation (sum of vertices, rays and lines) 

number of equations 

number of inequalities 

number of vertices 

number of rays 

number of lines 

number of facets 
Polyhedron boolean properties:
tests emptyness 

tests whether a polyhedra is the whole ambient space 

tests if the polyhedron has the same dimension as the ambient space 

tests whether two polyhedra are combinatorially isomorphic 

tests compactness, or boundedness of a polyhedron 

tests whether a polyhedron is a lattice polytope 

tests whether the polyhedron is inscribed in a sphere 

tests if the polyhedron can be used to produce another given polyhedron using a Minkowski sum. 

tests whether the polyhedron has full skeleton until half of the dimension (or up to a certain dimension) 

tests if the polar of a lattice polytope is also a lattice polytope (only for 

checks whether the degree of all vertices is equal to the dimension of the polytope 

test whether a polytope is a simplex 

checks whether all faces of the polyhedron are simplices 

tests whether self is a Lawrence polytope 

tests whether the polytope is selfdual 

test whether the polytope is a pyramid over one of its facets 

test whether the polytope is combinatorially equivalent to a bipyramid over some polytope 

test whether the polytope is combinatorially equivalent to a prism of some polytope 
Enumerative properties
the dimension of the ambient vector space 

the dimension of the polytope 

alias of dim 

the \(f\)vector (number of faces of each dimension) 

the flag\(f\)vector (number of chains of faces) 

highest cardinality for which all \(k\)subsets of the vertices are faces of the polyhedron 

highest cardinality for which all \(k\)faces are simplices 

highest cardinality for which the polar is \(k\)simplicial 
Implementation properties
gives the backend used 

gives the base ring used 

changes the base ring 
Transforming polyhedra
Minkowski sum of two polyhedra 

Minkowski difference of two polyhedra 

Minkowski decomposition (only for 

cartesian product of two polyhedra 

intersection of two polyhedra 

join of two polyhedra 

convex hull of the union of two polyhedra 

constructs an affinely equivalent fulldimensional polyhedron 

constructs a geometric realization of the barycentric subdivision 

scalar dilation 

truncates a specific face 

returns the face splitting of a face of self 

the onepoint suspension over a vertex of self (face splitting of a vertex) 

stack a face of the polyhedron 

returns an encompassing lattice polytope. 

returns the polar of a polytope (needs to be compact) 

prism over a polyhedron (increases both the dimension of the polyhedron and the dimension of the ambient space) 

pyramid over a polyhedron (increases both the dimension of the polyhedron and the dimension of the ambient space) 

bipyramid over a polyhedron (increases both the dimension of the polyhedron and the dimension of the ambient) 

translates by a given vector 

truncates all vertices simultaneously 

returns the Lawrence extension of self on a given point 

returns the Lawrence polytope of self 

returns the wedge over a face of self 
Combinatorics
the combinatorial polyhedron 

the face lattice 

the hasse diagram 

the automorphism group of the underlying combinatorial polytope 

underlying graph 

digraph (orientation of edges determined by a linear form) 

bipartite digraph given vertexfacet adjacency 

adjacency matrix 

incidence matrix 

slack matrix 

adjacency matrix of the facets 

adjacency matrix of the vertices 
Integral points
the Ehrhart polynomial for 

the Ehrhart polynomial for 

the Ehrhart quasipolynomial for 

the \(h^*\)vector for polytopes with integral vertices 

list of integral points 

number of integral points 

get the ith integral point without computing all interior lattice points 

checks whether the origin is an interior lattice point and compactness (only for 

get a random integral point 
Getting related geometric objects
returns the boundary complex of simplicial compact polyhedron 

returns the average of the vertices of the polyhedron 

returns the center of the mass 

returns the sum of the center and the rays 

returns a maximal chain of faces 

returns the fan spanned by the faces of the polyhedron 

a generator over the faces 

the list of faces 

the list of facets 

returns the fan spanned by the normals of the supporting hyperplanes of the polyhedron 

returns the (affine) Gale transform of the vertices of the polyhedron 

returns the hyperplane arrangement given by the defining facets of the polyhedron 

transform the polyhedra into a Linear Program 

returns a triangulation of the polyhedron 

returns an iterator of the fibrations of the lattice polytope (only for 
Other
generator for bounded edges 

returns the vertices of an encompassing cube 

tests whether the polyhedron contains a vector 

tests whether the polyhedron contains a vector in its interior using the ambient topology 

tests whether the polyhedron contains a vector in its relative interior 

returns the translation vector between two translation of two polyhedron (only for 

computes the integral of a polynomial over the polyhedron 

returns the radius of the smallest sphere containing the polyhedron 

returns the square of the radius of the smallest sphere containing the polyhedron 

computes different volumes of the polyhedron 

returns the restricted automorphism group 

returns the lattice automorphism group. Only for 