- Timestamp:
- Oct 11, 2010, 9:53:40 PM (14 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
- Children:
- 92f670a7754669a5b094209294c8d2af0499650b
- Parents:
- d5abcfb5a8d5981beafb238eb7ab2390e274e781
- Location:
- Singular/LIB
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/dmodapp.lib
rd5abcf rf52e64 10 10 11 11 OVERVIEW: Let K be a field of characteristic 0, R = K[x1,...,xN] and 12 @*D be the Weyl algebra in variables x1,...,xN,d1,...,dN.13 @*In this library there are the following procedures for algebraic D-modules:14 @* 12 D be the Weyl algebra in variables x1,...,xN,d1,...,dN. 13 In this library there are the following procedures for algebraic D-modules: 14 15 15 @* - given a cyclic representation D/I of a holonomic module and a polynomial 16 @*F in R, it is proved that the localization of D/I with respect to the mult.17 @*closed set of all powers of F is a holonomic D-module. Thus we aim to compute18 @*its cyclic representaion D/L for an ideal L in D. The procedures for the19 @*localization are DLoc, SDLoc and DLoc0.20 @* 16 F in R, it is proved that the localization of D/I with respect to the mult. 17 closed set of all powers of F is a holonomic D-module. Thus we aim to compute 18 its cyclic representaion D/L for an ideal L in D. The procedures for the 19 localization are DLoc, SDLoc and DLoc0. 20 21 21 @* - annihilator in D of a given polynomial F from R as well as 22 @*of a given rational function G/F from Quot(R). These can be computed via23 @*procedures annPoly resp. annRat.24 @* 22 of a given rational function G/F from Quot(R). These can be computed via 23 procedures annPoly resp. annRat. 24 25 25 @* - Groebner bases with respect to weights (according to (SST), given an 26 @*arbitrary integer vector containing weights for variables, one computes the27 @*homogenization of a given ideal relative to this vector, then one computes a28 @*Groebner basis and returns the dehomogenization of the result), initial29 @*forms and initial ideals in Weyl algebras with respect to a given weight30 @*vector can be computed with GBWeight, inForm, initialMalgrange and31 @*initialIdealW.32 @* 26 arbitrary integer vector containing weights for variables, one computes the 27 homogenization of a given ideal relative to this vector, then one computes a 28 Groebner basis and returns the dehomogenization of the result), initial 29 forms and initial ideals in Weyl algebras with respect to a given weight 30 vector can be computed with GBWeight, inForm, initialMalgrange and 31 initialIdealW. 32 33 33 @* - restriction and integration of a holonomic module D/I. Suppose I 34 @*annihilates a function F(x1,...,xn). Our aim is to compute an ideal J35 @*directly from I, which annihilates34 annihilates a function F(x1,...,xn). Our aim is to compute an ideal J 35 directly from I, which annihilates 36 36 @* - F(0,...,0,xk,...,xn) in case of restriction or 37 37 @* - the integral of F with respect to x1,...,xm in case of integration. 38 @*The corresponding procedures are restrictionModule, restrictionIdeal,39 @*integralModule and integralIdeal.40 @* 38 The corresponding procedures are restrictionModule, restrictionIdeal, 39 integralModule and integralIdeal. 40 41 41 @* - characteristic varieties defined by ideals in Weyl algebras can be computed 42 @*with charVariety and charInfo.43 @* 42 with charVariety and charInfo. 43 44 44 @* - appelF1, appelF2 and appelF4 return ideals in parametric Weyl algebras, 45 @*which annihilate corresponding Appel hypergeometric functions.45 which annihilate corresponding Appel hypergeometric functions. 46 46 47 47 48 48 References: 49 49 @* (SST) Saito, Sturmfels, Takayama 'Groebner Deformations of Hypergeometric 50 @*Differential Equations', Springer, 200050 Differential Equations', Springer, 2000 51 51 @* (OTW) Oaku, Takayama, Walther 'A Localization Algorithm for D-modules', 52 @*Journal of Symbolic Computation, 200052 Journal of Symbolic Computation, 2000 53 53 @* (OT) Oaku, Takayama 'Algorithms for D-modules', 54 @*Journal of Pure and Applied Algebra, 199854 Journal of Pure and Applied Algebra, 1998 55 55 56 56 … … 100 100 sortIntvec(v); sorts intvec 101 101 102 103 SEE ALSO: bfun_lib, dmod_lib, dmodvar_lib, gmssing_lib104 105 106 102 KEYWORDS: D-module; annihilator of polynomial; annihilator of rational function; 107 103 D-localization; localization of D-module; D-restriction; restriction of 108 104 D-module; D-integration; integration of D-module; characteristic variety; 109 105 Appel function; Appel hypergeometric function 106 107 SEE ALSO: bfun_lib, dmod_lib, dmodvar_lib, gmssing_lib 110 108 "; 111 109 112 113 110 /* 114 CHANGELOG 115 21.09.10 by DA:116 - restructured library for better readability117 - new / improved procs:111 Changelog 112 21.09.10 by DA: 113 - restructured library for better readability 114 - new / improved procs: 118 115 - toolbox: isInt, intRoots, sortIntvec 119 116 - GB wrt weights: GBWeight, initialIdealW rewritten using GBWeight 120 117 - restriction/integration: restrictionX, integralX where X in {Module, Ideal}, 121 118 fourier, inverseFourier, deRhamCohom, deRhamCohomIdeal 122 119 - characteristic variety: charVariety, charInfo 123 - added keywords for features124 - reformated help strings and examples in existing procs125 - added SUPPORT in header126 - added reference (OT)127 128 04.10.10 by DA:129 - incorporated suggestions by Oleksandr Motsak, among other:120 - added keywords for features 121 - reformated help strings and examples in existing procs 122 - added SUPPORT in header 123 - added reference (OT) 124 125 04.10.10 by DA: 126 - incorporated suggestions by Oleksandr Motsak, among other: 130 127 - bugfixes for fl2poly, sortIntvec, annPoly, GBWeight 131 128 - enhanced functionality for deleteGenerator, inForm 129 130 11.10.10 by DA: 131 - procedure bFactor now sorts the roots using new static procedure sortNumberIdeal 132 132 */ 133 133 … … 233 233 s = s[2..size(s)-1]; 234 234 return(s) 235 }235 } 236 236 237 237 static proc intLike (def i) … … 252 252 253 253 proc engine(def I, int i) 254 "USAGE: engine(I,i); I ideal/module/matrix, i an int254 "USAGE: engine(I,i); I ideal/module/matrix, i an int 255 255 RETURN: the same type as I 256 256 PURPOSE: compute the Groebner basis of I with the algorithm, chosen via i … … 287 287 288 288 proc poly2list (poly f) 289 "USAGE: poly2list(f); f a poly289 "USAGE: poly2list(f); f a poly 290 290 RETURN: list of exponents and corresponding terms of f 291 291 PURPOSE: converts a poly to a list of pairs consisting of intvecs (1st entry) … … 326 326 327 327 proc fl2poly(list L, string s) 328 "USAGE: fl2poly(L,s); L a list, s a string328 "USAGE: fl2poly(L,s); L a list, s a string 329 329 RETURN: poly 330 330 PURPOSE: reconstruct a monic polynomial in one variable from its factorization … … 375 375 376 376 proc insertGenerator (list #) 377 "USAGE: insertGenerator(id,p[,k]);377 "USAGE: insertGenerator(id,p[,k]); 378 378 @* id an ideal/module, p a poly/vector, k an optional int 379 379 RETURN: of the same type as id … … 456 456 457 457 proc deleteGenerator (def id, int k) 458 "USAGE: deleteGenerator(id,k); id an ideal/module, k an int458 "USAGE: deleteGenerator(id,k); id an ideal/module, k an int 459 459 RETURN: of the same type as id 460 460 PURPOSE: deletes the k-th generator from the first argument and returns … … 501 501 } 502 502 503 static proc sortNumberIdeal (ideal I) 504 // sorts ideal of constant polys (ie numbers), returns according permutation 505 { 506 int i; 507 int nI = ncols(I); 508 intvec dI; 509 for (i=nI; i>0; i--) 510 { 511 dI[i] = int(denominator(leadcoef(I[i]))); 512 } 513 int lcmI = lcm(dI); 514 for (i=nI; i>0; i--) 515 { 516 dI[i] = int(lcmI*leadcoef(I[i])); 517 } 518 intvec perm = sortIntvec(dI)[2]; 519 return(perm); 520 } 521 example 522 { 523 "EXAMPLE:"; echo = 2; 524 ring r = 0,s,dp; 525 ideal I = -9/20,-11/20,-23/20,-19/20,-1,-13/10,-27/20,-13/20,-21/20,-17/20, 526 -11/10,-9/10,-7/10; // roots of BS poly of reiffen(4,5) 527 intvec v = sortNumberIdeal(I); v; 528 I[v]; 529 } 530 503 531 proc bFactor (poly F) 504 "USAGE: bFactor(f); f poly532 "USAGE: bFactor(f); f poly 505 533 RETURN: list of ideal and intvec and possibly a string 506 534 PURPOSE: tries to compute the roots of a univariate poly f … … 554 582 II = subst(II,var(1),0); 555 583 II = -II; 584 intvec perm = sortNumberIdeal(II); 585 II = II[perm]; 586 mm = mm[perm]; 556 587 if (size(II)>0) 557 588 { … … 591 622 592 623 proc isInt (number n) 593 "USAGE: isInt(n); n a number624 "USAGE: isInt(n); n a number 594 625 RETURN: int, 1 if n is an integer or 0 otherwise 595 626 PURPOSE: check whether given object of type number is actually an int … … 619 650 620 651 proc intRoots (list l) 621 "USAGE: isInt(L); L a list652 "USAGE: isInt(L); L a list 622 653 RETURN: list 623 654 PURPOSE: extracts integer roots from a list given in @code{bFactor} format … … 678 709 679 710 proc sortIntvec (intvec v) 680 "USAGE: sortIntvec(v); v an intvec711 "USAGE: sortIntvec(v); v an intvec 681 712 RETURN: list of two intvecs 682 713 PURPOSE: sorts an intvec … … 760 791 761 792 proc isFsat(ideal I, poly F) 762 "USAGE: isFsat(I, F); I an ideal, F a poly793 "USAGE: isFsat(I, F); I an ideal, F a poly 763 794 RETURN: int, 1 if I is F-saturated and 0 otherwise 764 795 PURPOSE: checks whether the ideal I is F-saturated … … 799 830 800 831 proc annRat(poly g, poly f) 801 "USAGE: annRat(g,f); f, g polynomials832 "USAGE: annRat(g,f); f, g polynomials 802 833 RETURN: ring (a Weyl algebra) containing an ideal 'LD' 803 834 PURPOSE: compute the annihilator of the rational function g/f in the … … 916 947 // Now, compare with the output of Macaulay2: 917 948 ideal tst = 3*x*Dx + 2*y*Dy + 1, y^3*Dy^2 - x^2*Dy^2 + 6*y^2*Dy + 6*y, 918 9*y^2*Dx^2*Dy-4*y*Dy^3+27*y*Dx^2+2*Dy^2, 9*y^3*Dx^2-4*y^2*Dy^2+10*y*Dy -10;919 option(redSB); option(redTail);920 LD = groebner(LD);921 tst = groebner(tst);922 print(matrix(NF(LD,tst))); print(matrix(NF(tst,LD)));923 // So, these two answers are the same949 9*y^2*Dx^2*Dy-4*y*Dy^3+27*y*Dx^2+2*Dy^2, 9*y^3*Dx^2-4*y^2*Dy^2+10*y*Dy -10; 950 option(redSB); option(redTail); 951 LD = groebner(LD); 952 tst = groebner(tst); 953 print(matrix(NF(LD,tst))); print(matrix(NF(tst,LD))); 954 // So, these two answers are the same 924 955 } 925 956 926 957 proc annPoly(poly f) 927 "USAGE: annPoly(f); f a poly958 "USAGE: annPoly(f); f a poly 928 959 RETURN: ring (a Weyl algebra) containing an ideal 'LD' 929 960 PURPOSE: compute the complete annihilator ideal of f in the corresponding … … 992 1023 993 1024 proc DLoc(ideal I, poly F) 994 "USAGE: DLoc(I, f); I an ideal, f a poly1025 "USAGE: DLoc(I, f); I an ideal, f a poly 995 1026 RETURN: list of ideal and list 996 1027 ASSUME: the basering is a Weyl algebra … … 1046 1077 1047 1078 proc DLoc0(ideal I, poly F) 1048 "USAGE: DLoc0(I, f); I an ideal, f a poly1079 "USAGE: DLoc0(I, f); I an ideal, f a poly 1049 1080 RETURN: ring (a Weyl algebra) containing an ideal 'LD0' and a list 'BS' 1050 1081 PURPOSE: compute the presentation of the localization of D/I w.r.t. f^s, … … 1091 1122 dbprint(ppl,"// -2-2- attempt the factorization"); 1092 1123 list PP = factorize(p); //with constants and multiplicities 1093 ideal bs; intvec m; //the Bernstein polynomial is monic, so we are not interested in constants 1124 ideal bs; intvec m; //the Bernstein polynomial is monic, so 1125 // we are not interested in constants 1094 1126 for (i=2; i<= size(PP[1]); i++) //we delete P[1][1] and P[2][1] 1095 1127 { … … 1140 1172 } 1141 1173 } 1142 // if ( size(vP)>=2 )1143 // {1144 // vP = vP[2..size(vP)];1145 // }1174 // if ( size(vP)>=2 ) 1175 // { 1176 // vP = vP[2..size(vP)]; 1177 // } 1146 1178 if ( size(vP)==0 ) 1147 1179 { … … 1159 1191 dbprint(ppl-1, sP); 1160 1192 // int sP = minIntRoot(bbs,1); 1161 // P = normalize(P);1162 // bs = -subst(bs,s,0);1193 // P = normalize(P); 1194 // bs = -subst(bs,s,0); 1163 1195 if (sP >=0) 1164 1196 { … … 1287 1319 1288 1320 proc SDLoc(ideal I, poly F) 1289 "USAGE: SDLoc(I, f); I an ideal, f a poly1321 "USAGE: SDLoc(I, f); I an ideal, f a poly 1290 1322 RETURN: ring (basering extended by a new variable) containing an ideal 'LD' 1291 1323 PURPOSE: compute a generic presentation of the localization of D/I w.r.t. f^s … … 1505 1537 1506 1538 proc GBWeight (ideal I, intvec u, intvec v, list #) 1507 "USAGE: GBWeight(I,u,v [,s,t,w]);1539 "USAGE: GBWeight(I,u,v [,s,t,w]); 1508 1540 @* I ideal, u,v intvecs, s,t optional ints, w an optional intvec 1509 1541 RETURN: ideal, Groebner basis of I w.r.t. the weights u and v … … 1641 1673 1642 1674 proc inForm (def I, intvec w) 1643 "USAGE: inForm(I,w); I ideal or poly, w intvec1675 "USAGE: inForm(I,w); I ideal or poly, w intvec 1644 1676 RETURN: ideal, generated by initial forms of generators of I w.r.t. w, or 1645 1677 @* poly, initial form of input poly w.r.t. w … … 1718 1750 1719 1751 proc initialIdealW(ideal I, intvec u, intvec v, list #) 1720 "USAGE: initialIdealW(I,u,v [,s,t,w]);1752 "USAGE: initialIdealW(I,u,v [,s,t,w]); 1721 1753 @* I ideal, u,v intvecs, s,t optional ints, w an optional intvec 1722 1754 RETURN: ideal, GB of initial ideal of the input ideal wrt the weights u and v … … 1777 1809 1778 1810 proc initialMalgrange (poly f,list #) 1779 "USAGE: initialMalgrange(f,[,a,b,v]); f poly, a,b optional ints, v opt. intvec1811 "USAGE: initialMalgrange(f,[,a,b,v]); f poly, a,b optional ints, v opt. intvec 1780 1812 RETURN: ring, Weyl algebra induced by basering, extended by two new vars t,Dt 1781 1813 PURPOSE: computes the initial Malgrange ideal of a given polynomial w.r.t. the … … 2143 2175 2144 2176 proc restrictionModule (ideal I, intvec w, list #) 2145 "USAGE: restrictionModule(I,w,[,eng,m,G]);2177 "USAGE: restrictionModule(I,w,[,eng,m,G]); 2146 2178 @* I ideal, w intvec, eng and m optional ints, G optional ideal 2147 2179 RETURN: ring (a Weyl algebra) containing a module 'resMod' … … 2265 2297 2266 2298 proc restrictionIdeal (ideal I, intvec w, list #) 2267 "USAGE: restrictionIdeal(I,w,[,eng,m,G]);2299 "USAGE: restrictionIdeal(I,w,[,eng,m,G]); 2268 2300 @* I ideal, w intvec, eng and m optional ints, G optional ideal 2269 2301 RETURN: ring (a Weyl algebra) containing an ideal 'resIdeal' … … 2317 2349 2318 2350 proc fourier (ideal I, list #) 2319 "USAGE: fourier(I[,v]); I an ideal, v an optional intvec2351 "USAGE: fourier(I[,v]); I an ideal, v an optional intvec 2320 2352 RETURN: ideal 2321 2353 PURPOSE: computes the Fourier transform of an ideal in a Weyl algebra … … 2386 2418 2387 2419 proc inverseFourier (ideal I, list #) 2388 "USAGE: inverseFourier(I[,v]); I an ideal, v an optional intvec2420 "USAGE: inverseFourier(I[,v]); I an ideal, v an optional intvec 2389 2421 RETURN: ideal 2390 2422 PURPOSE: computes the inverse Fourier transform of an ideal in a Weyl algebra … … 2455 2487 2456 2488 proc integralModule (ideal I, intvec w, list #) 2457 "USAGE: integralModule(I,w,[,eng,m,G]);2489 "USAGE: integralModule(I,w,[,eng,m,G]); 2458 2490 @* I ideal, w intvec, eng and m optional ints, G optional ideal 2459 2491 RETURN: ring (a Weyl algebra) containing a module 'intMod' … … 2569 2601 2570 2602 proc integralIdeal (ideal I, intvec w, list #) 2571 "USAGE: integralIdeal(I,w,[,eng,m,G]);2603 "USAGE: integralIdeal(I,w,[,eng,m,G]); 2572 2604 @* I ideal, w intvec, eng and m optional ints, G optional ideal 2573 2605 RETURN: ring (a Weyl algebra) containing an ideal 'intIdeal' … … 2616 2648 2617 2649 proc deRhamCohomIdeal (ideal I, list #) 2618 "USAGE: deRhamCohomIdeal (I[,w,eng,k,G]);2650 "USAGE: deRhamCohomIdeal (I[,w,eng,k,G]); 2619 2651 @* I ideal, w optional intvec, eng and k optional ints, G optional ideal 2620 2652 RETURN: ideal … … 2779 2811 2780 2812 proc deRhamCohom (poly f, list #) 2781 "USAGE: deRhamCohom(f[,eng,m]); f poly, eng and m optional ints2813 "USAGE: deRhamCohom(f[,eng,m]); f poly, eng and m optional ints 2782 2814 RETURN: ring (a Weyl Algebra) containing an ideal 'DR' 2783 2815 ASSUME: Basering is a commutative and over a field of characteristic 0. … … 2890 2922 2891 2923 proc appelF1() 2892 "USAGE: appelF1();2924 "USAGE: appelF1(); 2893 2925 RETURN: ring (a parametric Weyl algebra) containing an ideal 'IAppel1' 2894 2926 PURPOSE: defines the ideal in a parametric Weyl algebra, … … 2921 2953 2922 2954 proc appelF2() 2923 "USAGE: appelF2();2955 "USAGE: appelF2(); 2924 2956 RETURN: ring (a parametric Weyl algebra) containing an ideal 'IAppel2' 2925 2957 PURPOSE: defines the ideal in a parametric Weyl algebra, … … 2951 2983 2952 2984 proc appelF4() 2953 "USAGE: appelF4();2985 "USAGE: appelF4(); 2954 2986 RETURN: ring (a parametric Weyl algebra) containing an ideal 'IAppel4' 2955 2987 PURPOSE: defines the ideal in a parametric Weyl algebra, … … 2984 3016 2985 3017 proc charVariety(ideal I, list #) 2986 "USAGE: charVariety(I [,eng]); I an ideal, eng an optional int3018 "USAGE: charVariety(I [,eng]); I an ideal, eng an optional int 2987 3019 RETURN: ring (commutative) containing an ideal 'charVar' 2988 3020 PURPOSE: computes an ideal whose zero set is the characteristic variety of I in … … 3048 3080 3049 3081 proc charInfo(ideal I) 3050 "USAGE: charInfo(I); I an ideal3082 "USAGE: charInfo(I); I an ideal 3051 3083 RETURN: ring (commut.) containing ideals 'charVar','singLoc' and list 'primDec' 3052 3084 PURPOSE: computes characteristic variety of I (in the sense of D-module theory), … … 3106 3138 3107 3139 /* 3108 static proc exCusp()3109 {3140 static proc exCusp() 3141 { 3110 3142 "EXAMPLE:"; echo = 2; 3111 3143 ring r = 0,(x,y,Dx,Dy),dp; … … 3123 3155 setring R; 3124 3156 DLoc(I,F); 3125 }3126 3127 static proc exWalther1()3128 {3157 } 3158 3159 static proc exWalther1() 3160 { 3129 3161 // p.18 Rem 3.10 3130 3162 ring r = 0,(x,Dx),dp; … … 3143 3175 LD0; 3144 3176 BS; 3145 }3146 3147 static proc exWalther2()3148 {3177 } 3178 3179 static proc exWalther2() 3180 { 3149 3181 // p.19 Rem 3.10 cont'd 3150 3182 ring r = 0,(x,Dx),dp; … … 3166 3198 setring R; 3167 3199 DLoc(I,F); 3168 }3169 3170 static proc exWalther3()3171 {3200 } 3201 3202 static proc exWalther3() 3203 { 3172 3204 // can check with annFs too :-) 3173 3205 // p.21 Ex 3.15 … … 3197 3229 setring R; 3198 3230 DLoc(I,F); 3199 }3200 3201 static proc ex_annRat()3202 {3231 } 3232 3233 static proc ex_annRat() 3234 { 3203 3235 // more complicated example for annRat 3204 3236 ring r = 0,(x,y,z),dp; … … 3207 3239 def A = annRat(g,f); 3208 3240 setring A; 3209 }3241 } 3210 3242 */ -
Singular/LIB/dmodvar.lib
rd5abcf rf52e64 5 5 LIBRARY: dmodvar.lib Algebraic D-modules for varieties 6 6 7 AUTHORS: Daniel Andres, daniel.andres@math.rwth-aachen.de 8 Viktor Levandovskyy, levandov@math.rwth-aachen.de 9 Jorge Martin-Morales, jorge@unizar.es 10 11 OVERVIEW: 12 Theory: Let K be a field of characteristic 0. Given a polynomial ring R = K[x_1,...,x_n] and 13 @* a set of polynomial f_1,..., f_r in R, define F = f_1 * ... * f_r and F^s:=f_1^s_1*...*f_r^s_r 14 @* for symbolic discrete (that is shiftable) variables s_1,..., s_r. 15 @* The module R[1/F]*F^s has a structure of a D<S>-module, where 16 D<S> := D(R) tensored with S over K, where 17 @* - D(R) is an n-th Weyl algebra K<x_1,...,x_n,d_1,...,d_n | d_j x_j = x_j d_j +1> 18 @* - S is the universal enveloping algebra of gl_r, generated by s_{ij}, where s_{ii}=s_i. 7 AUTHORS: Daniel Andres, daniel.andres@math.rwth-aachen.de 8 @* Viktor Levandovskyy, levandov@math.rwth-aachen.de 9 @* Jorge Martin-Morales, jorge@unizar.es 10 11 OVERVIEW: Let K be a field of characteristic 0. Given a polynomial ring R = K[x_1,...,x_n] 12 and polynomials f_1,...,f_r in R, define F = f_1*...*f_r and F^s = f_1^s_1*...*f_r^s_r 13 for symbolic discrete (that is shiftable) variables s_1,..., s_r. 14 The module R[1/F]*F^s has the structure of a D<S>-module, where D<S> = D(R) 15 tensored with S over K, where 16 @* - D(R) is the n-th Weyl algebra K<x_1,...,x_n,d_1,...,d_n | d_j x_j = x_j d_j + 1> 17 @* - S is the universal enveloping algebra of gl_r, generated by s_i = s_{ii}. 19 18 @* One is interested in the following data: 20 @* 21 @* - global Bernstein polynomial in one variable s = s_1 + ...+s_r, denoted by bs,22 @* - its minimal integer root s0, the list of all roots of bs, which are known23 @* to benegative rational numbers, with their multiplicities, which is denoted by BS24 @* 25 @*sum(k=1 to k=r) P_k*f_k*F^s = bs*F^s holds in R[1/F]*F^s.19 @* - the left ideal Ann F^s in D<S>, usually denoted by LD in the output 20 @* - global Bernstein polynomial in one variable s = s_1+...+s_r, denoted by bs, 21 @* - its minimal integer root s0, the list of all roots of bs, which are known to be 22 negative rational numbers, with their multiplicities, which is denoted by BS 23 @* - an r-tuple of operators in D<S>, denoted by PS, such that the functional equality 24 sum(k=1 to k=r) P_k*f_k*F^s = bs*F^s holds in R[1/F]*F^s. 26 25 27 26 References: 28 (BMS06) Budur, Mustata, Saito: Bernstein-Sato polynomials of arbitrary varieties (2006). 29 (ALM09) Andres, Levandovskyy, Martin-Morales : Principal Intersection and Bernstein-Sato Polynomial of an Affine Variety (2009). 27 (BMS06) Budur, Mustata, Saito: Bernstein-Sato polynomials of arbitrary varieties (2006). 28 @* (ALM09) Andres, Levandovskyy, Martin-Morales: Principal Intersection and Bernstein-Sato 29 Polynomial of an Affine Variety (2009). 30 30 31 31 32 PROCEDURES: 32 bfctVarIn(F[,L]); compute the roots of the Bernstein-Sato polynomial b(s) of the variety V(F) using initial ideal approach 33 bfctVarAnn(F[,L]); compute the roots of the Bernstein-Sato polynomial b(s) of the variety V(F) using Sannfs approach 34 SannfsVar(F[,O,e]); compute the annihilator of F^s in the ring D<S> 33 bfctVarIn(F[,L]); computes the roots of the Bernstein-Sato polynomial b(s) of the variety V(F) using initial ideal approach 34 bfctVarAnn(F[,L]); computes the roots of the Bernstein-Sato polynomial b(s) of the variety V(F) using Sannfs approach 35 SannfsVar(F[,O,e]); computes the annihilator of F^s in the ring D<S> 36 makeMalgrange(F[,ORD]); creates the Malgrange ideal, associated with F = F[1],..,F[P] 35 37 36 38 SEE ALSO: bfun_lib, dmod_lib, dmodapp_lib, gmssing_lib … … 39 41 Weyl algebra; parametric annihilator for variety; Budur-Mustata-Saito approach; initial ideal approach 40 42 "; 41 //AUXILIARY PROCEDURES: 42 //makeIF(F[,ORD]); create the Malgrange ideal, associated with F = F[1],..,F[P] 43 44 43 44 /* 45 45 // Static procs: 46 // coDim(I); compute the codimension of the leading ideal of I46 // coDim(I); compute the codimension of the leading ideal of I 47 47 // dmodvarAssumeViolation() 48 48 // ORDstr2list (ORD, NN) 49 49 // smallGenCoDim(I,k) 50 */ 51 52 /* 53 CHANGELOG 54 11.10.10 by DA: 55 - reformated help strings 56 - simplified code 57 - add and use of safeVarName 58 - renamed makeIF to makeMalgrange 59 */ 50 60 51 61 … … 59 69 proc testdmodvarlib () 60 70 { 61 "AUXILIARY PROCEDURES:"; 62 example makeIF; 63 "MAIN PROCEDURES:"; 71 example makeMalgrange; 64 72 example bfctVarIn; 65 73 example bfctVarAnn; 66 74 example SannfsVar; 67 75 } 68 69 76 // example coDim; 70 77 … … 73 80 static proc dmodvarAssumeViolation() 74 81 { 75 // returns Boolean : yes/no [for assume violation] 76 // char K = 0 77 // no qring 82 // char K = 0, no qring 78 83 if ( (size(ideal(basering)) >0) || (char(basering) >0) ) 79 84 { 80 // "ERROR: no qring is allowed"; 81 return(1); 82 } 83 return(0); 84 } 85 ERROR("Basering is inappropriate: characteristic>0 or qring present"); 86 } 87 return(); 88 } 89 90 static proc safeVarName (string s, string cv) 91 // assumes 's' to be a valid variable name 92 // returns valid var name string @@..@s 93 { 94 string S; 95 if (cv == "v") { S = "," + "," + varstr(basering) + ","; } 96 if (cv == "c") { S = "," + "," + charstr(basering) + ","; } 97 if (cv == "cv") { S = "," + charstr(basering) + "," + varstr(basering) + ","; } 98 s = "," + s + ","; 99 while (find(S,s) <> 0) 100 { 101 s[1] = "@"; 102 s = "," + s; 103 } 104 s = s[2..size(s)-1]; 105 return(s) 106 } 85 107 86 108 // da: in smallGenCoDim(), rewritten using mstd business 87 109 static proc coDim (ideal I) 88 "USAGE: coDim (I); I an ideal110 "USAGE: coDim (I); I an ideal 89 111 RETURN: int 90 112 PURPOSE: computes the codimension of the ideal generated by the leading monomials 91 @*of the given generators of the ideal. This is also the codimension of92 @*the ideal if it is represented by a standard basis.113 of the given generators of the ideal. This is also the codimension of 114 the ideal if it is represented by a standard basis. 93 115 NOTE: The codimension of an ideal I means the number of variables minus the 94 @*Krull dimension of the basering modulo I.95 EXAMPLE: example SannfsVar; shows examples116 Krull dimension of the basering modulo I. 117 EXAMPLE: example coDim; shows examples 96 118 " 97 119 { … … 122 144 123 145 proc SannfsVar (ideal F, list #) 124 "USAGE: SannfsVar(F [,ORD,eng]); F an ideal, ORD an optional string, eng an optional int 125 RETURN: ring 126 PURPOSE: compute the D<S>-module structure of D<S>*f^s where f = F[1]*..*F[P] 127 and D<S> is the Weyl algebra D tensored with K<S>=U(gl_P), according to the 128 generalized algorithm by Briancon and Maisonobe for affine varieties. 129 NOTE: activate this ring with the @code{setring} command. 130 @* In the ring D<S>, the ideal LD is the needed D<S>-module structure. 131 @* The value of ORD must be an elimination ordering in D<Dt,S> for Dt 132 @* written in the string form, otherwise the result may have no meaning. 133 @* By default ORD = '(a(1..(P)..1),a(1..(P+P^2)..1),dp)'. 134 @* If eng<>0, @code{std} is used for Groebner basis computations, 135 @* otherwise, and by default @code{slimgb} is used. 136 @* If printlevel=1, progress debug messages will be printed, 137 @* if printlevel>=2, all the debug messages will be printed. 146 "USAGE: SannfsVar(F [,ORD,eng]); F an ideal, ORD an optional string, eng an optional int 147 RETURN: ring (Weyl algebra tensored with U(gl_P)), containing an ideal LD 148 PURPOSE: compute the D<S>-module structure of D<S>*f^s where f = F[1]*...*F[P] 149 and D<S> is the Weyl algebra D tensored with K<S>=U(gl_P), according to the 150 generalized algorithm by Briancon and Maisonobe for affine varieties 151 ASSUME: The basering is commutative and over a field of characteristic 0. 152 NOTE: Activate the output ring D<S> with the @code{setring} command. 153 In the ring D<S>, the ideal LD is the needed D<S>-module structure. 154 @* The value of ORD must be an elimination ordering in D<Dt,S> for Dt 155 written in the string form, otherwise the result may have no meaning. 156 By default ORD = '(a(1..(P)..1),a(1..(P+P^2)..1),dp)'. 157 @* If eng<>0, @code{std} is used for Groebner basis computations, 158 otherwise, and by default @code{slimgb} is used. 159 DISPLAY: If printlevel=1, progress debug messages will be printed, 160 @* if printlevel>=2, all the debug messages will be printed. 138 161 EXAMPLE: example SannfsVar; shows examples 139 162 " 140 163 { 141 if (dmodvarAssumeViolation()) 142 { 143 ERROR("Basering is inappropriate: characteristic>0 or qring present"); 144 } 164 dmodvarAssumeViolation(); 145 165 if (!isCommutative()) 146 166 { … … 173 193 eng = int(#[2]); 174 194 } 175 else176 {177 eng = 0;178 }179 }180 else181 {182 // no second arg183 eng = 0;184 195 } 185 196 } … … 215 226 for (i=1; i<=P; i++) 216 227 { 217 RName[i] = "Dt("+string(i)+")";228 RName[i] = safeVarName("Dt("+string(i)+")","cv"); 218 229 for (j=1; j<=P; j++) 219 230 { 220 st = "s("+string(i)+")("+string(j)+")"; 221 RName[P+(i-1)*P+j] = st; 222 } 223 } 224 for(i=1; i<=N; i++) 225 { 226 for(j=1; j<=size(RName); j++) 227 { 228 if (Name[i] == RName[j]) 229 { 230 ERROR("Variable names should not include Dt(i), s(i)(j)"); 231 } 231 RName[P+(i-1)*P+j] = safeVarName("s("+string(i)+")("+string(j)+")","cv"); 232 232 } 233 233 } … … 236 236 for(i=1; i<=N; i++) 237 237 { 238 DName[i] = "D"+Name[i]; //concat238 DName[i] = safeVarName("D"+Name[i],"cv"); //concat 239 239 } 240 240 list NName = RName + Name + DName; … … 258 258 { 259 259 //[sij,Dtk] = djk*Dti 260 @D[k,P+(i-1)*P+j] = (j==k)*Dt(i); 260 // @D[k,P+(i-1)*P+j] = (j==k)*Dt(i); 261 @D[k,P+(i-1)*P+j] = (j==k)*var(i); 261 262 for (l=1; l<=P; l++) 262 263 { … … 264 265 { 265 266 //[sij,skl] = djk*sil - dil*skj 266 @D[P+(i-1)*P+j,P+(k-1)*P+l] = -(j==k)*s(i)(l) + (i==l)*s(k)(j); 267 // @D[P+(i-1)*P+j,P+(k-1)*P+l] = -(j==k)*s(i)(l) + (i==l)*s(k)(j); 268 @D[P+(i-1)*P+j,P+(k-1)*P+l] = -(j==k)*var(i*P+l) + (i==l)*var(k*P+j); 267 269 } 268 270 } … … 288 290 for (j=1; j<=P; j++) 289 291 { 290 I[(i-1)*P+j] = Dt(i)*F[j] + s(i)(j); 292 // I[(i-1)*P+j] = Dt(i)*F[j] + s(i)(j); 293 I[(i-1)*P+j] = var(i)*F[j] + var(i*P+j); 291 294 } 292 295 } … … 297 300 for (j=1; j<=P; j++) 298 301 { 299 q = Dt(j); 302 // q = Dt(j); 303 q = var(j); 300 304 q = q*diff(F[j],var(P+P^2+i)); 301 305 p = p + q; … … 304 308 } 305 309 // -------- the ideal I is ready ---------- 306 dbprint(ppl,"// -1-2- starting the elimination of "+string(Dt(1..P))+"in @R");310 dbprint(ppl,"// -1-2- starting the elimination of Dt(i) in @R"); 307 311 dbprint(ppl-1, I); 308 312 ideal J = engine(I,eng); … … 363 367 def A = SannfsVar(F); 364 368 setring A; 369 A; 365 370 LD; 366 371 } 367 372 368 373 proc bfctVarAnn (ideal F, list #) 369 "USAGE: bfctVarAnn(F[,gid,eng]); F an ideal, gid,eng optional ints374 "USAGE: bfctVarAnn(F[,gid,eng]); F an ideal, gid,eng optional ints 370 375 RETURN: list of an ideal and an intvec 371 376 PURPOSE: computes the roots of the Bernstein-Sato polynomial and their multiplicities 372 @* for an affine algebraic variety defined by F = F[1],..,F[r]. 373 ASSUME: The basering is a commutative polynomial ring in char 0. 374 BACKGROUND: In this proc, the annihilator of f^s in D[s] is computed and then a 375 @* system of linear equations is solved by linear reductions in order to 376 @* find the minimal polynomial of S = s(1)(1) + ... + s(P)(P) 377 NOTE: In the output list, the ideal contains all the roots and the intvec their multiplicities. 378 @* If gid<>0, the ideal is used as given. Otherwise, and by default, a 379 @* heuristically better suited generating set is used. 380 @* If eng<>0, @code{std} is used for GB computations, 381 @* otherwise, and by default, @code{slimgb} is used. 377 for an affine algebraic variety defined by F = F[1],..,F[r]. 378 ASSUME: The basering is commutative and over a field in char 0. 379 NOTE: In the output list, the ideal contains all the roots and 380 the intvec their multiplicities. 381 @* If gid<>0, the ideal is used as given. Otherwise, and by default, a 382 heuristically better suited generating set is used. 383 @* If eng<>0, @code{std} is used for GB computations, 384 otherwise, and by default, @code{slimgb} is used. 385 @* Computational remark: The time of computation can be very different depending 386 on the chosen generators of F, although the result is always the same. 387 @* Further note that in this proc, the annihilator of f^s in D[s] is computed and 388 then a system of linear equations is solved by linear reductions in order to 389 find the minimal polynomial of S = s(1)(1) + ... + s(P)(P). 390 The resulted is shifted by 1-codim(Var(F)) following (BMS06). 382 391 DISPLAY: If printlevel=1, progress debug messages will be printed, 383 @* if printlevel=2, all the debug messages will be printed. 384 COMPUTATIONAL REMARK: The time of computation can be very different depending 385 @* on the chosen generators of F, although the result is always the same. 392 @* if printlevel=2, all the debug messages will be printed. 386 393 EXAMPLE: example bfctVarAnn; shows examples 387 394 " 388 395 { 389 if (dmodvarAssumeViolation()) 390 { 391 ERROR("Basering is inappropriate: characteristic>0 or qring present"); 392 } 396 dmodvarAssumeViolation(); 393 397 if (!isCommutative()) 394 398 { … … 420 424 def @R2 = SannfsVar(F,eng); 421 425 printlevel = printlevel-1; 426 int sF = size(F); // no 0 in F 422 427 setring @R2; 423 428 // we are in D[s] and LD is a std of SannfsVar(F) … … 433 438 poly S; 434 439 int i; 435 for (i=1; i<=size(F); i++) 436 { 437 S = S + s(i)(i); 440 for (i=1; i<=sF; i++) 441 { 442 // S = S + s(i)(i); 443 S = S + var((i-1)*sF+i); 438 444 } 439 445 dbprint(ppl,"// -4-1- computing the minimal polynomial of S"); 440 //dbprint(ppl-1,"S = "+string(S));441 moduleM = pIntersect(S,K);446 dbprint(ppl-1,"S = "+string(S)); 447 vector M = pIntersect(S,K); 442 448 dbprint(ppl,"// -4-2- the minimal polynomial has been computed"); 443 //dbprint(ppl-1,M);444 449 ring @R3 = 0,s,dp; 445 dbprint(ppl,"// -5-1- the ring @R3(s) is ready"); 446 dbprint(ppl-1,@R3); 447 ideal M = imap(@R2,M); 448 //kill @R2; 449 poly p; 450 for (i=1; i<=size(M); i++) 451 { 452 p = p + M[i]*s^(i-1); 453 } 454 dbprint(ppl,"// -5-2- factorization of the minimal polynomial"); 455 list P = factorize(p); //with constants and multiplicities 456 dbprint(ppl-1,P); //the Bernstein polynomial is monic, 457 ideal bs; intvec m; //so we are not interested in constants 458 for (i=2; i<=ncols(P[1]); i++) //and that is why we delete P[1][1] and P[2][1] 459 { 460 bs[i-1] = P[1][i]; 461 m[i-1] = P[2][i]; 462 } 463 // convert factors to a list of their roots and multiplicities 464 bs = normalize(bs); 465 bs = -subst(bs,s,0); 450 vector M = imap(@R2,M); 451 poly p = vec2poly(M); 452 dbprint(ppl-1,p); 453 dbprint(ppl,"// -5-1- codimension of the variety"); 454 dbprint(ppl-1,cd); 455 dbprint(ppl,"// -5-2- shifting BS(s)=minpoly(s-codim+1)"); 456 p = subst(p,var(1),var(1)-cd+1); 457 dbprint(ppl-1,p); 458 dbprint(ppl,"// -5-3- factorization of the minimal polynomial"); 459 list BS = bFactor(p); 466 460 setring save; 467 // ideal GF = imap(@R2,GF); 468 // attrib(GF,"isSB",1); 469 kill @R2; 470 dbprint(ppl,"// -5-3- codimension of the variety"); 471 // int cd = coDim(GF); 472 dbprint(ppl-1,cd); 473 ideal bs = imap(@R3,bs); 474 dbprint(ppl,"// -5-4- shifting BS(s)=minpoly(s-codim+1)"); 475 for (i=1; i<=ncols(bs); i++) 476 { 477 bs[i] = bs[i] + cd - 1; 478 } 479 kill @R3; 480 list BS = bs,m; 461 list BS = imap(@R3,BS); 462 kill @R2,@R3; 481 463 return(BS); 482 464 } … … 489 471 } 490 472 491 static proc makeIF(ideal F, list #)492 "USAGE: makeIF(F [,ORD]); F an ideal, ORD an optional string493 RETURN: ring 494 PURPOSE: create the ideal by Malgrange associated with F = F[1],.. ,F[P].495 NOTE: activate thisring with the @code{setring} command. In this ring,496 @* -the ideal IF is the ideal by Malgrange corresponding to F.497 @* 498 @*written in the string form. By default ORD = 'dp'.499 @*If printlevel=1, progress debug messages will be printed,500 @* 501 EXAMPLE: example make IF; shows examples473 proc makeMalgrange (ideal F, list #) 474 "USAGE: makeMalgrange(F [,ORD]); F an ideal, ORD an optional string 475 RETURN: ring (Weyl algebra) containing an ideal IF 476 PURPOSE: create the ideal by Malgrange associated with F = F[1],...,F[P]. 477 NOTE: Activate the output ring with the @code{setring} command. In this ring, 478 the ideal IF is the ideal by Malgrange corresponding to F. 479 @* The value of ORD must be an arbitrary ordering in K<_t,_x,_Dt,_Dx> 480 written in the string form. By default ORD = 'dp'. 481 DISPLAY: If printlevel=1, progress debug messages will be printed, 482 @* if printlevel>=2, all the debug messages will be printed. 483 EXAMPLE: example makeMalgrange; shows examples 502 484 " 503 485 { … … 528 510 for (i=1; i<=P; i++) 529 511 { 530 TName[i] = "t("+string(i)+")"; 531 DTName[i] = "Dt("+string(i)+")"; 532 } 533 for (i=1; i<=N; i++) 534 { 535 for (j=1; j<=P; j++) 536 { 537 if (Name[i] == TName[j]) 538 { 539 ERROR("Variable names should not include t(i)"); 540 } 541 } 512 TName[i] = safeVarName("t("+string(i)+")","cv"); 513 DTName[i] = safeVarName("Dt("+string(i)+")","cv"); 542 514 } 543 515 //now, create the names for new vars … … 545 517 for (i=1; i<=N; i++) 546 518 { 547 DName[i] = "D"+Name[i]; //concat519 DName[i] = safeVarName("D"+Name[i],"cv"); //concat 548 520 } 549 521 list NName = TName + Name + DTName + DName; … … 556 528 def @R@ = ring(L); 557 529 setring @R@; 558 matrix @D[Nnew][Nnew]; 559 for (i=1; i<=N+P; i++) 560 { 561 @D[i,i+N+P]=1; 562 } 563 def @R = nc_algebra(1,@D); 530 def @R = Weyl(); 564 531 setring @R; 565 532 kill @R@; … … 571 538 for (j=1; j<=P; j++) 572 539 { 573 I[j] = t(j) - F[j]; 540 // I[j] = t(j) - F[j]; 541 I[j] = var(j) - F[j]; 574 542 } 575 543 poly p,q; … … 579 547 for (j=1; j<=P; j++) 580 548 { 581 q = Dt(j); 549 // q = Dt(j); 550 q = var(P+N+j); 582 551 q = diff(F[j],var(P+i))*q; 583 552 p = p + q; … … 595 564 ring R = 0,(x,y,z),Dp; 596 565 ideal I = x^2+y^3, z; 597 def W = make IF(I);566 def W = makeMalgrange(I); 598 567 setring W; 568 W; 599 569 IF; 600 570 } 601 571 602 572 proc bfctVarIn (ideal I, list #) 603 "USAGE: bfctVarIn(I [,a,b,c]); I an ideal, a,b,c optional ints573 "USAGE: bfctVarIn(I [,a,b,c]); I an ideal, a,b,c optional ints 604 574 RETURN: list of ideal and intvec 605 575 PURPOSE: computes the roots of the Bernstein-Sato polynomial and their 606 @* multiplicities for an affine algebraic variety defined by I. 607 ASSUME: The basering is commutative and of characteristic 0. 608 @* Varnames of the basering do not include t(1),...,t(r) and 609 @* Dt(1),...,Dt(r), where r is the number of entries of the input ideal. 610 BACKGROUND: In this proc, the initial ideal of the multivariate Malgrange ideal 611 @* defined by I is computed and then a system of linear equations is solved 612 @* by linear reductions following the ideas by Noro. 576 multiplicities for an affine algebraic variety defined by I. 577 ASSUME: The basering is commutative and over a field of characteristic 0. 578 @* Varnames of the basering do not include t(1),...,t(r) and 579 Dt(1),...,Dt(r), where r is the number of entries of the input ideal. 613 580 NOTE: In the output list, say L, 614 @* - L[1] of type ideal contains all the rational roots of a b-function, 615 @* - L[2] of type intvec contains the multiplicities of above roots, 616 @* - optional L[3] of type string is the part of b-function without 617 @* rational roots. 618 @* Note, that a b-function of degree 0 is encoded via L[1][1]=0, L[2]=0 and 619 @* L[3] is 1 (for nonzero constant) or 0 (for zero b-function). 620 @* If a<>0, the ideal is used as given. Otherwise, and by default, a 621 @* heuristically better suited generating set is used to reduce computation 622 @* time. 623 @* If b<>0, @code{std} is used for GB computations in characteristic 0, 624 @* otherwise, and by default, @code{slimgb} is used. 625 @* If c<>0, a matrix ordering is used for GB computations, otherwise, 626 @* and by default, a block ordering is used. 581 @* - L[1] of type ideal contains all the rational roots of a b-function, 582 @* - L[2] of type intvec contains the multiplicities of above roots, 583 @* - optional L[3] of type string is the part of b-function without rational roots. 584 @* Note, that a b-function of degree 0 is encoded via L[1][1]=0, L[2]=0 and 585 L[3] is 1 (for nonzero constant) or 0 (for zero b-function). 586 @* If a<>0, the ideal is used as given. Otherwise, and by default, a 587 heuristically better suited generating set is used to reduce computation time. 588 @* If b<>0, @code{std} is used for GB computations in characteristic 0, 589 otherwise, and by default, @code{slimgb} is used. 590 @* If c<>0, a matrix ordering is used for GB computations, otherwise, 591 and by default, a block ordering is used. 592 @* Further note, that in this proc, the initial ideal of the multivariate Malgrange 593 ideal defined by I is computed and then a system of linear equations is solved 594 by linear reductions following the ideas by Noro. 595 The result is shifted by 1-codim(Var(F)) following (BMS06). 627 596 DISPLAY: If printlevel=1, progress debug messages will be printed, 628 @* 597 @* if printlevel>=2, all the debug messages will be printed. 629 598 EXAMPLE: example bfctVarIn; shows examples 630 599 " 631 600 { 632 if (dmodvarAssumeViolation()) 633 { 634 ERROR("Basering is inappropriate: characteristic>0 or qring present"); 635 } 601 dmodvarAssumeViolation(); 636 602 if (!isCommutative()) 637 603 { … … 674 640 // step 1: setting up the multivariate Malgrange ideal 675 641 int r = size(I); 676 def D = make IF(I);642 def D = makeMalgrange(I); 677 643 setring D; 678 644 dbprint(ppl-1,"// Computing in " + string(n+r) + "-th Weyl algebra:", D); … … 692 658 { 693 659 ideal B = L[1]; 694 for (i=1; i<=ncols(B); i++) 695 { 696 B[i] = -B[i]+c-r-1; 697 } 698 L[1] = B; 660 ideal BB; 661 int nB = ncols(B); 662 for (i=nB; i>0; i--) 663 { 664 BB[i] = -B[nB-i+1]+c-r-1; 665 } 666 L[1] = BB; 699 667 } 700 668 else // should never get here: BS poly has non-rational roots … … 722 690 static proc smallGenCoDim (ideal I, int Iasgiven) 723 691 { 724 // call from K[x] 725 // returns list L 692 // call from K[x], returns list L 726 693 // L[1]=I or L[1]=smaller generating set of I 727 694 // L[2]=codimension(I) 728 int ppl = printlevel - voice + 3;695 int ppl = printlevel - voice + 2; 729 696 int n = nvars(basering); 730 697 int c; … … 791 758 } 792 759 793 760 /* 794 761 // Some more examples 795 762 796 763 static proc TXcups() 797 764 { 798 799 800 801 802 803 804 805 806 807 765 "EXAMPLE:"; echo = 2; 766 //TX tangent space of X=V(x^2+y^3) 767 ring R = 0,(x0,x1,y0,y1),Dp; 768 ideal F = x0^2+y0^3, 2*x0*x1+3*y0^2*y1; 769 printlevel = 0; 770 //ORD = "(a(1,1),a(1,1,1,1,1,1),dp)"; 771 //eng = 0; 772 def A = SannfsVar(F); 773 setring A; 774 LD; 808 775 } 809 776 810 777 static proc ex47() 811 778 { 812 813 814 815 816 817 779 ring r7 = 0,(x0,x1,y0,y1),dp; 780 ideal I = x0^2+y0^3, 2*x0*x1+3*y0^2*y1; 781 bfctVarIn(I); 782 // second ex - too big 783 ideal J = x0^4+y0^5, 4*x0^3*x1+5*y0^4*y1; 784 bfctVarIn(J); 818 785 } 819 786 820 787 static proc ex48() 821 788 { 822 823 824 789 ring r8 = 0,(x1,x2,x3),dp; 790 ideal I = x1^3-x2*x3, x2^2-x1*x3, x3^2-x1^2*x2; 791 bfctVarIn(I); 825 792 } 826 793 827 794 static proc ex49 () 828 795 { 829 830 831 796 ring r9 = 0,(z1,z2,z3,z4),dp; 797 ideal I = z3^2-z2*z4, z2^2*z3-z1*z4, z2^3-z1*z3; 798 bfctVarIn(I); 832 799 } 833 800 834 801 static proc ex410() 835 802 { 836 837 838 839 840 841 803 LIB "toric.lib"; 804 ring r = 0,(z(1..7)),dp; 805 intmat A[3][7]; 806 A = 6,4,2,0,3,1,0,0,1,2,3,0,1,0,0,0,0,0,1,1,2; 807 ideal I = toric_ideal(A,"pt"); 808 I = std(I); 842 809 //ideal I = z(6)^2-z(3)*z(7), z(5)*z(6)-z(2)*z(7), z(5)^2-z(1)*z(7), 843 810 // z(4)*z(5)-z(3)*z(6), z(3)*z(5)-z(2)*z(6), z(2)*z(5)-z(1)*z(6), 844 811 // z(3)^2-z(2)*z(4), z(2)*z(3)-z(1)*z(4), z(2)^2-z(1)*z(3); 845 bfctVarIn(I,1); // no result yet 846 } 812 bfctVarIn(I,1); // no result yet 813 } 814 */ -
Singular/LIB/ncfactor.lib
rd5abcf rf52e64 979 979 result = list(list(1,h)); 980 980 }//only the trivial factorization could be found 981 return(result); 981 //now, refine the possible redundant list 982 return( refineFactList(result) ); 982 983 }//proc facFirstWeyl 983 984 example … … 1595 1596 }//Nontrivial factorization 1596 1597 }//recursively factorize factors 1597 return(result); 1598 //now, refine the possible redundant list 1599 return( refineFactList(result) ); 1598 1600 }//facFirstShift 1599 1601 example … … 1841 1843 1842 1844 */ 1845 1846 /* more things from Martin Lee to fix: 1847 1848 ring R = 0,(x,s),dp; 1849 def r = nc_algebra(1,s); 1850 setring(r); 1851 poly h = (s2*x+x)*s; 1852 h= h* (x+s); 1853 def l= facFirstShift(h); 1854 l; // contained doubled entries 1855 1856 1857 ring R = 0,(x,s),dp; 1858 def r = nc_algebra(1,-1); 1859 setring(r); 1860 poly h = (s2*x+x)*s; 1861 h= h* (x+s); 1862 def l= facFirstWeyl(h); 1863 l; // contained doubled entries: not anymore, fixed! 1864 1865 */ 1866 1867 static proc refineFactList(list L) 1868 { 1869 // assume: list L is an output of factorization proc 1870 // doing: remove doubled entries 1871 int s = size(L); int sm; 1872 int i,j,k,cnt; 1873 list M, U, A, B; 1874 A = L; 1875 k = 0; 1876 cnt = 1; 1877 for (i=1; i<=s; i++) 1878 { 1879 if (size(A[i]) != 0) 1880 { 1881 M = A[i]; 1882 // "probing with"; M; i; 1883 B[cnt] = M; cnt++; 1884 for (j=i+1; j<=s; j++) 1885 { 1886 // if ( (size(L[j]) == sm) && (isEqualList(M,L[j])) ) 1887 if ( isEqualList(M,A[j]) ) 1888 { 1889 k++; 1890 // U consists of intvecs with equal pairs 1891 U[k] = intvec(i,j); 1892 A[j] = 0; 1893 } 1894 } 1895 } 1896 } 1897 kill A,U,M; 1898 return(B); 1899 } 1900 example 1901 { 1902 "EXAMPLE:";echo=2; 1903 ring R = 0,(x,s),dp; 1904 def r = nc_algebra(1,1); 1905 setring(r); 1906 list l,m; 1907 l = list(1,s2+1,x,s,x+s); 1908 m = l,list(1,s,x,s,x),l; 1909 refineFactList(m); 1910 } 1911 1912 static proc isEqualList(list L, list M) 1913 { 1914 // int boolean: 1=yes, 0 =no : test whether two lists are identical 1915 int s = size(L); 1916 if (size(M)!=s) { return(0); } 1917 int j=1; 1918 while ( (L[j]==M[j]) && (j<s) ) 1919 { 1920 j++; 1921 } 1922 if (L[j]==M[j]) 1923 { 1924 return(1); 1925 } 1926 return(0); 1927 } 1928 example 1929 { 1930 "EXAMPLE:";echo=2; 1931 ring R = 0,(x,s),dp; 1932 def r = nc_algebra(1,1); 1933 setring(r); 1934 list l,m; 1935 l = list(1,s2+1,x,s,x+s); 1936 m = l; 1937 isEqualList(m,l); 1938 }
Note: See TracChangeset
for help on using the changeset viewer.