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.

AUTHORS:

  • Ewgenij Gawrilow, Michael Joswig: main authors of polymake
  • William Stein: Sage interface
class sage.geometry.polytope.Polymake
_Polymake__make(cmd, name)
__repr__()
associahedron(dimension)
birkhoff(n)
cell24()

EXAMPLES:

sage: polymake.cell24()            # optional: needs polymake
The 24-cell
convex_hull(points=[])

EXAMPLES:

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\n{1 2}\n{0 2}\n{0 1}\n\n'
cube(dimension, scale=0)
from_data(data)
rand01(d, n, seed=None)
reconfigure()

Reconfigure polymake.

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

class sage.geometry.polytope.Polytope(datafile, desc)

Create a polytope.

EXAMPLES:

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.

__add__(other)
__init__(datafile, desc)
__weakref__
list of weak references to the object (if defined)
_repr_()
cmd(cmd)
data()
facets()

EXAMPLES:

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)]
graph()
is_simple()

Return True if this polytope is simple.

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

EXAMPLES:

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

AUTHORS:

  • Edwin O’Shea (2006-05-02): Definition of simple.
n_facets()

EXAMPLES:

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()

EXAMPLES:

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)]
visual()
write(filename)

Previous topic

Groebner Fans

Next topic

Homology of Simplicial Complexes

This Page