Goto Chapter: Top 1 2 3 4 5 6 7 Ind

### 7 Polytopes

#### 7.1 Creating polytopes

##### 7.1-1 PolytopeByInequalities
 ‣ PolytopeByInequalities( L ) ( operation )

Returns: a Polytope Object

The operation takes a list L of lists [L_1, L_2, ...] where each L_j represents an inequality and returns the polytope defined by them (if they define a polytope). For example the j'th entry L_j = [c_j,a_{j1},a_{j2},...,a_{jn}] corresponds to the inequality c_j+\sum_{i=1}^n a_{ji}x_i \geq 0.

##### 7.1-2 Polytope
 ‣ Polytope( L ) ( operation )

Returns: a Polytope Object

The operation takes the list of the vertices and returns the polytope defined by them.

#### 7.2 Attributes

##### 7.2-1 ExternalCddPolytope
 ‣ ExternalCddPolytope( P ) ( attribute )

Returns: a CddPolyhedron

Converts the polytope to a CddPolyhedron. The operations of CddInterface can then be applied on this polyhedron.

##### 7.2-2 LatticePoints
 ‣ LatticePoints( P ) ( attribute )

Returns: a List

The operation returns the list of integer points inside the polytope.

##### 7.2-3 RelativeInteriorLatticePoints
 ‣ RelativeInteriorLatticePoints( P ) ( attribute )

Returns: a List

The operation returns the interior lattice points inside the polytope.

##### 7.2-4 VerticesOfPolytope
 ‣ VerticesOfPolytope( P ) ( attribute )

Returns: a list of lists

The operation returns the vertices of the polytope

##### 7.2-5 Vertices
 ‣ Vertices( P ) ( operation )

Returns: a list of lists

The same output as VerticesOfPolytope.

##### 7.2-6 DefiningInequalities
 ‣ DefiningInequalities( P ) ( attribute )

Returns: a list of lists

The operation returns the defining inequalities of the polytope. I.e., a list of lists [L_1, L_2, ...] where each L_j=[c_j,a_{j1},a_{j2},...,a_{jn}] represents the inequality c_j+\sum_{i=1}^n a_{ji}x_i \geq 0. If L and -L occur in the output then L is called a defining-equality of the polytope.

##### 7.2-7 EqualitiesOfPolytope
 ‣ EqualitiesOfPolytope( P ) ( attribute )

Returns: a list of lists

The operation returns the defining-equalities of the polytope.

##### 7.2-8 FacetInequalities
 ‣ FacetInequalities( P ) ( attribute )

Returns: a list of lists

The operation returns the list of the inequalities of the facets. Each defining inequality that is not defining-equality of the polytope is a facet inequality.

##### 7.2-9 VerticesInFacets
 ‣ VerticesInFacets( P ) ( attribute )

Returns: a list of lists

The operation returns list of lists L. The entries of each L_j in L consists of 0's or 1's. For instance, if L_j=[1,0,0,1,0,1], then The polytope has 6 vertices and the vertices of the j'th facet are \{V_1,V_4,V_6\}.

##### 7.2-10 NormalFan
 ‣ NormalFan( P ) ( attribute )

Returns: a fan

The operation returns the normal fan of the given polytope.

##### 7.2-11 FaceFan
 ‣ FaceFan( P ) ( attribute )

Returns: a fan

The operation returns the face fan of the given polytope. Remember that the face fan of a polytope is isomorphic to the normal fan of its polar polytope.

##### 7.2-12 AffineCone
 ‣ AffineCone( P ) ( attribute )

Returns: a cone

If the ambient space of the polytope is \mathrm{R}^n, then the output is a cone in \mathrm{R}^{n+1}. The defining rays of the cone are {[a_{j1},a_{j2},...,a_{jn},1]}_j such that V_j=[a_{j1},a_{j2},...,a_{jn}] is a vertex in the polytope.

##### 7.2-13 PolarPolytope
 ‣ PolarPolytope( P ) ( attribute )

Returns: a Polytope

The operation returns the polar polytope of the given polytope.

##### 7.2-14 DualPolytope
 ‣ DualPolytope( P ) ( attribute )

Returns: a Polytope

The operation returns the dual polytope of the given polytope.

#### 7.3 Properties

##### 7.3-1 IsEmpty
 ‣ IsEmpty( P ) ( property )

Returns: a true or false

Returns whether the polytope empty or not

##### 7.3-2 IsLatticePolytope
 ‣ IsLatticePolytope( P ) ( property )

Returns: a true or false

Returns whether the polytope is lattice polytope or not.

##### 7.3-3 IsVeryAmple
 ‣ IsVeryAmple( P ) ( property )

Returns: a true or false

Returns whether the polytope is very ample or not.

##### 7.3-4 IsNormalPolytope
 ‣ IsNormalPolytope( P ) ( property )

