playground:playground

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 [' Cone']

Specializations:

  • Polytope::Lattice: A polytope all of whose vertex coordinates are integral.
  • Polytope<Float>: A pointed polyhedron with float coordinates realized in Rd.

It mainly exists for visualization.

Convex hull and related algorithms use floating-point arithmetics. Due to numerical errors inherent to this kind of computations, the resulting combinatorial description can be arbitrarily far away from the truth, or even not correspond to any valid polytope. You have been warned.

None of the standard construction clients produces objects of this type. If you want to get one, create it with the explicit constructor or convert_to.

  • Symmetry: These specializations capture information of the object that is concerned with the action of permutation groups.
  • Polytope<Rational>: A rational polyhedron realized in Q^d

Examples:

  • 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.


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

CUBICAL

  • 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

MINIMAL_NON_FACES

GRAPH

  • 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

COMPLEXITY

  • Type: Float
  • Parameter describing the shape of the face-lattice of a 4-polytope.

G_VECTOR

  • Type: Vector
  • (Toric) g-vector, defined via the (generalized) h-vector as gi = hi - hi-1.

COCUBICAL

  • 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

DUAL_GRAPH

  • 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.

EDGE_ORIENTATION

  • 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

F2_VECTOR

  • 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

MOEBIUS_STRIP_EDGES

  • 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.

EDGE_ORIENTABLE

  • 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

N_VERTICES

  • Type: Int
  • Number of VERTICES.
    Alias for property N_RAYS.
  • 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

SIMPLICIALITY

  • 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.

SIMPLE

  • 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

SELF_DUAL

  • 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

COCUBICALITY

  • 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

EXCESS_VERTEX_DEGREE

  • 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

CD_INDEX_COEFFICIENTS

  • Type: Vector
  • Coefficients of the cd-index.

FATNESS

  • Type: Float
  • Parameter describing the shape of the face-lattice of a 4-polytope.

TWO_FACE_SIZES

  • 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)}

BALANCE

  • 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

SIMPLICITY

  • 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

DUAL_BOUNDED_H_VECTOR

  • 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.

SUBRIDGE_SIZES

  • Type: Map
  • Lists for each occurring size (= number of incident facets or ridges) of a subridge how many there are.

SIMPLEXITY_LOWER_BOUND

  • Type: Int
  • A lower bound for the minimal number of simplices in a triangulation

VERTICES_IN_FACETS

  • 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

F_VECTOR

  • 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

SIMPLICIAL

  • 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

ALTSHULER_DET

  • Type: Integer
  • Let M be the vertex-facet incidence matrix, then the Altshuler determinant is
    defined as max{det(M &lowast; MT), det(MT &lowast; M)}.
  • Example:
    This prints the Altshuler determinant of the built-in pentagonal pyramid (Johnson solid 2):
     >  print johnson_solid("pentagonal_pyramid")->ALTSHULER_DET;
     25

HASSE_DIAGRAM

FACETS_THRU_VERTICES

FACE_SIMPLICITY

  • 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

NEIGHBORLINESS

  • 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

VERTEX_SIZES

  • 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

DUAL_H_VECTOR

  • 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.

N_VERTEX_FACET_INC

  • Type: Int
  • Number of pairs of incident vertices and facets.
    Alias for property N_RAY_FACET_INC.

NEIGHBORLY

  • 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 &lfloor;dim/2&rfloor; neighborly:
     >  print cyclic(4,6)->NEIGHBORLY;
     true

BALANCED

  • 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

CUBICAL_H_VECTOR

  • Type: Vector
  • Cubical h-vector. Defined for cubical polytopes.

CUBICALITY

  • 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

MOEBIUS_STRIP_QUADS

  • 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.

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

ONE_VERTEX

  • 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

INEQUALITIES_THRU_VERTICES

VERTICES

  • 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);

STEINER_POINTS

  • Type: Matrix
  • A weighted inner point depending on the outer angle called Steiner point for all faces of dimensions 2 to d.

POINTS_IN_FACETS

SPLIT_COMPATIBILITY_GRAPH

  • Type: Graph
  • Two SPLITS are compatible if the defining hyperplanes do not intersect in the
    interior of the polytope. This defines a graph.

N_POINTS

QUOTIENT_SPACE

  • A topological quotient space obtained from a polytope by identifying faces.

FACETS_THRU_POINTS

FEASIBLE

  • Type: Bool
  • True if the polyhedron is not empty.

GALE_TRANSFORM

  • Type: Matrix
  • Coordinates of the Gale transform.

VERTEX_BARYCENTER

  • 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

CONE_DIM

  • 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

