This is an old revision of the document!
BigObject Polytope
Not necessarily bounded convex polyhedron, i.e., the feasible region of a linear program. Nonetheless, the name “Polytope” is used for two reasons: Firstly, as far as the combinatorics is concerned we always deal with polytopes; see the description of VERTICES_IN_FACETS for details. Note that a pointed polyhedron is projectively equivalent to a polytope. The second reason is historical. We use homogeneous coordinates, which is why Polytope is derived from Cone. derived from ['/polytope/objects/Cone'] specializations: {'Polytope::Lattice': {'$text': ' A polytope all of whose vertex coordinates are integral.\n'}, 'Polytope<Float>': {'$text': ' A pointed polyhedron with float coordinates realized in Rd.\n\n It mainly exists for visualization.\n\n Convex hull and related algorithms use floating-point arithmetics.\n Due to numerical errors inherent to this kind of computations, the resulting\n combinatorial description can be arbitrarily far away from the truth, or even\n not correspond to any valid polytope. You have been warned.\n\n None of the standard construction clients produces objects of this type.\n If you want to get one, create it with the explicit constructor or convert_to.\n'}, 'Symmetry': {'$text': ' These specializations capture information of the object that is concerned with the action of permutation groups.\n'}, 'Polytope<Rational>': {'$text': ' A rational polyhedron realized in Q^d\n'}}
- Example:
To construct a polytope as the convex hull of three points in the plane use
> $p=new Polytope(POINTS=>[[1,0,0],[1,1,0],[1,0,1]]); print $p->N_FACETS 3
Note that homogeneous coordinates are used throughout.
- Example:
Many standard constructions are available directly. For instance, to get a regular 120-cell (which is 4-dimensional) use:
> $c=regular_120_cell(); print $c->VOLUME; 1575+705r5
This is the exact volume 1575+705*\sqrt{5}.
polymake has limited support for polytopes with non-rational coordinates.
Properties
Combinatorics
These properties capture combinatorial information of the object. Combinatorial properties only depend on combinatorial data of the object like, e.g., the face lattice.
H_VECTOR
- Type: Vector
- h-vector, defined via recursion on the face lattice of a polytope.
Coincides for simplicial polytopes with the combinatorial definition
of the h-vector via shellings
- Type: Bool
- True if all facets are cubes.
- Example:
A k-dimensional cube has k-1-dimensional cubes as facets and is therefore cubical. The following checks if this holds for the
3-dimensional case:
> print cube(3)->CUBICAL; true
- Example:
This checks if a zonotope generated by 4 random points on the 3-dimensional sphere is cubical, which is always the case.
> print zonotope(rand_sphere(3,4)->VERTICES)->CUBICAL; true
- Type: Array
- Minimal non-faces of a SIMPLICIAL polytope.
- Type: Graph
- Properties of GRAPH:
EDGE_DIRECTIONS
- Type: EdgeMap
- Difference of the vertices for each edge (only defined up to signs).
SQUARED_EDGE_LENGTHS
- Type: EdgeMap
- Squared Euclidean length of each edge
LATTICE_ACCUMULATED_EDGE_LENGTHS
- Type: Map
- a map associating to each edge length of the polytope the number of edges with this length
the lattice edge length of an edge is one less than the number of lattice points on that edge
LATTICE_EDGE_LENGTHS
- Type: EdgeMap
- the lattice lengths of the edges of the polytope
i.e. for each edge one less than the number of lattice points on that edge
- Type: Float
- Parameter describing the shape of the face-lattice of a 4-polytope.
- Type: Vector
- (Toric) g-vector, defined via the (generalized) h-vector as gi = hi - hi-1.
- Type: Bool
- Dual to CUBICAL.
- Example:
Since the cross-polytope is dual to a cube of same dimension, it is cocubical. The following checks this for the 3-dimensional case:
> print cross(3)->COCUBICAL; true
- Type: Graph
- Properties of DUAL_GRAPH:
DIHEDRAL_ANGLES
- Type: EdgeMap
- Dihedral angles (in radians) between the two facets corresponding to
each edge of the dual graph, i.e. the ridges of the polytope.
- Type: Matrix
- List of all edges with orientation, such that for each 2-face the opposite edges point in the same direction.
Each line is of the form (u v), which indicates that the edge {u,v} is oriented from u to v.
The polytope is required to be 2-cubical. - Example:
The following prints a list of oriented edges of a 2-dimensional cube such that opposing edges have the same orientation:
> $p = cube(2); print $p->EDGE_ORIENTATION; 0 2 1 3 0 1 2 3
- Type: Matrix
- fik is the number of incident pairs of i-faces and k-faces; the main diagonal contains the F_VECTOR.
- Example:
The following prints the f2-vector of a 3-dimensional cube:
> print cube(3)->F2_VECTOR; 8 24 24 24 12 24 24 24 6
- Type: Matrix
- Ordered list of edges of a Moebius strip with parallel interior edges.
Consists of k lines of the form (vi wi), for i=1, …, k. \\
The Moebius strip in question is given by the quadrangles
(vi, wi, wi+1,vi+1), for i=1, …, k-1, and the quadrangle (v1, w1, vk, wk).\\
Validity can be verified with the client validate_moebius_strip.
The polytope is required to be 2-cubical.
- Type: Bool
- True if there exists an edge-orientation (see EDGE_ORIENTATION for a definition).
The polytope is required to be 2-cubical. - Example:
The following checks a 3-dimensional cube for edge orientability:
> $p = cube(3); print $p->EDGE_ORIENTABLE; true
- Example:
A 3-dimensinal cube with one stacked facet is still 2-cubical. Therefore we can check for edge orientability:
> $p = stack(cube(3),5); print $p->EDGE_ORIENTABLE; true
- Type: Int
- Example:
The following prints the number of vertices of a 3-dimensional cube:
> print cube(3)->N_VERTICES; 8
- Example:
The following prints the number of vertices of the convex hull of 10 specific points lying in the unit square [0,1]^2:
> print rand_box(2,10,1,seed=>4583572)->N_VERTICES; 4
- Type: Int
- Maximal dimension in which all faces are simplices.
- Example:
The 3-dimensional cross-polytope is simplicial, i.e. its simplicity is 2. After truncating an arbitrary vertex
the simplicity is reduced to 1.
> print cross(3)->SIMPLICIALITY; 2
> print truncation(cross(3),4)->SIMPLICIALITY; 1
FOLDABLE_MAX_SIGNATURE_UPPER_BOUND
- Type: Int
- An upper bound for the maximal signature of a foldable triangulation of a polytope
The signature is the absolute difference of the normalized volumes of black minus white maximal simplices,
where only odd normalized volumes are taken into account.
- Type: Bool
- True if the polytope is simple. Dual to SIMPLICIAL.
- Example:
This determines if a 3-dimensional cube is simple or not:
> print cube(3)->SIMPLE; true
- Type: Bool
- True if the polytope is self-dual.
- Example:
The following checks if the centered square with side length 2 is self dual:
> print cube(2)->SELF_DUAL; true
- Example:
The elongated square pyramid (Johnson solid 8) is dual to itself, since the apex of the square pyramid attachted to the cube
and the opposing square of the cube swap roles. The following checks this property and prints the result:
> print johnson_solid(8)->SELF_DUAL; true
- Type: Int
- Dual to CUBICALITY.
- Example:
After stacking a facet of the 3-dimensional cube, its cubicality is lowered to 2. Hence its dual polytope has cocubicality 2 as well. The
following produces such a stacked cube and asks for its cocubicality after polarization:
> $p = stack(cube(3),5); print polarize($p)->COCUBICALITY; 2
- Type: Int
- Measures the deviation of the cone from being simple in terms of the GRAPH.
Alias for property EXCESS_RAY_DEGREE. - Example:
The excess vertex degree of an egyptian pyramid is one.
> print pyramid(cube(2))->EXCESS_VERTEX_DEGREE; 1
- Type: Vector
- Coefficients of the cd-index.
- Type: Float
- Parameter describing the shape of the face-lattice of a 4-polytope.
- Type: Map
- Lists for each occurring size (= number of incident vertices or edges) of a 2-face how many there are.
- Example:
This prints the number of facets spanned by 3,4 or 5 vertices a truncated 3-dimensional cube has.
> $p = truncation(cube(3),5); print $p->TWO_FACE_SIZES; {(3 1) (4 3) (5 3)}
- Type: Int
- Maximal dimension in which all facets are balanced.
- Example:
The following full dimensional polytope given by 10 specific vertices on the 8-dimensional sphere is 3-neighborly. Hence the dual polytope is
3-balanced, where we first center and then polarize it.
> $p = rand_sphere(8,10,seed=>8866463); $q = polarize(center($p)); print $q->BALANCE; 3
- Type: Int
- Maximal dimension in which all dual faces are simplices.
- Example:
This checks the 3-dimensional cube for simplicity. Since the cube is dual to the cross-polytope of equal dimension and all its faces are simplices,
the result is 2.
> print cube(3)->SIMPLICITY; 2
- Type: Vector
- h-vector of the bounded subcomplex, defined for not necessarily bounded polyhedra
which are simple (as polyhedra, i.e., VERTEX_DEGREES on the FAR_FACE do not matter).
Coincides with the reverse h-vector of the dual simplicial ball.
Note that this vector will usually start with a number of zero entries.
- Type: Map
- Lists for each occurring size (= number of incident facets or ridges) of a subridge how many there are.
- Type: Int
- A lower bound for the minimal number of simplices in a triangulation
- Type: IncidenceMatrix
- Vertex-facet incidence matrix, with rows corresponding to facets and columns
to vertices. Vertices and facets are numbered from 0 to N_VERTICES-1 rsp.
N_FACETS-1, according to their order in VERTICES rsp. FACETS.\\
This property is at the core of all combinatorial properties. It has the following semantics:
(1) The combinatorics of an unbounded and pointed polyhedron is defined to be the combinatorics
of the projective closure.
(2) The combiantorics of an unbounded polyhedron which is not pointed is defined to be the
combinatorics of the quotient modulo the lineality space.
Therefore: VERTICES_IN_FACETS and each other property which is grouped under “Combinatorics”
always refers to some polytope.
Alias for property RAYS_IN_FACETS. - Example:
The following prints the vertex-facet incidence matrix of a 5-gon by listing all facets as a set of contained vertices
in a cyclic order (each line corresponds to an edge):
> print n_gon(5)->VERTICES_IN_FACETS; {1 2} {2 3} {3 4} {0 4} {0 1}
- Example:
The following prints the Vertex_facet incidence matrix of the standard 3-simplex together with the facet numbers:
> print rows_numbered(simplex(3)->VERTICES_IN_FACETS); 0:1 2 3 1:0 2 3 2:0 1 3 3:0 1 2
- Type: Vector
- fk is the number of k-faces.
- Example:
This prints the f-vector of a 3-dimensional cube. The first entry represents the vertices.
> print cube(3)->F_VECTOR; 8 12 6
- Example:
This prints the f-vector of the 3-dimensional cross-polytope. Since the cube and the cross polytope
of equal dimension are dual, their f-vectors are the same up to reversion.
> print cross(3)->F_VECTOR; 6 12 8
- Example:
After truncating the first standard basis vector of the 3-dimensional cross-polytope the f-vector changes.
Only segments of the incident edges of the cut off vertex remain and the intersection of these with the new hyperplane
generate four new vertices. These also constitute four new edges and a new facet.
> print truncation(cross(3),4)->F_VECTOR; 9 16 9
- Type: Bool
- True if the polytope is simplicial.
- Example:
A polytope with random vertices uniformly distributed on the unit sphere is simplicial. The following checks
this property and prints the result for 8 points in dimension 3:
> print rand_sphere(3,8)->SIMPLICIAL; true
- Type: Integer
- Let M be the vertex-facet incidence matrix, then the Altshuler determinant is
defined as max{det(M ∗ MT), det(MT ∗ M)}. - Example:
This prints the Altshuler determinant of the built-in pentagonal pyramid (Johnson solid 2):
> print johnson_solid("pentagonal_pyramid")->ALTSHULER_DET; 25
- Type: Lattice
- Type: IncidenceMatrix
- transposed VERTICES_IN_FACETS
Notice that this is a temporary property; it will not be stored in any file.
Alias for property FACETS_THRU_RAYS.
- Type: Int
- Maximal dimension in which all faces are simple polytopes.
This checks the 3-dimensional cube for face simplicity. Since the cube is dual to the cross-polytope of equal dimension and it is simplicial,
the result is 3.
> print cube(3)→SIMPLICITY;
| 3
- Type: Int
- Maximal dimension in which all facets are neighborly.
- Example:
This determines that the full dimensional polytope given by 10 specific vertices on the 8-dimensional sphere is 3-neighborly, i.e.
all 3-dimensional faces are tetrahedra. Hence the polytope is not neighborly.
> print rand_sphere(8,10,seed=>8866463)->NEIGHBORLINESS; 3
- Type: Array
- Number of incident facets for each vertex.
Alias for property RAY_SIZES. - Example:
The following prints the number of incident facets for each vertex of the elongated pentagonal pyramid (Johnson solid 9)
> print johnson_solid(9)->VERTEX_SIZES; 5 4 4 4 4 4 3 3 3 3 3
- Type: Vector
- dual h-vector, defined via recursion on the face lattice of a polytope.
Coincides for simple polytopes with the combinatorial definition
of the h-vector via abstract objective functions.
- Type: Int
- Number of pairs of incident vertices and facets.
Alias for property N_RAY_FACET_INC.
- Type: Bool
- True if the polytope is neighborly.
- Example:
This checks the 4-dimensional cyclic polytope with 6 points on the moment curve for neighborliness, i.e. if it is ⌊dim/2⌋ neighborly:
> print cyclic(4,6)->NEIGHBORLY; true
- Type: Bool
- Dual to NEIGHBORLY.
- Example:
Since cyclic polytopes generated by vertices on the moment curve are neighborly, their dual polytopes are balanced. The following checks this
for the 4-dimensional case by centering the cyclic polytope and then polarizing it:
> $p = cyclic(4,6); $q = polarize(center($p)); print $q->BALANCED; true
- Type: Vector
- Cubical h-vector. Defined for cubical polytopes.
- Type: Int
- Maximal dimension in which all facets are cubes.
- Example:
We will modify the 3-dimensional cube in two different ways. While stacking some facets (in this case facets 4 and 5) preserves the cubicality up to
dimension 2, truncating an arbitrary vertex reduces the cubicality to 1.
> print stack(cube(3),[4,5])->CUBICALITY; 2
> print truncation(cube(3),5)->CUBICALITY; 1
- Type: Matrix
- Unordered list of quads which forms a Moebius strip with parallel interior edges.
Each line lists the vertices of a quadrangle in cyclic order.\\
Validity can be verified with the client validate_moebius_strip_quads.
The polytope is required to be 2-cubical.
Geometry
These properties capture geometric information of the object. Geometric properties depend on geometric information of the object, like, e.g., vertices or facets.
CENTRALLY_SYMMETRIC
- Type: Bool
- True if P = -P.
- Example:
A centered 3-cube is centrally symmetric. By stacking a single facet (5), this property is lost. We can
recover it by stacking the opposing facet (4) as well.
> $p = cube(3); print $p->CENTRALLY_SYMMETRIC; true
> print stack($p,5)->CENTRALLY_SYMMETRIC; false
> print stack($p,new Set<Int>(4,5))->CENTRALLY_SYMMETRIC; true
- Type: Vector
- A vertex of a pointed polyhedron.
Alias for property ONE_RAY. - Example:
This prints the first vertex of the 3-cube (corresponding to the first row in the vertex matrix).
> print cube(3)->ONE_VERTEX; 1 -1 -1 -1
- Type: IncidenceMatrix
- Type: Matrix
- Vertices of the polyhedron. No redundancies are allowed.
All vectors in this section must be non-zero.
The coordinates are normalized the same way as POINTS. Dual to FACETS.
This section is empty if and only if the polytope is empty.
The property VERTICES appears only in conjunction with the property LINEALITY_SPACE.
The specification of the property VERTICES requires the specification of LINEALITY_SPACE, and vice versa.
Alias for property RAYS. - Example:
To print the vertices (in homogeneous coordinates) of the standard 2-simplex, i.e. a right-angled isoceles triangle, type this:
> print simplex(2)->VERTICES; (3) (0 1) 1 1 0 1 0 1
- Example:
If we know some points to be vertices of their convex hull, we can store them as rows in a Matrix and construct a new polytope with it.
The following produces a 3-dimensioanl pyramid over the standard 2-simplex with the specified vertices:
> $M = new Matrix([[1,0,0,0],[1,1,0,0],[1,0,1,0],[1,0,0,3]]); $p = new Polytope(VERTICES=>$M);
- Example:
The following adds a (square) pyramid to one facet of a 3-cube. We do this by extracting the vertices of the cube via the built-in
method and then attach the apex of the pyramid to the matrix.
> $v = new Vector([1,0,0,3/2]); $M = cube(3)->VERTICES / $v; $p = new Polytope(VERTICES=>$M);
- Type: Matrix
- A weighted inner point depending on the outer angle called Steiner point for all faces of dimensions 2 to d.
- Type: IncidenceMatrix
- Similar to VERTICES_IN_FACETS, but with columns corresponding to POINTS instead of VERTICES.
This property is a byproduct of convex hull computation algorithms.
It is discarded as soon as VERTICES_IN_FACETS is computed.
Alias for property INPUT_RAYS_IN_FACETS.
- Type: Graph
- Two SPLITS are compatible if the defining hyperplanes do not intersect in the
interior of the polytope. This defines a graph.
- Type: Int
- Type: QuotientSpace
- A topological quotient space obtained from a polytope by identifying faces.
- Type: IncidenceMatrix
- similar to FACETS_THRU_VERTICES, but with POINTS instead of VERTICES
Notice that this is a temporary property; it will not be stored in any file.
Alias for property FACETS_THRU_INPUT_RAYS.
- Type: Bool
- True if the polyhedron is not empty.
- Type: Matrix
- Coordinates of the Gale transform.
- Type: Vector
- The center of gravity of the vertices of a bounded polytope.
- Example:
This prints the vertex barycenter of the standard 3-simplex:
> print simplex(3)->VERTEX_BARYCENTER; 1 1/4 1/4 1/4
- Type: Int
- One more than the dimension of the affine hull of the polyhedron
= one more than the dimension of the polyhedron.
= dimension of the homogenization of the polyhedron
If the polytope is given purely combinatorially, this is the dimension of a minimal embedding space - Example:
This prints the cone dimension of a 3-cube. Since the dimension of its affine closure is 3, the result is 4.
> print cube(3)->CONE_DIM; 4
- Type: Matrix
- The splits of the polytope, i.e., hyperplanes cutting the polytope in
two parts such that we have a regular subdivision.
- Type: Bool
- A rational polytope is lattice if each bounded vertex has integer coordinates.
- Type: Array
- The permutation induced by the central symmetry, if present.
- Type: Bool
- is the zonotope calculated from ZONOTOPE_INPUT_POINTS or ZONOTOPE_INPUT_VECTORS to be centered at the origin?
The zonotope is always calculated as the Minkowski sum of all segments conv {x,v}, where
* v ranges over the ZONOTOPE_INPUT_POINTS or ZONOTOPE_INPUT_VECTORS, and
* x = -v if CENTERED_ZONOTOPE = 1,
* x = 0 if CENTERED_ZONOTOPE = 0.
Input section only.
- Type: Cone
- The cone of all Minkowski summands of the polytope P.
Up to scaling, a polytope S is a Minkowski summand of P if and only if
the edge directions of S are a subset of those of P,
and the closing condition around any 2-face of P is preserved.
Coordinates of the cone correspond to the rescaled lengths
of the edges of the graph of P (in the order given by the property EDGES of the GRAPH of P).
The Minkowski cone is defined as the intersection of all
equations given by the closing condition around 2-faces with the positive orthant.
For more information see e.g.
Klaus Altmann: The versal deformation of an isolated toric Gorenstein singularity
- Type: Bool
- True if and only if LINEALITY_SPACE trivial and FAR_FACE is trivial.
- Example:
A pyramid over a square is bounded. Removing the base square yields an unbounded pointed polyhedron
(the vertices with first entry equal to zero correspond to rays).
> $p = pyramid(cube(2)); print $p->BOUNDED; true
> $q = facet_to_infinity($p,4); print $q->BOUNDED; false
- Type: Matrix
- The rows of this matrix contain a configuration of affine points in homogeneous cooordinates.
The zonotope is obtained as the Minkowski sum of all rows, normalized to x_0 = 1.
Thus, if the input matrix has n columns, the ambient affine dimension of the resulting zonotope is n-1.
- Type: Matrix
- Dual basis of the affine hull of the polyhedron.
The property AFFINE_HULL appears only in conjunction with the property FACETS.
The specification of the property FACETS requires the specification of AFFINE_HULL, and vice versa.
Alias for property LINEAR_SPAN.
- Type: IncidenceMatrix
- Alias for property RAYS_IN_RIDGES.
- Type: Int
- One more than the dimension of the space in which the polyhedron lives.
= dimension of the space in which the homogenization of the polyhedron lives
- Type: Matrix
- The i-th row is the normal vector of a hyperplane separating the i-th vertex from the others.
This property is a by-product of redundant point elimination algorithm.
All vectors in this section must be non-zero.
Alias for property RAY_SEPARATORS. - Example:
This prints a matrix in which each row represents a normal vector of a hyperplane seperating one vertex of a centered square
with side length 2 from the other ones. The first and the last hyperplanes as well as the second and third hyperplanes are the same
up to orientation.
> print cube(2)->VERTEX_NORMALS; 0 1/2 1/2 0 -1/2 1/2 0 1/2 -1/2 0 -1/2 -1/2
- Type: Vector
- Steiner point of the whole polytope.
- Type: AffineLattice
- An affine lattice L such that P + L tiles the affine span of P
- Type: IncidenceMatrix
- Similar to VERTICES_IN_FACETS, but with rows corresponding to INEQUALITIES instead of FACETS.
This property is a byproduct of convex hull computation algorithms.
It is discarded as soon as VERTICES_IN_FACETS is computed.
Alias for property RAYS_IN_INEQUALITIES.
- Type: Vector
- Some point belonging to the polyhedron.
- Example:
This stores a (homogeneous) point belonging to the 3-cube as a vector and prints its coordinates:
> $v = cube(3)->VALID_POINT; print $v; 1 -1 -1 -1
- Type: Bool
- True if (1, 0, 0, …) is contained (possibly in the boundary).
- Example:
The cube [0,1]^3 is only weakly centered, since the origin is on the boundary.
> $p = cube(3,0,0); print $p->WEAKLY_CENTERED; true
> print $p->CENTERED; false
- Type: Vector
- Valid strict inequality for all affine points of the polyhedron.
- Type: Vector
- Centroid (center of mass) of the polytope.
- Type: Bool
- True if the polyhedron does not contain an affine line.
- Example:
A square does not contain an affine line and is therefore pointed. Removing one facet does not change this, although
it is no longer bounded. After removing two opposing facets, it contains infinitely many affine lines orthogonal to the
removed facets.
> $p = cube(2); print $p->POINTED; true
> print facet_to_infinity($p,0)->POINTED; true
> print new Polytope(INEQUALITIES=>$p->FACETS->minor([0,1],All))->POINTED; false
- Type: Bool
- True if (1, 0, 0, …) is in the relative interior.
If full-dimensional then polar to BOUNDED. - Example:
The cube [0,1]^3 is not centered, since the origin is on the boundary. By a small translation we can make it centered:
> $p = cube(3,0,0); print $p->CENTERED; false
> $t = new Vector([-1/2,-1/2,-1/2]); print translate($p,$t)->CENTERED; true
- Type: Float
- The minimal angle between any two vertices (seen from the VERTEX_BARYCENTER).
- Type: Set
- The following is defined for CENTERED polytopes only:
A facet is special if the cone over that facet with the origin as the apex contains the VERTEX_BARYCENTER.
Motivated by Obro's work on Fano polytopes.
- Type: Int
- Number of points with 0/1-coordinates in a polytope.
Input property
These properties are for input only. They allow redundant information.
INEQUALITIES
- Type: Matrix
- Inequalities that describe half-spaces such that the polyhedron is their intersection.
Redundancies are allowed. Dual to POINTS.\\
A vector (A0, A1, …, Ad) defines the
(closed affine) half-space of points (1, x1, …, xd) such that
A0 + A1 x1 + … + Ad xd >= 0.\\
Input section only. Ask for FACETS and AFFINE_HULL if you want to compute an H-representation
from a V-representation.
- Type: Matrix
- Points such that the polyhedron is their convex hull.
Redundancies are allowed.
The vector (x0, x1, … xd) represents a point in d-space given in homogeneous coordinates.
Affine points are identified by x0 > 0.
Points with x0 = 0 can be interpreted as rays.\\
polymake automatically normalizes each coordinate vector, dividing them by the first non-zero element.
The clients and rule subroutines can always assume that x0 is either 0 or 1.
All vectors in this section must be non-zero.
Dual to INEQUALITIES.\\
Input section only. Ask for VERTICES if you want to compute a V-representation from an H-representation.
Alias for property INPUT_RAYS. - Example:
Given some (homogeneous) points in 3-space we first construct a matrix containing them. Assume we don't know wether these are all
vertices of their convex hull or not. To safely produce a polytope from these points, we set the input to the matrix representing them.
In the following the points under consideration are the vertices of the 3-simplex together with their barycenter, which will be no vertex:
> $M = new Matrix([[1,0,0,0],[1,1,0,0],[1,0,1,0],[1,0,0,1],[1,1/4,1/4,1/4]]); $p = new Polytope(POINTS=>$M); print $p->VERTICES; 1 0 0 0 1 1 0 0 1 0 1 0 1 0 0 1
- Type: Matrix
- Equations that hold for all points of the polyhedron.\\
A vector (A0, A1, …, Ad) describes the hyperplane
of all points (1, x1, …, xd) such that A0 + A1 x1 + … + Ad xd = 0.
All vectors in this section must be non-zero.\\
Input section only. Ask for AFFINE_HULL if you want to see an irredundant description of the affine span.
Lattice points in cones
These properties capture information that depends on the lattice structure of the cone. polymake always works with the integer lattice.
SPANNING
- Type: Bool
- The polytope is spanning if the lattice points generate the lattice
- Type: Vector
- The integral width of the polytope with respect to each facet normal.
- Type: Bool
- True if the FACET_WIDTH is one.
- Type: Integer
- If the polytope is GORENSTEIN then this is the multiple such that the polytope is REFLEXIVE.
- Type: Bool
- The polytope is canonical if there is exactly one interior lattice point.
- Type: Bool
- True if the polytope contains no lattice points other than the vertices.
- Type: Bool
- Type: Bool
- True if the polytope and its dual have integral vertices.
- Type: UniPolynomial
- The Ehrhart polynomial.
- Type: Integer
- The normalized volume of the polytope.
- Type: Array
- The Ehrhart quasi-polynomial of a rational polytope.
Coefficients are periodic functions of integral period. - Example:
To obtain the Ehrhart quasi-polynomial of a scaled 2-dimensional cross polytope write:
> $p=scale(cross(2),1/3); print join("\n",@{$p->EHRHART_QUASI_POLYNOMIAL}); 2/9*x^2 + 2/3*x + 1 2/9*x^2 + 2/9*x + 5/9 2/9*x^2 -2/9*x + 5/9
- Type: Bool
- The polytope is normal if the Hilbert basis of the cone spanned by P x {1} is at height 1.
Equivalently points in integral dilates of P are postive integral sums of lattice points of P.
FACET_VERTEX_LATTICE_DISTANCES
- Type: Matrix
- The entry (i,j) equals the lattice distance of vertex j from facet i.
- Type: Bool
- The polytope is smooth if the associated projective variety is smooth; the determinant of the edge directions is +/-1 at every vertex.
- Type: GroebnerBasis
- The Groebner basis for the toric ideal associated to the lattice points in the polytope using any term order.
- Type: Int
- COMBINATORIAL_DIM+1-LATTICE_DEGREE or the smallest integer k such that k*P has an interior lattice point.
- Type: Vector
- One direction which realizes LATTICE_WIDTH of the polytope.
- Type: Bool
- The polytope is terminal if there is exactly one interior lattice point and all other lattice points are vertices.
- Type: Matrix
- VERTICES are interpreted as coefficient vectors for this basis
given in affine form
assumed to the the standard basis if not explicitely specified.
- Type: Integer
- The minimal integral width of the polytope.
- Type: Vector
- If the polytope is GORENSTEIN, then this is the unique interior lattice point
in the multiple of the polytope that is REFLEXIVE.
- Type: Int
- The degree of the h*-polynomial or Ehrhart polynomial.
- Type: Bool
- The polytope is very ample if the Hilbert Basis of the cone spanned by the edge-directions of any vertex lies inside the polytope.
- Type: Integer
- The maximal integral width of the polytope with respect to the facet normals.
Lattice points in polytopes
These properties capture information that depends on the lattice structure of the polytope. polymake always works with the integer lattice.
N_LATTICE_POINTS
- Type: Integer
- The number of LATTICE_POINTS
- Type: Matrix
- The lattice points on the boundary of the polytope, including the vertices.
- Type: Array
- The lattice points generators in the polytope.
The output consists of three matrices [P,R,L], where
P are lattice points which are contained in the polytope
R are rays and L is the lineality.
Together they form a description of all lattice points.
Every lattice point can be described as
p + lambda*R + mu*L
where p is a row in P and lambda has only non-negative
integral coordinates and mu has arbitrary integral coordinates.
- Type: Integer
- The number of BOUNDARY_LATTICE_POINTS
- Type: Integer
- The number of INTERIOR_LATTICE_POINTS
- Type: Matrix
- The lattice points strictly in the interior of the polytope
Matroid properties
Optimization
These properties provide tools from linear, integer and dicrete optimization. In particular, linear programs are defined here.
LP
- Type: LinearProgram
- Linear program applied to the polytope
- Mixed integer linear program applied to the polytope
Symmetry
These properties capture information of the object that is concerned with the action of permutation groups.
GROUP
- Type: Group
- Methods of GROUP:
REPRESENTATIVE_INEQUALITIES
- UNDOCUMENTED
- Properties of GROUP:
MATRIX_ACTION
- Type: MatrixActionOnVectors
- Properties of MATRIX_ACTION:
VERTICES_ORBITS
- Type: Array
- Alias for property VECTORS_ORBITS.
POINTS_ACTION
- Type: PermutationAction
- Alias for property INPUT_RAYS_ACTION.
COORDINATE_ACTION
- Type: PermutationAction
- Properties of COORDINATE_ACTION:
POINTS_GENERATORS
- Type: Matrix
- Alias for property INPUT_RAYS_GENERATORS.
N_POINTS_GENERATORS
- Type: Int
- Alias for property N_INPUT_RAYS_GENERATORS.
REPRESENTATIVE_CERTIFIERS
- Type: Matrix
- A matrix of representatives of all certifiers
for POINTS_GENERATORS with respect to the
GROUP.
A certifier is an integer point in the
given orbit polytope.
Note that the representative certifiers must be in
the same order as the corresponding nodes
in the NOP_GRAPH. Further, the CP_INDICES
refer to row indices of this property.
CP_INDICES
- Type: Set
- The row indices of all core points among
the REPRESENTATIVE_CERTIFIERS.
N_REPRESENTATIVE_CERTIFIERS
- Type: Int
- The number of REPRESENTATIVE_CERTIFIERS.
VERTICES_GENERATORS
- Type: Matrix
- Alias for property RAYS_GENERATORS.
REPRESENTATIVE_CORE_POINTS
- Type: Matrix
- A matrix of representatives of all core points in
the given orbit polytope.
A core point is an integer point whose orbit
polytope is lattice-free (i.e. does not contain
integer points besides its vertices).
NOP_GRAPH
- Type: Graph
- The NOP-graph of POINTS_GENERATORS with respect to the
GROUP. The nodes of the NOP-graph
correspond to the REPRESENTATIVE_CERTIFIERS,
which represent the different orbit polytopes
contained in the given orbit polytope.
N_VERTICES_GENERATORS
- Type: Int
- Alias for property N_RAYS_GENERATORS.
N_REPRESENTATIVE_CORE_POINTS
- Type: Int
- The number of REPRESENTATIVE_CORE_POINTS.
REPRESENTATIVE_VERTICES
- Type: Matrix
- Alias for property REPRESENTATIVE_RAYS.
SYMMETRIC_RAYS
- Type: Matrix
VERTICES_ACTION
- Type: PermutationAction
- Properties of VERTICES_ACTION:
SYMMETRIZED_COCIRCUIT_EQUATIONS
- The cocircuit equations, projected to a certain direct sum of isotypic components
SYMMETRIC_FACETS
- Type: Matrix
Triangulation and volume
Everything in this group is defined for BOUNDED polytopes only.
SQUARED_RELATIVE_VOLUMES
- Type: Array
- Array of the squared relative k-dimensional volumes of the simplices in
a triangulation of a d-dimensional polytope.
- Type:
- Example:
The following prints the Mahler volume of the centered 2-cube:
> print cube(2)->MAHLER_VOLUME; 8
- Type:
- Volume of the polytope.
- Example:
The following prints the volume of the centered 3-dimensional cube with side length 2:
> print cube(3)->VOLUME; 8
- Type: Map
- The k-dimensional Euclidean volume of a k-dimensional rational polytope
embedded in R^n.
This value is obtained by summing the square roots of the entries in SQUARED_RELATIVE_VOLUMES
using the function naive_sum_of_square_roots. Since this latter function
does not try very hard to compute the real value, you may have to resort to
a computer algebra package.
The value is encoded as a map collecting the coefficients of various roots encountered in the sum.
For example, {(3 1/2),(5 7)} represents sqrt{3}/2 + 7 sqrt{5}.
If the output is not satisfactory, please use a symbolic algebra package. - Example:
The following prints the 2-dimensional volume of a centered square with side length 2 embedded in the 3-space (the result is 4):
> $M = new Matrix([1,-1,1,0],[1,-1,-1,0],[1,1,-1,0],[1,1,1,0]); $p = new Polytope<Rational>(VERTICES=>$M); print $p->RELATIVE_VOLUME; {(1 4)}
- Properties of TRIANGULATION:
GKZ_VECTOR
- Type: Vector
- GKZ-vector
See Chapter 7 in Gelfand, Kapranov, and Zelevinsky:
Discriminants, Resultants and Multidimensional Determinants, Birkhäuser 1994
- Type: SubdivisionOfPoints
- Properties of POLYTOPAL_SUBDIVISION:
REFINED_SPLITS
- Type: Set
- The splits that are coarsenings of the subdivision.
If the subdivision is regular these form the unique split decomposition of
the corresponding weight function.
Unbounded polyhedra
These properties collect geometric information of a polytope only relevant if it is unbounded, e. g. the far face or the complex of bounded faces.
UNBOUNDED_FACETS
- Type: Set
- Indices of facets that are unbounded.
- Type: PolyhedralComplex
- Properties of BOUNDED_COMPLEX:
GRAPH
- Type: Graph
- Properties of GRAPH:
TOTAL_LENGTH
- Type:
- Sum of all EDGE_LENGTHS.
EDGE_COLORS
- Type: EdgeMap
- Each edge indicates the maximal dimension of a bounded
face containing it. Mainly used for visualization purposes.
EDGE_DIRECTIONS
- Type: EdgeMap
- Difference of the vertices for each edge (only defined up to signs).
EDGE_LENGTHS
- Type: EdgeMap
- The length of each edge measured in the maximum metric.
VERTEX_MAP
- Type: Array
- Type: Int
- Number of bounded vertices (non-rays).
- Type: Bool
- Type: Vector
- A linear objective function for which each unbounded edge is increasing;
only defined for unbounded polyhedra.
- Type: Set
- Indices of vertices that are rays.
Visualization
These properties are for visualization.
VIF_CYCLIC_NORMAL
- Type: Array
- Reordered VERTICES_IN_FACETS for 2d and 3d-polytopes.
Vertices are listed in the order of their appearance
when traversing the facet border counterclockwise seen from outside of the polytope.\\
For a 2d-polytope (which is a closed polygon), lists all vertices in the border traversing order.
Alias for property RIF_CYCLIC_NORMAL.
- Type: Array
- Unique names assigned to the VERTICES.
If specified, they are shown by visualization tools instead of vertex indices.\\
For a polytope build from scratch, you should create this property by yourself,
either manually in a text editor, or with a client program.\\
If you build a polytope with a construction function
taking some other input polytope(s), the labels are created the labels automatically
except if you call the function with a no_labels option. The exact format of the
abels is dependent on the construction, and is described in the corresponding help topic.
Alias for property RAY_LABELS.
- Type: Array
- Unique names assigned to the FACETS, analogous to VERTEX_LABELS.
- Type: Array
- Reordered transposed VERTICES_IN_FACETS. Dual to VIF_CYCLIC_NORMAL.
Alias for property FTR_CYCLIC_NORMAL.
- Type: Array
- Unique names assigned to the INEQUALITIES, analogous to VERTEX_LABELS.
- Type: Array
- Unique names assigned to the POINTS, analogous to VERTEX_LABELS.
Alias for property INPUT_RAY_LABELS.
NEIGHBOR_VERTICES_CYCLIC_NORMAL
- Type: Array
- Reordered GRAPH. Dual to NEIGHBOR_FACETS_CYCLIC_NORMAL.
Alias for property NEIGHBOR_RAYS_CYCLIC_NORMAL.
- Type: Matrix
- Coordinates of points for an affine Gale diagram.
- Type: SchlegelDiagram
- Holds one special projection (the Schlegel diagram) of the polytope.
Methods
Backward compatibility
These methods are provided for backward compatibility with older versions of polymake only. They should not be used in new code.
N_EDGES
Combinatorics
These methods capture combinatorial information of the object. Combinatorial properties only depend on combinatorial data of the object like, e.g., the face lattice.
CD_INDEX
- Returns: String
- Prettily print the cd-index given in CD_INDEX_COEFFICIENTS
- Returns: Int
- The number of ridges (faces of codimension 2) of the polytope
equals the number of edges of the DUAL_GRAPH
Geometry
These methods capture geometric information of the object. Geometric properties depend on geometric information of the object, like, e.g., vertices or facets.
DIM
- Returns: Int
- returns the dimension of the polytope
- Returns the inner description of a Polytope:
[V,L] where V are the vertices and L is the lineality space
MINKOWSKI_CONE_POINT( Vector < Rational > point)
- Parameters:
- returns the Minkowski summand of a polytope P given by
a point in the MINKOWSKI_CONE.
- Returns: Int
- returns the dimension of the ambient space of the polytope
labeled_vertices( String label …)
- Parameters:
- String
label …
: vertex labels
- Find the vertices by given labels.
- Returns the outer description of a Polytope:
[F,A] where F are the facets and A is the affine hull
MINKOWSKI_CONE_COEFF( Vector < Rational > coeff)
- Parameters:
- returns the Minkowski summand of a polytope P given by
a coefficient vector to the rays of the MINKOWSKI_CONE.
Lattice points in cones
These methods capture information that depends on the lattice structure of the cone. polymake always works with the integer lattice.
FACET_POINT_LATTICE_DISTANCES( Vector < Rational > v)
- Parameters:
- Vector containing the distances of a given point v from all facets
- Vector containing the coefficients of the EHRHART_POLYNOMIAL, ordered
by increasing degree of the corresponding term.
N_LATTICE_POINTS_IN_DILATION( Int n)
- Parameters:
- Int
n
: dilation factor
- Returns: Int
- The number of LATTICE_POINTS in the n-th dilation of the polytope
POLYTOPE_IN_STD_BASIS( Polytope < Rational > P)
- Parameters:
- returns a polytope in the integer lattice basis if a LATTICE_BASIS is given
Lattice points in polytopes
These methods capture information that depends on the lattice structure of the polytope. polymake always works with the integer lattice.
LATTICE_POINTS
- Returns the lattice points in bounded Polytopes.
Triangulation and volume
These methods collect information about triangulations of the object and properties usually computed from such, as the volume.
TRIANGULATION_INT_SIGNS
- the orientation of the simplices of TRIANGULATION_INT in the given order of the POINTS
Unbounded polyhedra
These methods collect geometric information of a polytope only relevant if it is unbounded, e. g. the far face or the complex of bounded faces.
BOUNDED_HASSE_DIAGRAM
- HASSE_DIAGRAM constrained to affine vertices
Nodes representing the maximal inclusion-independent faces are connected to the top-node
regardless of their dimension
- Graph of the bounded subcomplex.
- Indices of FACETS that are bounded.
- Indices of VERTICES that are no rays.
- Dual graph of the bounded subcomplex.
Visualization
These methods are for visualization.
VISUAL_BOUNDED_GRAPH
- Returns: Visual::PolytopeGraph
- Visualize the GRAPH of a polyhedron.
- Returns: Visual::PolytopeGraph
- Visualizes the graph of a symmetric cone:
All nodes belonging to one orbit get the same color.
- Returns: Visual::PolytopeLattice
- Visualize the dual face lattice of a polyhedron as a multi-layer graph.
- Returns: Visual::SchlegelDiagram
- Create a Schlegel diagram and draw it.
- Returns: Visual::Object
- Returns: Visual::Graph
- Visualize the DUAL_GRAPH of a polyhedron.
- Returns: Visual::PolytopeLattice
- Visualize the HASSE_DIAGRAM of a polyhedron as a multi-layer graph.
write_stl( String filename)
- Parameters:
- String
filename
:
- Take a 3-polytope and write ASCII STL output.
- Example:
> dodecahedron()->write_stl("/tmp/dodecahedron.stl");
- Returns: Visual::PolytopeGraph
- Visualize the GRAPH of a polyhedron.
- Returns: Visual::Gale
- Generate the Gale diagram of a d-polyhedron with at most d+4 vertices.
- Returns: Visual::Polytope
- Visualize a polytope as a graph (if 1d), or as a solid object (if 2d or 3d),
or as a Schlegel diagram (4d).