Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

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

563501 views
1
2
3 4ti2 functions
3
4
5
3.1 Groebner
6
7
These are wrappers of some use cases of 4ti2s groebner command.
8
9
3.1-1 4ti2Interface_groebner_matrix
10
11
4ti2Interface_groebner_matrix( matrix[, ordering] )  function
12
Returns: A list of vectors
13
14
This launches the 4ti2 groebner command with the argument as matrix input.
15
The output will be the the Groebner basis of the binomial ideal generated by
16
the left kernel of the input matrix. Note that this is different from 4ti2's
17
convention which takes the right kernel. It returns the output of the
18
groebner command as a list of lists. The second argument can be a vector to
19
specify a monomial ordering, in the way that x^m > x^n if ordering*m >
20
ordering*n
21
22
3.1-2 4ti2Interface_groebner_basis
23
24
4ti2Interface_groebner_basis( basis[, ordering] )  function
25
Returns: A list of vectors
26
27
This launches the 4ti2 groebner command with the argument as matrix input.
28
The outpur will be the Groebner basis of the binomial ideal generated by the
29
rows of the input matrix. It returns the output of the groebner command as a
30
list of lists. The second argument is like before.
31
32
33
3.1-3 Defining ideal of toric variety
34
35
We want to compute the groebner basis of the ideal defining the affine toric
36
variety associated to the cone generated by the inequalities [ [ 7, -1 ], [
37
0, 1 ] ], i.e. a rational normal curve.
38
39
 Example 
40

41
gap> LoadPackage( "4ti2Interface" );
42
true
43
gap> cone := [ [ 7, -1 ], [ 0, 1 ] ];
44
[ [ 7, -1 ], [ 0, 1 ] ]
45
gap> basis := 4ti2Interface_hilbert_inequalities( cone );;
46
gap> groebner := 4ti2Interface_groebner_matrix( basis );;
47
gap> time;
48
0
49
gap> Length( groebner );
50
21
51

52
53
54
3.2 Hilbert
55
56
These are wrappers of some use cases of 4ti2s hilbert command.
57
58
3.2-1 4ti2Interface_hilbert_inequalities
59
60
4ti2Interface_hilbert_inequalities( A )  function
61
4ti2Interface_hilbert_inequalities_in_positive_orthant( A )  function
62
Returns: a list of vectors
63
64
This function produces the hilbert basis of the cone C given by Ax >= 0 for
65
all x in C. For the second function also x >= 0 is assumed.
66
67
3.2-2 4ti2Interface_hilbert_equalities_in_positive_orthant
68
69
4ti2Interface_hilbert_equalities_in_positive_orthant( A )  function
70
Returns: a list of vectors
71
72
This function produces the hilbert basis of the cone C given by the
73
equations Ax = 0 in the positive orthant of the coordinate system.
74
75
3.2-3 4ti2Interface_hilbert_equalities_and_inequalities
76
77
4ti2Interface_hilbert_equalities_and_inequalities( A, B )  function
78
4ti2Interface_hilbert_equalities_and_inequalities_in_positive_orthant( A, B )  function
79
Returns: a list of vectors
80
81
This function produces the hilbert basis of the cone C given by the
82
equations Ax = 0 and the inequations Bx >= 0. For the second function x>=0
83
is assumed.
84
85
86
3.2-4 Generators of semigroup
87
88
We want to compute the Hilbert basis of the cone obtained by intersecting
89
the positive orthant with the hyperplane given by the equation below.
90
91
 Example 
92

93
gap> LoadPackage( "4ti2Interface" );
94
true
95
gap> gens := [ 23,25,37,49 ];
96
[ 23, 25, 37, 49 ]
97
gap> equation := [ Concatenation( gens, -gens ) ];
98
[ [ 23, 25, 37, 49, -23, -25, -37, -49 ] ]
99
gap> basis := 4ti2Interface_hilbert_equalities_in_positive_orthant( equation );;
100
gap> time;
101
12
102
gap> Length( basis );
103
436
104

105
106
107
3.2-5 Hilbert basis of dual cone
108
109
We want to compute the Hilbert basis of the cone which faces are represented
110
by the inequalities below. This example is taken from the toric and the
111
ToricVarieties package manual. In both packages it is very slow with the
112
internal algorithms.
113
114
 Example 
115

116
gap> LoadPackage( "4ti2Interface" );
117
true
118
gap> inequalities := [ [1,2,3,4],[0,1,0,7],[3,1,0,2],[0,0,1,0] ];
119
[ [ 1, 2, 3, 4 ], [ 0, 1, 0, 7 ], [ 3, 1, 0, 2 ], [ 0, 0, 1, 0 ] ]
120
gap> basis := 4ti2Interface_hilbert_inequalities( inequalities );;
121
gap> time;
122
0
123
gap> Length( basis );
124
29
125

126
127
128
3.3 ZSolve
129
130
3.3-1 4ti2Interface_zsolve_equalities_and_inequalities
131
132
4ti2Interface_zsolve_equalities_and_inequalities( eqs, eqs_rhs, ineqs, ineqs_rhs[, signs] )  function
133
4ti2Interface_zsolve_equalities_and_inequalities_in_positive_orthant( eqs, eqs_rhs, ineqs, ineqs_rhs )  function
134
Returns: a list of three matrices
135
136
This function produces a basis of the system eqs = eqs_rhs and ineqs >=
137
ineqs_rhs. It outputs a list containing three matrices. The first one is a
138
list of points in a polytope, the second is the hilbert basis of a cone. The
139
set of solutions is then the minkowski sum of the polytope generated by the
140
points in the first list and the cone generated by the hilbert basis in the
141
second matrix. The third one is the free part of the solution polyhedron.
142
The optional argument signs must be a list of zeros and ones which length is
143
the number of variables. If the ith entry is one, the ith variable must be
144
>= 0. If the entry is 0, the number is arbitraty. Default is all zero. It is
145
also possible to set the option precision to 32, 64 or gmp. The default, if
146
no option is given, 32 is used. Please note that a higher precision leads to
147
slower computation. For the second function xi >= 0 for all variables is
148
assumed.
149
150
151
3.4 Graver
152
153
3.4-1 4ti2Interface_graver_equalities
154
155
4ti2Interface_graver_equalities( eqs[, signs] )  function
156
4ti2Interface_graver_equalities_in_positive_orthant( eqs )  function
157
Returns: a matrix
158
159
This calls the function graver with the equalities eqs = 0. It outputs one
160
list containing the graver basis of the system. the optional argument signs
161
is used like in zsolve. The second command assumes x_i ≥ 0.
162
163
164