SPLITS

  • Type: Matrix
  • The splits of the polytope, i.e., hyperplanes cutting the polytope in
    two parts such that we have a regular subdivision.

LATTICE

  • Type: Bool
  • A rational polytope is lattice if each bounded vertex has integer coordinates.

CS_PERMUTATION

  • Type: Array
  • The permutation induced by the central symmetry, if present.

CENTERED_ZONOTOPE

  • 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.

MINKOWSKI_CONE

  • 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

BOUNDED

  • 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

ZONOTOPE_INPUT_POINTS

  • 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.

AFFINE_HULL

  • 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.

VERTICES_IN_RIDGES

CONE_AMBIENT_DIM

  • 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

VERTEX_NORMALS

  • 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

STEINER_POINT

  • Type: Vector
  • Steiner point of the whole polytope.

TILING_LATTICE

  • An affine lattice L such that P + L tiles the affine span of P

VERTICES_IN_INEQUALITIES

VALID_POINT

  • 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

WEAKLY_CENTERED

  • 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

FAR_HYPERPLANE

  • Type: Vector
  • Valid strict inequality for all affine points of the polyhedron.

CENTROID

  • Type: Vector
  • Centroid (center of mass) of the polytope.

POINTED

  • 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

CENTERED

  • 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

MINIMAL_VERTEX_ANGLE

SPECIAL_FACETS

  • 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.

N_01POINTS

  • Type: Int
  • Number of points with 0/1-coordinates in a polytope.

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.

POINTS

  • 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

EQUATIONS

  • 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.

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

FACET_WIDTHS

  • Type: Vector
  • The integral width of the polytope with respect to each facet normal.

COMPRESSED

GORENSTEIN_INDEX

CANONICAL

  • Type: Bool
  • The polytope is canonical if there is exactly one interior lattice point.

LATTICE_EMPTY

  • Type: Bool
  • True if the polytope contains no lattice points other than the vertices.

POLAR_SMOOTH

  • Type: Bool
  • The lattice polytope is polar to smooth if it is REFLEXIVE and the polar of the polytope (wrt to its interior point) is a SMOOTH lattice polytope.

REFLEXIVE

  • Type: Bool
  • True if the polytope and its dual have integral vertices.

EHRHART_POLYNOMIAL

LATTICE_VOLUME

  • Type: Integer
  • The normalized volume of the polytope.

EHRHART_QUASI_POLYNOMIAL

  • 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

NORMAL

  • 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.

SMOOTH

  • Type: Bool
  • The polytope is smooth if the associated projective variety is smooth; the determinant of the edge directions is +/-1 at every vertex.

GROEBNER_BASIS

  • The Groebner basis for the toric ideal associated to the lattice points in the polytope using any term order.

LATTICE_CODEGREE

LATTICE_WIDTH_DIRECTION

TERMINAL

  • Type: Bool
  • The polytope is terminal if there is exactly one interior lattice point and all other lattice points are vertices.

LATTICE_BASIS

  • 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.

LATTICE_WIDTH

  • Type: Integer
  • The minimal integral width of the polytope.

GORENSTEIN

  • Type: Bool
  • The polytope is Gorenstein if a dilation of the polytope is REFLEXIVE up to translation.

GORENSTEIN_VECTOR

  • Type: Vector
  • If the polytope is GORENSTEIN, then this is the unique interior lattice point
    in the multiple of the polytope that is REFLEXIVE.

LATTICE_DEGREE

  • Type: Int
  • The degree of the h*-polynomial or Ehrhart polynomial.

VERY_AMPLE

  • 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.

FACET_WIDTH

  • Type: Integer
  • The maximal integral width of the polytope with respect to the facet normals.

These properties capture information that depends on the lattice structure of the polytope. polymake always works with the integer lattice.

N_LATTICE_POINTS

BOUNDARY_LATTICE_POINTS

  • Type: Matrix
  • The lattice points on the boundary of the polytope, including the vertices.

LATTICE_POINTS_GENERATORS

  • 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.

N_BOUNDARY_LATTICE_POINTS

N_INTERIOR_LATTICE_POINTS

INTERIOR_LATTICE_POINTS

  • Type: Matrix
  • The lattice points strictly in the interior of the polytope

Properties which belong to the corresponding (oriented) matroid

CHIROTOPE

  • Type: Text
  • Chirotope corresponding to the VERTICES. TOPCOM format.

CIRCUITS

COCIRCUITS


These properties provide tools from linear, integer and dicrete optimization. In particular, linear programs are defined here.

LP

MILP


These properties capture information of the object that is concerned with the action of permutation groups.

GROUP


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.

