34.3 Polytopes

Module: sage.geometry.polytope

Polytopes

This module provides access to polymake, which 'has been developed since 1997 in the Discrete Geometry group at the Institute of Mathematics of Technische Universitat Berlin. Since 2004 the development is shared with Fachbereich Mathematik, Technische Universitat Darmstadt. The system offers access to a wide variety of algorithms and packages within a common framework. polymake is flexible and continuously expanding. The software supplies C++ and perl interfaces which make it highly adaptable to individual needs.'

NOTE: If you have trouble with this module do

        sage: !polymake --reconfigure   # not tested
at the command line.

Author Log:

Class: Polymake

class Polymake

Functions: associahedron,$ \,$ birkhoff,$ \,$ cell24,$ \,$ convex_hull,$ \,$ cube,$ \,$ from_data,$ \,$ rand01,$ \,$ reconfigure

cell24( self)

sage: polymake.cell24()            # optional: needs polymake
The 24-cell

convex_hull( self, [points=[]])

            sage: R.<x,y,z> = PolynomialRing(QQ,3)
            sage: f = x^3 + y^3 + z^3 + x*y*z
            sage: e = f.exponents()
            sage: a = [[1] + list(v) for v in e]
            sage: a
            [[1, 3, 0, 0], [1, 0, 3, 0], [1, 1, 1, 1], [1, 0, 0, 3]]
            sage: n = polymake.convex_hull(a)       # optional: needs polymake
            sage: n                                 # optional
            Convex hull of points [[1, 0, 0, 3], [1, 0, 3, 0], [1, 1, 1,
1], [1, 3, 0, 0]]
            sage: n.facets()                        # optional
            [(0, 1, 0, 0), (3, -1, -1, 0), (0, 0, 1, 0)]
            sage: n.is_simple()                     # optional
            True
            sage: n.graph()                         # optional
            'GRAPH
{1 2}
{0 2}
{0 1}

'

reconfigure( self)

Reconfigure polymake.

Remember to run polymake.reconfigure() as soon as you have changed the customization file and/or installed missing software!

Special Functions: __repr__,$ \,$ _Polymake__make

Class: Polytope

class Polytope
Create a polytope.

sage: P = polymake.convex_hull([[1,0,0,0], [1,0,0,1], [1,0,1,0], [1,0,1,1],  [1,1,0,0], [1,1,0,1], [1,1,1,0], [1,1,1,1]])   # optional: needs polymake

NOTE: If you have trouble with this module do

        sage: !polymake --reconfigure   # not tested
at the command line.

Polytope( self, datafile, desc)

Functions: cmd,$ \,$ data,$ \,$ facets,$ \,$ graph,$ \,$ is_simple,$ \,$ n_facets,$ \,$ vertices,$ \,$ visual,$ \,$ write

facets( self)

sage: P = polymake.convex_hull([[1,0,0,0], [1,0,0,1], [1,0,1,0], [1,0,1,1],  [1,1,0,0], [1,1,0,1], [1,1,1,0], [1,1,1,1]])   # optional: needs polymake
sage: P.facets()                            # optional
[(0, 0, 0, 1), (0, 1, 0, 0), (0, 0, 1, 0), (1, 0, 0, -1), (1, 0, -1, 0),
(1, -1, 0, 0)]

is_simple( self)

Return True if this polytope is simple.

A polytope is simple if the degree of each vertex equals the dimension of the polytope.

sage: P = polymake.convex_hull([[1,0,0,0], [1,0,0,1], [1,0,1,0], [1,0,1,1],  [1,1,0,0], [1,1,0,1], [1,1,1,0], [1,1,1,1]])        # optional: needs polymake
sage: P.is_simple()                              # optional
True

Author: Edwin O'Shea (2006-05-02): Definition of simple.

n_facets( self)

sage: P = polymake.convex_hull([[1,0,0,0], [1,0,0,1], [1,0,1,0], [1,0,1,1],  [1,1,0,0], [1,1,0,1], [1,1,1,0], [1,1,1,1]])     # optional: needs polymake
sage: P.n_facets()                            # optional
6

vertices( self)

sage: P = polymake.convex_hull([[1,0,0,0], [1,0,0,1], [1,0,1,0], [1,0,1,1],  [1,1,0,0], [1,1,0,1], [1,1,1,0], [1,1,1,1]])     # optional: needs polymake
sage: P.vertices()                            # optional
[(1, 0, 0, 0), (1, 0, 0, 1), (1, 0, 1, 0), (1, 0, 1, 1), (1, 1, 0, 0), (1,
1, 0, 1), (1, 1, 1, 0), (1, 1, 1, 1)]

Special Functions: __add__,$ \,$ __init__,$ \,$ _repr_

__add__( self, other)

See About this document... for information on suggesting changes.