Returns: a true or false

Returns whether the polytope is normal or not.

##### 7.3-5 IsSimplicial
 ‣ IsSimplicial( P ) ( property )

Returns: a true or false

Returns whether the polytope is simplicial or not.

##### 7.3-6 IsSimplexPolytope
 ‣ IsSimplexPolytope( P ) ( property )

Returns: a true or false

Returns whether the polytope is simplex polytope or not.

##### 7.3-7 IsSimplePolytope
 ‣ IsSimplePolytope( P ) ( property )

Returns: a true or false

Returns whether the polytope is simple or not.

##### 7.3-8 IsReflexive
 ‣ IsReflexive( P ) ( property )

Returns: a true or false

Returns whether the polytope is reflexive or not, i.e., if its dual polytope is lattice polytope.

##### 7.3-9 IsFanoPolytope
 ‣ IsFanoPolytope( P ) ( property )

Returns: a true or false

returns whether the polytope is Fano or not. Fano polytope is a full dimensional lattice polytope whose vertices are primitive elements in the containing lattice, i.e., each vertex is not a positive integer multiple of any other lattice element.

##### 7.3-10 IsCanonicalFanoPolytope
 ‣ IsCanonicalFanoPolytope( P ) ( property )

Returns: a true or false

returns whether the polytope is canonical Fano or not. A canonical Fano polytope is a full dimensional lattice polytope whose relative interior contains only one lattice point, namely the origin.

##### 7.3-11 IsTerminalFanoPolytope
 ‣ IsTerminalFanoPolytope( P ) ( property )

Returns: a true or false

returns whether the polytope is terminal Fano or not. A terminal Fano polytope is a full dimensional lattice polytope whose lattice points are its vertices and the origin.

##### 7.3-12 IsSmoothFanoPolytope
 ‣ IsSmoothFanoPolytope( P ) ( property )

Returns: a true or false

Returns whether the polytope is smooth fano polytope or not, i.e, if the vertices in each facet form a basis for the containing lattice or not. polytope.

#### 7.4 Operations on polytopes

##### 7.4-1 \+
 ‣ \+( P1, P2 ) ( operation )

Returns: a polytope

The output is Minkowski sum of the input polytopes.

##### 7.4-2 \*
 ‣ \*( n, P ) ( operation )

Returns: a polytope

The output is Minkowski sum of the input polytope with itself n times.

##### 7.4-3 IntersectionOfPolytopes
 ‣ IntersectionOfPolytopes( P1, P2 ) ( operation )

Returns: a polytope

The output is the intersection of the input polytopes.

##### 7.4-4 RandomInteriorPoint
 ‣ RandomInteriorPoint( P ) ( operation )

Returns: a list

Returns a random interior point in the polytope.

##### 7.4-5 IsInteriorPoint
 ‣ IsInteriorPoint( M, P ) ( operation )

Returns: true or false

Checks if the given point is interior point of the polytope.