MAHLER_VOLUME

  • Type:
  • Mahler volume (or volume product) of the polytope.
    Defined as the volume of the polytope and the volume of its polar (for BOUNDED, CENTERED and FULL_DIM polytopes only).
    Often studied for centrally symmetric convex bodies, where the regular cubes are conjectured to be the global minimiers.
  • Example:
    The following prints the Mahler volume of the centered 2-cube:
     >  print cube(2)->MAHLER_VOLUME;
     8

VOLUME

  • 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

RELATIVE_VOLUME

  • 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)}

TRIANGULATION

  • 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

POLYTOPAL_SUBDIVISION

  • 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.

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.

BOUNDED_COMPLEX

  • Properties of BOUNDED_COMPLEX:
    • GRAPH
      • Type: Graph
      • Properties of GRAPH:
      • TOTAL_LENGTH
      • 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
      • For every row of VERTICES this indicates the corresponding row in the
        VERTICES of the parent polytope.

N_BOUNDED_VERTICES

  • Type: Int
  • Number of bounded vertices (non-rays).

SIMPLE_POLYHEDRON

  • Type: Bool
  • True if each bounded vertex of a (possibly unbounded) d-polyhedron has vertex degree d in the GRAPH.
    The vertex degrees of the vertices on the FAR_FACE do not matter.

TOWARDS_FAR_FACE

  • Type: Vector
  • A linear objective function for which each unbounded edge is increasing;
    only defined for unbounded polyhedra.

FAR_FACE

  • Type: Set
  • Indices of vertices that are rays.

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.

VERTEX_LABELS

  • 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.

FACET_LABELS

FTV_CYCLIC_NORMAL

INEQUALITY_LABELS

POINT_LABELS

NEIGHBOR_VERTICES_CYCLIC_NORMAL

GALE_VERTICES

  • Type: Matrix
  • Coordinates of points for an affine Gale diagram.

SCHLEGEL_DIAGRAM

  • Holds one special projection (the Schlegel diagram) of the polytope.

These methods are provided for backward compatibility with older versions of polymake only. They should not be used in new code.

N_EDGES

  • Returns: Int
  • The number of edges of the GRAPH

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

N_RIDGES

  • Returns: Int
  • The number of ridges (faces of codimension 2) of the polytope
    equals the number of edges of the DUAL_GRAPH

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

INNER_DESCRIPTION

  • Returns: Array < Matrix < tparams
  • 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)

AMBIENT_DIM

  • Returns: Int
  • returns the dimension of the ambient space of the polytope

labeled_vertices( String label …)

  • Parameters:
  • Returns: Set < Int >
  • Find the vertices by given labels.

OUTER_DESCRIPTION

  • Returns: Array < Matrix < tparams
  • 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:
    • Vector < Rational > coeff : coefficient vector to the rays of the Minkowski summand cone
  • Returns: Polytope < Rational >
  • returns the Minkowski summand of a polytope P given by
    a coefficient vector to the rays of the MINKOWSKI_CONE.

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:
  • Returns: Vector < Integer >
  • Vector containing the distances of a given point v from all facets

EHRHART_POLYNOMIAL_COEFF

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)


These methods capture information that depends on the lattice structure of the polytope. polymake always works with the integer lattice.

LATTICE_POINTS

  • Returns: Matrix < Integer >
  • Returns the lattice points in bounded Polytopes.

These methods collect information about triangulations of the object and properties usually computed from such, as the volume.

TRIANGULATION_INT_SIGNS


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

BOUNDED_GRAPH

  • Graph of the bounded subcomplex.

BOUNDED_FACETS

BOUNDED_VERTICES

BOUNDED_DUAL_GRAPH

  • Dual graph of the bounded subcomplex.

These methods are for visualization.

VISUAL_BOUNDED_GRAPH

VISUAL_ORBIT_COLORED_GRAPH

  • Visualizes the graph of a symmetric cone:
    All nodes belonging to one orbit get the same color.

VISUAL_DUAL_FACE_LATTICE

SCHLEGEL

VISUAL_DUAL

VISUAL_DUAL_GRAPH

VISUAL_FACE_LATTICE

write_stl( String filename)

  • Parameters:
  • Take a 3-polytope and write ASCII STL output.
  • Example:

     >  dodecahedron()->write_stl("/tmp/dodecahedron.stl");  

VISUAL_GRAPH

GALE

  • Returns: Visual::Gale
  • Generate the Gale diagram of a d-polyhedron with at most d+4 vertices.

VISUAL

  • Visualize a polytope as a graph (if 1d), or as a solid object (if 2d or 3d),
    or as a Schlegel diagram (4d).
  • playground/playground.1553097884.txt.gz
  • Last modified: 2019/03/20 16:04
  • by oroehrig