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
A Overview of the LocalizeRingForHomalg Package Source Code
3
4
This appendix is included in the documentation to shine some light on the
5
mathematical backgrounds of this Package. Neither is it needed to work with
6
this package nor should the methods presented here be called directly. The
7
functions documented here are entries of the so called ring table and not to
8
be called directly. There are higher level methods in declared and installed
9
in MatricesForHomalg, which call this functions (--> ?MatricesForHomalg:The
10
Basic Matrix Operations).
11
12
We only present the simpler procedures, where no transformation matrices are
13
computed, since the computation of transformation matrices carries no
14
further mathematical ideas.
15
16
17
A.1 The generic Methods
18
19
There are some methods in localized rings, where homalg is able to fall back
20
on procedures of the corresponding global ring. Furthermore these methods
21
work quite good together with Mora's algorithm as implemented in Singular,
22
since we can treat it like a global ring. We will present some methods as an
23
example, to show the idea:
24
25
A.1-1 BasisOfRowModule
26
27
BasisOfRowModule( M )  function
28
Returns: a "basis" of the module generated by M
29
30
This procedure computes a basis by using the Funcod of the underlying
31
computation ring. If the computation ring is given by Mora's Algorithm, we
32
will indeed compute a local basis. If we just use the global ring for
33
computations, this will be a global basis and is just computed for some
34
simplifications and not for the use of reducing by it. Of course we can just
35
forget about the denominator of M.
36
37
 Code 
38
BasisOfRowModule :=
39
 function( M )
40

41
 Info(
42
 InfoLocalizeRingForHomalg,
43
 2,
44
 "Start BasisOfRowModule with ",
45
 NrRows( M ), "x", NrColumns( M )
46
 );
47

48
 return HomalgLocalMatrix( BasisOfRowModule( Numerator( M ) ), HomalgRing( M ) );
49
 
50
end,
51

52
53
A.1-2 DecideZeroRows
54
55
DecideZeroRows( A, B )  function
56
Returns: a "reduced" form of A with respect to B
57
58
This procedure just calls the DecideZeroRows of the computation ring for the
59
numerator of A.
60
61
If we use Mora's algorithm this procedure will just call it. The result is
62
divided by the denominator of A afterwards. Again we do not need to care
63
about the denominator of B.
64
65
If we use the reduction implemented in this package, this Funcod is
66
overwritten and will not be called.
67
68
 Code 
69
DecideZeroRows :=
70
 function( A, B )
71
 local R, ComputationRing, hook, result;
72
 
73
 Info(
74
 InfoLocalizeRingForHomalg,
75
 2,
76
 "Start DecideZeroRows with ",
77
 NrRows( A ), "x", NrColumns( A ),
78
 " and ",
79
 NrRows( B ), "x", NrColumns( B )
80
 );
81
 
82
 R := HomalgRing( A );
83
 ComputationRing := AssociatedComputationRing( R );
84
 
85
 result := DecideZeroRows( Numerator( A ) , Numerator( B ) );
86
 result := HomalgLocalMatrix( result, Denominator( A ) , R );
87
 Info( InfoLocalizeRingForHomalgShowUnits, 1, "DecideZeroRows: produces denominator: ", Name( Denominator( result ) ) );
88
 return result;
89

90
 end,
91

92
93
A.1-3 SyzygiesGeneratorsOfRows
94
95
SyzygiesGeneratorsOfRows( M )  function
96
Returns: a "basis" of the syzygies of the arguments (for details consult
97
the homalg help)
98
99
It is easy to see, that a global syzygy is also a local syzygy and vice
100
versa when clearing the local Syzygy of its denominators. So this procedure
101
just calls the syzygy Funcod of the underlying computation ring.
102
103
 Code 
104
SyzygiesGeneratorsOfRows :=
105
 function( M )
106
 
107
 Info(
108
 InfoLocalizeRingForHomalg,
109
 2,
110
 "Start SyzygiesGeneratorsOfRows with ",
111
 NrRows( M ), "x", NrColumns( M )
112
 );
113

114
 return HomalgLocalMatrix(\
115
 SyzygiesGeneratorsOfRows( Numerator( M ) ), HomalgRing( M )\
116
 );
