This method makes a NormalToricVariety from a Polyhedron as implemented in the Polyhedra package. In particular, the associated fan is inner normal fan to the polyhedron.
i1 : P = convexHull (id_(ZZ^3) | -id_(ZZ^3)); |
i2 : vertices P o2 = | -1 1 0 0 0 0 | | 0 0 -1 1 0 0 | | 0 0 0 0 -1 1 | 3 6 o2 : Matrix QQ <--- QQ |
i3 : X = normalToricVariety P; |
i4 : rays X o4 = {{-1, -1, -1}, {1, -1, -1}, {-1, 1, -1}, {1, 1, -1}, {-1, -1, 1}, {1, ------------------------------------------------------------------------ -1, 1}, {-1, 1, 1}, {1, 1, 1}} o4 : List |
i5 : max X o5 = {{0, 1, 2, 3}, {0, 1, 4, 5}, {0, 2, 4, 6}, {1, 3, 5, 7}, {2, 3, 6, 7}, ------------------------------------------------------------------------ {4, 5, 6, 7}} o5 : List |
The recommended method for creating a NormalToricVariety from a polytope is normalToricVariety(Matrix). In fact, this package avoids using objects from the Polyhedra whenever possible. Here is a trivial example, namely projective 2-space, illustrating the substantial increase in time resulting from the use of a Polyhedra polyhedron.
i6 : vertMatrix = matrix {{0,1,0},{0,0,1}} o6 = | 0 1 0 | | 0 0 1 | 2 3 o6 : Matrix ZZ <--- ZZ |
i7 : X1 = time normalToricVariety convexHull (vertMatrix); -- used 0.0149772 seconds |
i8 : X2 = time normalToricVariety vertMatrix; -- used 0.00173978 seconds |
i9 : assert(set rays X2 === set rays X1 and max X1 === max X2) |