For a torus-invariant Weil divisors $D = \sum_i a_i D_i$ the associated polyhedron is $\{ m \in M : (m, v_i) \geq -a_i \forall i \}$. Given a torus-invariant Weil divisor, this methods makes the associated polyhedra as an object in Polyhedra.
i1 : PP2 = toricProjectiveSpace 2; |
i2 : P0 = polytope (-PP2_0) o2 = P0 o2 : Polyhedron |
i3 : assert (dim P0 === -1) |
i4 : P1 = polytope (0*PP2_0) o4 = P1 o4 : Polyhedron |
i5 : assert (dim P1 == 0) |
i6 : assert (vertices P1 == 0) |
i7 : P2 = polytope (PP2_0) o7 = P2 o7 : Polyhedron |
i8 : vertices P2
o8 = | 0 1 0 |
| 0 0 1 |
2 3
o8 : Matrix QQ <--- QQ
|
i9 : halfspaces P2
o9 = (| -1 0 |, | 0 |)
| 0 -1 | | 0 |
| 1 1 | | 1 |
o9 : Sequence
|
This method works with $\QQ$-Cartier divisors.
i10 : Y = normalToricVariety matrix {{0,1,0,0,1},{0,0,1,0,1},{0,0,0,1,1},{0,0,0,0,3}};
|
i11 : assert not isCartier Y_0 |
i12 : assert isQQCartier Y_0 |
i13 : P3 = polytope Y_0; |
i14 : vertices P3
o14 = | 0 1/3 0 0 1/3 |
| 0 0 1/3 0 1/3 |
| 0 0 0 1/3 1/3 |
| 0 0 0 0 1 |
4 5
o14 : Matrix QQ <--- QQ
|
i15 : vertices polytope Y_0
o15 = | 0 1/3 0 0 1/3 |
| 0 0 1/3 0 1/3 |
| 0 0 0 1/3 1/3 |
| 0 0 0 0 1 |
4 5
o15 : Matrix QQ <--- QQ
|
i16 : halfspaces P3
o16 = (| 3 3 3 -2 |, | 1 |)
| 0 0 0 -1 | | 0 |
| -3 0 0 1 | | 0 |
| 0 -3 0 1 | | 0 |
| 0 0 -3 1 | | 0 |
o16 : Sequence
|
It also works divisors on non-complete toric varieties.
i17 : Z = normalToricVariety ({{1,0},{1,1},{0,1}}, {{0,1},{1,2}});
|
i18 : assert not isComplete Z |
i19 : D = - toricDivisor Z
o19 = Z + Z + Z
0 1 2
o19 : ToricDivisor on Z
|
i20 : P4 = polytope D; |
i21 : rays P4
o21 = | 1 0 |
| 0 1 |
2 2
o21 : Matrix QQ <--- QQ
|
i22 : vertices P4
o22 = | -1 0 |
| 0 -1 |
2 2
o22 : Matrix QQ <--- QQ
|
i23 : halfspaces P4
o23 = (| -1 0 |, | 1 |)
| 0 -1 | | 1 |
| -1 -1 | | 1 |
o23 : Sequence
|