1 | /////////////////////////////////////////////////////////////////////////////// |
---|
2 | version="$Id: center.lib,v 1.19 2006-05-05 14:36:12 motsak Exp $" |
---|
3 | category="Noncommutative" |
---|
4 | info=" |
---|
5 | LIBRARY: center.lib computation of central elements of GR-algebras |
---|
6 | AUTHOR: Oleksandr Motsak, motsak@mathematik.uni-kl.de. |
---|
7 | OVERVIEW: Computing elements of center and centralizers of sets of elements |
---|
8 | in non-commutative algebras. |
---|
9 | |
---|
10 | MAIN PROCEDURES: |
---|
11 | centralizeSet(F, V): v.s. basis of the centralizer of F within V |
---|
12 | centralizerVS(F, D): v.s. basis of the centralizer of F |
---|
13 | centralizerRed(F, D[, N]): reduced basis of the centralizer of F |
---|
14 | centerVS(D): v.s. basis of the center |
---|
15 | centerRed(D[, k]): reduced basis of the center |
---|
16 | |
---|
17 | center(D[, k]): reduced basis of the center |
---|
18 | centralizer(F, D[, k]): reduced bais of the centralizer of F |
---|
19 | |
---|
20 | sa_reduce(V): 's.a. reduction' of pairwise commuting elements |
---|
21 | sa_poly_reduce(p, V): 's.a. reduction' of p by pairwise commuting elements |
---|
22 | |
---|
23 | inCenter(T): checks the centrality of list/ideal/poly T |
---|
24 | inCentralizer(T, S): checks whether list/ideal/poly T commute with S |
---|
25 | isCartan(p): checks whether polynomial p is a Cartan element |
---|
26 | |
---|
27 | AUXILIARY PROCEDURES: |
---|
28 | applyAdF(Basis, f): images of elements under the k-linear map Ad_{f} |
---|
29 | linearMapKernel(Images): kernel of a linear map given by images |
---|
30 | linearCombinations(Basis, C): k-linear combinations of elements |
---|
31 | |
---|
32 | variablesStandard(): set of algebra generators in their natural order |
---|
33 | variablesSorted(): heuristically sorted set of algebra generators |
---|
34 | |
---|
35 | PBW_eqDeg(Deg): PBW monomials of given degree |
---|
36 | PBW_maxDeg(MaxDeg): PBW monomials up to given degree |
---|
37 | PBW_maxMonom(MaxMonom): PBW monomials up to given maximal monomial |
---|
38 | |
---|
39 | KEYWORDS: center; centralizer; cartan; reduce; centralize; PBW |
---|
40 | " |
---|
41 | |
---|
42 | LIB "general.lib" // for "sort" |
---|
43 | LIB "poly.lib" // for "maxdeg" |
---|
44 | |
---|
45 | |
---|
46 | /******************************************************/ |
---|
47 | // ::DefaultStuff:: Shortcuts to useful short functions. Just to avoid if( if( if( ... ))). |
---|
48 | /******************************************************/ |
---|
49 | |
---|
50 | |
---|
51 | /******************************************************/ |
---|
52 | static proc DefaultValue ( def s, list # ) // Process general variable parameters list |
---|
53 | " |
---|
54 | RETURN: s or (typeof(s))(#) |
---|
55 | " |
---|
56 | { |
---|
57 | def @p = s; |
---|
58 | if ( size(#) > 0 ) |
---|
59 | { |
---|
60 | if ( typeof(#[1]) == typeof(s) ) |
---|
61 | { |
---|
62 | @p = #[1]; |
---|
63 | } |
---|
64 | } |
---|
65 | return( @p ); |
---|
66 | } |
---|
67 | |
---|
68 | /******************************************************/ |
---|
69 | static proc DefaultInt( list # ) // Process variable parameters list with 'int' default value |
---|
70 | " |
---|
71 | RETURN: 0 or int(#) |
---|
72 | " |
---|
73 | { |
---|
74 | int @p = 0; |
---|
75 | return( DefaultValue( @p, # ) ); |
---|
76 | } |
---|
77 | |
---|
78 | /******************************************************/ |
---|
79 | static proc DefaultIdeal ( list # ) // Process variable parameters list with 'ideal' default value |
---|
80 | " |
---|
81 | RETURN: 0 or ideal(#) |
---|
82 | " |
---|
83 | { |
---|
84 | ideal @p = 0; |
---|
85 | return( DefaultValue( @p, # ) ); |
---|
86 | } |
---|
87 | |
---|
88 | |
---|
89 | |
---|
90 | /******************************************************/ |
---|
91 | // ::Debug:: Shortcuts to used debugging functions. |
---|
92 | /******************************************************/ |
---|
93 | |
---|
94 | |
---|
95 | /******************************************************/ |
---|
96 | static proc toprint( int pl ) // To print or not to print?!? The answer is here! |
---|
97 | " |
---|
98 | RETURN: 1 means to print, otherwise 0. |
---|
99 | " |
---|
100 | { |
---|
101 | return( printlevel >= ( 3 - pl) ); // voice + ? |
---|
102 | } |
---|
103 | |
---|
104 | /******************************************************/ |
---|
105 | static proc DBPrint( int pl, list # ) // My 'dbprint' which uses toprint(i). |
---|
106 | " |
---|
107 | USAGE: |
---|
108 | " |
---|
109 | { |
---|
110 | if( toprint(pl) ) |
---|
111 | { |
---|
112 | dbprint(1, #); |
---|
113 | } |
---|
114 | } |
---|
115 | |
---|
116 | /******************************************************/ |
---|
117 | static proc BCall( string Name, list # ) // This function must be called at the beginning of every 'mathematical' function. |
---|
118 | " |
---|
119 | USAGE: Name is a name of a mathematical function to trace. # means parameters into the function. |
---|
120 | " |
---|
121 | { |
---|
122 | if( toprint(0) ) |
---|
123 | { |
---|
124 | "CALL: ", Name, "( "; |
---|
125 | dbprint(1, #); |
---|
126 | " )"; |
---|
127 | } |
---|
128 | } |
---|
129 | |
---|
130 | /******************************************************/ |
---|
131 | static proc ECall(string Name, list #) // This function must be called at the end of every 'mathematical' function. |
---|
132 | " |
---|
133 | USAGE: Name is a name of a mathematical function to trace. # means result of the function. |
---|
134 | " |
---|
135 | { |
---|
136 | if( toprint(0) ) |
---|
137 | { |
---|
138 | "RET : ", Name, " => Result: {"; |
---|
139 | dbprint(1, #); |
---|
140 | " }"; |
---|
141 | } |
---|
142 | } |
---|
143 | |
---|
144 | |
---|
145 | |
---|
146 | /******************************************************/ |
---|
147 | // ::Helpers:: Small functions used in this library. |
---|
148 | /******************************************************/ |
---|
149 | |
---|
150 | /******************************************************/ |
---|
151 | static proc makeNice( def l ) |
---|
152 | " |
---|
153 | RETURN: the same as input |
---|
154 | PURPOSE: make 'nice' polynomials, kill scalars |
---|
155 | " |
---|
156 | { |
---|
157 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "makeNice", l ); }; /*4DEBUG*/ |
---|
158 | |
---|
159 | poly p; |
---|
160 | |
---|
161 | if( typeof(l) == "poly" ) |
---|
162 | { |
---|
163 | // "normal" polynomial form == no denominators, gcd of coeffs is a unit |
---|
164 | l = cleardenom( l ); |
---|
165 | if ( deg(p) > 0 ) |
---|
166 | { |
---|
167 | l = cleardenom( l / leadcoef(l) ); |
---|
168 | } |
---|
169 | } else |
---|
170 | { |
---|
171 | if( typeof(l) == "ideal" ) |
---|
172 | { |
---|
173 | for( int i = 1; i <= size(l); i++ ) |
---|
174 | { |
---|
175 | p = l[i]; |
---|
176 | p = cleardenom( p ); |
---|
177 | |
---|
178 | // Now make polynomials look nice: |
---|
179 | if ( deg(p) > 0 ) // throw away scalars! |
---|
180 | { |
---|
181 | // "normal" polynomial form == no denominators, gcd of coeffs is a unit |
---|
182 | p = cleardenom( p / leadcoef(p) ); |
---|
183 | } else |
---|
184 | { |
---|
185 | p = 0; // no constants |
---|
186 | } |
---|
187 | l[i] = p; |
---|
188 | |
---|
189 | } |
---|
190 | |
---|
191 | l = simplify(l, 2 + 8); |
---|
192 | } |
---|
193 | } |
---|
194 | |
---|
195 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "makeNice", l ); }; /*4DEBUG*/ |
---|
196 | return( l ); |
---|
197 | } |
---|
198 | |
---|
199 | |
---|
200 | |
---|
201 | /******************************************************/ |
---|
202 | static proc monomialForm( def p ) |
---|
203 | " |
---|
204 | : p is either poly or ideal |
---|
205 | RETURN: polynomial with all monomials from p but without coefficients. |
---|
206 | " |
---|
207 | { |
---|
208 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "monomialForm", p ); }; /*4DEBUG*/ |
---|
209 | |
---|
210 | poly result = 0; int k, j; poly m; |
---|
211 | |
---|
212 | if( typeof(p) == "ideal" ) // |
---|
213 | { |
---|
214 | if( ncols(p) > 0 ) |
---|
215 | { |
---|
216 | result = uni_poly( p[1] ); |
---|
217 | |
---|
218 | for ( k = ncols(p); k > 1; k -- ) |
---|
219 | { |
---|
220 | for( j = size(p[k]); j > 0; j-- ) |
---|
221 | { |
---|
222 | m = leadmonom( p[k][j] ); |
---|
223 | |
---|
224 | if( size(result + m) > size(result) ) // trick! |
---|
225 | { |
---|
226 | result = result + m; |
---|
227 | } |
---|
228 | } |
---|
229 | |
---|
230 | } |
---|
231 | } |
---|
232 | } |
---|
233 | else |
---|
234 | { |
---|
235 | if( typeof(p) == "poly" ) // |
---|
236 | { |
---|
237 | result = uni_poly(p); |
---|
238 | } else |
---|
239 | { |
---|
240 | ERROR( "ERROR: Wrong input! Expected polynomial or ideal!" ); |
---|
241 | } |
---|
242 | } |
---|
243 | |
---|
244 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "monomialForm", result ); }; /*4DEBUG*/ |
---|
245 | return( result ); |
---|
246 | } |
---|
247 | |
---|
248 | /******************************************************/ |
---|
249 | static proc uni_poly( poly p ) |
---|
250 | " |
---|
251 | returns polynomial with the same monomials but without coefficients. |
---|
252 | " |
---|
253 | { |
---|
254 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "uni_poly", p ); }; /*4DEBUG*/ |
---|
255 | |
---|
256 | poly result = 0; |
---|
257 | |
---|
258 | for ( int k = size(p); k > 0; k -- ) |
---|
259 | { |
---|
260 | result = result + leadmonom( p[k] ); |
---|
261 | } |
---|
262 | |
---|
263 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "uni_poly", result ); }; /*4DEBUG*/ |
---|
264 | return( result ); |
---|
265 | } |
---|
266 | |
---|
267 | |
---|
268 | |
---|
269 | |
---|
270 | |
---|
271 | /******************************************************/ |
---|
272 | static proc smoothQideal( ideal I, list #) |
---|
273 | " |
---|
274 | PURPOSE: smooths the ideal in a current QUOTIENT(!) ring. |
---|
275 | " |
---|
276 | { |
---|
277 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "smoothQideal", I ); }; /*4DEBUG*/ |
---|
278 | |
---|
279 | ideal A = I - NF( I, twostd(DefaultIdeal(#)), 1 ); // component wise |
---|
280 | |
---|
281 | if( size(A) > 0 ) // Were there any changes (any non-zero component)? |
---|
282 | { |
---|
283 | ideal T; |
---|
284 | |
---|
285 | int j = 1; |
---|
286 | |
---|
287 | for( int i = 1; i <= ncols(I); i++ ) |
---|
288 | { |
---|
289 | if( size(A[i]) == 0 ) // keep only unchanged elements |
---|
290 | { |
---|
291 | T[ j ] = I[i]; j++; |
---|
292 | } |
---|
293 | } |
---|
294 | I = T; |
---|
295 | } |
---|
296 | |
---|
297 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "smoothQideal", I ); }; /*4DEBUG*/ |
---|
298 | |
---|
299 | return( I ); |
---|
300 | } |
---|
301 | |
---|
302 | |
---|
303 | |
---|
304 | |
---|
305 | /******************************************************/ |
---|
306 | // ::PBW:: PBW basis construction. |
---|
307 | /******************************************************/ |
---|
308 | |
---|
309 | |
---|
310 | |
---|
311 | |
---|
312 | /******************************************************/ |
---|
313 | proc PBW_maxDeg( int MaxDeg ) |
---|
314 | "USAGE: PBW_maxDeg(MaxDeg); int MaxDeg |
---|
315 | PURPOSE: Compute PBW elements up to a given maximal degree. |
---|
316 | RETURN: ideal consisting of found elements. |
---|
317 | NOTE: unit is omitted. Weights are ignored! |
---|
318 | " |
---|
319 | { |
---|
320 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "PBW_maxDeg", MaxDeg ); }; /*4DEBUG*/ |
---|
321 | |
---|
322 | ideal Basis = 0; |
---|
323 | |
---|
324 | for (int k = 1; k <= MaxDeg; k ++ ) |
---|
325 | { |
---|
326 | Basis = Basis + maxideal(k); |
---|
327 | } |
---|
328 | |
---|
329 | Basis = smoothQideal( Basis ); |
---|
330 | |
---|
331 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "PBW_maxDeg", Basis ); }; /*4DEBUG*/ |
---|
332 | return( Basis ); |
---|
333 | } |
---|
334 | example |
---|
335 | { |
---|
336 | "EXAMPLE:"; echo = 2; |
---|
337 | ring A = 0,(e,f,h),dp; |
---|
338 | matrix D[3][3]=0; |
---|
339 | D[1,2]=-h; D[1,3]=2*e; D[2,3]=-2*f; |
---|
340 | ncalgebra(1,D); // this algebra is U(sl_2) |
---|
341 | |
---|
342 | // PBW Basis of A_2 - monomials of degree <= 2, without unit: |
---|
343 | PBW_maxDeg( 2 ); |
---|
344 | } |
---|
345 | |
---|
346 | |
---|
347 | /******************************************************/ |
---|
348 | proc PBW_eqDeg( int Deg ) |
---|
349 | "USAGE: PBW_eqDeg(Deg); int Deg |
---|
350 | PURPOSE: Compute PBW elements of a given degree. |
---|
351 | RETURN: ideal consisting of found elements. |
---|
352 | NOTE: Unit is omitted. Weights are ignored! |
---|
353 | " |
---|
354 | { |
---|
355 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "PBW_eqDeg", Deg ); }; /*4DEBUG*/ |
---|
356 | |
---|
357 | ideal Basis = smoothQideal( maxideal( Deg ) ); |
---|
358 | |
---|
359 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "PBW_eqDeg", Basis ); }; /*4DEBUG*/ |
---|
360 | return( Basis ); |
---|
361 | } |
---|
362 | example |
---|
363 | { |
---|
364 | "EXAMPLE:"; echo = 2; |
---|
365 | ring A = 0,(e,f,h),dp; |
---|
366 | matrix D[3][3]=0; |
---|
367 | D[1,2]=-h; D[1,3]=2*e; D[2,3]=-2*f; |
---|
368 | ncalgebra(1,D); // this algebra is U(sl_2) |
---|
369 | |
---|
370 | // PBW Basis of A_2 \ A_1 - monomials of degree == 2: |
---|
371 | PBW_eqDeg( 2 ); |
---|
372 | } |
---|
373 | |
---|
374 | |
---|
375 | /******************************************************/ |
---|
376 | proc PBW_maxMonom( poly MaxMonom ) |
---|
377 | "USAGE: PBW_maxMonom(m); poly m |
---|
378 | PURPOSE: Compute PBW elements up to a given maximal one. |
---|
379 | RETURN: ideal consisting of found elements. |
---|
380 | NOTE: Unit is omitted. Weights are ignored! |
---|
381 | " |
---|
382 | { |
---|
383 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "PBW_maxMonom", MaxMonom ); }; /*4DEBUG*/ |
---|
384 | |
---|
385 | ideal K = 0; |
---|
386 | |
---|
387 | intvec exp = leadexp( MaxMonom ); |
---|
388 | |
---|
389 | for ( int k = 1; k <= size(exp); k ++ ) |
---|
390 | { |
---|
391 | K[ 1 + size(K) ] = var(k)^( 1 + exp[k] ); |
---|
392 | } |
---|
393 | |
---|
394 | attrib(K, "isSB", 1); |
---|
395 | |
---|
396 | K = kbase(K); |
---|
397 | |
---|
398 | K = K[ (ncols(K)-1)..1]; // reverse, kill last 1 |
---|
399 | |
---|
400 | K = smoothQideal( K ); |
---|
401 | |
---|
402 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "PBW_maxMonom", K ); }; /*4DEBUG*/ |
---|
403 | |
---|
404 | return( K ); |
---|
405 | } |
---|
406 | example |
---|
407 | { |
---|
408 | "EXAMPLE:"; echo = 2; |
---|
409 | ring A = 0,(e,f,h),dp; |
---|
410 | matrix D[3][3]=0; |
---|
411 | D[1,2]=-h; D[1,3]=2*e; D[2,3]=-2*f; |
---|
412 | ncalgebra(1,D); // this algebra is U(sl_2) |
---|
413 | |
---|
414 | // At most 1st degree in e, h and at most 2nd degree in f, unit is omitted: |
---|
415 | PBW_maxMonom( e*(f^2)* h ); |
---|
416 | } |
---|
417 | |
---|
418 | |
---|
419 | |
---|
420 | |
---|
421 | /******************************************************/ |
---|
422 | // ::CORE:: Core procedures... |
---|
423 | /******************************************************/ |
---|
424 | |
---|
425 | |
---|
426 | |
---|
427 | /******************************************************/ |
---|
428 | proc applyAdF( ideal I, poly p ) |
---|
429 | " |
---|
430 | USAGE: applyAdF( Basis, f); ideal Basis, poly f |
---|
431 | PURPOSE: Apply Ad_{f} to every element of Basis |
---|
432 | RETURN: ideal, Ad_{f}(Basis) |
---|
433 | SEE ALSO: linearMapKernel; linearMapKernel |
---|
434 | " |
---|
435 | { |
---|
436 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "applyAdF", I, p ); }; /*4DEBUG*/ |
---|
437 | |
---|
438 | poly t; ideal II = 0; |
---|
439 | |
---|
440 | for ( int k = ncols(I); k > 0; k --) |
---|
441 | { |
---|
442 | t = I[k]; |
---|
443 | II[k] = p * t - t * p; // we have to reduce smooth images in Qrings... |
---|
444 | } |
---|
445 | |
---|
446 | II = NF( II, twostd(0) ); // ... now! |
---|
447 | |
---|
448 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "applyAdF", II ); }; /*4DEBUG*/ |
---|
449 | return( II ); |
---|
450 | } |
---|
451 | example |
---|
452 | { |
---|
453 | "EXAMPLE:"; echo = 2; |
---|
454 | ring A = 0,(e,f,h),dp; |
---|
455 | matrix D[3][3]=0; |
---|
456 | D[1,2]=-h; D[1,3]=2*e; D[2,3]=-2*f; |
---|
457 | ncalgebra(1,D); // this algebra is U(sl_2) |
---|
458 | |
---|
459 | // Let us consider the linear map Ad_{e} from A_2 into A. |
---|
460 | |
---|
461 | // Compute the PBW basis of A_2: |
---|
462 | ideal Basis = PBW_maxDeg( 2 ); Basis; |
---|
463 | |
---|
464 | // Compute images of basis elements under the linear map Ad_e: |
---|
465 | ideal Image = applyAdF( Basis, e ); Image; |
---|
466 | |
---|
467 | // Now we have a linear map given by: Basis_i --> Image_i |
---|
468 | // Let's compute its kernel: |
---|
469 | module C = linearMapKernel( Image ); C; |
---|
470 | |
---|
471 | // Now we can compute the kernel of Ad_e by means of basis vectors: |
---|
472 | ideal K = linearCombinations(Basis, C); K; |
---|
473 | |
---|
474 | // Let's check that Ad_e(K) is zero: |
---|
475 | applyAdF( K, e ); |
---|
476 | } |
---|
477 | |
---|
478 | |
---|
479 | |
---|
480 | /******************************************************/ |
---|
481 | proc linearMapKernel( ideal Images ) |
---|
482 | "USAGE: linearMapKernel( Images ); ideal Images |
---|
483 | PURPOSE: Computes the kernel of a linear map: e_i \mapsto Images[i], |
---|
484 | @* where e_i are certain basis vectors |
---|
485 | RETURN: syzygy module, or 0 if all images are zeroes |
---|
486 | SEE ALSO: applyAdF; linearMapKernel |
---|
487 | " |
---|
488 | { |
---|
489 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "linearMapKernel", Images ); }; /*4DEBUG*/ |
---|
490 | |
---|
491 | // This must be a list of monomials in a form of polynomial (sum with coeffs == 1) |
---|
492 | poly Monomials = monomialForm( Images ); |
---|
493 | |
---|
494 | int N = size( Monomials ); // number of different monomials |
---|
495 | |
---|
496 | if ( N == 0 ) // & ncols( Images ) > 0 => all Images == 0 |
---|
497 | { |
---|
498 | int result = 0; |
---|
499 | |
---|
500 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "linearMapKernel", result ); }; /*4DEBUG*/ |
---|
501 | return( result ); |
---|
502 | } |
---|
503 | |
---|
504 | // Compute matrix MD |
---|
505 | module MD; // zero |
---|
506 | |
---|
507 | int x, y; |
---|
508 | |
---|
509 | vector w; |
---|
510 | |
---|
511 | poly p, m; |
---|
512 | |
---|
513 | int V = ncols(Images); // must be equal to ncols(Basis) and size(Basis)! |
---|
514 | |
---|
515 | // We take monomials as vector space basis of <Image>_k... |
---|
516 | |
---|
517 | // TODO: Is there any other way to compute a basis of it and represent images as |
---|
518 | // linear combination of them??? |
---|
519 | |
---|
520 | // Maybe some 'free resolution' stuff??? But we need linear maps only!!! |
---|
521 | |
---|
522 | for ( x = 1; x <= V; x++ ) // For every Image vector |
---|
523 | { |
---|
524 | w = 0; |
---|
525 | |
---|
526 | p = Images[x]; |
---|
527 | |
---|
528 | y = 1; // from 1st monomial in Monomials... |
---|
529 | |
---|
530 | while( size(p) > 0 ) |
---|
531 | { |
---|
532 | m = leadmonom(p); |
---|
533 | |
---|
534 | // y < N! |
---|
535 | while( Monomials[y] != m ) |
---|
536 | // There MUST be this monomial because of the construction of Monomials polynomial! |
---|
537 | { |
---|
538 | y++; // to size() |
---|
539 | } |
---|
540 | |
---|
541 | // found monomial m at position y. |
---|
542 | |
---|
543 | w = w + leadcoef(p) * gen(y); // leadcoef(p) MUST be nonzero! |
---|
544 | p = p - lead(p); // kill lead term |
---|
545 | } |
---|
546 | |
---|
547 | MD[x] = w; |
---|
548 | } |
---|
549 | |
---|
550 | /*******************************************/ |
---|
551 | |
---|
552 | // save options |
---|
553 | intvec v = option( get ); |
---|
554 | |
---|
555 | // set right options |
---|
556 | option( redSB ); |
---|
557 | option( redTail ); |
---|
558 | |
---|
559 | // compute everything in a right form |
---|
560 | MD = simplify( std( syz(MD) ), 1 + 2 + 8 ); |
---|
561 | // note that MD is a matrix of numbers - no polynomials... |
---|
562 | |
---|
563 | // restore options |
---|
564 | option( set, v ); |
---|
565 | |
---|
566 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "linearMapKernel", MD ); }; /*4DEBUG*/ |
---|
567 | |
---|
568 | return( MD ); |
---|
569 | } |
---|
570 | example |
---|
571 | { |
---|
572 | "EXAMPLE:"; echo = 2; |
---|
573 | ring A = 0,(e,f,h),dp; |
---|
574 | matrix D[3][3]=0; |
---|
575 | D[1,2]=-h; D[1,3]=2*e; D[2,3]=-2*f; |
---|
576 | ncalgebra(1,D); // this algebra is U(sl_2) |
---|
577 | |
---|
578 | // Let us consider the linear map Ad_{e} from A_2 into A. |
---|
579 | |
---|
580 | // Compute the PBW basis of A_2: |
---|
581 | ideal Basis = PBW_maxDeg( 2 ); Basis; |
---|
582 | |
---|
583 | // Compute images of basis elements under the linear map Ad_e: |
---|
584 | ideal Image = applyAdF( Basis, e ); Image; |
---|
585 | |
---|
586 | // Now we have a linear map given by: Basis_i --> Image_i |
---|
587 | // Let's compute its kernel: |
---|
588 | module C = linearMapKernel( Image ); C; |
---|
589 | |
---|
590 | // Now we can compute the kernel of Ad_e by means of basis vectors: |
---|
591 | ideal K = linearCombinations(Basis, C); K; |
---|
592 | |
---|
593 | // Let's check that Ad_e(K) is zero: |
---|
594 | ideal Z = applyAdF( K, e ); Z; |
---|
595 | |
---|
596 | // Now linearMapKernel will return a single integer 0: |
---|
597 | def CC = linearMapKernel(Z); typeof(CC); CC; |
---|
598 | } |
---|
599 | |
---|
600 | |
---|
601 | /******************************************************/ |
---|
602 | proc linearCombinations( ideal Basis, module KER ) |
---|
603 | " |
---|
604 | USAGE: linearCombinations( Basis, C ); ideal Basis, module C |
---|
605 | PURPOSE: computes linear combinations of Basis vectors with coefficients from C |
---|
606 | RETURN: ideal generated by computed linear combinations |
---|
607 | SEE ALSO: linearMapKernel; applyAdF |
---|
608 | " |
---|
609 | { |
---|
610 | |
---|
611 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "linearCombinations", Basis, KER ); }; /*4DEBUG*/ |
---|
612 | |
---|
613 | |
---|
614 | number c; |
---|
615 | |
---|
616 | int x, y; |
---|
617 | |
---|
618 | vector w; |
---|
619 | |
---|
620 | poly p; |
---|
621 | |
---|
622 | ideal result = 0; |
---|
623 | |
---|
624 | // Kernel' basis translation |
---|
625 | for ( x = 1; x <= ncols(KER); x++ ) |
---|
626 | { |
---|
627 | p = 0; |
---|
628 | w = KER[x]; |
---|
629 | |
---|
630 | for ( y = 1; y <= nrows(w); y++ ) |
---|
631 | { |
---|
632 | c = leadcoef( w[y] ); |
---|
633 | |
---|
634 | if ( c != 0 ) |
---|
635 | { |
---|
636 | p = p + c * Basis[y]; // linear combination of base vectors { Basis[y] } |
---|
637 | } |
---|
638 | } |
---|
639 | result[ x ] = p; |
---|
640 | } |
---|
641 | |
---|
642 | |
---|
643 | // no reduction in quotient algebras is needed. No multiplications were done! |
---|
644 | |
---|
645 | |
---|
646 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "linearCombinations", result ); }; /*4DEBUG*/ |
---|
647 | |
---|
648 | return( result ); |
---|
649 | } |
---|
650 | example |
---|
651 | { |
---|
652 | "EXAMPLE:"; echo = 2; |
---|
653 | ring A = 0,(e,f,h),dp; |
---|
654 | matrix D[3][3]=0; |
---|
655 | D[1,2]=-h; D[1,3]=2*e; D[2,3]=-2*f; |
---|
656 | ncalgebra(1,D); // this algebra is U(sl_2) |
---|
657 | |
---|
658 | // Let us consider the linear map Ad_{e} from A_2 into A. |
---|
659 | |
---|
660 | // Compute the PBW basis of A_2: |
---|
661 | ideal Basis = PBW_maxDeg( 2 ); Basis; |
---|
662 | |
---|
663 | // Compute images of basis elements under the linear map Ad_e: |
---|
664 | ideal Image = applyAdF( Basis, e ); Image; |
---|
665 | |
---|
666 | // Now we have a linear map given by: Basis_i --> Image_i |
---|
667 | // Let's compute its kernel: |
---|
668 | module C = linearMapKernel( Image ); C; |
---|
669 | |
---|
670 | // Now we can compute the kernel of Ad_e by means of basis vectors: |
---|
671 | ideal K = linearCombinations(Basis, C); K; |
---|
672 | |
---|
673 | // Let's check that Ad_e(K) is zero: |
---|
674 | applyAdF( K, e ); |
---|
675 | } |
---|
676 | |
---|
677 | |
---|
678 | |
---|
679 | /******************************************************/ |
---|
680 | static proc LINEAR_MAP_KERNEL(ideal Basis, ideal Images ) // Ker of the linear map given by its values on basis vectors |
---|
681 | " |
---|
682 | PURPOSE: Computation of the kernel basis of the linear map given by the list @given |
---|
683 | " |
---|
684 | { |
---|
685 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "LINEAR_MAP_KERNEL", Basis, Images ); }; /*4DEBUG*/ |
---|
686 | |
---|
687 | ideal result = 0; |
---|
688 | |
---|
689 | if ( size( Basis ) == 0 ) |
---|
690 | { |
---|
691 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "LINEAR_MAP_KERNEL", result ); }; /*4DEBUG*/ |
---|
692 | return( result ); |
---|
693 | } |
---|
694 | |
---|
695 | // compute fundamental solutions system |
---|
696 | def T = linearMapKernel( Images ); |
---|
697 | |
---|
698 | |
---|
699 | // check result of linearMapKernel |
---|
700 | if( (typeof(T) == "int") and (T == 0) ) |
---|
701 | { |
---|
702 | // All zeroes! Return Basis: |
---|
703 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "LINEAR_MAP_KERNEL", Basis ); }; /*4DEBUG*/ |
---|
704 | return( Basis ); |
---|
705 | } |
---|
706 | else |
---|
707 | { |
---|
708 | if( typeof(T) != "module" ) |
---|
709 | { |
---|
710 | ERROR( "Wrong output from the 'linearMapKernel' function!" ); |
---|
711 | } |
---|
712 | } |
---|
713 | |
---|
714 | result = linearCombinations( Basis, T ); |
---|
715 | |
---|
716 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "LINEAR_MAP_KERNEL", result ); }; /*4DEBUG*/ |
---|
717 | return( result ); |
---|
718 | } |
---|
719 | |
---|
720 | |
---|
721 | |
---|
722 | |
---|
723 | /******************************************************/ |
---|
724 | static proc ZeroKer( ideal Basis, ideal Images ) // VS Basis of a Kernel of the linear map AD_h, h is a Cartan element |
---|
725 | " |
---|
726 | PURPOSE: Computes VS Basis of a Kernel of the linear map AD_h, when h is a Cartan element |
---|
727 | NOTE: the result is a set of all basis vectors having a zero image |
---|
728 | " |
---|
729 | { |
---|
730 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "ZeroKer", Basis, Images ); }; /*4DEBUG*/ |
---|
731 | |
---|
732 | ideal result = 0; |
---|
733 | |
---|
734 | for( int i = 1; i <= ncols( Basis ); i++ ) |
---|
735 | { |
---|
736 | if( size( Images[i] ) == 0 ) // zero image? |
---|
737 | { |
---|
738 | result[ 1 + size(result) ] = Basis[i]; // take this basis vector! |
---|
739 | } |
---|
740 | } |
---|
741 | |
---|
742 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "ZeroKer", result ); }; /*4DEBUG*/ |
---|
743 | return( result ); |
---|
744 | } |
---|
745 | |
---|
746 | |
---|
747 | |
---|
748 | |
---|
749 | /******************************************************/ |
---|
750 | // ::Variables:: Computes a set of variables |
---|
751 | /******************************************************/ |
---|
752 | |
---|
753 | |
---|
754 | |
---|
755 | /******************************************************/ |
---|
756 | proc variablesStandard() // Returns an ideal of variables in a current base ring. |
---|
757 | "USAGE: variablesStandard(); |
---|
758 | RETURN: ideal, generated by algebra variables |
---|
759 | PURPOSE: computes the set of algebra variables taken in their natural order |
---|
760 | SEE ALSO: variablesSorted |
---|
761 | EXAMPLE: example variablesStandard; shows an example |
---|
762 | " |
---|
763 | { |
---|
764 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "variablesStandard" ); }; /*4DEBUG*/ |
---|
765 | |
---|
766 | ideal result = maxideal(1); |
---|
767 | |
---|
768 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "variablesStandard", result ); }; /*4DEBUG*/ |
---|
769 | return( result ); |
---|
770 | } |
---|
771 | example |
---|
772 | { |
---|
773 | "EXAMPLE:"; echo = 2; |
---|
774 | ring A = 0,(x,y,z),dp; |
---|
775 | matrix D[3][3]=0; |
---|
776 | D[1,2]=-z; D[1,3]=2*x; D[2,3]=-2*y; |
---|
777 | ncalgebra(1,D); // this algebra is U(sl_2) |
---|
778 | // Variables in their natural order: |
---|
779 | variablesStandard(); |
---|
780 | } |
---|
781 | |
---|
782 | /******************************************************/ |
---|
783 | proc variablesSorted() // Sorts variables into an ideal. This is a kind of heuristics! |
---|
784 | "USAGE: variablesSorted(); |
---|
785 | RETURN: ideal, generated by sorted algebra variables |
---|
786 | PURPOSE: computes the set of algebra variables sorted so that |
---|
787 | @* Cartan variables go first |
---|
788 | NOTE: This is a heuristics for the computation of center: |
---|
789 | @* it is better to compute centralizers of Cartan variables first since in this |
---|
790 | @* case we can omit solving the system of equations. |
---|
791 | SEE ALSO: variablesStandard |
---|
792 | EXAMPLE: example variablesSorted; shows an example |
---|
793 | "{ |
---|
794 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "variablesSorted" ); }; /*4DEBUG*/ |
---|
795 | |
---|
796 | ideal V = variablesStandard(); |
---|
797 | int N = size( V ); // == nvars( basering ) |
---|
798 | |
---|
799 | ideal result = 0; |
---|
800 | |
---|
801 | int r_begin = 1; |
---|
802 | int r_end = N; |
---|
803 | |
---|
804 | poly v; |
---|
805 | |
---|
806 | for( int k = 1; k <= N; k++ ) |
---|
807 | { |
---|
808 | v = V[k]; |
---|
809 | |
---|
810 | if( isCartan(v) == 1 ) // Cartan elements go 1st |
---|
811 | { |
---|
812 | result[r_begin] = v; |
---|
813 | r_begin++; |
---|
814 | } else // Other - in the end... |
---|
815 | { |
---|
816 | result[r_end] = v; |
---|
817 | r_end--; |
---|
818 | } |
---|
819 | } |
---|
820 | |
---|
821 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "variablesSorted", result ); }; /*4DEBUG*/ |
---|
822 | return( result ); |
---|
823 | } |
---|
824 | example |
---|
825 | { |
---|
826 | "EXAMPLE:"; echo = 2; |
---|
827 | ring A = 0,(x,y,z),dp; |
---|
828 | matrix D[3][3]=0; |
---|
829 | D[1,2]=-z; D[1,3]=2*x; D[2,3]=-2*y; |
---|
830 | ncalgebra(1,D); // this algebra is U(sl_2) |
---|
831 | // There is only one Cartan variable - z in U(sl_2), |
---|
832 | // it must go 1st: |
---|
833 | variablesSorted(); |
---|
834 | } |
---|
835 | |
---|
836 | |
---|
837 | |
---|
838 | |
---|
839 | |
---|
840 | /******************************************************/ |
---|
841 | /******************************************************/ |
---|
842 | // ::BasicCentralizerComputation:: Basic functions for centralize' computation. |
---|
843 | /******************************************************/ |
---|
844 | /******************************************************/ |
---|
845 | |
---|
846 | |
---|
847 | |
---|
848 | |
---|
849 | |
---|
850 | /******************************************************/ |
---|
851 | proc centralizeSet( ideal F, ideal V ) // HL 'core' function |
---|
852 | "USAGE: centralizeSet( F, V ); ideal F, ideal V |
---|
853 | INPUT: a finite set of elements F, vector space basis V |
---|
854 | RETURN: ideal, generated by base elements |
---|
855 | PURPOSE: computes a v.s. basis of the centralizer of F in v.s. V |
---|
856 | NOTE: Cen(F,V) is computed by the formula Cen(F[N],..,Cen(F[1],V)..) |
---|
857 | SEE ALSO: centralizerVS; centralizer; inCentralizer |
---|
858 | EXAMPLE: example centralizeSet; shows an example |
---|
859 | " |
---|
860 | { |
---|
861 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "centralizeSet", F, V ); }; /*4DEBUG*/ |
---|
862 | |
---|
863 | int N = size(F); |
---|
864 | |
---|
865 | if( N == 0) |
---|
866 | { |
---|
867 | ERROR( "F MUST be non empty!!!" ); |
---|
868 | } |
---|
869 | |
---|
870 | DBPrint(1, "BasisSize: " + string(size(V)) ); |
---|
871 | |
---|
872 | ideal Images; |
---|
873 | |
---|
874 | for( int v = 1; (v <= N) and (size(V) > 0); v++ ) |
---|
875 | { |
---|
876 | DBPrint(1, "Centralizing " + string(F[v]) ); |
---|
877 | |
---|
878 | Images = applyAdF( V, F[v] ); |
---|
879 | |
---|
880 | if( (isCartan(F[v]) == 1) or (size(V) == 1) ) |
---|
881 | { |
---|
882 | V = ZeroKer( V, Images ); |
---|
883 | } else |
---|
884 | { |
---|
885 | V = LINEAR_MAP_KERNEL( V, Images ); |
---|
886 | } |
---|
887 | |
---|
888 | // Printing... |
---|
889 | DBPrint(1, "Progress: [ " + string(v) + " / " + string(N) + " ]"+ |
---|
890 | " => BasisSize: " + string(size(V)) ); |
---|
891 | } |
---|
892 | |
---|
893 | V = makeNice(V); |
---|
894 | |
---|
895 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "centralizeSet", V ); }; /*4DEBUG*/ |
---|
896 | |
---|
897 | return( V ); |
---|
898 | } |
---|
899 | example |
---|
900 | { |
---|
901 | "EXAMPLE:"; echo = 2; |
---|
902 | ring A_4_1 = 0,(e(1..4)),dp; |
---|
903 | matrix D[4][4]=0; |
---|
904 | D[2,4] = -e(1); |
---|
905 | D[3,4] = -e(2); |
---|
906 | // This is $A_{41}$ - the first real Lie algebra of dimension $4$. |
---|
907 | ncalgebra(1,D); |
---|
908 | |
---|
909 | ideal F = variablesSorted(); F; |
---|
910 | |
---|
911 | // the center of $A_{41}$ is generated by |
---|
912 | // $e(1)$ and $-1/2*e(2)^2+e(1)*e(3)$ |
---|
913 | // therefore one may consider computing it in the following way: |
---|
914 | |
---|
915 | // 1. Compute PBW basis consisting of |
---|
916 | // monomials of exponent <= (1,2,1,0) |
---|
917 | ideal V = PBW_maxMonom( e(1) * e(2)^ 2 * e(3) ); |
---|
918 | |
---|
919 | // 2. Compute the centralizer of F within vector space |
---|
920 | // spanned by these monomials: |
---|
921 | ideal C = centralizeSet( F, V ); C; |
---|
922 | |
---|
923 | inCenter(C); |
---|
924 | } |
---|
925 | |
---|
926 | |
---|
927 | |
---|
928 | /******************************************************/ |
---|
929 | proc centralizerVS( ideal F, int d ) |
---|
930 | "USAGE: centralizerVS( F, D ); ideal F, int D |
---|
931 | RETURN: ideal, generated by elements of degree <= D |
---|
932 | PURPOSE: computes a v.s. basis of the centralizer of F up to degree D. |
---|
933 | NOTE: D must be non-negative |
---|
934 | SEE ALSO: centerVS; centralizer; inCentralizer |
---|
935 | EXAMPLE: example centralizerVS; shows an example |
---|
936 | " |
---|
937 | { |
---|
938 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "centralizerVS", F, d ); }; /*4DEBUG*/ |
---|
939 | |
---|
940 | if( size(F) == 0) |
---|
941 | { |
---|
942 | ERROR( "F MUST be non-empty!!!" ); |
---|
943 | } |
---|
944 | |
---|
945 | ideal V = centralizeSet( F, PBW_maxDeg( d ) ); // basis of the Centralizer of S in PBW basis |
---|
946 | |
---|
947 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "centralizerVS", V ); }; /*4DEBUG*/ |
---|
948 | |
---|
949 | return( V ); |
---|
950 | } |
---|
951 | example |
---|
952 | { |
---|
953 | "EXAMPLE:"; echo = 2; |
---|
954 | ring A = 0,(x,y,z),dp; |
---|
955 | matrix D[3][3]=0; |
---|
956 | D[1,2]=-z; D[1,3]=2*x; D[2,3]=-2*y; |
---|
957 | ncalgebra(1,D); // this algebra is U(sl_2) |
---|
958 | ideal F = x, y; |
---|
959 | // find all elements commuting with x and y of degree <= 4: |
---|
960 | ideal C = centralizerVS(F, 4); |
---|
961 | C; |
---|
962 | inCentralizer(C, F); |
---|
963 | } |
---|
964 | |
---|
965 | |
---|
966 | |
---|
967 | |
---|
968 | /******************************************************/ |
---|
969 | // ::CenterAliases:: Basic functions/aliases for center' computation. |
---|
970 | /******************************************************/ |
---|
971 | |
---|
972 | |
---|
973 | |
---|
974 | |
---|
975 | /******************************************************/ |
---|
976 | proc centerVS( int D ) |
---|
977 | "USAGE: centerVS( D ); int D |
---|
978 | RETURN: ideal, generated by elements of degree <= D |
---|
979 | PURPOSE: computes a v.s. basis of the center up to degree D. |
---|
980 | NOTE: D must be non-negative |
---|
981 | SEE ALSO: centralizerVS; center; inCenter |
---|
982 | EXAMPLE: example centerVS; shows an example |
---|
983 | " |
---|
984 | { |
---|
985 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "centerVS", D ); }; /*4DEBUG*/ |
---|
986 | |
---|
987 | |
---|
988 | if( nameof( basering ) == "basering" ) |
---|
989 | { |
---|
990 | // ERROR( "No current ring!" ); |
---|
991 | } |
---|
992 | |
---|
993 | if( D < 0 ) |
---|
994 | { |
---|
995 | ERROR( "Degree D must be non-negative!" ); |
---|
996 | } |
---|
997 | |
---|
998 | ideal result = centralizerVS( variablesSorted(), D ); |
---|
999 | |
---|
1000 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "centerVS", result ); }; /*4DEBUG*/ |
---|
1001 | |
---|
1002 | return( result ); |
---|
1003 | } |
---|
1004 | example |
---|
1005 | { |
---|
1006 | "EXAMPLE:"; echo = 2; |
---|
1007 | ring A = 0,(x,y,z),dp; |
---|
1008 | matrix D[3][3]=0; |
---|
1009 | D[1,2]=-z; D[1,3]=2*x; D[2,3]=-2*y; |
---|
1010 | ncalgebra(1,D); // this algebra is U(sl_2) |
---|
1011 | // find all central elements of degree <= 4 |
---|
1012 | ideal Z = centerVS(4); |
---|
1013 | Z; |
---|
1014 | // note that the second element is the square of the first |
---|
1015 | // plus the multiple of the first: |
---|
1016 | Z[2] - Z[1]^2 + 8*Z[1]; |
---|
1017 | inCenter(Z); |
---|
1018 | } |
---|
1019 | |
---|
1020 | |
---|
1021 | /******************************************************/ |
---|
1022 | proc centralizerRed( ideal F, int D, list # ) |
---|
1023 | "USAGE: centralizerRed( F, D[, N] ); ideal F, int D[, int N] |
---|
1024 | RETURN: ideal, generated by computed generators |
---|
1025 | PURPOSE: computes a subalgebra generators of centralizer(F) up to degree D. |
---|
1026 | NOTE: In general, one cannot compute the whole centralizer(F). |
---|
1027 | @* Hence, one has to specify a termination condition via arguments D and/or N. |
---|
1028 | @* If D is positive, only centralizing elements up to degree D will be found. |
---|
1029 | @* If D is negative, the termination is determined by N only. |
---|
1030 | @* If N is given, the computation stops if at least N elements has been found. |
---|
1031 | @* Warning: if N is given and bigger than the actual number of generators, |
---|
1032 | @* the procedure may not terminate. |
---|
1033 | @* Current ordering must be a degree compatible well-ordering. |
---|
1034 | SEE ALSO: centralizerVS; centerRed; centralizer; inCentralizer |
---|
1035 | EXAMPLE: example centralizerRed; shows an example |
---|
1036 | " |
---|
1037 | { |
---|
1038 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "centralizerRed", F, D, # ); }; /*4DEBUG*/ |
---|
1039 | |
---|
1040 | if( nameof( basering ) == "basering" ) |
---|
1041 | { |
---|
1042 | // ERROR( "No current ring!" ); |
---|
1043 | } |
---|
1044 | |
---|
1045 | if( size(F) == 0) |
---|
1046 | { |
---|
1047 | ERROR( "F MUST be non-empty!!!" ); |
---|
1048 | } |
---|
1049 | |
---|
1050 | ///////////////////////////////////////////////////////////////////////////// |
---|
1051 | |
---|
1052 | int i, j, l, d; |
---|
1053 | |
---|
1054 | ///////////////////////////////////////////////////////////////////////////// |
---|
1055 | |
---|
1056 | int k = DefaultInt(#); |
---|
1057 | |
---|
1058 | int m = (k > 0); |
---|
1059 | |
---|
1060 | int MinDeg = 6; // starting guess for Maximal Bounding Degree, 6 |
---|
1061 | int Delta = 4; // increment of it, 4 |
---|
1062 | |
---|
1063 | if( m and (D <= 0) ) |
---|
1064 | { |
---|
1065 | // minimal guess |
---|
1066 | D = MinDeg; |
---|
1067 | } |
---|
1068 | |
---|
1069 | if( !m and D < 0) |
---|
1070 | { |
---|
1071 | ERROR("Wrong bounding condition!"); |
---|
1072 | } |
---|
1073 | |
---|
1074 | ///////////////////////////////////////////////////////////////////////////// |
---|
1075 | |
---|
1076 | def NCRING = basering; // Non-commutative ring |
---|
1077 | list L = ringlist( NCRING ); |
---|
1078 | def L1, L2, L3, L4 = L[1..4]; // General components |
---|
1079 | |
---|
1080 | def COMMRING = ring( list( L1, L2, L3, L4 ) ); // Underlying commutative ring |
---|
1081 | |
---|
1082 | |
---|
1083 | ///////////////////////////////////////////////////////////////////////////// |
---|
1084 | |
---|
1085 | // we keep the list of found leading monomials in the commutative ring! |
---|
1086 | setring COMMRING; |
---|
1087 | |
---|
1088 | // Init |
---|
1089 | list FOUND_LEADING_MONOMIALS = list(); |
---|
1090 | |
---|
1091 | for( i = 1; i <= D; i++ ) |
---|
1092 | { |
---|
1093 | FOUND_LEADING_MONOMIALS[i] = ideal(); |
---|
1094 | } |
---|
1095 | |
---|
1096 | ideal FLM, NEW, T; // in COMMRING |
---|
1097 | |
---|
1098 | ///////////////////////////////////////////////////////////////////////////// |
---|
1099 | |
---|
1100 | setring NCRING; |
---|
1101 | |
---|
1102 | ideal result, FLM, PBW, NEW, T, P; // in NCRING |
---|
1103 | |
---|
1104 | // Main loop: |
---|
1105 | i = 1; |
---|
1106 | |
---|
1107 | while( i <= D ) |
---|
1108 | { |
---|
1109 | DBPrint( 1, "Current degree is " + string(i) ); |
---|
1110 | |
---|
1111 | ///////////////////////////////////////////////////////////////////////////// |
---|
1112 | |
---|
1113 | // Compute current "reduced" PBW basis... |
---|
1114 | |
---|
1115 | // Prepare current found leading monomials |
---|
1116 | setring COMMRING; |
---|
1117 | FLM = FOUND_LEADING_MONOMIALS[i]; |
---|
1118 | |
---|
1119 | // And back to NCRing |
---|
1120 | setring NCRING; |
---|
1121 | |
---|
1122 | FLM = imap(COMMRING, FLM); // We cannot write imap(COMMRING, FOUND_LEADING_MONOMIALS[i]) :((( |
---|
1123 | |
---|
1124 | attrib(FLM, "isSB", 1); // just to avoid "no standard basis" warning. |
---|
1125 | |
---|
1126 | // degrees should not change, |
---|
1127 | // no monomials should be multiplied here |
---|
1128 | T = reduce( PBW_eqDeg( i ), FLM, 1 ); |
---|
1129 | |
---|
1130 | // we simply kill in T monomials occurring in FOUND_LEADING_MONOMIALS[i] |
---|
1131 | P = PBW + T; // + simplifies |
---|
1132 | |
---|
1133 | // Compute current centralizer |
---|
1134 | NEW = centralizeSet( F, P ); |
---|
1135 | |
---|
1136 | if( size(NEW) > 0 ) |
---|
1137 | { |
---|
1138 | // In order to speedup multiplications we are going into a commutative ring: |
---|
1139 | setring COMMRING; |
---|
1140 | |
---|
1141 | // we can perform commutative interreduction |
---|
1142 | // since no monomials should be multiplied! |
---|
1143 | // degrees should not change |
---|
1144 | NEW = interred( imap( NCRING, NEW ) ); |
---|
1145 | |
---|
1146 | // Go back! |
---|
1147 | setring NCRING; |
---|
1148 | |
---|
1149 | NEW = imap( COMMRING, NEW ); |
---|
1150 | |
---|
1151 | DBPrint( 1, "Found: ", NEW ); |
---|
1152 | |
---|
1153 | // Add them to result... |
---|
1154 | result = result + NEW; |
---|
1155 | } |
---|
1156 | |
---|
1157 | // Did we find needed number of generators? Or reached the bound? |
---|
1158 | if( (m and (size(result) >= k)) or (!m and (i == D)) ) |
---|
1159 | { |
---|
1160 | break; // Get out of here!!! |
---|
1161 | } |
---|
1162 | |
---|
1163 | // otherwise we must update FOUND_LEADING_MONOMIALS |
---|
1164 | if( size(NEW) > 0 ) |
---|
1165 | { |
---|
1166 | setring COMMRING; |
---|
1167 | |
---|
1168 | FLM = 0; |
---|
1169 | |
---|
1170 | // We must update FOUND_LEADING_MONOMIALS!!! |
---|
1171 | for( j = 1; j <= size(NEW); j++ ) |
---|
1172 | { |
---|
1173 | FLM[j] = leadmonom( NEW[j] ); // we are interested in leading monomials only! |
---|
1174 | } |
---|
1175 | |
---|
1176 | FOUND_LEADING_MONOMIALS[i] = FOUND_LEADING_MONOMIALS[i] + FLM; |
---|
1177 | |
---|
1178 | for( j = 1; j <= D; j = j + i ) // For every degree (j*i) of LNEW, do: |
---|
1179 | { |
---|
1180 | for( l = j; (l+i) <= D; l++ ) |
---|
1181 | { |
---|
1182 | FOUND_LEADING_MONOMIALS[l+i] = |
---|
1183 | FOUND_LEADING_MONOMIALS[l+i] + FOUND_LEADING_MONOMIALS[l] * FLM; |
---|
1184 | } |
---|
1185 | } |
---|
1186 | |
---|
1187 | // Return to NCRING |
---|
1188 | setring NCRING; |
---|
1189 | |
---|
1190 | FLM = imap(COMMRING, FLM); |
---|
1191 | attrib(FLM, "isSB", 1);// just to avoid "no standard basis" warning. |
---|
1192 | |
---|
1193 | // we simply kill in T monomials occurring in FOUND_LEADING_MONOMIALS[i] |
---|
1194 | T = reduce( T, FLM, 1 ); |
---|
1195 | |
---|
1196 | PBW = PBW + T; |
---|
1197 | } else |
---|
1198 | { |
---|
1199 | PBW = P; |
---|
1200 | } |
---|
1201 | |
---|
1202 | |
---|
1203 | if( m and (i == D) ) // Was the previous estimation too small??? |
---|
1204 | { |
---|
1205 | // We must update FOUND_LEADING_MONOMIALS in their Commutative world: |
---|
1206 | setring COMMRING; |
---|
1207 | |
---|
1208 | // Init new grades: |
---|
1209 | for( j = D + 1; j <= (D + Delta); j++ ) |
---|
1210 | { |
---|
1211 | FOUND_LEADING_MONOMIALS[j] = ideal(); |
---|
1212 | } |
---|
1213 | |
---|
1214 | FLM = 0; |
---|
1215 | |
---|
1216 | // All previously computed elements in their order! |
---|
1217 | NEW = imap( NCRING, result ); |
---|
1218 | |
---|
1219 | for( j = 1; j <= size(NEW); j++ ) |
---|
1220 | { |
---|
1221 | FLM[j] = leadmonom( NEW[j] ); // we are interested in leading monomials only! |
---|
1222 | } |
---|
1223 | |
---|
1224 | while( size(FLM) > 0 ) |
---|
1225 | { |
---|
1226 | // minimal degree: |
---|
1227 | d = mindeg(FLM); |
---|
1228 | |
---|
1229 | // take all of minimal degree: |
---|
1230 | T = jet( FLM, d ); |
---|
1231 | |
---|
1232 | // there are size(T) elements of smallest degree (deg(FLM[1])) in FLM! |
---|
1233 | |
---|
1234 | // Add them in the same way: |
---|
1235 | for( j = 1; j <= (D + Delta); j = j + d ) // For every degree (j*d) of T, do: |
---|
1236 | { |
---|
1237 | for( l = j; (l + d) <= (D + Delta); l++ ) |
---|
1238 | { |
---|
1239 | if( (l + d) > D ) // Only new should be updated! |
---|
1240 | { |
---|
1241 | FOUND_LEADING_MONOMIALS[l+d] = |
---|
1242 | FOUND_LEADING_MONOMIALS[l+d] + FOUND_LEADING_MONOMIALS[l] * T; |
---|
1243 | } |
---|
1244 | } |
---|
1245 | } |
---|
1246 | |
---|
1247 | // Kill them from FLM: |
---|
1248 | if( size(T) < size(FLM) ) |
---|
1249 | { |
---|
1250 | FLM = FLM[ (size(T)+1) .. size(FLM) ]; |
---|
1251 | } else |
---|
1252 | { |
---|
1253 | FLM = 0; // break; |
---|
1254 | } |
---|
1255 | |
---|
1256 | } |
---|
1257 | |
---|
1258 | // Go back... |
---|
1259 | setring NCRING; |
---|
1260 | |
---|
1261 | // And set new Bound |
---|
1262 | D = D + Delta; |
---|
1263 | } |
---|
1264 | |
---|
1265 | i++; |
---|
1266 | } |
---|
1267 | |
---|
1268 | result = makeNice(result); |
---|
1269 | |
---|
1270 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "centralizerRed", result ); }; /*4DEBUG*/ |
---|
1271 | |
---|
1272 | return( result ); |
---|
1273 | } |
---|
1274 | example |
---|
1275 | { |
---|
1276 | "EXAMPLE:"; echo = 2; |
---|
1277 | ring A = 0,(x,y,z),dp; |
---|
1278 | matrix D[3][3]=0; |
---|
1279 | D[1,2]=-z; D[1,3]=2*x; D[2,3]=-2*y; |
---|
1280 | ncalgebra(1,D); // this algebra is U(sl_2) |
---|
1281 | ideal F = x, y; |
---|
1282 | // find subalgebra generators degree <= 4 of an algebra of |
---|
1283 | // all elements commuting with x and y: |
---|
1284 | ideal C = centralizerRed(F, 4); |
---|
1285 | C; |
---|
1286 | inCentralizer(C, F); |
---|
1287 | } |
---|
1288 | |
---|
1289 | |
---|
1290 | /******************************************************/ |
---|
1291 | proc centerRed( int D, list # ) |
---|
1292 | "USAGE: centerRed( D[, N] ); int D[, int N] |
---|
1293 | RETURN: ideal, generated by computed generators |
---|
1294 | PURPOSE: computes a subalgebra generators of the center up to degree D. |
---|
1295 | NOTE: In general, one cannot compute the whole center. |
---|
1296 | @* Hence, one has to specify a termination condition via arguments D and/or N. |
---|
1297 | @* If D is positive, only central elements up to degree D will be found. |
---|
1298 | @* If D is negative, the termination is determined by N only. |
---|
1299 | @* If N is given, the computation stops if at least N elements has been found. |
---|
1300 | @* Warning: if N is given and bigger than the actual number of generators, |
---|
1301 | @* the procedure may not terminate. |
---|
1302 | @* Current ordering must be a degree compatible well-ordering. |
---|
1303 | SEE ALSO: centralizerRed; centerVS; center; inCenter |
---|
1304 | EXAMPLE: example centerRed; shows an example |
---|
1305 | " |
---|
1306 | { |
---|
1307 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "centerRed", D, # ); }; /*4DEBUG*/ |
---|
1308 | |
---|
1309 | if( nameof( basering ) == "basering" ) |
---|
1310 | { |
---|
1311 | // ERROR( "No current ring!" ); |
---|
1312 | } |
---|
1313 | |
---|
1314 | ideal result = centralizerRed( variablesSorted(), D, # ); |
---|
1315 | |
---|
1316 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "centerRed", result ); }; /*4DEBUG*/ |
---|
1317 | |
---|
1318 | return( result ); |
---|
1319 | } |
---|
1320 | example |
---|
1321 | { |
---|
1322 | "EXAMPLE:"; echo = 2; |
---|
1323 | ring A = 0,(x,y,z),dp; |
---|
1324 | matrix D[3][3]=0; |
---|
1325 | D[1,2]=z; |
---|
1326 | ncalgebra(1,D); // it is a Heisenberg algebra |
---|
1327 | // find vector space basis of center of degree <= 3 |
---|
1328 | ideal VSZ = centerVS(3); |
---|
1329 | // There should be 3 degrees of z. |
---|
1330 | VSZ; |
---|
1331 | inCenter(VSZ); |
---|
1332 | // find "minimal" central elements of degree <= 3 |
---|
1333 | ideal SAZ = centerRed(3); |
---|
1334 | // Only 'z' must be computed |
---|
1335 | SAZ; |
---|
1336 | inCenter(SAZ); |
---|
1337 | } |
---|
1338 | |
---|
1339 | |
---|
1340 | /******************************************************/ |
---|
1341 | /******************************************************/ |
---|
1342 | // ::SubAlgebraReduction:: A kind of subalgebra reduction... |
---|
1343 | /******************************************************/ |
---|
1344 | /******************************************************/ |
---|
1345 | |
---|
1346 | /******************************************************/ |
---|
1347 | static proc INTERRED( ideal S ) |
---|
1348 | "USAGE: INTERRED( S ); ideal S |
---|
1349 | RETURN: ideal, interreduced S |
---|
1350 | PURPOSE: interreduction without monomial multiplication, |
---|
1351 | just make every leading monomial occur in a single polynomial |
---|
1352 | " |
---|
1353 | { |
---|
1354 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "INTERRED", S ); }; /*4DEBUG*/ |
---|
1355 | |
---|
1356 | ideal result = S; |
---|
1357 | |
---|
1358 | int flag = 1; |
---|
1359 | |
---|
1360 | int i, j, N; |
---|
1361 | |
---|
1362 | poly p, lm; |
---|
1363 | |
---|
1364 | while( flag == 1 ) |
---|
1365 | { |
---|
1366 | flag = 0; |
---|
1367 | |
---|
1368 | result = sort( simplify( result, 1 + 2 + 8) )[1]; |
---|
1369 | // sorting w.r.t. actual monomial ordering |
---|
1370 | // generators with SMALLER(!) leading term come FIRST |
---|
1371 | |
---|
1372 | N = size(result); |
---|
1373 | |
---|
1374 | // kill leading monomials: |
---|
1375 | |
---|
1376 | i = 1; |
---|
1377 | while( i < N ) |
---|
1378 | { |
---|
1379 | p = result[i]; |
---|
1380 | lm = leadmonom(p); |
---|
1381 | |
---|
1382 | j = i + 1; |
---|
1383 | while( leadmonom(result[j]) == lm ) |
---|
1384 | { |
---|
1385 | result[j] = result[j] - p; // leadcoefs are 1 because of simplify. |
---|
1386 | flag = 1; // we have changed something => we do still need to care about it... |
---|
1387 | j++; |
---|
1388 | |
---|
1389 | if( j > N ) |
---|
1390 | { |
---|
1391 | break; |
---|
1392 | } |
---|
1393 | } |
---|
1394 | |
---|
1395 | i = j; |
---|
1396 | } |
---|
1397 | } |
---|
1398 | |
---|
1399 | // We are done! No common leading monomials! |
---|
1400 | // The result is sorted |
---|
1401 | |
---|
1402 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "INTERRED", result ); }; /*4DEBUG*/ |
---|
1403 | |
---|
1404 | return( result ); |
---|
1405 | } |
---|
1406 | |
---|
1407 | |
---|
1408 | /******************************************************/ |
---|
1409 | static proc SANF( poly p, list FOUND_LEADING_MONOMIALS ) |
---|
1410 | " |
---|
1411 | reduce p wrt found multiples without ANY polynomial multiplications! |
---|
1412 | " |
---|
1413 | { |
---|
1414 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "SANF", p, FOUND_LEADING_MONOMIALS); }; /*4DEBUG*/ |
---|
1415 | |
---|
1416 | poly q = p; |
---|
1417 | poly head = 0; |
---|
1418 | |
---|
1419 | int d; int N = size(FOUND_LEADING_MONOMIALS); |
---|
1420 | |
---|
1421 | while( size(q) > 0 ) |
---|
1422 | { |
---|
1423 | d = maxdeg(p); |
---|
1424 | |
---|
1425 | if( (0 < d) and (d <= N) ) |
---|
1426 | { |
---|
1427 | if( size(FOUND_LEADING_MONOMIALS[d]) > 0 ) |
---|
1428 | { |
---|
1429 | attrib( FOUND_LEADING_MONOMIALS[d], "isSB", 1); |
---|
1430 | q = reduce( p, FOUND_LEADING_MONOMIALS[d] ); |
---|
1431 | } |
---|
1432 | |
---|
1433 | DBPrint(1, string(p) + " --> " + string(q) ); |
---|
1434 | } |
---|
1435 | |
---|
1436 | if( q == p ) |
---|
1437 | { |
---|
1438 | p = lead(q); |
---|
1439 | |
---|
1440 | if( d > 0 ) |
---|
1441 | { |
---|
1442 | // No scalars! |
---|
1443 | head = head + p; |
---|
1444 | } |
---|
1445 | |
---|
1446 | q = q - p; |
---|
1447 | } |
---|
1448 | |
---|
1449 | p = q; |
---|
1450 | } |
---|
1451 | |
---|
1452 | |
---|
1453 | |
---|
1454 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "SANF", head ); }; /*4DEBUG*/ |
---|
1455 | |
---|
1456 | return( head ); |
---|
1457 | } |
---|
1458 | |
---|
1459 | |
---|
1460 | /******************************************************/ |
---|
1461 | static proc maxdegInt( ideal I ) |
---|
1462 | { |
---|
1463 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "maxdegInt", I ); }; /*4DEBUG*/ |
---|
1464 | |
---|
1465 | intmat D = maxdeg(I); |
---|
1466 | |
---|
1467 | int max = D[1, 1]; int m; |
---|
1468 | |
---|
1469 | for( int c = 2; c <= ncols(D); c++ ) |
---|
1470 | { |
---|
1471 | m = D[1, c]; |
---|
1472 | |
---|
1473 | if( m > max ) |
---|
1474 | { |
---|
1475 | max = m; |
---|
1476 | } |
---|
1477 | } |
---|
1478 | |
---|
1479 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "maxdegInt", max ); }; /*4DEBUG*/ |
---|
1480 | |
---|
1481 | return( max ); |
---|
1482 | } |
---|
1483 | |
---|
1484 | /******************************************************/ |
---|
1485 | proc sa_reduce( ideal V ) // 'subalgebra basis' computation |
---|
1486 | "USAGE: sa_reduce(V); ideal V |
---|
1487 | RETURN: ideal, generated by found elements |
---|
1488 | PURPOSE: compute a s.a. basis of an algebra generated by V |
---|
1489 | NOTE: May produce wrong result in quotient algebras. |
---|
1490 | SEE ALSO: sa_poly_reduce |
---|
1491 | EXAMPLE: example sa_reduce; shows an example |
---|
1492 | " |
---|
1493 | { |
---|
1494 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "sa_reduce", V ); }; /*4DEBUG*/ |
---|
1495 | |
---|
1496 | ideal result = ideal(); |
---|
1497 | |
---|
1498 | ideal FLM = INTERRED( V ); // The output is sorted "[1]<[2]<[3]<..." |
---|
1499 | |
---|
1500 | // We are bounded by maximal degree!!! |
---|
1501 | int D = maxdegInt( FLM ); |
---|
1502 | |
---|
1503 | // Init |
---|
1504 | list FOUND_LEADING_MONOMIALS = list(); |
---|
1505 | |
---|
1506 | int i; |
---|
1507 | |
---|
1508 | for( i = 1; i <= D; i++ ) |
---|
1509 | { |
---|
1510 | FOUND_LEADING_MONOMIALS[i] = ideal(); |
---|
1511 | } |
---|
1512 | |
---|
1513 | int d, j, l; |
---|
1514 | |
---|
1515 | poly p, q; ideal T; |
---|
1516 | |
---|
1517 | |
---|
1518 | int c = 1; // polynomials in FLM commute pairwise |
---|
1519 | |
---|
1520 | for( j = 1; (j < size(FLM)) and (c == 1); j++ ) |
---|
1521 | { |
---|
1522 | p = FLM[j]; |
---|
1523 | |
---|
1524 | for( l = j+1; (l <= size(FLM)) and (c == 1); l++ ) |
---|
1525 | { |
---|
1526 | q = FLM[l]; |
---|
1527 | |
---|
1528 | if( NF(p*q - q*p, twostd(0)) != 0 ) |
---|
1529 | { |
---|
1530 | c = 0; // There exists non-commuting pair |
---|
1531 | } |
---|
1532 | } |
---|
1533 | } |
---|
1534 | |
---|
1535 | while( size(FLM) > 0 ) |
---|
1536 | { |
---|
1537 | // Take the 1st element of FLM... |
---|
1538 | p = FLM[1]; // SANF( FLM[1], FOUND_LEADING_MONOMIALS ); |
---|
1539 | |
---|
1540 | FLM[1] = 0; // ...and kill it from FLM |
---|
1541 | |
---|
1542 | d = maxdeg( p ); |
---|
1543 | T = ideal(p); |
---|
1544 | |
---|
1545 | FOUND_LEADING_MONOMIALS[d] = FOUND_LEADING_MONOMIALS[d] + T; |
---|
1546 | |
---|
1547 | for( j = 1; j <= D; j = j + d ) // For every degree (j*d) of T, do: |
---|
1548 | { |
---|
1549 | for( l = j; (l + d) <= D; l++ ) |
---|
1550 | { |
---|
1551 | FOUND_LEADING_MONOMIALS[l+d] = |
---|
1552 | FOUND_LEADING_MONOMIALS[l+d] + FOUND_LEADING_MONOMIALS[l] * T; |
---|
1553 | |
---|
1554 | if( c != 1 ) |
---|
1555 | { |
---|
1556 | FOUND_LEADING_MONOMIALS[l+d] = |
---|
1557 | FOUND_LEADING_MONOMIALS[l+d] + T * FOUND_LEADING_MONOMIALS[l]; |
---|
1558 | } |
---|
1559 | } |
---|
1560 | } |
---|
1561 | |
---|
1562 | if( size(FLM) > 0 ) |
---|
1563 | { |
---|
1564 | for( i = 2; i <= ncols(FLM); i++ ) |
---|
1565 | { |
---|
1566 | FLM[i] = SANF( FLM[i], FOUND_LEADING_MONOMIALS ); |
---|
1567 | } |
---|
1568 | FLM = INTERRED( FLM ); |
---|
1569 | } |
---|
1570 | |
---|
1571 | DBPrint(1, "Found: " + string(T) ); |
---|
1572 | |
---|
1573 | result = result + T; |
---|
1574 | |
---|
1575 | } |
---|
1576 | |
---|
1577 | result = makeNice(result); |
---|
1578 | |
---|
1579 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "sa_reduce", result ); }; /*4DEBUG*/ |
---|
1580 | |
---|
1581 | return( result ); |
---|
1582 | } |
---|
1583 | example |
---|
1584 | { "EXAMPLE:"; echo = 2; |
---|
1585 | ring A = 0,(x,y,z),dp; |
---|
1586 | matrix D[3][3]=0; |
---|
1587 | D[1,2]=-z; D[1,3]=2*x; D[2,3]=-2*y; |
---|
1588 | ncalgebra(1,D); // this algebra is U(sl_2) |
---|
1589 | poly f = 4*x*y+z^2-2*z; // a central polynomial |
---|
1590 | ideal I = f, f*f, f*f*f - 10*f*f, f+3*z^3; I; |
---|
1591 | sa_reduce(I); // should be just f and z^3 |
---|
1592 | } |
---|
1593 | |
---|
1594 | |
---|
1595 | |
---|
1596 | /******************************************************/ |
---|
1597 | proc sa_poly_reduce( poly p, ideal V ) // subalgebra reduction of a polynomial |
---|
1598 | "USAGE: sa_poly_reduce(p, V); poly p, ideal V |
---|
1599 | RETURN: polynomial, a reduction of p wrt V |
---|
1600 | PURPOSE: computes a reduction of polynomial p wrt V |
---|
1601 | NOTE: May produce wrong result in quotient algebras. |
---|
1602 | SEE ALSO: sa_reduce |
---|
1603 | EXAMPLE: example sa_poly_reduce; shows an example |
---|
1604 | " |
---|
1605 | { |
---|
1606 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "sa_poly_reduce", p, V ); }; /*4DEBUG*/ |
---|
1607 | // As previous... |
---|
1608 | |
---|
1609 | ideal FLM = INTERRED( V ); // The output is sorted "[1]<[2]<[3]<..." |
---|
1610 | |
---|
1611 | // We are bounded by maximal degree!!! |
---|
1612 | int D = maxdegInt( FLM + ideal(p) ); |
---|
1613 | |
---|
1614 | // Init |
---|
1615 | list FOUND_LEADING_MONOMIALS = list(); |
---|
1616 | |
---|
1617 | int i; |
---|
1618 | |
---|
1619 | for( i = 1; i <= D; i++ ) |
---|
1620 | { |
---|
1621 | FOUND_LEADING_MONOMIALS[i] = ideal(); |
---|
1622 | } |
---|
1623 | |
---|
1624 | int d, j, l; |
---|
1625 | |
---|
1626 | poly f, q; ideal T; |
---|
1627 | |
---|
1628 | |
---|
1629 | int c = 1; // polynomials in FLM commute pairwise |
---|
1630 | |
---|
1631 | for( j = 1; (j < size(FLM)) and (c == 1); j++ ) |
---|
1632 | { |
---|
1633 | f = FLM[j]; |
---|
1634 | |
---|
1635 | for( l = j+1; (l <= size(FLM)) and (c == 1); l++ ) |
---|
1636 | { |
---|
1637 | q = FLM[l]; |
---|
1638 | |
---|
1639 | if( NF(f*q - q*f, twostd(0)) != 0 ) |
---|
1640 | { |
---|
1641 | c = 0; |
---|
1642 | } |
---|
1643 | } |
---|
1644 | } |
---|
1645 | |
---|
1646 | |
---|
1647 | while( size(FLM) > 0 ) |
---|
1648 | { |
---|
1649 | // Take the 1st element of FLM... |
---|
1650 | q = SANF( FLM[1], FOUND_LEADING_MONOMIALS ); |
---|
1651 | |
---|
1652 | FLM[1] = 0; // ...and kill it from FLM |
---|
1653 | |
---|
1654 | d = maxdeg(q); |
---|
1655 | T = ideal(q); |
---|
1656 | |
---|
1657 | FOUND_LEADING_MONOMIALS[d] = FOUND_LEADING_MONOMIALS[d] + T; |
---|
1658 | |
---|
1659 | for( j = 1; j <= D; j = j + d ) // For every degree (j*d) of T, do: |
---|
1660 | { |
---|
1661 | for( l = j; (l + d) <= D; l++ ) |
---|
1662 | { |
---|
1663 | FOUND_LEADING_MONOMIALS[l+d] = |
---|
1664 | FOUND_LEADING_MONOMIALS[l+d] + FOUND_LEADING_MONOMIALS[l] * T; |
---|
1665 | |
---|
1666 | if( c != 1 ) |
---|
1667 | { |
---|
1668 | FOUND_LEADING_MONOMIALS[l+d] = |
---|
1669 | FOUND_LEADING_MONOMIALS[l+d] + T * FOUND_LEADING_MONOMIALS[l]; |
---|
1670 | } |
---|
1671 | } |
---|
1672 | } |
---|
1673 | |
---|
1674 | if( size(FLM) > 0 ) |
---|
1675 | { |
---|
1676 | for( i = 2; i <= ncols(FLM); i++ ) |
---|
1677 | { |
---|
1678 | FLM[i] = SANF( FLM[i], FOUND_LEADING_MONOMIALS ); |
---|
1679 | } |
---|
1680 | FLM = INTERRED( FLM ); |
---|
1681 | } |
---|
1682 | } |
---|
1683 | |
---|
1684 | poly result = SANF(p, FOUND_LEADING_MONOMIALS); |
---|
1685 | |
---|
1686 | result = makeNice( result ); |
---|
1687 | |
---|
1688 | |
---|
1689 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "sa_poly_reduce", result ); }; /*4DEBUG*/ |
---|
1690 | |
---|
1691 | return( result ); |
---|
1692 | } |
---|
1693 | example |
---|
1694 | { "EXAMPLE:"; echo = 2; |
---|
1695 | ring A = 0,(x,y,z),dp; |
---|
1696 | matrix D[3][3]=0; |
---|
1697 | D[1,2]=-z; D[1,3]=2*x; D[2,3]=-2*y; |
---|
1698 | ncalgebra(1,D); // this algebra is U(sl_2) |
---|
1699 | poly f = 4*x*y+z^2-2*z; // a central polynomial |
---|
1700 | sa_poly_reduce(f + 3*f*f + x, ideal(f) ); // should be just 'x' |
---|
1701 | } |
---|
1702 | |
---|
1703 | |
---|
1704 | |
---|
1705 | |
---|
1706 | |
---|
1707 | |
---|
1708 | |
---|
1709 | /******************************************************/ |
---|
1710 | // ::inStuff:: inCentralizer, inCenter, isCartan helpers |
---|
1711 | /******************************************************/ |
---|
1712 | |
---|
1713 | |
---|
1714 | /******************************************************/ |
---|
1715 | static proc inCentralizer_poly( poly p, ideal S ) |
---|
1716 | " |
---|
1717 | if p in centralizer(S) => return 1, otherwise return 0 |
---|
1718 | " |
---|
1719 | { |
---|
1720 | poly f; |
---|
1721 | |
---|
1722 | for( int k = 1; k <= size(S); k++ ) |
---|
1723 | { |
---|
1724 | f = S[k]; |
---|
1725 | |
---|
1726 | if( NF( f * p - p * f, twostd(0) ) != 0 ) |
---|
1727 | { |
---|
1728 | DBPrint( 1, "POLY: " + string (p) + |
---|
1729 | " is NOT in the centralizer of poly {" + string(f) + "}" ); |
---|
1730 | return (0); |
---|
1731 | } |
---|
1732 | } |
---|
1733 | |
---|
1734 | return( 1 ); |
---|
1735 | } |
---|
1736 | |
---|
1737 | /******************************************************/ |
---|
1738 | static proc inCentralizer_list( def l, ideal S ) |
---|
1739 | { |
---|
1740 | for( int @i = 1; @i <= size(l); @i++ ) |
---|
1741 | { |
---|
1742 | if( (typeof(l[@i])=="poly") or (typeof(l[@i]) == "int") or (typeof(l[@i]) == "number") ) |
---|
1743 | { |
---|
1744 | if(! inCentralizer_poly(l[@i], S) ) |
---|
1745 | { |
---|
1746 | return(0); |
---|
1747 | } |
---|
1748 | |
---|
1749 | } else |
---|
1750 | { |
---|
1751 | if( (typeof(l[@i])=="list") or (typeof(l[@i])=="ideal") ) |
---|
1752 | { |
---|
1753 | if(! inCentralizer_list(l[@i], S) ) |
---|
1754 | { |
---|
1755 | return(0); |
---|
1756 | } |
---|
1757 | } |
---|
1758 | } |
---|
1759 | } |
---|
1760 | return(1); |
---|
1761 | } |
---|
1762 | |
---|
1763 | |
---|
1764 | /******************************************************************************/ |
---|
1765 | proc inCentralizer( def a, ideal S ) // Checks the commutativity of polynomials of a with the polynomials in S |
---|
1766 | "USAGE: inCentralizer(a, S); a poly/list/ideal, S poly/ideal |
---|
1767 | RETURN: integer, 1 if a in the centralizer(S), 0 otherwise |
---|
1768 | PURPOSE: check whether a is centralizing with respect to elements of S |
---|
1769 | EXAMPLE: example inCentralizer; shows examples |
---|
1770 | " |
---|
1771 | { |
---|
1772 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "inCentralizer", a, S ); }; /*4DEBUG*/ |
---|
1773 | |
---|
1774 | if( nameof( basering ) == "basering" ) |
---|
1775 | { |
---|
1776 | // ERROR( "No current ring!" ); |
---|
1777 | } |
---|
1778 | |
---|
1779 | |
---|
1780 | int res; |
---|
1781 | |
---|
1782 | if( (typeof(a) == "poly") or (typeof(a) == "int") or (typeof(a) == "number") ) |
---|
1783 | { |
---|
1784 | res = inCentralizer_poly(a, S); |
---|
1785 | } else |
---|
1786 | { |
---|
1787 | if( (typeof(a)=="list") or (typeof(a)=="ideal") ) |
---|
1788 | { |
---|
1789 | res = inCentralizer_list(a, S); |
---|
1790 | } else |
---|
1791 | { |
---|
1792 | res = -1; |
---|
1793 | } |
---|
1794 | } |
---|
1795 | |
---|
1796 | if( res == -1 ) |
---|
1797 | { |
---|
1798 | ERROR( "Wrong argument!" ); |
---|
1799 | } |
---|
1800 | |
---|
1801 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "inCentralizer", res ); }; /*4DEBUG*/ |
---|
1802 | |
---|
1803 | return (res); |
---|
1804 | } |
---|
1805 | example |
---|
1806 | { |
---|
1807 | "EXAMPLE:";echo=2; |
---|
1808 | ring r=0,(x,y,z),dp; |
---|
1809 | matrix D[3][3]=0; |
---|
1810 | D[1,2]=-z; |
---|
1811 | ncalgebra(1,D); // the Heisenberg algebra |
---|
1812 | poly f = x^2; |
---|
1813 | poly a = z; // 'z' is central => it lies in any centralizer! |
---|
1814 | poly b = y^2; |
---|
1815 | inCentralizer(a, f); |
---|
1816 | inCentralizer(b, f); |
---|
1817 | list l = list(1, a); |
---|
1818 | inCentralizer(l, f); |
---|
1819 | ideal I = a, b; |
---|
1820 | inCentralizer(I, f); |
---|
1821 | printlevel = 2; |
---|
1822 | inCentralizer(a, f); // yes |
---|
1823 | inCentralizer(b, f); // no |
---|
1824 | } |
---|
1825 | |
---|
1826 | /******************************************************/ |
---|
1827 | proc inCenter( def a ) // Checks the centrality of a |
---|
1828 | "USAGE: inCenter(a); a poly/list/ideal |
---|
1829 | RETURN: integer, 1 if a in the center, 0 otherwise |
---|
1830 | PURPOSE: check whether a given element is central |
---|
1831 | EXAMPLE: example inCenter; shows examples |
---|
1832 | " |
---|
1833 | { |
---|
1834 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "inCenter", a ); }; /*4DEBUG*/ |
---|
1835 | |
---|
1836 | if( nameof( basering ) == "basering" ) |
---|
1837 | { |
---|
1838 | // ERROR( "No current ring!" ); |
---|
1839 | } |
---|
1840 | |
---|
1841 | int result = inCentralizer( a, variablesStandard() ); |
---|
1842 | |
---|
1843 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "inCenter", result ); }; /*4DEBUG*/ |
---|
1844 | |
---|
1845 | return( result ); |
---|
1846 | } |
---|
1847 | example |
---|
1848 | { |
---|
1849 | "EXAMPLE:";echo=2; |
---|
1850 | ring r=0,(x,y,z),dp; |
---|
1851 | matrix D[3][3]=0; |
---|
1852 | D[1,2]=-z; |
---|
1853 | D[1,3]=2*x; |
---|
1854 | D[2,3]=-2*y; |
---|
1855 | ncalgebra(1,D); // this is U(sl_2) |
---|
1856 | poly p=4*x*y+z^2-2*z; |
---|
1857 | inCenter(p); |
---|
1858 | poly f=4*x*y; |
---|
1859 | inCenter(f); |
---|
1860 | list l= list( 1, p, p^2, p^3); |
---|
1861 | inCenter(l); |
---|
1862 | ideal I= p, f; |
---|
1863 | inCenter(I); |
---|
1864 | } |
---|
1865 | |
---|
1866 | |
---|
1867 | /******************************************************/ |
---|
1868 | proc isCartan( poly f ) // Checks whether f is a Cartan element. |
---|
1869 | "USAGE: isCartan(f); poly f |
---|
1870 | PURPOSE: check whether f is a Cartan element. |
---|
1871 | RETURN: integer, 1 if f is a Cartan element and 0 otherwise. |
---|
1872 | NOTE: f is a Cartan element |
---|
1873 | @* iff for all g in A there exists C in K such that [f, g] = C * g |
---|
1874 | @* iff for all variables v_i there exist C in K such that [f, v_i] = C * v_i. |
---|
1875 | " |
---|
1876 | { |
---|
1877 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ BCall( "isCartan", f ); }; /*4DEBUG*/ |
---|
1878 | |
---|
1879 | if( nameof( basering ) == "basering" ) |
---|
1880 | { |
---|
1881 | // ERROR( "No current ring!" ); |
---|
1882 | } |
---|
1883 | |
---|
1884 | |
---|
1885 | ideal V = variablesStandard(); |
---|
1886 | |
---|
1887 | int r = 1; poly v, g; |
---|
1888 | |
---|
1889 | for( int i = size(V); i > 0; i-- ) |
---|
1890 | { |
---|
1891 | v = leadmonom(V[i]); // V[i] must be just a variable, but... |
---|
1892 | |
---|
1893 | g = NF( f*v - v*f, twostd(0) ); // [f, V[i]] |
---|
1894 | |
---|
1895 | if( size(g) > 0 ) |
---|
1896 | { |
---|
1897 | if( size(g) > 1 ) // it is not just \alpha * v_i. |
---|
1898 | { |
---|
1899 | r = 0; |
---|
1900 | break; |
---|
1901 | } |
---|
1902 | |
---|
1903 | if( leadmonom(g) != v ) // g = \alpha * v_j, j != i. |
---|
1904 | { |
---|
1905 | r = 0; |
---|
1906 | break; |
---|
1907 | } |
---|
1908 | |
---|
1909 | } // else \alpha = 0 |
---|
1910 | } |
---|
1911 | |
---|
1912 | /*4DEBUG*/ if( defined( @@@DEBUG ) ){ ECall( "isCartan", r ); }; /*4DEBUG*/ |
---|
1913 | return( r ); |
---|
1914 | } |
---|
1915 | example |
---|
1916 | { |
---|
1917 | "EXAMPLE:";echo=2; |
---|
1918 | ring r=0,(x,y,z),dp; |
---|
1919 | matrix D[3][3]=0; |
---|
1920 | D[1,2]=-z; |
---|
1921 | D[1,3]=2*x; |
---|
1922 | D[2,3]=-2*y; |
---|
1923 | ncalgebra(1,D); // this is U(sl_2) with cartan - z |
---|
1924 | isCartan(z); // yes! |
---|
1925 | poly p=4*x*y+z^2-2*z; |
---|
1926 | isCartan(p); // central elements are Cartan elements! |
---|
1927 | poly f=4*x*y; |
---|
1928 | isCartan(f); // no way! |
---|
1929 | isCartan( 10 + p + z ); // scalar + central + cartan |
---|
1930 | } |
---|
1931 | |
---|
1932 | |
---|
1933 | |
---|
1934 | |
---|
1935 | /******************************************************/ |
---|
1936 | /******************************************************/ |
---|
1937 | // ::MainAliases:: The main non-static functions, visible to user are here. They are wrappers around basic functions. |
---|
1938 | /******************************************************/ |
---|
1939 | /******************************************************/ |
---|
1940 | |
---|
1941 | |
---|
1942 | |
---|
1943 | |
---|
1944 | /******************************************************/ |
---|
1945 | proc center( int D, list # ) // Computes the generators of the center of a basering |
---|
1946 | "USAGE: center(D[, N]); int D, int N |
---|
1947 | RETURN: ideal, generated by elements of degree at most D |
---|
1948 | PURPOSE: computes a subalgebra generators of the center up to degree D. |
---|
1949 | NOTE: In general, one cannot compute the whole center. |
---|
1950 | @* Hence, one has to specify a termination condition via arguments D and/or N. |
---|
1951 | @* If D is positive, only central elements up to degree D will be found. |
---|
1952 | @* If D is negative, the termination is determined by N only. |
---|
1953 | @* If N is given, the computation stops if at least N elements has been found. |
---|
1954 | @* Warning: if N is given and bigger than the actual number of generators, |
---|
1955 | @* the procedure may not terminate. |
---|
1956 | @* Current ordering must be a degree compatible well-ordering. |
---|
1957 | SEE ALSO: centralizer; inCenter |
---|
1958 | EXAMPLE: example center; shows an example |
---|
1959 | " |
---|
1960 | { |
---|
1961 | if( nameof( basering ) == "basering" ) |
---|
1962 | { |
---|
1963 | // ERROR( "No current ring!" ); |
---|
1964 | } |
---|
1965 | |
---|
1966 | if( DefaultInt( # ) > 0 ) |
---|
1967 | { |
---|
1968 | return( centerRed( D, # ) ); |
---|
1969 | } |
---|
1970 | |
---|
1971 | if( D >= 0 ) |
---|
1972 | { |
---|
1973 | return( sa_reduce( centerVS(D) ) ); // Experimental! May be wrong!!! |
---|
1974 | } |
---|
1975 | |
---|
1976 | ERROR( "Wrong arguments!" ); |
---|
1977 | } |
---|
1978 | example |
---|
1979 | { |
---|
1980 | "EXAMPLE:"; echo = 2; |
---|
1981 | ring A = 0,(x,y,z,t),dp; |
---|
1982 | matrix D[4][4]=0; |
---|
1983 | D[1,2]=-z; D[1,3]=2*x; D[2,3]=-2*y; |
---|
1984 | ncalgebra(1,D); // this algebra is U(sl_2) tensored with K[t] |
---|
1985 | ideal Z = center(3); // find all central elements of degree <= 3 |
---|
1986 | Z; |
---|
1987 | inCenter(Z); |
---|
1988 | ideal ZZ = center(-1, 1); // find one central element of the lowest degree |
---|
1989 | ZZ; |
---|
1990 | inCenter(ZZ); |
---|
1991 | } |
---|
1992 | |
---|
1993 | /******************************************************/ |
---|
1994 | proc centralizer( ideal S, int D, list # ) // Computes the generators of the centralizer of S in a basering |
---|
1995 | "USAGE: centralizer(F, D[, N]); poly/ideal F, int D[, int N] |
---|
1996 | RETURN: ideal, generated by computed generators |
---|
1997 | PURPOSE: computes a subalgebra generators of centralizer(F) up to degree D. |
---|
1998 | NOTE: In general, one cannot compute the whole centralizer(F). |
---|
1999 | @* Hence, one has to specify a termination condition via arguments D and/or N. |
---|
2000 | @* If D is positive, only centralizing elements up to degree D will be found. |
---|
2001 | @* If D is negative, the termination is determined by N only. |
---|
2002 | @* If N is given, the computation stops if at least N elements has been found. |
---|
2003 | @* Warning: if N is given and bigger than the actual number of generators, |
---|
2004 | @* the procedure may not terminate. |
---|
2005 | @* Current ordering must be a degree compatible well-ordering. |
---|
2006 | SEE ALSO: center; inCentralizer |
---|
2007 | EXAMPLE: example centralizer; shows an example |
---|
2008 | " |
---|
2009 | { |
---|
2010 | if( nameof( basering ) == "basering" ) |
---|
2011 | { |
---|
2012 | // ERROR( "No current ring!" ); |
---|
2013 | } |
---|
2014 | |
---|
2015 | if( DefaultInt( # ) > 0 ) |
---|
2016 | { |
---|
2017 | return( centralizerRed( S, D, # ) ); |
---|
2018 | } |
---|
2019 | |
---|
2020 | if( D >= 0 ) |
---|
2021 | { |
---|
2022 | return( sa_reduce( centralizerVS(S, D) ) ); // Experimental! May be wrong!!! |
---|
2023 | } |
---|
2024 | |
---|
2025 | ERROR( "Wrong arguments!" ); |
---|
2026 | } |
---|
2027 | example |
---|
2028 | { |
---|
2029 | "EXAMPLE:"; echo = 2; |
---|
2030 | ring A = 0,(x,y,z),dp; |
---|
2031 | matrix D[3][3]=0; |
---|
2032 | D[1,2]=-z; D[1,3]=2*x; D[2,3]=-2*y; |
---|
2033 | ncalgebra(1,D); // this algebra is U(sl_2) |
---|
2034 | poly f = 4*x*y+z^2-2*z; // a central polynomial |
---|
2035 | f; |
---|
2036 | ideal c = centralizer(f, 2); // find all elements of the centralizer of f |
---|
2037 | // of degree <= 2 |
---|
2038 | c; // since f is central, the answer consists of generators of A |
---|
2039 | inCentralizer(c, f); |
---|
2040 | ideal cc = centralizer(f,-1,2); // find at least two elements of the centralizer of f |
---|
2041 | cc; |
---|
2042 | inCentralizer(cc, f); |
---|
2043 | poly g = z^2-2*z; // some non-central polynomial |
---|
2044 | c = centralizer(g, 2); // find all elements of the centralizer of g |
---|
2045 | // of degree <= 2 |
---|
2046 | c; |
---|
2047 | inCentralizer(c, g); |
---|
2048 | centralizer(g,-1,1); // find the element of the lowest degree in the centralizer |
---|
2049 | cc = centralizer(g,-1,2); // find at least two elements of the centralizer of g |
---|
2050 | cc; |
---|
2051 | inCentralizer(cc, g); |
---|
2052 | } |
---|
2053 | |
---|
2054 | |
---|
2055 | /******************************************************* |
---|
2056 | // normally one should use this library together with ncalg.lib in the following way: |
---|
2057 | |
---|
2058 | LIB "ncalg.lib"; |
---|
2059 | def Usl3 = makeUsl(3); // U(sl_3) |
---|
2060 | setring Usl3; |
---|
2061 | |
---|
2062 | // show current ring: |
---|
2063 | basering; |
---|
2064 | |
---|
2065 | LIB "center.lib"; |
---|
2066 | |
---|
2067 | // easy example(few seconds), must compute two polynomials of degrees 2 and 3. |
---|
2068 | center(3); |
---|
2069 | |
---|
2070 | kill Usl3; |
---|
2071 | |
---|
2072 | def Ug2 = makeUg2(); // U(g_2) |
---|
2073 | setring Ug2; |
---|
2074 | |
---|
2075 | // show current ring: |
---|
2076 | basering; |
---|
2077 | |
---|
2078 | // easy example(few seconds), must compute one polynomial of degree 2. |
---|
2079 | center(2); |
---|
2080 | |
---|
2081 | // hard example (~hours), must compute two polynomials of degrees 2 and 6. |
---|
2082 | center(6); |
---|
2083 | |
---|
2084 | quit; |
---|
2085 | *******************************************************/ |
---|