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:
EXAMPLES:
sage: polymake.cell24() # optional: needs polymake
The 24-cell
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'
Reconfigure polymake.
Remember to run polymake.reconfigure() as soon as you have changed the customization file and/or installed missing software!
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.
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)]
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:
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
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)]