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 : fVector P o2 = {6, 12, 8, 1} o2 : List |
i3 : vertices P o3 = | -1 1 0 0 0 0 | | 0 0 -1 1 0 0 | | 0 0 0 0 -1 1 | 3 6 o3 : Matrix QQ <--- QQ |
i4 : X = normalToricVariety P; |
i5 : rays X o5 = {{-1, -1, -1}, {1, -1, -1}, {-1, 1, -1}, {1, 1, -1}, {-1, -1, 1}, {1, ------------------------------------------------------------------------ -1, 1}, {-1, 1, 1}, {1, 1, 1}} o5 : List |
i6 : max X o6 = {{0, 1, 2, 3}, {0, 1, 4, 5}, {0, 2, 4, 6}, {1, 3, 5, 7}, {2, 3, 6, 7}, ------------------------------------------------------------------------ {4, 5, 6, 7}} o6 : List |
i7 : picardGroup X 1 o7 = ZZ o7 : ZZ-module, free |
When the polyhedron is not full-dimensional, restricting to the smallest linear subspace that contains the polyhedron guarantees that normal fan is strongly convex.
i8 : P = convexHull transpose matrix unique permutations {1,1,0,0}; |
i9 : assert not isFullDimensional P |
i10 : fVector P o10 = {6, 12, 8, 1} o10 : List |
i11 : X = normalToricVariety P; |
i12 : assert (dim P === dim X) |
i13 : rays X o13 = {{-1, 0, 0}, {1, 0, 0}, {0, -1, 0}, {0, 1, 0}, {0, 0, -1}, {-1, -1, ----------------------------------------------------------------------- -1}, {0, 0, 1}, {1, 1, 1}} o13 : List |
i14 : max X o14 = {{0, 2, 5, 6}, {0, 3, 4, 5}, {0, 3, 6, 7}, {1, 2, 4, 5}, {1, 2, 6, 7}, ----------------------------------------------------------------------- {1, 3, 4, 7}} o14 : List |
i15 : assert (8 === #rays X) |
i16 : assert (6 === #max X) |
i17 : picardGroup X 1 o17 = ZZ o17 : ZZ-module, free |
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 increase in time resulting from the use of a Polyhedra polyhedron.
i18 : vertMatrix = matrix {{0,1,0},{0,0,1}} o18 = | 0 1 0 | | 0 0 1 | 2 3 o18 : Matrix ZZ <--- ZZ |
i19 : X1 = time normalToricVariety convexHull (vertMatrix); -- used 0.0342905 seconds |
i20 : X2 = time normalToricVariety vertMatrix; -- used 0.00344423 seconds |
i21 : assert (set rays X2 === set rays X1 and max X1 === max X2) |