CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
2
2 Cones and semigroups
3
4
5
2.1 Cones
6
7
This section introduces the toric commands which deal with cones and related
8
combinatorial-geometric objects. Recall, a cone is a strongly convex
9
polyhedral cone ([Ful93], page 4).
10
11
2.1-1 InsideCone
12
13
InsideCone( v, L )  function
14
15
This command returns `true` if the vector v belongs to the interior of the
16
(strongly convex polyhedral) cone generated by the vectors in L.
17
18
This procedure does not check if L generates a strongly convex polyhedral
19
cone.
20
21
 Example 
22
gap> L:=[[1,0,0],[1,1,0],[1,1,1],[1,0,1]];; v:=[0,0,1];;
23
gap> InsideCone(v,L);
24
false
25
gap> L:=[[1,0],[3,4]];;
26
gap> v:=[1,-7]; InsideCone(v,L);
27
[ 1, -7 ]
28
false
29
gap> v:=[4,-3]; InsideCone(v,L);
30
[ 4, -3 ]
31
false
32
gap> v:=[4,-4]; InsideCone(v,L);
33
[ 4, -4 ]
34
false
35
gap> v:=[4,1]; InsideCone(v,L);
36
[ 4, 1 ]
37
true
38

39
40
2.1-2 InDualCone
41
42
InDualCone( v, L )  function
43
44
This command returns `true` if v belongs to the dual of the cone generated
45
by the vectors in L.
46
47
 Example 
48
gap> L:=[[1,0,0],[1,1,0],[1,1,1],[1,0,1]];; v:=[0,0,1];;
49
gap> InDualCone(v,L);
50
true
51
gap> L:=[[1,0],[3,4]];
52
[ [ 1, 0 ], [ 3, 4 ] ]
53
gap> v:=[1,-7]; InDualCone(v,L);
54
[ 1, -7 ]
55
false
56
gap> v:=[4,-3]; InDualCone(v,L);
57
[ 4, -3 ]
58
true
59
gap> v:=[4,-4]; InDualCone(v,L);
60
[ 4, -4 ]
61
false
62
gap> v:=[4,1]; InDualCone(v,L);
63
[ 4, 1 ]
64
true
65

66
67
2.1-3 PolytopeLatticePoints
68
69
PolytopeLatticePoints( A, Perps )  function
70
71
Input: Perps=[v_1,...,v_k] is the list of ``inward normal" vectors
72
perpendicular to the walls of a polytope P in the vector space L_0^*⊗ Q,
73
A=[a_1,...,a_k] is a k-tuple of integers, where a_i denotes the amount the
74
i-th ``wall" (defined by the normal v_i) is shifted from the origin (each
75
a_i is assumed non-negative).
76
For example, the polytope P with faces [x=0, x=a, y=0, y=b] has
77
Perps=[[1,0],[-1,0],[0,1],[0,-1]] and A=[0,a,0,b].
78
Output: the list of points in P ∩ L_0^*.
79
80
 Example 
81
gap> Perps:=[[1,0],[-1,0],[0,1],[0,-1]];
82
[ [ 1, 0 ], [ -1, 0 ], [ 0, 1 ], [ 0, -1 ] ]
83
gap> A:=[0,4,0,3];
84
[ 0, 4, 0, 3 ]
85
gap> PolytopeLatticePoints(A,Perps);
86
[ [ 0, 0 ], [ 0, 1 ], [ 0, 2 ], [ 0, 3 ], [ 1, 0 ], [ 1, 1 ], [ 1, 2 ],
87
 [ 1, 3 ], [ 2, 0 ], [ 2, 1 ], [ 2, 2 ], [ 2, 3 ], [ 3, 0 ], [ 3, 1 ],
88
 [ 3, 2 ], [ 3, 3 ], [ 4, 0 ], [ 4, 1 ], [ 4, 2 ], [ 4, 3 ] ]
89
gap> Length(last);
90
20
91

92
93
2.1-4 Faces
94
95
Faces( Rays )  function
96
97
Input: Rays is a list of rays for the fan ∆
98
Output: All the normals to the faces (hyperplanes of the cone).
99
100
 Example 
101
gap> Cones1:=[[[2,-1],[-1,2]],[[-1,2],[-1,-1]],[[-1,-1],[2,-1]]];;
102
gap> Faces(Cones1[1]);
103
[ [ 1/2, 1 ], [ 2, 1 ] ]
104
gap> Faces(Cones1[2]);
105
[ [ -2, -1 ], [ -1, 1 ] ]
106
gap> Cones2:=[[[ 2,0,0],[0,2,0],[0,0,2]], [[2,0,0], [0,2,0], [2,-2,1],[1,2,-2]]];;
107
gap> Faces(Cones2[1]);
108
[ [ 0, 0, 1 ], [ 0, 1, 0 ], [ 1, 0, 0 ] ]
109
gap> Faces(Cones2[2]);
110
[ [ 1/3, 5/6, 1 ], [ 1/2, 0, -1 ], [ 2, 0, 1 ] ]
111