117
 
118
 end,
119

120
121
122
A.2 The Local Decide Zero trick
123
124
A.2-1 DecideZeroRows
125
126
DecideZeroRows( B, A )  function
127
Returns: a "reduced" form of B with respect to A
128
129
This procedure is the mathematical core procedure of this package. We use a
130
trick to decide locally, whether B can be reduced to zero by A with a global
131
computation. First a heuristic is used by just checking, whether the element
132
lies inside the global module, generated by the generators of the local
133
module. This of course implies this for the local module having the
134
advantage of a short computation time and leaving a normal form free of
135
denominators. If this check fails, we use our trick to check for each row of
136
B independently, whether it lies in the module generated by B.
137
138
 Code 
139
DecideZeroRows :=
140
 function( B, A )
141
 local R, T, m, gens, n, GlobalR, one, N, b, numB, denB, i, B1, A1, B2, A2, B3;
142
 
143
 Info( 
144
 InfoLocalizeRingForHomalg,
145
 2,
146
 "Start DecideZeroRows with ",
147
 NrRows( B ), "x", NrColumns( B ),
148
 " and ",
149
 NrRows( A ), "x", NrColumns( A ) 
150
 );
151
 
152
 R := HomalgRing( B );
153
 GlobalR := AssociatedComputationRing( R );
154
 T := HomalgVoidMatrix( R );
155
 gens := GeneratorsOfMaximalLeftIdeal( R );
156
 n := NrRows( gens );
157
 one := One( GlobalR );
158
 
159
 m := NrRows( A );
160
 A1 := Numerator( A );
161
 
162
 N := HomalgZeroMatrix( 0, NrColumns( B ), R );
163
 b := Eval( B );
164
 numB := b[1];
165
 denB := b[2];
166
 
167
 for i in [ 1 .. NrRows( B ) ] do
168
 
169
 #use global reduction as heuristic
170
 B1 := CertainRows( numB, [ i ] );
171
 B2 := HomalgLocalMatrix( DecideZeroRows( B1, A1 ), R );
172
 
173
 #if it is nonzero, check whether local reduction makes it zero
174
 if not IsZero( B2 ) then
175
 A2 := UnionOfRows( A1, gens * B1 );
176
 A2 := BasisOfRows( A2 );
177
 B3 := HomalgLocalMatrix( DecideZeroRows( B1, A2 ), R );
178
 if IsZero( B3 ) then
179
 B2 := B3;
180
 fi;
181
 fi;
182
 
183
 N := UnionOfRows( N, B2 );
184
 
185
 od;
186
 
187
 N := HomalgRingElement( one, denB, R ) * N;
188
 
189
 Info( InfoLocalizeRingForHomalgShowUnits, 1, "DecideZeroRows: produces denominator: ", Name( Denominator( N ) ) );
190
 
191
 return N;
192
 
193
 end,
194

195
196
197
A.3 Tools
198
199
The package LocalizeRingForHomalg also implements tool functions. These are
200
referred to from MatricesForHomalg automatically. We list the implemented
201
methods here are and refer to the MatricesForHomalg documentation (-->
202
?MatricesForHomalg: The Matrix Tool Operations and
203
?MatricesForHomalg:RingElement) for details. All tools functions from
204
MatricesForHomalg not listed here are also supported by fallback tools.
205
206
 IsZero
207
208
 IsOne
209
210
 Minus
211
212
 DivideByUnit
213
214
 IsUnit
215
216
 Sum
217
218
 Product
219
220
 ShallowCopy
221
222
 ZeroMatrix
223
224
 IdentityMatrix
225
226
 AreEqualMatrices
227
228
 Involution
229
230
 CertainRows
231
232
 CertainColumns
233
234
 UnionOfRows
235
236
 UnionOfColumns
237
238
 DiagMat
239
240
 KroneckerMat
241
242
 MulMat
243
244
 AddMat
245
246
 SubMat
247
248
 Compose
249
250
 NrRows
251
252
 NrColumns
253
254
 IsZeroMatrix
255
256
 IsDiagonalMatrix
257
258
 ZeroRows
259
260
 ZeroColumns
261
262
263