# polytope(ToricDivisor) -- makes the associated 'Polyhedra' polyhedron

## Synopsis

• Usage:
polytope D
• Function: polytope
• Inputs:
• D,
• Outputs:

## Description

For a torus-invariant Weil divisors D = ∑i ai Di the associated polyhedron is {m ∈M : (m, vi) ≥-ai ∀i }. Given a torus-invariant Weil divisor, this methods makes the associated polyhedra as an object in Polyhedra.
 `i1 : PP2 = projectiveSpace 2;` ```i2 : polytope (-PP2_0) o2 = {ambient dimension => 2 } dimension of lineality space => 0 dimension of polyhedron => -1 number of facets => 0 number of rays => 0 number of vertices => 0 o2 : Polyhedron``` ```i3 : polytope (0*PP2_0) o3 = {ambient dimension => 2 } dimension of lineality space => 0 dimension of polyhedron => 0 number of facets => 0 number of rays => 0 number of vertices => 1 o3 : Polyhedron``` ```i4 : P = polytope (PP2_0) o4 = {ambient dimension => 2 } dimension of lineality space => 0 dimension of polyhedron => 2 number of facets => 3 number of rays => 0 number of vertices => 3 o4 : Polyhedron``` ```i5 : vertices P o5 = | 0 1 0 | | 0 0 1 | 2 3 o5 : Matrix QQ <--- QQ```
This method works with -Cartier divisors.
 `i6 : Y = normalToricVariety matrix {{0,1,0,0,1},{0,0,1,0,1},{0,0,0,1,1},{0,0,0,0,3}};` ```i7 : isCartier Y_0 o7 = false``` ```i8 : isQQCartier Y_0 o8 = true``` ```i9 : polytope Y_0 o9 = {ambient dimension => 4 } dimension of lineality space => 0 dimension of polyhedron => 4 number of facets => 5 number of rays => 0 number of vertices => 5 o9 : Polyhedron``` ```i10 : vertices polytope Y_0 o10 = | 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 o10 : Matrix QQ <--- QQ```
It also works divisors on non-complete toric varieties.
 `i11 : Z = normalToricVariety({{1,0},{1,1},{0,1}},{{0,1},{1,2}});` ```i12 : isComplete Z o12 = false``` ```i13 : D = - toricDivisor Z o13 = D + D + D 0 1 2 o13 : ToricDivisor on Z``` ```i14 : P = polytope D o14 = {ambient dimension => 2 } dimension of lineality space => 0 dimension of polyhedron => 2 number of facets => 3 number of rays => 2 number of vertices => 2 o14 : Polyhedron``` ```i15 : rays P o15 = | 1 0 | | 0 1 | 2 2 o15 : Matrix ZZ <--- ZZ``` ```i16 : vertices P o16 = | -1 0 | | 0 -1 | 2 2 o16 : Matrix QQ <--- QQ```