112
113
2.1-5 ConesOfFan
114
115
ConesOfFan( Delta, k )  function
116
117
Input: Delta is the fan of cones,
118
k is the dimension of the cones desired.
119
Output: The k-dimensional cones in the fan.
120
121
2.1-6 NumberOfConesOfFan
122
123
NumberOfConesOfFan( Delta, k )  function
124
125
Input: Delta is the fan of cones in V=Q^n,
126
k is the dimension of the cones counted.
127
Output: The number of k-dimensional cones in the fan.
128
129
Idea: The fan Delta is represented as a set of maximal cones. For each
130
maximal cone, look at the k-dimensional faces obtained by taking n choose k
131
subsets of the rays describing the cone. Certain of these k-subsets yield
132
the desired cones.
133
134
 Example 
135
gap> Delta0:=[ [ [2,0,0],[0,2,0],[0,0,2] ], [ [2,0,0],[0,2,0],[2,-2,1],[1,2,-2] ] ];;
136
gap> NumberOfConesOfFan(Delta0,2);
137
6
138
gap> ConesOfFan(Delta0,2);
139
[ [ [ 0, 0, 2 ], [ 0, 2, 0 ] ], [ [ 0, 0, 2 ], [ 2, 0, 0 ] ], 
140
 [ [ 0, 2, 0 ], [ 1, 2, -2 ] ], [ [ 0, 2, 0 ], [ 2, -2, 1 ] ],
141
 [ [ 0, 2, 0 ], [ 2, 0, 0 ] ], [ [ 1, 2, -2 ], [ 2, -2, 1 ] ] ]
142
gap> ConesOfFan(Delta0,1);
143
[ [ [ 0, 0, 2 ] ], [ [ 0, 2, 0 ] ], [ [ 1, 2, -2 ] ], 
144
 [ [ 2, -2, 1 ] ], [ [ 2, 0, 0 ] ] ]
145
gap> NumberOfConesOfFan(Delta0,1);
146
5
147

148
149
2.1-7 ToricStar
150
151
ToricStar( sigma, Delta )  function
152
153
Input: sigma is a cone in the fan, represented by its set of maximal (i.e.,
154
highest dimensional) cones.
155
Delta is the fan of cones in V=Q^n.
156
Output: The star of the cone sigma in Delta, i.e., the cones τ which have
157
sigma as a face.
158
159
 Example 
160
gap> MaxCones:=[ [ [2,0,0],[0,2,0],[0,0,2] ], 
161
>  [ [2,0,0],[0,2,0],[2,-2,1],[1,2,-2] ] ];;
162
gap> #this is the set of maximal cones in the fan Delta
163
gap> ToricStar([[1,0]],MaxCones);
164
[ ]
165
gap> ToricStar([[2,0,0],[0,2,0]],MaxCones);
166
[ [ [ 0, 2, 0 ], [ 2, 0, 0 ] ], [ [ 2, 0, 0 ], [ 0, 2, 0 ], [ 0, 0, 2 ] ],
167
 [ [ 2, 0, 0 ], [ 0, 2, 0 ], [ 2, -2, 1 ], [ 1, 2, -2 ] ] ]
168
gap> MaxCones:=[ [ [2,0,0],[0,2,0],[0,0,2] ], [ [2,0,0],[0,2,0],[1,1,-2] ] ];;
169
gap> ToricStar([[2,0,0],[0,2,0]],MaxCones);
170
[ [ [ 0, 2, 0 ], [ 2, 0, 0 ] ], [ [ 2, 0, 0 ], [ 0, 2, 0 ], [ 0, 0, 2 ] ],
171
 [ [ 2, 0, 0 ], [ 0, 2, 0 ], [ 1, 1, -2 ] ] ]
172
gap> ToricStar([[1,0]],MaxCones);
173
[ ]
174

175
176
177
2.2 Semigroups
178
179
2.2-1 DualSemigroupGenerators
180
181
DualSemigroupGenerators( L )  function
182
183
Input: L is a list of integral n-vectors generating a cone σ.
184
Output: the generators of S_σ,
185
186
Idea: let M be the maximum of the absolute values of the coordinates of the
187
L[i]'s, for each vector v in [1..M]^n, test if v is in the dual cone σ^*. If
188
so, add v to list of possible generators. Once this for loop is finished,
189
one can check this list for redundant generators. The trick is to simply
190
omit those elements which are of the form d_1+d_2, where d_1 and d_2 are
191
``small" elements in the integral dual cone.
192
193
This program is not very efficient and should not be used in ``large
194
examples'' involving semigroups with ``many'' generators. For example, if
195
you take L:=[[1,2,3,4],[0,1,0,7],[3,1,0,2],[0,0,1,0]]; then
196
DualSemigroupGenerators(L); can exhaust GAP's memory allocation.
197
198
 Example 
199
gap> L:=[[1,0],[3,4]];; DualSemigroupGenerators([[1,0],[3,4]]);
200
[ [ 0, 0 ], [ 0, 1 ], [ 1, 0 ], [ 2, -1 ], [ 3, -2 ], [ 4, -3 ] ]
201
gap> L:=[[1,0,0],[1,1,0],[1,1,1],[1,0,1]];;
202
gap> DualSemigroupGenerators(L);
203
[ [ 0, 0, 0 ], [ 0, 0, 1 ], [ 0, 1, 0 ], [ 1, -1, 0 ], [ 1, 0, -1 ] ]
204

205
206
207