gap> P:= Polytope( [ [ 0, 0, 0 ], [ 1, 0, 0 ], [ 0, 1, 0 ], [ 1, 1, 2 ] ] );
<A polytope in |R^3>
gap> IsNormalPolytope( P );
false
gap> IsVeryAmple( P );
false
gap> Q:= Polytope( [ [ 0, 0, 0 ], [ 1, 0, 0 ], [ 0, 1, 0 ], [ 1, 1, 1 ] ] );
<A polytope in |R^3>
gap> IsNormalPolytope( Q );
true
gap> IsVeryAmple( Q );
true
gap> Q;
<A normal very ample polytope in |R^3 with 4 vertices>
gap> T:= Polytope( [ [ 0, 0, 0 ], [ 1, 0, 0 ], [ 0, 1, 0 ], [ 1, 1, 4 ] ] );
<A polytope in |R^3>
gap> I:= Polytope( [ [ 0, 0, 0 ], [ 0, 0, 1 ] ] );
<A polytope in |R^3>
gap> J:= T + I;
<A polytope in |R^3>
gap> IsVeryAmple( J );
true
gap> IsNormalPolytope( J );
false
gap> J;
<A very ample polytope in |R^3 with 8 vertices>
gap> # Example 2.2.20 Cox, Toric Varieties
> A:= [ [1,1,1,0,0,0], [1,1,0,1,0,0], [1,0,1,0,1,0], [ 1,0,0,1,0,1],
> [ 1,0,0,0,1,1], [ 0,1,1,0,0,1], [0,1,0,1,1,0], [0,1,0,0,1,1],
> [0,0,1,1,1,0], [0,0,1,1,0,1] ];
[ [ 1, 1, 1, 0, 0, 0 ], [ 1, 1, 0, 1, 0, 0 ], [ 1, 0, 1, 0, 1, 0 ],
[ 1, 0, 0, 1, 0, 1 ], [ 1, 0, 0, 0, 1, 1 ], [ 0, 1, 1, 0, 0, 1 ],
[ 0, 1, 0, 1, 1, 0 ], [ 0, 1, 0, 0, 1, 1 ], [ 0, 0, 1, 1, 1, 0 ],
[ 0, 0, 1, 1, 0, 1 ] ]
gap> H:= Polytope( A );
<A polytope in |R^6>
gap> IsVeryAmple( H );
true
gap> IsNormalPolytope( H );
false
gap> H;
<A very ample polytope in |R^6 with 10 vertices>
gap> l:= [ [ 0, 0, 1 ], [ 0, 0, 0 ], [ 1, 0, 0 ], [ 1, 0, 1 ], [ 0, 1, 0 ],
> [ 0, 1, 1 ], [ 1, 1, 4 ], [ 1, 1, 5 ] ];;
gap> P:= Polytope( l );
<A polytope in |R^3>
gap> IsNormalPolytope( P );
false
gap> lattic_points:= LatticePoints( P );
[ [ 0, 0, 0 ], [ 0, 0, 1 ], [ 0, 1, 0 ], [ 0, 1, 1 ], [ 1, 0, 0 ], [ 1, 0, 1 ],
[ 1, 1, 4 ], [ 1, 1, 5 ] ]
gap> u:= Cartesian( lattic_points, lattic_points );;
gap> k:= Set( List( u, u-> u[1]+u[2] ) );
[ [ 0, 0, 0 ], [ 0, 0, 1 ], [ 0, 0, 2 ], [ 0, 1, 0 ], [ 0, 1, 1 ], [ 0, 1, 2 ],
[ 0, 2, 0 ], [ 0, 2, 1 ], [ 0, 2, 2 ], [ 1, 0, 0 ], [ 1, 0, 1 ], [ 1, 0, 2 ],
[ 1, 1, 0 ], [ 1, 1, 1 ], [ 1, 1, 2 ], [ 1, 1, 4 ], [ 1, 1, 5 ], [ 1, 1, 6 ],
[ 1, 2, 4 ], [ 1, 2, 5 ], [ 1, 2, 6 ], [ 2, 0, 0 ], [ 2, 0, 1 ], [ 2, 0, 2 ],
[ 2, 1, 4 ], [ 2, 1, 5 ], [ 2, 1, 6 ], [ 2, 2, 8 ], [ 2, 2, 9 ], [ 2, 2, 10 ] ]
gap> Q:= 2*P;
<A polytope in |R^3 with 8 vertices>
gap> LatticePoints( Q );
[ [ 0, 0, 0 ], [ 0, 0, 1 ], [ 0, 0, 2 ], [ 0, 1, 0 ], [ 0, 1, 1 ], [ 0, 1, 2 ],
[ 0, 2, 0 ], [ 0, 2, 1 ], [ 0, 2, 2 ], [ 1, 0, 0 ],
[ 1, 0, 1 ], [ 1, 0, 2 ], [ 1, 1, 0 ], [ 1, 1, 1 ], [ 1, 1, 2 ], [ 1, 1, 3 ],
[ 1, 1, 4 ], [ 1, 1, 5 ], [ 1, 1, 6 ], [ 1, 2, 4 ], [ 1, 2, 5 ], [ 1, 2, 6 ],
[ 2, 0, 0 ], [ 2, 0, 1 ], [ 2, 0, 2 ], [ 2, 1, 4 ],
[ 2, 1, 5 ], [ 2, 1, 6 ], [ 2, 2, 8 ], [ 2, 2, 9 ], [ 2, 2, 10 ] ]
gap> P:= Polytope( [ [ 1, 1 ], [ 1, -1 ], [ -1, 1 ], [ -1, -1 ] ] );
<A polytope in |R^2>
gap> Q:= PolarPolytope( P );
<A polytope in |R^2>
gap> Vertices( Q );
[ [ -1, 0 ], [ 0, -1 ], [ 0, 1 ], [ 1, 0 ] ]
gap> T := PolarPolytope( Q );
<A polytope in |R^2>
gap> Vertices( T );
[ [ -1, -1 ], [ -1, 1 ], [ 1, -1 ], [ 1, 1 ] ]
gap> P:= Polytope( [ [ 0, 0 ], [ 1, -1], [ -1, 1 ], [ -1, -1 ] ] );
<A polytope in |R^2>
gap> # PolarPolytope( P );;

gap> P := PolytopeByInequalities( [ [ 0, 0, 1 ], [ 1, -1, -1 ], [ 1, 1, -1 ] ] );
<A polytope in |R^2>
gap> Vertices( P );
[ [ -1, 0 ], [ 0, 1 ], [ 1, 0 ] ]

Goto Chapter: Top 1 2 3 4 5 6 7 Ind

generated by GAPDoc2HTML