Changeset d033934 in git
- Timestamp:
- Oct 8, 2010, 5:51:28 PM (14 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38077648e7239f98078663eb941c3c979511150a')
- Children:
- 16f3ec8acc0e5cac82cb4932f043eb71a823aeb4
- Parents:
- 06b868f104bd8bb9bbaee58e1dc3d68022ae66a3
- Location:
- Singular/LIB
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/dmod.lib
r06b868 rd033934 5 5 LIBRARY: dmod.lib Algorithms for algebraic D-modules 6 6 AUTHORS: Viktor Levandovskyy, levandov@math.rwth-aachen.de 7 Jorge Martin Morales, jorge@unizar.es7 @* Jorge Martin Morales, jorge@unizar.es 8 8 9 9 OVERVIEW: 10 10 Theory: Let K be a field of characteristic 0. Given a polynomial ring 11 R = K[x_1,...,x_n] and a polynomial F in R,12 one is interested in the R[1/F]-module of rank one, generated by13 the symbol F^s for a symbolic discrete variable s.14 In fact, the module R[1/F]*F^s has a structure of a D(R)[s]-module, where D(R)15 is an n-th Weyl algebra K<x_1,...,x_n,d_1,...,d_n | d_j x_j = x_j d_j +1> and16 D(R)[s] = D(R) tensored with K[s] over K.17 Constructively, one needs to find a left ideal I = I(F^s) in D(R), such18 that K[x_1,...,x_n,1/F]*F^s is isomorphic to D(R)/I as a D(R)-module.19 We often write just D for D(R) and D[s] for D(R)[s].20 One is interested in the following data:21 - Ann F^s = I = I(F^s) in D(R)[s], denoted by LD in the output22 - global Bernstein polynomial in K[s], denoted by bs,23 - its minimal integer root s0, the list of all roots of bs, which are known24 to be rational, with their multiplicities, which is denoted by BS25 - Ann F^s0 = I(F^s0) in D(R), denoted by LD0 in the output26 (LD0 is a holonomic ideal in D(R))27 - Ann^(1) F^s in D(R)[s], denoted by LD1 (logarithmic derivations)28 - an operator in D(R)[s], denoted by PS, such that the functional equality29 PS*F^(s+1) = bs*F^s holds in K[x_1,...,x_n,1/F]*F^s.11 @* R = K[x_1,...,x_n] and a polynomial F in R, 12 @* one is interested in the R[1/F]-module of rank one, generated by 13 @* the symbol F^s for a symbolic discrete variable s. 14 @* In fact, the module R[1/F]*F^s has a structure of a D(R)[s]-module, where D(R) 15 @* is an n-th Weyl algebra K<x_1,...,x_n,d_1,...,d_n | d_j x_j = x_j d_j +1> and 16 @* D(R)[s] = D(R) tensored with K[s] over K. 17 @* Constructively, one needs to find a left ideal I = I(F^s) in D(R), such 18 @* that K[x_1,...,x_n,1/F]*F^s is isomorphic to D(R)/I as a D(R)-module. 19 @* We often write just D for D(R) and D[s] for D(R)[s]. 20 @* One is interested in the following data: 21 @* - Ann F^s = I = I(F^s) in D(R)[s], denoted by LD in the output 22 @* - global Bernstein polynomial in K[s], denoted by bs, 23 @* - its minimal integer root s0, the list of all roots of bs, which are known 24 @* to be rational, with their multiplicities, which is denoted by BS 25 @* - Ann F^s0 = I(F^s0) in D(R), denoted by LD0 in the output 26 @* (LD0 is a holonomic ideal in D(R)) 27 @* - Ann^(1) F^s in D(R)[s], denoted by LD1 (logarithmic derivations) 28 @* - an operator in D(R)[s], denoted by PS, such that the functional equality 29 @* PS*F^(s+1) = bs*F^s holds in K[x_1,...,x_n,1/F]*F^s. 30 30 31 31 References: 32 We provide the following implementations of algorithms:33 @* (OT) the classical Ann F^s algorithm from Oaku and Takayama (Journal of34 Pure and Applied Math., 1999),35 @* (LOT) Levandovskyy's modification of the Oaku-Takayama algorithm (ISSAC 2007)36 @* (BM) the Ann F^s algorithm by Briancon and Maisonobe (Remarques sur37 l'ideal de Bernstein associe a des polynomes, preprint, 2002)38 @* (LM08) V. Levandovskyy and J. Martin-Morales, ISSAC 200839 @* (C) Countinho, A Primer of Algebraic D-Modules,40 @* (SST) Saito, Sturmfels, Takayama 'Groebner Deformations of Hypergeometric41 Differential Equations', Springer, 200032 @* We provide the following implementations of algorithms: 33 @* (OT) the classical Ann F^s algorithm from Oaku and Takayama (Journal of 34 @* Pure and Applied Math., 1999), 35 @* (LOT) Levandovskyy's modification of the Oaku-Takayama algorithm (ISSAC 2007) 36 @* (BM) the Ann F^s algorithm by Briancon and Maisonobe (Remarques sur 37 @* l'ideal de Bernstein associe a des polynomes, preprint, 2002) 38 @* (LM08) V. Levandovskyy and J. Martin-Morales, ISSAC 2008 39 @* (C) Countinho, A Primer of Algebraic D-Modules, 40 @* (SST) Saito, Sturmfels, Takayama 'Groebner Deformations of Hypergeometric 41 @* Differential Equations', Springer, 2000 42 42 43 43 44 44 Guide: 45 @*- Ann F^s = I(F^s) = LD in D(R)[s] can be computed by Sannfs [BM, OT, LOT] 46 @*- Ann^(1) F^s in D(R)[s] can be computed by Sannfslog 47 @*- global Bernstein polynomial bs in K[s] can be computed by bernsteinBM 48 @*- Ann F^s0 = I(F^s0) = LD0 in D(R) can be computed by annfs0, annfs, annfsBM, 49 annfsOT, annfsLOT, annfs2, annfsRB etc. 50 @*- all the relevant data to F^s (LD, LD0, bs, PS) are computed by operatorBM 51 @*- operator PS can be computed via operatorModulo or operatorBM 52 53 @*- annihilator of F^{s1} for a number s1 is computed with annfspecial 54 @*- annihilator of F_1^s_1 * ... * F_p^s_p is computed with annfsBMI 55 @*- computing the multiplicity of a rational number r in the Bernstein poly 56 of a given ideal goes with checkRoot 57 @*- check, whether a given univariate polynomial divides the Bernstein poly 58 goes with checkFactor 45 @* - Ann F^s = I(F^s) = LD in D(R)[s] can be computed by Sannfs [BM, OT, LOT] 46 @* - Ann^(1) F^s in D(R)[s] can be computed by Sannfslog 47 @* - global Bernstein polynomial bs in K[s] can be computed by bernsteinBM 48 @* - Ann F^s0 = I(F^s0) = LD0 in D(R) can be computed by annfs0, annfs, annfsBM, 49 @* annfsOT, annfsLOT, annfs2, annfsRB etc. 50 @* - all the relevant data to F^s (LD, LD0, bs, PS) are computed by operatorBM 51 @* - operator PS can be computed via operatorModulo or operatorBM 52 @* 53 @* - annihilator of F^{s1} for a number s1 is computed with annfspecial 54 @* - annihilator of F_1^s_1 * ... * F_p^s_p is computed with annfsBMI 55 @* - computing the multiplicity of a rational number r in the Bernstein poly 56 @* of a given ideal goes with checkRoot 57 @* - check, whether a given univariate polynomial divides the Bernstein poly 58 @* goes with checkFactor 59 59 60 60 61 PROCEDURES: 62 61 63 annfs(F[,S,eng]); compute Ann F^s0 in D and Bernstein polynomial for a poly F 62 64 annfspecial(I, F, m, n); compute Ann F^n from Ann F^s for a polynomial F and a number n 63 65 Sannfs(F[,S,eng]); compute Ann F^s in D[s] for a polynomial F 64 66 Sannfslog(F[,eng]); compute Ann^(1) F^s in D[s] for a polynomial F 65 bernsteinBM(F[,eng]); compute global Bernstein -Sato polynomial of a poly F (algof Briancon-Maisonobe)66 bernsteinLift(I,F [,eng]); compute a multiple of Bernstein-Satopolynomial via lift-like procedure67 operatorBM(F[,eng]); compute Ann F^s, Ann F^s0, BS and PS for a poly F (algorithm of Briancon-Maisonobe)67 bernsteinBM(F[,eng]); compute global Bernstein polynomial for a polynomial F (algorithm of Briancon-Maisonobe) 68 bernsteinLift(I,F [,eng]); compute a possible multiple of Bernstein polynomial via lift-like procedure 69 operatorBM(F[,eng]); compute Ann F^s, Ann F^s0, BS and PS for a polynomial F (algorithm of Briancon-Maisonobe) 68 70 operatorModulo(F, I, b); compute PS via the modulo approach 69 71 annfsParamBM(F[,eng]); compute the generic Ann F^s (algorithm by Briancon and Maisonobe) and exceptional parametric constellations for a polynomial F with parametric coefficients … … 88 90 89 91 KEYWORDS: D-module; D-module structure; left annihilator ideal; Bernstein-Sato polynomial; global Bernstein-Sato polynomial; 90 Weyl algebra; Bernstein operator; logarithmic annihilator ideal; parametric annihilator; root of Bernstein-Sato polynomial; 92 Weyl algebra; Bernstein operator; logarithmic annihilator ideal; parametric annihilator; root of Bernstein-Sato polynomial; 91 93 hyperplane arrangement; Oaku-Takayama algorithm; Briancon-Maisonobe algorithm; LOT algorithm 92 94 "; … … 5352 5354 " 5353 5355 { 5354 if (dmodappassumeViolation()) 5356 // char>0 or qring 5357 if ( (size(ideal(basering)) >0) || (char(basering) >0) ) 5355 5358 { 5356 5359 ERROR("Basering is inappropriate: characteristic>0 or qring present"); … … 5368 5371 if (attrib(M,"isSB")!=1) 5369 5372 { 5370 M = std(M);5373 M = engine(M,0); 5371 5374 } 5372 5375 int dimR = gkdim(std(0)); … … 6221 6224 V[1]=0; 6222 6225 number ct = content(V); // content of the cofactors 6223 // addition by VL: indeed just gcd of denominators is needed!!!6224 // hence TODO6225 6226 poly CF = ct*V[ncols(J)]; // polynomial in K[s]<x,dx>, cofactor to F 6226 6227 dbprint(ppl,"// -3-4- the cofactor candidate found"); -
Singular/LIB/dmodapp.lib
r06b868 rd033934 13 13 @* In this library there are the following procedures for algebraic D-modules: 14 14 @* 15 @* - localization of a holonomic module D/I with respect to a mult. closed set16 @* of all powers of a given polynomial F from R. Our aim is to compute an17 @* ideal L in D, such that D/L is a presentation of a localized module. Such L18 @* always exists, since such localizations are known to be holonomic and thus19 @* cyclic modules. The procedures for the localization are DLoc,SDLoc and DLoc0.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 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 20 @* 21 21 @* - annihilator in D of a given polynomial F from R as well as … … 23 23 @* procedures annPoly resp. annRat. 24 24 @* 25 @* - Groebner bases with respect to weights, initial forms and initial ideals 26 @* in Weyl algebras with respect to a given weight vector can be computed with 27 @* GBWeight, inForm, initialMalgrange and initialIdealW. 25 @* - Groebner bases with respect to weights (according to (SST), given an 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. 28 32 @* 29 33 @* - restriction and integration of a holonomic module D/I. Suppose I … … 45 49 @* (SST) Saito, Sturmfels, Takayama 'Groebner Deformations of Hypergeometric 46 50 @* Differential Equations', Springer, 2000 47 @* (OTW) Oaku, Takayama, Walther 'A Localization Algorithm for D-modules', 2000 48 @* (OT) Oaku, Takayama 'Algorithms for D-modules', 1998 51 @* (OTW) Oaku, Takayama, Walther 'A Localization Algorithm for D-modules', 52 @* Journal of Symbolic Computation, 2000 53 @* (OT) Oaku, Takayama 'Algorithms for D-modules', 54 @* Journal of Pure and Applied Algebra, 1998 49 55 50 56 51 57 PROCEDURES: 52 58 53 annPoly(f); annihilator of a polynomial f in the corr. Weyl algebra54 annRat(f,g); annihilator of a rational function f/g in thecorr. Weyl algebra55 DLoc(I, F); presentation of the localization of D/I w.r.t.f^s56 SDLoc(I, F); a generic presentation of the localization of D/I w.r.t.f^s57 DLoc0(I, F); presentation of the localization of D/I w.r.t. f^s,based on SDLoc58 59 GBWeight(I,u,v[,a,b]); Groebner basis of I w.r.t. the weight vector (u,v)60 initialMalgrange(f[,s,t,v]); Groebner basis of the initial Malgrange ideal for f61 initialIdealW(I,u,v[,s,t]); initial ideal of a given ideal w.r.t. given weights62 inForm(f,w); initial form of a poly/ideal w.r.t. a givenweight63 64 restrictionIdeal(I,w ,[,eng,m,G]); restriction ideal of I w.r.t.w65 restrictionModule(I,w[,eng,m,G]); restriction module of I w.r.t.w66 integralIdeal(I,w ,[,eng,m,G]); integral ideal of I w.r.t.w67 integralModule(I,w[,eng,m,G]); integral module of I w.r.t.w68 deRhamCohom(f[,eng,m]); basis of n-th de Rham cohomologygroup69 deRhamCohomIdeal(I[,w,eng,m,G]); basis of n-th de Rham cohomologygroup70 71 charVariety(I); c haracteristic variety of the ideal I72 charInfo(I); c har. variety of ideal I, itssingular locus and primary decomp.73 isFsat(I,F); check whether the ideal I is F-saturated74 75 76 77 appelF1(); create an ideal annihilating Appel F1 function78 appelF2(); create an ideal annihilating Appel F2 function79 appelF4(); create an ideal annihilating Appel F4 function80 81 fourier(I[,v]); Fourier automorphism82 inverseFourier(I[,v]); inverse Fourier automorphism59 annPoly(f); computes annihilator of a polynomial f in the corr. Weyl algebra 60 annRat(f,g); computes annihilator of rational function f/g in corr. Weyl algebra 61 DLoc(I,f); computes presentation of localization of D/I wrt symbolic power f^s 62 SDLoc(I,f); computes generic presentation of the localization of D/I wrt f^s 63 DLoc0(I,f); computes presentation of localization of D/I wrt f^s based on SDLoc 64 65 GBWeight(I,u,v[,a,b]); computes Groebner basis of I wrt a weight vector 66 initialMalgrange(f[,s,t,v]); computes Groebner basis of initial Malgrange ideal 67 initialIdealW(I,u,v[,s,t]); computes initial ideal of wrt a given weight 68 inForm(f,w); computes initial form of poly/ideal wrt a weight 69 70 restrictionIdeal(I,w[,eng,m,G]); computes restriction ideal of I wrt w 71 restrictionModule(I,w[,eng,m,G]); computes restriction module of I wrt w 72 integralIdeal(I,w[,eng,m,G]); computes integral ideal of I wrt w 73 integralModule(I,w[,eng,m,G]); computes integral module of I wrt w 74 deRhamCohom(f[,eng,m]); computes basis of n-th de Rham cohom. group 75 deRhamCohomIdeal(I[,w,eng,m,G]); computes basis of n-th de Rham cohom. group 76 77 charVariety(I); computes characteristic variety of the ideal I 78 charInfo(I); computes char. variety, singular locus and primary decomp. 79 isFsat(I,F); checks whether the ideal I is F-saturated 80 81 82 83 appelF1(); creates an ideal annihilating Appel F1 function 84 appelF2(); creates an ideal annihilating Appel F2 function 85 appelF4(); creates an ideal annihilating Appel F4 function 86 87 fourier(I[,v]); applies Fourier automorphism to ideal 88 inverseFourier(I[,v]); applies inverse Fourier automorphism to ideal 83 89 84 90 bFactor(F); computes the roots of irreducible factors of an univariate poly 85 intRoots(L); dismiss non-integer roots from list in bFactor format86 poly2list(f); decompose a polynomialinto a list of terms and exponents87 fl2poly(L,s); reconstruct a monic univariate polynomial from its factorization88 89 insertGenerator(id,p[,k]); insert an element into an ideal/module90 deleteGenerator(id,k); delete the k-th element from an ideal/module91 92 engine(I,i); computes a Groebner basis with the algorithm givenby i93 isInt(n); check whether object of type number is actuallyint94 sortIntvec(v); sort intvec91 intRoots(L); dismisses non-integer roots from list in bFactor format 92 poly2list(f); decomposes the polynomial f into a list of terms and exponents 93 fl2poly(L,s); reconstructs a monic univariate polynomial from its factorization 94 95 insertGenerator(id,p[,k]); inserts an element into an ideal/module 96 deleteGenerator(id,k); deletes the k-th element from an ideal/module 97 98 engine(I,i); computes a Groebner basis with the algorithm specified by i 99 isInt(n); checks whether number n is actually an int 100 sortIntvec(v); sorts intvec 95 101 96 102 … … 99 105 100 106 KEYWORDS: D-module; annihilator of polynomial; annihilator of rational function; 101 D-localization; localization of D-module; D-restriction; restriction of 107 D-localization; localization of D-module; D-restriction; restriction of 102 108 D-module; D-integration; integration of D-module; characteristic variety; 103 109 Appel function; Appel hypergeometric function … … 109 115 21.09.10 by DA: 110 116 - restructured library for better readability 111 - new / improved procs: 117 - new / improved procs: 112 118 - toolbox: isInt, intRoots, sortIntvec 113 119 - GB wrt weights: GBWeight, initialIdealW rewritten using GBWeight … … 119 125 - added SUPPORT in header 120 126 - added reference (OT) 127 128 04.10.10 by DA: 129 - incorporated suggestions by Oleksandr Motsak, among other: 130 - bugfixes for fl2poly, sortIntvec, annPoly, GBWeight 131 - enhanced functionality for deleteGenerator, inForm 121 132 */ 122 133 … … 174 185 // general assumptions //////////////////////////////////////////////////////// 175 186 176 proc dmodappassumeViolation() 177 { 178 // returns Boolean : yes/no [for assume violation] 179 // char K = 0 180 // no qring 187 static proc dmodappAssumeViolation() 188 { 189 // char K <> 0 or qring 181 190 if ( (size(ideal(basering)) >0) || (char(basering) >0) ) 182 191 { 183 // "ERROR: no qring is allowed"; 184 return(1); 185 } 186 return(0); 192 ERROR("Basering is inappropriate: characteristic>0 or qring present"); 193 } 194 return(); 187 195 } 188 196 189 197 static proc dmodappMoreAssumeViolation() 190 198 { 191 // char K = 0, no qring 192 if ((size(ideal(basering))>0) || (char(basering)>0)) 193 { 194 ERROR("Basering is inappropriate: characteristic>0 or qring present"); 195 } 199 // char K <> 0, qring 200 dmodappAssumeViolation(); 196 201 // no Weyl algebra 197 202 if (isWeyl() == 0) 198 203 { 199 ERROR("Basering is not a Weyl algebra"); 204 ERROR("Basering is not a Weyl algebra"); 200 205 } 201 206 // wrong sequence of vars … … 213 218 214 219 static proc safeVarName (string s, string cv) 220 // assumes 's' to be a valid variable name 221 // returns valid var name string @@..@s 215 222 { 216 223 string S; … … 226 233 s = s[2..size(s)-1]; 227 234 return(s) 235 } 236 237 static proc intLike (def i) 238 { 239 string str = typeof(i); 240 if (str == "int" || str == "number" || str == "bigint") 241 { 242 return(1); 243 } 244 else 245 { 246 return(0); 247 } 228 248 } 229 249 … … 269 289 "USAGE: poly2list(f); f a poly 270 290 RETURN: list of exponents and corresponding terms of f 271 PURPOSE: convert a polynomial to a list of exponents and corresponding terms 291 PURPOSE: converts a poly to a list of pairs consisting of intvecs (1st entry) 292 @* and polys (2nd entry), where the i-th pair contains the exponent of the 293 @* i-th term of f and the i-th term (with coefficient) itself. 272 294 EXAMPLE: example poly2list; shows examples 273 295 " … … 279 301 l[1] = list(leadexp(f), lead(f)); 280 302 } 281 else { l[size(f)] = list(); } // memory pre-allocation 282 while (f != 0) 283 { 284 l[i] = list(leadexp(f), lead(f)); 285 f = f - lead(f); 286 i++; 303 else 304 { 305 l[size(f)] = list(); // memory pre-allocation 306 while (f != 0) 307 { 308 l[i] = list(leadexp(f), lead(f)); 309 f = f - lead(f); 310 i++; 311 } 287 312 } 288 313 return(l); … … 295 320 poly2list(F); 296 321 ring r2 = 0,(x,y),dp; 297 poly F = x2y+ x*y2;322 poly F = x2y+5xy2; 298 323 poly2list(F); 324 poly2list(0); 299 325 } 300 326 … … 312 338 if (varNum(s)==0) 313 339 { 314 ERROR( "no such variable found in the basering"); return(0);340 ERROR(s+ " is no variable in the basering"); 315 341 } 316 342 poly x = var(varNum(s)); 317 343 poly P = 1; 318 int sl = size(L[1]);319 344 ideal RR = L[1]; 345 int sl = ncols(RR); 320 346 intvec IV = L[2]; 321 for(int i=1; i<= sl; i++) 347 if (sl <> nrows(IV)) 348 { 349 ERROR("number of roots doesn't match number of multiplicites"); 350 } 351 for(int i=1; i<=sl; i++) 322 352 { 323 353 if (IV[i] > 0) … … 336 366 "EXAMPLE:"; echo = 2; 337 367 ring r = 0,(x,y,z,s),Dp; 338 ideal I = -1,-4/3, -5/3,-2;339 intvec mI = 2,1, 1,1;368 ideal I = -1,-4/3,0,-5/3,-2; 369 intvec mI = 2,1,2,1,1; 340 370 list BS = I,mI; 341 371 poly p = fl2poly(BS,"s"); … … 347 377 "USAGE: insertGenerator(id,p[,k]); 348 378 @* id an ideal/module, p a poly/vector, k an optional int 349 RETURN: same as id 350 PURPOSE: inserts p into the first argument at k-th index position and returns 351 @* the enlarged object 379 RETURN: of the same type as id 380 PURPOSE: inserts p into id at k-th position and returns the enlarged object 352 381 NOTE: If k is given, p is inserted at position k, otherwise (and by default), 353 @* p is inserted at the beginning .382 @* p is inserted at the beginning (k=1). 354 383 SEE ALSO: deleteGenerator 355 384 EXAMPLE: example insertGenerator; shows examples … … 363 392 if (inp1 == "ideal" || inp1 == "module") 364 393 { 365 if (inp1 == "ideal") { ideal id = #[1]; } 366 else { module id = #[1]; } 394 def id = #[1]; 367 395 } 368 396 else { ERROR("first argument has to be of type ideal or module"); } … … 370 398 if (inp2 == "poly" || inp2 == "vector") 371 399 { 372 if (inp2 =="poly") { poly f = #[2]; } 373 else 374 { 375 if (inp1 == "ideal") 376 { 377 ERROR("second argument has to be a polynomial if first argument is an ideal"); 378 } 379 else { vector f = #[2]; } 380 } 400 def f = #[2]; 381 401 } 382 402 else { ERROR("second argument has to be of type poly/vector"); } 403 if (inp1 == "ideal" && inp2 == "vector") 404 { 405 ERROR("second argument has to be a polynomial if first argument is an ideal"); 406 } 407 // don't check module/poly combination due to auto-conversion 408 // if (inp1 == "module" && inp2 == "poly") 409 // { 410 // ERROR("second argument has to be a vector if first argument is a module"); 411 // } 383 412 int n = ncols(id); 384 413 int k = 1; // default 385 414 if (size(#)>=3) 386 415 { 387 if ( typeof(#[3]) == "int")388 { 389 k = #[3];416 if (intLike(#[3])) 417 { 418 k = int(#[3]); 390 419 if (k<=0) 391 420 { … … 406 435 else // 1<k<=n 407 436 { 437 J[n+1] = id[n]; // preinit 408 438 J[1..k-1] = id[1..k-1]; 409 439 J[k] = f; … … 420 450 insertGenerator(I,y^3); 421 451 insertGenerator(I,y^3,2); 422 module M = I ;452 module M = I*gen(3); 423 453 insertGenerator(M,[x^3,y^2,z],2); 424 } 425 426 proc deleteGenerator (list #) 427 "USAGE: deleteGenerator(id,k); id an ideal/module, k an int 428 RETURN: same as id 429 PURPOSE: deletes the k-th generator from the first argument and returns 430 @* the altered object 454 insertGenerator(M,x+y+z,4); 455 } 456 457 proc deleteGenerator (def id, int k) 458 "USAGE: deleteGenerator(id,k); id an ideal/module, k an int 459 RETURN: of the same type as id 460 PURPOSE: deletes the k-th generator from the first argument and returns 461 @* the altered object 431 462 SEE ALSO: insertGenerator 432 EXAMPLE: example insertGenerator; shows examples463 EXAMPLE: example deleteGenerator; shows examples 433 464 " 434 465 { 435 if (size(#) < 2) 436 { 437 ERROR("deleteGenerator has to be called with 2 arguments (ideal/module,int)"); 438 } 439 string inp1 = typeof(#[1]); 440 if (inp1 == "ideal" || inp1 == "module") 441 { 442 if (inp1 == "ideal") { ideal id = #[1]; } 443 else { module id = #[1]; } 444 } 445 else { ERROR("first argument has to be of type ideal or module"); } 446 string inp2 = typeof(#[2]); 447 if (inp2 == "int" || inp2 == "number") { int k = int(#[2]); } 448 else { ERROR("second argument has to be of type int"); } 466 string inp1 = typeof(id); 467 if (inp1 <> "ideal" && inp1 <> "module") 468 { 469 ERROR("first argument has to be of type ideal or module"); 470 } 471 execute(inp1 +" J;"); 449 472 int n = ncols(id); 450 if (n == 1) { ERROR(inp1+" must have more than one generator"); } 451 if (k<=0 || k>n) { ERROR("second argument has to be in the range 1,...,"+string(n)); } 452 execute(inp1 +" J;"); 473 if (n == 1 && k == 1) { return(J); } 474 if (k<=0 || k>n) 475 { 476 ERROR("second argument has to be in the range 1,...,"+string(n)); 477 } 478 J[n-1] = 0; // preinit 453 479 if (k == 1) { J = id[2..n]; } 454 480 else … … 469 495 ideal I = x^2,y^3,z^4; 470 496 deleteGenerator(I,2); 471 module M = [x,y,z],[x2,y2,z2],[x3,y3,z3];; 472 deleteGenerator(M,2); 497 module M = [x,y,z],[x2,y2,z2],[x3,y3,z3]; 498 print(deleteGenerator(M,2)); 499 M = M[1]; 500 deleteGenerator(M,1); 473 501 } 474 502 475 503 proc bFactor (poly F) 476 504 "USAGE: bFactor(f); f poly 477 RETURN: list 505 RETURN: list of ideal and intvec and possibly a string 478 506 PURPOSE: tries to compute the roots of a univariate poly f 479 507 NOTE: The output list consists of two or three entries: … … 481 509 @* if present, a third one being the product of all irreducible factors 482 510 @* of degree greater than one, given as string. 511 @* If f is the zero polynomial or if f has no roots in the ground field, 512 @* this is encoded as root 0 with multiplicity 0. 483 513 DISPLAY: If printlevel=1, progress debug messages will be printed, 484 514 @* if printlevel>=2, all the debug messages will be printed. … … 556 586 bFactor((x^2+1)^2); 557 587 bFactor((y^2+1/2)*(y+9)*(y-7)); 588 bFactor(1); 589 bFactor(0); 558 590 } 559 591 … … 606 638 if (sl>2) 607 639 { 608 609 640 if (typeof(l[3])<>"string"){wronginput = 1;} 641 if (sl>3){wronginput = 1;} 610 642 } 611 643 } … … 617 649 } 618 650 int i,j; 619 int n = ncols(l[1]); 651 ideal l1 = l[1]; 652 int n = ncols(l1); 620 653 j = 1; 621 654 ideal I; … … 623 656 for (i=1; i<=n; i++) 624 657 { 625 if (size(l [1][j])>1) // poly not number658 if (size(l1[j])>1) // poly not number 626 659 { 627 660 ERROR("Ideal in list has wrong format."); 628 661 } 629 if (isInt(leadcoef(l [1][i])))630 { 631 I[j] = l [1][i];662 if (isInt(leadcoef(l1[i]))) 663 { 664 I[j] = l1[i]; 632 665 v[j] = l[2][i]; 633 666 j++; … … 653 686 @* Unlike in the procedure @code{sort}, zeros are not dismissed. 654 687 SEE ALSO: sort 655 EXAMPLE: example sort intvec; shows examples688 EXAMPLE: example sortIntvec; shows examples 656 689 " 657 690 { 658 691 int i; 659 692 intvec vpos,vzero,vneg,vv,sortv,permv; 693 list l; 660 694 for (i=1; i<=nrows(v); i++) 661 695 { … … 680 714 vpos = vpos[2..size(vpos)]; 681 715 vv = v[vpos]; 682 l ist l= sort(vv);716 l = sort(vv); 683 717 vv = l[1]; 684 718 vpos = vpos[l[2]]; … … 716 750 list L = sortIntvec(v); L; 717 751 v[L[2]]; 752 v = -3,0; 753 sortIntvec(v); 754 v = 0,-3; 755 sortIntvec(v); 718 756 } 719 757 … … 723 761 proc isFsat(ideal I, poly F) 724 762 "USAGE: isFsat(I, F); I an ideal, F a poly 725 RETURN: int 726 PURPOSE: check whether the ideal I is F-saturated 727 NOTE: 1 is returned if I is F-saturated, otherwise 0 is returned. 728 @* we check indeed that Ker(D --F--> D/I) is (0) 763 RETURN: int, 1 if I is F-saturated and 0 otherwise 764 PURPOSE: checks whether the ideal I is F-saturated 765 NOTE: We check indeed that Ker(D--> F--> D/I) is 0, where D is the basering. 729 766 EXAMPLE: example isFsat; shows examples 730 767 " … … 733 770 /* works in any algebra */ 734 771 /* for simplicity : later check attrib */ 735 /* returns -1 if true*/772 /* returns 1 if I is F-sat */ 736 773 if (attrib(I,"isSB")!=1) 737 774 { … … 740 777 matrix @M = matrix(I); 741 778 matrix @F[1][1] = F; 742 module S = modulo(@F,@M);779 def S = modulo(module(@F),module(@M)); 743 780 S = NF(S,I); 744 781 S = groebner(S); … … 763 800 proc annRat(poly g, poly f) 764 801 "USAGE: annRat(g,f); f, g polynomials 765 RETURN: ring 766 PURPOSE: compute the annihilator of a rational function g/f in the Weyl algebra 802 RETURN: ring (a Weyl algebra) containing an ideal 'LD' 803 PURPOSE: compute the annihilator of the rational function g/f in the 804 @* corresponding Weyl algebra 805 ASSUME: basering is commutative and over a field of characteristic 0 767 806 NOTE: Activate the output ring with the @code{setring} command. 768 @* In the output ring, the ideal LD (in Groebner basis) is the 769 @* annihilator. 770 @* The algorithm uses the computation of ann f^{-1} via D-modules. 807 @* In the output ring, the ideal 'LD' (in Groebner basis) is the 808 @* annihilator of g/f. 809 @* The algorithm uses the computation of Ann(f^{-1}) via D-modules, 810 @* see (SST). 771 811 DISPLAY: If printlevel =1, progress debug messages will be printed, 772 812 @* if printlevel>=2, all the debug messages will be printed. … … 775 815 " 776 816 { 777 778 if (dmodappassumeViolation())779 {780 ERROR("Basering is inappropriate: characteristic>0 or qring present");781 }782 817 // assumption check 818 dmodappAssumeViolation(); 819 if (!isCommutative()) 820 { 821 ERROR("Basering must be commutative."); 822 } 783 823 // assumptions: f is not a constant 784 if (f==0) { ERROR(" Denominatorcannot be zero"); }785 if ( leadexp(f) == 0)824 if (f==0) { ERROR("the denominator f cannot be zero"); } 825 if ((leadexp(f) == 0) && (size(f) < 2)) 786 826 { 787 827 // f = const, so use annPoly … … 790 830 return(@R); 791 831 } 792 832 // computes the annihilator of g/f 793 833 def save = basering; 794 834 int ppl = printlevel-voice+2; … … 811 851 if (mir ==0) 812 852 { 813 "No integer root found! Aborting computations, inform the authors!"; 814 return(0); 853 ERROR("No integer root found! Aborting computations, inform the authors!"); 815 854 } 816 855 // now mir == i is m.i.r. … … 887 926 proc annPoly(poly f) 888 927 "USAGE: annPoly(f); f a poly 889 RETURN: ring 890 PURPOSE: compute the complete annihilator ideal of f in the Weyl algebra D 891 NOTE: activate the output ring with the @code{setring} command. 892 @* In the output ring, the ideal LD (in Groebner basis) is the 928 RETURN: ring (a Weyl algebra) containing an ideal 'LD' 929 PURPOSE: compute the complete annihilator ideal of f in the corresponding 930 @* Weyl algebra 931 ASSUME: basering is commutative and over a field of characteristic 0 932 NOTE: Activate the output ring with the @code{setring} command. 933 @* In the output ring, the ideal 'LD' (in Groebner basis) is the 893 934 @* annihilator. 894 935 DISPLAY: If printlevel =1, progress debug messages will be printed, … … 898 939 " 899 940 { 941 // assumption check 942 dmodappAssumeViolation(); 943 if (!isCommutative()) 944 { 945 ERROR("Basering must be commutative."); 946 } 900 947 // computes a system of linear PDEs with polynomial coeffs for f 901 948 def save = basering; … … 906 953 for (i=1; i<=N; i++) 907 954 { 908 Name[N+i] = "D"+Name[i]; // concat955 Name[N+i] = safeVarName("D"+Name[i],"cv"); // concat 909 956 } 910 957 L[2] = Name; … … 920 967 } 921 968 matrix F[1][1] = imap(save,f); 922 ideal I = modulo(F,M); 923 ideal LD = groebner(I); 969 def I = modulo(module(F),module(M)); 970 ideal LD = I; 971 LD = groebner(LD); 924 972 export LD; 925 973 return(@@R); … … 935 983 gkdim(LD); // must be 3 = 6/2, since A/LD is holonomic module 936 984 NF(Dy^4, LD); // must be 0 since Dy^4 clearly annihilates f 985 poly f = imap(r,f); 986 NF(LD*f,std(ideal(Dx,Dy,Dz))); // must be zero if LD indeed annihilates f 937 987 } 938 988 … … 942 992 943 993 proc DLoc(ideal I, poly F) 944 "USAGE: DLoc(I, F); I an ideal, Fa poly945 RETURN: nothing (exports objects instead)994 "USAGE: DLoc(I, f); I an ideal, f a poly 995 RETURN: list of ideal and list 946 996 ASSUME: the basering is a Weyl algebra 947 997 PURPOSE: compute the presentation of the localization of D/I w.r.t. f^s 948 NOTE: In the basering, the following objects are exported:949 @* - the ideal LD0 (in Groebner basis) isthe presentation of the998 NOTE: In the output list L, 999 @* - L[1] is an ideal (given as Groebner basis), the presentation of the 950 1000 @* localization, 951 @* - the list BS containsroots with multiplicities of Bernstein1001 @* - L[2] is a list containing roots with multiplicities of Bernstein 952 1002 @* polynomial of (D/I)_f. 953 1003 DISPLAY: If printlevel =1, progress debug messages will be printed, … … 958 1008 /* runs SDLoc and DLoc0 */ 959 1009 /* assume: run from Weyl algebra */ 960 if (dmodappassumeViolation()) 961 { 962 ERROR("Basering is inappropriate: characteristic>0 or qring present"); 963 } 1010 dmodappAssumeViolation(); 964 1011 if (!isWeyl()) 965 1012 { 966 1013 ERROR("Basering is not a Weyl algebra"); 967 }968 if (defined(LD0) || defined(BS))969 {970 ERROR("Reserved names LD0 and/or BS are used. Please rename the objects.");971 1014 } 972 1015 int old_printlevel = printlevel; … … 982 1025 setring @R; 983 1026 ideal LD0 = imap(@R3,LD0); 984 export LD0;985 1027 ideal bs = imap(@R3,bs); 986 1028 list BS; BS[1] = bs; BS[2] = m; 987 export BS;988 1029 kill @R3; 989 1030 printlevel = old_printlevel; 1031 return(list(LD0,BS)); 990 1032 } 991 1033 example; … … 998 1040 // I is not holonomic, since its dimension is not 4/2=2 999 1041 gkdim(I); 1000 DLoc(I, x2-y3); // exports LD0 and BS1001 L D0; // localized module (R/I)_f is isomorphic to R/LD01002 BS;// description of b-function for localization1042 list L = DLoc(I, x2-y3); 1043 L[1]; // localized module (R/I)_f is isomorphic to R/LD0 1044 L[2]; // description of b-function for localization 1003 1045 } 1004 1046 1005 1047 proc DLoc0(ideal I, poly F) 1006 "USAGE: DLoc0(I, F); I an ideal, Fa poly1007 RETURN: ring 1048 "USAGE: DLoc0(I, f); I an ideal, f a poly 1049 RETURN: ring (a Weyl algebra) containing an ideal 'LD0' and a list 'BS' 1008 1050 PURPOSE: compute the presentation of the localization of D/I w.r.t. f^s, 1009 1051 @* where D is a Weyl Algebra, based on the output of procedure SDLoc 1010 1052 ASSUME: the basering is similar to the output ring of SDLoc procedure 1011 NOTE: activate th isring with the @code{setring} command. In this ring,1012 @* - the ideal LD0 ( inGroebner basis) is the presentation of the1013 1014 @* - the list BS contains roots and multiplicities of Bernstein 1015 1053 NOTE: activate the output ring with the @code{setring} command. In this ring, 1054 @* - the ideal LD0 (given as Groebner basis) is the presentation of the 1055 @* localization, 1056 @* - the list BS contains roots and multiplicities of Bernstein 1057 @* polynomial of (D/I)_f. 1016 1058 DISPLAY: If printlevel =1, progress debug messages will be printed, 1017 1059 @* if printlevel>=2, all the debug messages will be printed. … … 1019 1061 " 1020 1062 { 1021 if (dmodappassumeViolation()) 1022 { 1023 ERROR("Basering is inappropriate: characteristic>0 or qring present"); 1024 } 1063 dmodappAssumeViolation(); 1025 1064 /* assume: to be run in the output ring of SDLoc */ 1026 1065 /* doing: add F, eliminate vars*Dvars, factorize BS */ … … 1248 1287 1249 1288 proc SDLoc(ideal I, poly F) 1250 "USAGE: SDLoc(I, F); I an ideal, Fa poly1251 RETURN: ring 1289 "USAGE: SDLoc(I, f); I an ideal, f a poly 1290 RETURN: ring (basering extended by a new variable) containing an ideal 'LD' 1252 1291 PURPOSE: compute a generic presentation of the localization of D/I w.r.t. f^s 1253 ASSUME: the basering D is a Weyl algebra 1254 NOTE: activate this ring with the @code{setring} command. In this ring,1255 @* the ideal LD ( inGroebner basis) is the presentation of the1256 @* localization 1292 ASSUME: the basering D is a Weyl algebra over a field of characteristic 0 1293 NOTE: Activate this ring with the @code{setring} command. In this ring, 1294 @* the ideal LD (given as Groebner basis) is the presentation of the 1295 @* localization. 1257 1296 DISPLAY: If printlevel =1, progress debug messages will be printed, 1258 1297 @* if printlevel>=2, all the debug messages will be printed. … … 1264 1303 /* assume: we're in the Weyl algebra D in x1,x2,...,d1,d2,... */ 1265 1304 1266 if (dmodappassumeViolation()) 1267 { 1268 ERROR("Basering is inappropriate: characteristic>0 or qring present"); 1269 } 1305 dmodappAssumeViolation(); 1270 1306 if (!isWeyl()) 1271 1307 { … … 1469 1505 1470 1506 proc GBWeight (ideal I, intvec u, intvec v, list #) 1471 "USAGE: GBWeight(I,u,v [,s,t,w]); 1507 "USAGE: GBWeight(I,u,v [,s,t,w]); 1472 1508 @* I ideal, u,v intvecs, s,t optional ints, w an optional intvec 1473 1509 RETURN: ideal, Groebner basis of I w.r.t. the weights u and v 1474 ASSUME: The basering is the n-th Weyl algebra in characteristic 0 and for all 1475 @* 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 holds, i.e. the 1476 @* sequence of variables is given by x(1),...,x(n),D(1),...,D(n), 1477 @* where D(i) is the differential operator belonging to x(i). 1510 ASSUME: The basering is the n-th Weyl algebra over a field of characteristic 0 1511 @* and for all 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 1512 @* holds, i.e. the sequence of variables is given by 1513 @* x(1),...,x(n),D(1),...,D(n), where D(i) is the differential operator 1514 @* belonging to x(i). 1478 1515 PURPOSE: computes a Groebner basis with respect to given weights 1479 NOTE: u and v are understood as weight vectors for x(i) and D(i), 1480 @* respectively. 1516 NOTE: The weights u and v are understood as weight vectors for x(i) and D(i), 1517 @* respectively. According to (SST), one computes the homogenization of a 1518 @* given ideal relative to (u,v), then one computes a Groebner basis and 1519 @* returns the dehomogenization of the result. 1481 1520 @* If s<>0, @code{std} is used for Groebner basis computations, 1482 1521 @* otherwise, and by default, @code{slimgb} is used. … … 1484 1523 @* otherwise, and by default, a block ordering is used. 1485 1524 @* If w is given and consists of exactly 2*n strictly positive entries, 1486 @* w is used as homogenization weight. 1487 @* Otherwise, and by default, the homogenization weight (1,...,1) is used. 1525 @* w is used for constructing the weighted homogenized Weyl algebra, 1526 @* see Noro (2002). Otherwise, and by default, the homogenization weight 1527 @* (1,...,1) is used. 1488 1528 DISPLAY: If printlevel=1, progress debug messages will be printed, 1489 1529 @* if printlevel>=2, all the debug messages will be printed. … … 1500 1540 if (size(#)>0) 1501 1541 { 1502 if ( typeof(#[1])=="int" || typeof(#[1])=="number")1542 if (intLike(#[1])) 1503 1543 { 1504 1544 whichengine = int(#[1]); … … 1506 1546 if (size(#)>1) 1507 1547 { 1508 if ( typeof(#[2])=="int" || typeof(#[2])=="number")1548 if (intLike(#[2])) 1509 1549 { 1510 1550 methodord = int(#[2]); 1511 1551 } 1512 1552 if (size(#)>2) 1513 1553 { 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1554 if (typeof(#[3])=="intvec") 1555 { 1556 if (size(#[3])==2*n && allPositive(#[3])==1) 1557 { 1558 homogweights = #[3]; 1559 } 1560 else 1561 { 1562 print("// Homogenization weight vector must consist of positive entries and be"); 1563 print("// of size " + string(n) + ". Using weight (1,...,1)."); 1564 } 1565 } 1526 1566 } 1527 1567 } … … 1538 1578 if (methodord == 0) // default: blockordering 1539 1579 { 1580 Lord[5] = C0; 1581 Lord[4] = list("lp",intvec(1)); 1582 Lord[3] = list("dp",intvec(1:(N-1))); 1540 1583 Lord[2] = list("a",uv); 1541 Lord[3] = list("dp",intvec(1:(N-1)));1542 Lord[4] = list("lp",intvec(1));1543 Lord[5] = C0;1544 1584 } 1545 1585 else // M() ordering … … 1547 1587 intmat @Ord[N][N]; 1548 1588 @Ord[1,1..N] = uv; @Ord[2,1..N] = 1:(N-1); 1549 for (i=1; i<=N-2; i++) 1550 { 1589 for (i=1; i<=N-2; i++) 1590 { 1551 1591 @Ord[2+i,N - i] = -1; 1552 1592 } … … 1564 1604 // 1.4 create non-commutative relations 1565 1605 matrix @relD[N][N]; 1566 for (i=1; i<=n; i++) 1567 { 1568 @relD[i,n+i] = var(N)^(homogweights[i]+homogweights[n+i]); 1606 for (i=1; i<=n; i++) 1607 { 1608 @relD[i,n+i] = var(N)^(homogweights[i]+homogweights[n+i]); 1569 1609 } 1570 1610 def Dh = nc_algebra(1,@relD); 1571 setring Dh; kill @Dh; 1611 setring Dh; kill @Dh; 1572 1612 dbprint(ppl-1,"// computing in ring",Dh); 1573 1613 // 2. Compute the initial ideal 1574 1614 ideal I = imap(save,I); 1575 I = homog(I, h);1615 I = homog(I,var(N)); 1576 1616 // 2.1 the hard part: Groebner basis computation 1577 1617 dbprint(ppl, "// starting Groebner basis computation with engine: "+string(whichengine)); … … 1590 1630 def D2 = Weyl(); 1591 1631 setring D2; 1592 ideal I = 3*x^2*Dy+2*y*Dx,2*x*Dx+3*y*Dy+6; I = std(I);1632 ideal I = 3*x^2*Dy+2*y*Dx,2*x*Dx+3*y*Dy+6; 1593 1633 intvec u = -2,-3; 1594 1634 intvec v = -u; 1595 1635 GBWeight(I,u,v); 1636 ideal J = std(I); 1637 GBWeight(J,u,v); // same as above 1596 1638 u = 0,1; 1597 1639 GBWeight(I,u,v); 1598 1640 } 1599 1641 1600 proc inForm (ideal I, intvec w) 1601 "USAGE: inForm(I,w); I ideal, w intvec 1602 RETURN: ideal, the initial form of I w.r.t. the weight vector w 1603 PURPOSE: computes the initial form of an ideal w.r.t. a given weight vector 1604 NOTE: the size of the weight vector must be equal to the number of variables 1605 @* of the basering. 1642 proc inForm (def I, intvec w) 1643 "USAGE: inForm(I,w); I ideal or poly, w intvec 1644 RETURN: ideal, generated by initial forms of generators of I w.r.t. w, or 1645 @* poly, initial form of input poly w.r.t. w 1646 PURPOSE: computes the initial form of an ideal or a poly w.r.t. the weight w 1647 NOTE: The size of the weight vector must be equal to the number of variables 1648 @* of the basering. 1606 1649 EXAMPLE: example inForm; shows examples 1607 1650 " 1608 1651 { 1652 string inp1 = typeof(I); 1653 if ((inp1 <> "ideal") && (inp1 <> "poly")) 1654 { 1655 ERROR("first argument has to be an ideal or a poly"); 1656 } 1609 1657 if (size(w) != nvars(basering)) 1610 1658 { … … 1615 1663 return(I); 1616 1664 } 1617 int j,i,s,m; 1665 int j,i; 1666 bigint s,m; 1618 1667 list l; 1619 1668 poly g; … … 1629 1678 if (s == m) 1630 1679 { 1631 1680 g = g + l[i][2]; 1632 1681 } 1633 1682 else … … 1642 1691 J[j] = g; 1643 1692 } 1644 return(J); 1693 if (inp1 == "ideal") 1694 { 1695 return(J); 1696 } 1697 else 1698 { 1699 return(J[1]); 1700 } 1645 1701 } 1646 1702 example 1647 1703 { 1648 1704 "EXAMPLE:"; echo = 2; 1649 ring @D = 0,(x,y,Dx,Dy),dp; 1650 def D = Weyl(); 1651 setring D; 1705 ring r = 0,(x,y,Dx,Dy),dp; 1706 def D = Weyl(); setring D; 1652 1707 poly F = 3*x^2*Dy+2*y*Dx; 1653 1708 poly G = 2*x*Dx+3*y*Dy+6; … … 1659 1714 inForm(I,w2); 1660 1715 inForm(I,w3); 1716 inForm(F,w1); 1661 1717 } 1662 1718 … … 1677 1733 @* otherwise, and by default, a block ordering is used. 1678 1734 @* If w is given and consists of exactly 2*n strictly positive entries, 1679 @* w is used as homogenization weight. 1735 @* w is used as homogenization weight. 1680 1736 @* Otherwise, and by default, the homogenization weight (1,...,1) is used. 1681 1737 DISPLAY: If printlevel=1, progress debug messages will be printed, … … 1710 1766 def D2 = Weyl(); 1711 1767 setring D2; 1712 ideal I = 3*x^2*Dy+2*y*Dx,2*x*Dx+3*y*Dy+6; I = std(I);1768 ideal I = 3*x^2*Dy+2*y*Dx,2*x*Dx+3*y*Dy+6; 1713 1769 intvec u = -2,-3; 1714 1770 intvec v = -u; 1715 1771 initialIdealW(I,u,v); 1772 ideal J = std(I); 1773 initialIdealW(J,u,v); // same as above 1716 1774 u = 0,1; 1717 1775 initialIdealW(I,u,v); … … 1721 1779 "USAGE: initialMalgrange(f,[,a,b,v]); f poly, a,b optional ints, v opt. intvec 1722 1780 RETURN: ring, Weyl algebra induced by basering, extended by two new vars t,Dt 1723 PURPOSE: computes the initial Malgrange ideal of a given polynomial w.r.t. the weight1724 @* vector (-1,0...,0,1,0,...,0) such that the weight of t is -1 and the1725 @* weight of Dt is 1.1726 ASSUME: The basering is commutative and o f characteristic 0.1781 PURPOSE: computes the initial Malgrange ideal of a given polynomial w.r.t. the 1782 @* weight vector (-1,0...,0,1,0,...,0) such that the weight of t is -1 1783 @* and the weight of Dt is 1. 1784 ASSUME: The basering is commutative and over a field of characteristic 0. 1727 1785 NOTE: Activate the output ring with the @code{setring} command. 1728 @* The returned ring contains the ideal \"inF\", being the initial ideal1786 @* The returned ring contains the ideal 'inF', being the initial ideal 1729 1787 @* of the Malgrange ideal of f. 1730 1788 @* Varnames of the basering should not include t and Dt. … … 1736 1794 @* (d,v[1],...,v[n],1,d+1-v[1],...,d+1-v[n]) is used for homogenization 1737 1795 @* computations, where d denotes the weighted degree of f. 1738 @* Otherwise and by default, v is set to (1,...,1). See Noro , 2002.1796 @* Otherwise and by default, v is set to (1,...,1). See Noro (2002). 1739 1797 DISPLAY: If printlevel=1, progress debug messages will be printed, 1740 1798 @* if printlevel>=2, all the debug messages will be printed. … … 1742 1800 " 1743 1801 { 1744 if (dmodappassumeViolation()) 1745 { 1746 ERROR("Basering is inappropriate: characteristic>0 or qring present"); 1747 } 1802 dmodappAssumeViolation(); 1748 1803 if (!isCommutative()) 1749 1804 { … … 1759 1814 if (size(#)>0) 1760 1815 { 1761 if ( typeof(#[1])=="int" || typeof(#[1])=="number")1816 if (intLike(#[1])) 1762 1817 { 1763 1818 whichengine = int(#[1]); … … 1765 1820 if (size(#)>1) 1766 1821 { 1767 if ( typeof(#[2])=="int" || typeof(#[2])=="number")1822 if (intLike(#[2])) 1768 1823 { 1769 1824 methodord = int(#[2]); … … 1771 1826 if (size(#)>2) 1772 1827 { 1773 if ( typeof(#[3])=="intvec" && size(#[3])==n && allPositive(#[3])==1)1828 if ((typeof(#[3])=="intvec") && (size(#[3])==n) && (allPositive(#[3])==1)) 1774 1829 { 1775 1830 u0 = #[3]; … … 1778 1833 } 1779 1834 } 1780 // creating the homogenized extended Weyl algebra1781 1835 list RL = ringlist(save); 1782 1836 RL = RL[1..4]; // if basering is commutative nc_algebra … … 1834 1888 I = I, var(n+2+i)+diff(f,var(i+1))*var(n+2); 1835 1889 } 1836 // I = engine(I,whichengine); // todo is it efficient to compute a GB firstwrt dp first?1890 // I = engine(I,whichengine); // todo efficient to compute GB wrt dp first? 1837 1891 // 3.2 computie the initial ideal 1838 1892 intvec w = 1,0:n; … … 1878 1932 if (size(#)>0) 1879 1933 { 1880 if ( typeof(#[1])=="int" || typeof(#[1])=="number")1934 if (intLike(#[1])) 1881 1935 { 1882 1936 whichengine = int(#[1]); … … 1884 1938 if (size(#)>1) 1885 1939 { 1886 if ( typeof(#[2])=="int" || typeof(#[2])=="number")1940 if (intLike(#[2])) 1887 1941 { 1888 1889 1942 l0 = int(#[2]); 1943 l0set = 1; 1890 1944 } 1891 1945 if (size(#)>2) 1892 1946 { 1893 1947 if (typeof(#[3])=="ideal") 1894 1948 { 1895 1896 1897 1949 G = #[3]; 1950 Gset = 1; 1951 } 1898 1952 } 1899 1953 } … … 1902 1956 int i,j,k; 1903 1957 int n = nvars(basering)/2; 1904 if (w == intvec(0))1958 if (w == 0:size(w)) 1905 1959 { 1906 1960 ERROR("weight vector must not be zero"); … … 1940 1994 kill inG,v,s; 1941 1995 L = intRoots(L); // integral roots of b-function 1942 if (L[2]== intvec(0)) // no integral roots1996 if (L[2]==0:size(L[2])) // no integral roots 1943 1997 { 1944 1998 return(list(ideal(0),ideal(0))); … … 1958 2012 } 1959 2013 intvec m; 1960 for (i= 1; i<=size(G); i++)2014 for (i=ncols(G); i>0; i--) 1961 2015 { 1962 2016 m[i] = deg(G[i],ww); … … 2014 2068 for (k=1; k<=ncols(B); k++) 2015 2069 { 2016 2017 2018 2070 p = B[k]*G[i]; 2071 p = f(p); 2072 M[size(M)+1] = p; 2019 2073 } 2020 2074 } 2021 2075 } 2022 ideal Bl0; 2023 for (i=0; i<=l0; i++) 2024 { 2025 Bl0 = Bl0,Blist[i+1]; 2026 } 2027 Bl0 = deleteGenerator(Bl0,1); 2076 ideal Bl0 = Blist[1..(l0+1)]; 2028 2077 dbprint(ppl,"// found basis of free module"); 2029 dbprint(ppl-1,"// " + string(Bl ist));2078 dbprint(ppl-1,"// " + string(Bl0)); 2030 2079 dbprint(ppl,"// found generators of submodule"); 2031 2080 dbprint(ppl-1,"// " + string(M)); … … 2062 2111 if (!zeropresent) // restrict/integrate all vars, return input ring 2063 2112 { 2064 def newR = save; 2113 def newR = save; 2065 2114 } 2066 2115 else … … 2096 2145 "USAGE: restrictionModule(I,w,[,eng,m,G]); 2097 2146 @* I ideal, w intvec, eng and m optional ints, G optional ideal 2098 RETURN: ring 2099 ASSUME: The basering is the n-th Weyl algebra in characteristic 0 and for all 2100 @* 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 holds, i.e. the 2101 @* sequence of variables is given by x(1),...,x(n),D(1),...,D(n), 2102 @* where D(i) is the differential operator belonging to x(i). 2147 RETURN: ring (a Weyl algebra) containing a module 'resMod' 2148 ASSUME: The basering is the n-th Weyl algebra over a field of characteristic 0 2149 @* and for all 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 2150 @* holds, i.e. the sequence of variables is given by 2151 @* x(1),...,x(n),D(1),...,D(n), where D(i) is the differential operator 2152 @* belonging to x(i). 2103 2153 @* Further, assume that I is holonomic and that w is n-dimensional with 2104 2154 @* non-negative entries. 2105 2155 PURPOSE: computes the restriction module of a holonomic ideal to the subspace 2106 @* defined by the variables belonging to the non-zero entries of the 2107 @* given intvec. 2108 NOTE: The output ring is the Weyl algebra defined by the zero entries of the 2109 @* given intvec. It contains an object @code{resMod} of type @code{module 2110 @* being the restriction module of the given ideal wrt the given intvec. 2156 @* defined by the variables corresponding to the non-zero entries of the 2157 @* given intvec 2158 NOTE: The output ring is the Weyl algebra defined by the zero entries of w. 2159 @* It contains a module 'resMod' being the restriction module of I wrt w. 2111 2160 @* If there are no zero entries, the input ring is returned. 2112 2161 @* If eng<>0, @code{std} is used for Groebner basis computations, … … 2119 2168 @* Further note, that the assumptions on m and G (if given) are not 2120 2169 @* checked. 2121 0DISPLAY: If printlevel=1, progress debug messages will be printed,2170 DISPLAY: If printlevel=1, progress debug messages will be printed, 2122 2171 @* if printlevel>=2, all the debug messages will be printed. 2123 2172 EXAMPLE: example restrictionModule; shows examples … … 2128 2177 if (size(#)>0) 2129 2178 { 2130 if ( typeof(#[1])=="int" || typeof(#[1])=="number")2179 if (intLike(#[1])) 2131 2180 { 2132 2181 eng = int(#[1]); … … 2156 2205 if (size(#)>0) 2157 2206 { 2158 if( typeof(#[1])=="int" || typeof(#[1])=="number")2159 { 2160 eng = #[1];2207 if(intLike(#[1])) 2208 { 2209 eng = int(#[1]); 2161 2210 } 2162 2211 } … … 2192 2241 if (M[1,i]<>0) 2193 2242 { 2194 2195 2196 2197 2198 2243 v = M[2..r,i]; 2244 if (v == zm) 2245 { 2246 J[size(J+1)] = M[1,i]; 2247 } 2199 2248 } 2200 2249 } … … 2218 2267 "USAGE: restrictionIdeal(I,w,[,eng,m,G]); 2219 2268 @* I ideal, w intvec, eng and m optional ints, G optional ideal 2220 RETURN: ring 2221 ASSUME: The basering is the n-th Weyl algebra in characteristic 0 and for all 2222 @* 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 holds, i.e. the 2223 @* sequence of variables is given by x(1),...,x(n),D(1),...,D(n), 2224 @* where D(i) is the differential operator belonging to x(i). 2269 RETURN: ring (a Weyl algebra) containing an ideal 'resIdeal' 2270 ASSUME: The basering is the n-th Weyl algebra over a field of characteristic 0 2271 @* and for all 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 2272 @* holds, i.e. the sequence of variables is given by 2273 @* x(1),...,x(n),D(1),...,D(n), where D(i) is the differential operator 2274 @* belonging to x(i). 2225 2275 @* Further, assume that I is holonomic and that w is n-dimensional with 2226 2276 @* non-negative entries. 2227 2277 PURPOSE: computes the restriction ideal of a holonomic ideal to the subspace 2228 @* defined by the variables belonging to the non-zero entries of the 2229 @* given intvec. 2230 NOTE: The output ring is the Weyl algebra defined by the zero entries of the 2231 @* given intvec. It contains an object @code{resIdeal} of type @code{ideal} 2232 @* being the restriction ideal of the given ideal wrt the given intvec. 2278 @* defined by the variables corresponding to the non-zero entries of the 2279 @* given intvec 2280 NOTE: The output ring is the Weyl algebra defined by the zero entries of w. 2281 @* It contains an ideal 'resIdeal' being the restriction ideal of I wrt w. 2233 2282 @* If there are no zero entries, the input ring is returned. 2234 2283 @* If eng<>0, @code{std} is used for Groebner basis computations, … … 2246 2295 " 2247 2296 { 2248 def save = basering;2249 2297 def rm = restrictionIdealEngine(I,w,"restriction",#); 2250 setring rm;2251 // export(resIdeal);2252 setring save;2253 2298 return(rm); 2254 2299 } … … 2274 2319 "USAGE: fourier(I[,v]); I an ideal, v an optional intvec 2275 2320 RETURN: ideal 2276 PURPOSE: computes the Fourier transform of an ideal in the Weyl algebra 2277 ASSUME: The basering is the n-th Weyl algebra in characteristic 0 and for all 2278 @* 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 holds, i.e. the 2279 @* sequence of variables is given by x(1),...,x(n),D(1),...,D(n), 2280 @* where D(i) is the differential operator belonging to x(i). 2281 NOTE: If v is an intvec with entries ranging from 1 to n, the Fourier 2321 PURPOSE: computes the Fourier transform of an ideal in a Weyl algebra 2322 ASSUME: The basering is the n-th Weyl algebra over a field of characteristic 0 2323 @* and for all 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 2324 @* holds, i.e. the sequence of variables is given by 2325 @* x(1),...,x(n),D(1),...,D(n), where D(i) is the differential operator 2326 @* belonging to x(i). 2327 NOTE: The Fourier automorphism is defined by mapping x(i) to -D(i) and 2328 @* D(i) to x(i). 2329 @* If v is an intvec with entries ranging from 1 to n, the Fourier 2282 2330 @* transform of I restricted to the variables given by v is computed. 2331 SEE ALSO: inverseFourier 2283 2332 EXAMPLE: example fourier; shows examples 2284 2333 " … … 2295 2344 int n = nvars(basering)/2; 2296 2345 int i; 2297 if(v <> intvec(0))2346 if(v <> 0:size(v)) 2298 2347 { 2299 2348 v = sortIntvec(v)[1]; … … 2302 2351 if (v[i] == v[i+1]) 2303 2352 { 2304 2353 ERROR("No double entries allowed in intvec"); 2305 2354 } 2306 2355 } 2307 2356 } 2308 else 2309 { 2310 for (i=1; i<=n; i++) 2311 { 2312 v[i] = i; 2313 } 2357 else 2358 { 2359 v = 1..n; 2314 2360 } 2315 2361 ideal m = maxideal(1); … … 2342 2388 "USAGE: inverseFourier(I[,v]); I an ideal, v an optional intvec 2343 2389 RETURN: ideal 2344 PURPOSE: computes the inverse of the Fourier transform of an ideal in the Weyl 2345 @* algebra 2346 ASSUME: The basering is the n-th Weyl algebra in characteristic 0 and for all 2347 @* 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 holds, i.e. the 2348 @* sequence of variables is given by x(1),...,x(n),D(1),...,D(n), 2349 @* where D(i) is the differential operator belonging to x(i). 2350 NOTE: If v is an intvec with entries ranging from 1 to n, the inverse Fourier 2390 PURPOSE: computes the inverse Fourier transform of an ideal in a Weyl algebra 2391 ASSUME: The basering is the n-th Weyl algebra over a field of characteristic 0 2392 @* and for all 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 2393 @* holds, i.e. the sequence of variables is given by 2394 @* x(1),...,x(n),D(1),...,D(n), where D(i) is the differential operator 2395 @* belonging to x(i). 2396 NOTE: The Fourier automorphism is defined by mapping x(i) to -D(i) and 2397 @* D(i) to x(i). 2398 @* If v is an intvec with entries ranging from 1 to n, the inverse Fourier 2351 2399 @* transform of I restricted to the variables given by v is computed. 2400 SEE ALSO: fourier 2352 2401 EXAMPLE: example inverseFourier; shows examples 2353 2402 " … … 2364 2413 int n = nvars(basering)/2; 2365 2414 int i; 2366 if(v <> intvec(0))2415 if(v <> 0:size(v)) 2367 2416 { 2368 2417 v = sortIntvec(v)[1]; … … 2371 2420 if (v[i] == v[i+1]) 2372 2421 { 2373 2422 ERROR("No double entries allowed in intvec"); 2374 2423 } 2375 2424 } 2376 2425 } 2377 else 2378 { 2379 for (i=1; i<=n; i++) 2380 { 2381 v[i] = i; 2382 } 2426 else 2427 { 2428 v = 1..n; 2383 2429 } 2384 2430 ideal m = maxideal(1); … … 2411 2457 "USAGE: integralModule(I,w,[,eng,m,G]); 2412 2458 @* I ideal, w intvec, eng and m optional ints, G optional ideal 2413 RETURN: ring 2414 ASSUME: The basering is the n-th Weyl algebra in characteristic 0 and for all 2415 @* 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 holds, i.e. the 2416 @* sequence of variables is given by x(1),...,x(n),D(1),...,D(n), 2417 @* where D(i) is the differential operator belonging to x(i). 2459 RETURN: ring (a Weyl algebra) containing a module 'intMod' 2460 ASSUME: The basering is the n-th Weyl algebra over a field of characteristic 0 2461 @* and for all 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 2462 @* holds, i.e. the sequence of variables is given by 2463 @* x(1),...,x(n),D(1),...,D(n), where D(i) is the differential operator 2464 @* belonging to x(i). 2418 2465 @* Further, assume that I is holonomic and that w is n-dimensional with 2419 2466 @* non-negative entries. 2420 PURPOSE: computes the integral module of a holonomic ideal to the subspace 2421 @* defined by the variables belonging to the non-zero entries of the 2422 @* given intvec. 2423 NOTE: The output ring is the Weyl algebra defined by the zero entries of the 2424 @* given intvec. It contains an object @code{intMod} of type @code{module} 2425 @* being the integral module of the given ideal wrt the given intvec. 2467 PURPOSE: computes the integral module of a holonomic ideal w.r.t. the subspace 2468 @* defined by the variables corresponding to the non-zero entries of the 2469 @* given intvec 2470 NOTE: The output ring is the Weyl algebra defined by the zero entries of w. 2471 @* It contains a module 'intMod' being the integral module of I wrt w. 2426 2472 @* If there are no zero entries, the input ring is returned. 2427 2473 @* If eng<>0, @code{std} is used for Groebner basis computations, 2428 2474 @* otherwise, and by default, @code{slimgb} is used. 2429 @* Let F denote the Fourier transform of I wrtw.2430 @* The minimal integer root of the b-function of F(I) w rtthe weight2475 @* Let F(I) denote the Fourier transform of I w.r.t. w. 2476 @* The minimal integer root of the b-function of F(I) w.r.t. the weight 2431 2477 @* (-w,w) can be specified via the optional argument m. 2432 2478 @* The optional argument G is used for specifying a Groebner Basis of F(I) 2433 2479 @* wrt the weight (-w,w), that is, the initial form of G generates the 2434 @* initial ideal of F(I) w rtthe weight (-w,w).2480 @* initial ideal of F(I) w.r.t. the weight (-w,w). 2435 2481 @* Further note, that the assumptions on m and G (if given) are not 2436 2482 @* checked. … … 2445 2491 if (size(#)>0) 2446 2492 { 2447 if ( typeof(#[1])=="int" || typeof(#[1])=="number")2493 if (intLike(#[1])) 2448 2494 { 2449 2495 whichengine = int(#[1]); … … 2451 2497 if (size(#)>1) 2452 2498 { 2453 if ( typeof(#[2])=="int" || typeof(#[2])=="number")2499 if (intLike(#[2])) 2454 2500 { 2455 2456 2501 l0 = int(#[2]); 2502 l0set = 1; 2457 2503 } 2458 2504 if (size(#)>2) 2459 2505 { 2460 2506 if (typeof(#[3])=="ideal") 2461 2507 { 2462 2463 2464 2508 G = #[3]; 2509 Gset = 1; 2510 } 2465 2511 } 2466 2512 } … … 2474 2520 if (w[i]>0) 2475 2521 { 2476 if (v == intvec(0))2522 if (v == 0:size(v)) 2477 2523 { 2478 2524 v[1] = i; 2479 2525 } 2480 2526 else 2481 2527 { 2482 2528 v[size(v)+1] = i; 2483 2529 } 2484 2530 } … … 2525 2571 "USAGE: integralIdeal(I,w,[,eng,m,G]); 2526 2572 @* I ideal, w intvec, eng and m optional ints, G optional ideal 2527 RETURN: ring 2528 ASSUME: The basering is the n-th Weyl algebra in characteristic 0 and for all 2529 @* 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 holds, i.e. the 2530 @* sequence of variables is given by x(1),...,x(n),D(1),...,D(n), 2531 @* where D(i) is the differential operator belonging to x(i). 2573 RETURN: ring (a Weyl algebra) containing an ideal 'intIdeal' 2574 ASSUME: The basering is the n-th Weyl algebra over a field of characteristic 0 2575 @* and for all 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 2576 @* holds, i.e. the sequence of variables is given by 2577 @* x(1),...,x(n),D(1),...,D(n), where D(i) is the differential operator 2578 @* belonging to x(i). 2532 2579 @* Further, assume that I is holonomic and that w is n-dimensional with 2533 2580 @* non-negative entries. 2534 PURPOSE: computes the integral ideal of a holonomic ideal tothe subspace2535 @* defined by the variables belonging to the non-zero entries of the2581 PURPOSE: computes the integral ideal of a holonomic ideal w.r.t. the subspace 2582 @* defined by the variables corresponding to the non-zero entries of the 2536 2583 @* given intvec. 2537 NOTE: The output ring is the Weyl algebra defined by the zero entries of the 2538 @* given intvec. It contains an object @code{intIdeal} of type @code{ideal} 2539 @* being the integral ideal of the given ideal wrt the given intvec. 2584 NOTE: The output ring is the Weyl algebra defined by the zero entries of w. 2585 @* It contains ideal 'intIdeal' being the integral ideal of I w.r.t. w. 2540 2586 @* If there are no zero entries, the input ring is returned. 2541 2587 @* If eng<>0, @code{std} is used for Groebner basis computations, … … 2553 2599 " 2554 2600 { 2555 def save = basering;2556 2601 def im = restrictionIdealEngine(I,w,"integral",#); 2557 setring im;2558 //export(intIdeal);2559 setring save;2560 2602 return(im); 2561 2603 } … … 2577 2619 @* I ideal, w optional intvec, eng and k optional ints, G optional ideal 2578 2620 RETURN: ideal 2579 ASSUME: The basering is the n-th Weyl algebra in characteristic 0 and for all 2580 @* 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 holds, i.e. the 2581 @* sequence of variables is given by x(1),...,x(n),D(1),...,D(n), 2582 @* where D(i) is the differential operator belonging to x(i). 2583 @* Further, assume that I is a cyclic representation of the holonomic 2584 @* module K[x,1/f]f^m, where f in K[x] and m is smaller than or equal to 2621 ASSUME: The basering is the n-th Weyl algebra D over a field of characteristic 2622 @* zero and for all 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 2623 @* holds, i.e. the sequence of variables is given by 2624 @* x(1),...,x(n),D(1),...,D(n), where D(i) is the differential operator 2625 @* belonging to x(i). 2626 @* Further, assume that I is of special kind, namely let f in K[x] and 2627 @* consider the module K[x,1/f]f^m, where m is smaller than or equal to 2585 2628 @* the minimal integer root of the Bernstein-Sato polynomial of f. 2629 @* Since this module is known to be a holonomic D-module, it has a cyclic 2630 @* presentation D/I. 2586 2631 PURPOSE: computes a basis of the n-th de Rham cohomology group of the complement 2587 2632 @* of the hypersurface defined by f 2588 NOTE: If I does not satisfy the conditions described above, the result might2589 @* have no meaning. 2633 NOTE: If I does not satisfy the assumptions described above, the result might 2634 @* have no meaning. Note that I can be computed with @code{annfs}. 2590 2635 @* If w is an intvec with exactly n strictly positive entries, w is used 2591 2636 @* in the computation. Otherwise, and by default, w is set to (1,...,1). 2592 2637 @* If eng<>0, @code{std} is used for Groebner basis computations, 2593 2638 @* otherwise, and by default, @code{slimgb} is used. 2594 @* Let F denote the Fourier transform of I wrt w.2639 @* Let F(I) denote the Fourier transform of I wrt w. 2595 2640 @* An integer smaller than or equal to the minimal integer root of the 2596 2641 @* b-function of F(I) wrt the weight (-w,w) can be specified via the … … 2601 2646 @* Further note, that the assumptions on I, k and G (if given) are not 2602 2647 @* checked. 2648 THEORY: (SST) pp. 232-235 2603 2649 DISPLAY: If printlevel=1, progress debug messages will be printed, 2604 2650 @* if printlevel>=2, all the debug messages will be printed. 2651 SEE ALSO: deRhamCohom 2605 2652 EXAMPLE: example deRhamCohomIdeal; shows examples 2606 2653 " … … 2616 2663 if (allPositive(#[1])==1) 2617 2664 { 2618 2665 w = #[1]; 2619 2666 } 2620 2667 else 2621 2668 { 2622 2623 2669 print("// Entries of intvec must be strictly positive"); 2670 print("// Using weight " + string(w)); 2624 2671 } 2625 2672 if (size(#)>1) 2626 2673 { 2627 if (typeof(#[2])=="int" || typeof(#[2])=="number")2674 if (intLike(#[2])) 2628 2675 { 2629 2630 2631 2676 whichengine = int(#[2]); 2677 } 2678 if (size(#)>2) 2632 2679 { 2633 if (typeof(#[3])=="int" || typeof(#[3])=="number")2680 if (intLike(#[3])) 2634 2681 { 2635 2636 2637 2638 2682 l0 = int(#[3]); 2683 l0set = 1; 2684 } 2685 if (size(#)>3) 2639 2686 { 2640 2687 if (typeof(#[4])=="ideal") 2641 2688 { 2642 2643 2644 2645 2646 2689 G = #[4]; 2690 Gset = 1; 2691 } 2692 } 2693 } 2647 2694 } 2648 2695 } … … 2656 2703 if (w[i]>0) 2657 2704 { 2658 if (v == intvec(0))2705 if (v == 0:size(v)) 2659 2706 { 2660 2707 v[1] = i; 2661 2708 } 2662 2709 else 2663 2710 { 2664 2711 v[size(v)+1] = i; 2665 2712 } 2666 2713 } … … 2700 2747 N = simplify(N,2+8); 2701 2748 printlevel = printlevel-1; 2702 N = linReduceIdeal(N); 2749 N = linReduceIdeal(N); 2703 2750 N = simplify(N,2+8); 2704 2751 for (i=1; i<=size(B); i++) … … 2711 2758 while (p<N[j]) 2712 2759 { 2713 2760 j++; 2714 2761 } 2715 2762 N = insertGenerator(N,p,j+1); … … 2727 2774 def W = annRat(1,F^2); // so we compute the annihilator of 1/F^2 2728 2775 setring W; W; // Weyl algebra, contains LD = Ann(1/F^2) 2729 LD; // K[x,y,z,1/ f]f^(-2) is isomorphic to W/LD as W-module2776 LD; // K[x,y,z,1/F]F^(-2) is isomorphic to W/LD as W-module 2730 2777 deRhamCohomIdeal(LD); // we see that the K-dim is 2 2731 2778 } … … 2733 2780 proc deRhamCohom (poly f, list #) 2734 2781 "USAGE: deRhamCohom(f[,eng,m]); f poly, eng and m optional ints 2735 RETURN: ring 2736 ASSUME: Basering is a commutative ring in n variables over a field of char 0. 2737 PURPOSE: computes a basis of the n-th de Rham cohomology group of f^m 2738 NOTE: The output ring is the n-th Weyl algebra. It contains an object 2739 @* @code{DR} of type @code{ideal}, being a basis of the n-th de Rham 2740 @* cohomology group of the complement of the hypersurface defined by f. 2782 RETURN: ring (a Weyl Algebra) containing an ideal 'DR' 2783 ASSUME: Basering is a commutative and over a field of characteristic 0. 2784 PURPOSE: computes a basis of the n-th de Rham cohomology group of the complement 2785 @* of the hypersurface defined by f, where n denotes the number of 2786 @* variables of the basering 2787 NOTE: The output ring is the n-th Weyl algebra. It contains an ideal 'DR' 2788 @* being a basis of the n-th de Rham cohomology group of the complement of 2789 @* the hypersurface defined by f. 2741 2790 @* If eng<>0, @code{std} is used for Groebner basis computations, 2742 2791 @* otherwise, and by default, @code{slimgb} is used. … … 2745 2794 @* not checked. If not specified, m is set to the minimal integer root of 2746 2795 @* the Bernstein-Sato polynomial of f. 2796 THEORY: (SST) pp. 232-235 2747 2797 DISPLAY: If printlevel=1, progress debug messages will be printed, 2748 2798 @* if printlevel>=2, all the debug messages will be printed. 2799 SEE ALSO: deRhamCohomIdeal 2749 2800 EXAMPLE: example deRhamCohom; shows example 2750 2801 " … … 2754 2805 if (size(#)>0) 2755 2806 { 2756 if( typeof(#[1])=="int" || typeof(#[1])=="number")2807 if(intLike(#[1])) 2757 2808 { 2758 2809 eng = int(#[1]); … … 2760 2811 if (size(#)>1) 2761 2812 { 2762 if( typeof(#[2])=="int" || typeof(#[2])=="number")2813 if(intLike(#[2])) 2763 2814 { 2764 2765 2815 l0 = int(#[2]); 2816 l0given = 1; 2766 2817 } 2767 2818 } … … 2774 2825 def save = basering; 2775 2826 int n = nvars(save); 2776 dbprint(ppl,"// Computing Ann(f^s)...");2827 dbprint(ppl,"// Computing s-parametric annihilator Ann(f^s)..."); 2777 2828 def A = Sannfs(f); 2778 2829 setring A; … … 2785 2836 ideal LDf = LD,f; 2786 2837 LDf = engine(LDf,eng); 2787 vector v = pIntersect( s,LDf); // BS poly of f2838 vector v = pIntersect(var(2*n+1),LDf); // BS poly of f 2788 2839 list BS = bFactor(vec2poly(v)); 2789 2840 dbprint(ppl,"// ...done"); … … 2840 2891 proc appelF1() 2841 2892 "USAGE: appelF1(); 2842 RETURN: ring (and exports an ideal into it) 2843 PURPOSE: define the ideal in a parametric Weyl algebra, 2844 @* which annihilates Appel F1 hypergeometric function 2845 NOTE: the ideal called IAppel1 is exported to the output ring 2846 EXAMPLE: example appelF1; shows examples 2893 RETURN: ring (a parametric Weyl algebra) containing an ideal 'IAppel1' 2894 PURPOSE: defines the ideal in a parametric Weyl algebra, 2895 @* which annihilates Appel F1 hypergeometric function 2896 NOTE: The output ring is a parametric Weyl algebra. It contains an ideal 2897 @* 'IAappel1' annihilating Appel F1 hypergeometric function. 2898 @* See (SST) p. 48. 2899 EXAMPLE: example appelF1; shows example 2847 2900 " 2848 2901 { 2849 2902 // Appel F1, d = b', SST p.48 2850 2903 ring @r = (0,a,b,c,d),(x,y,Dx,Dy),(a(0,0,1,1),a(0,0,1,0),dp); 2851 matrix @D[4][4]; 2852 @D[1,3]=1; @D[2,4]=1; 2853 def @S = nc_algebra(1,@D); 2904 def @S = Weyl(); 2854 2905 setring @S; 2855 2906 ideal IAppel1 = … … 2871 2922 proc appelF2() 2872 2923 "USAGE: appelF2(); 2873 RETURN: ring (and exports an ideal into it) 2874 PURPOSE: define the ideal in a parametric Weyl algebra, 2875 @* which annihilates Appel F2 hypergeometric function 2876 NOTE: the ideal called IAppel2 is exported to the output ring 2877 EXAMPLE: example appelF2; shows examples 2924 RETURN: ring (a parametric Weyl algebra) containing an ideal 'IAppel2' 2925 PURPOSE: defines the ideal in a parametric Weyl algebra, 2926 @* which annihilates Appel F2 hypergeometric function 2927 NOTE: The output ring is a parametric Weyl algebra. It contains an ideal 2928 @* 'IAappel2' annihilating Appel F2 hypergeometric function. 2929 @* See (SST) p. 85. 2930 EXAMPLE: example appelF2; shows example 2878 2931 " 2879 2932 { 2880 2933 // Appel F2, c = b', SST p.85 2881 2934 ring @r = (0,a,b,c),(x,y,Dx,Dy),(a(0,0,1,1),a(0,0,1,0),dp); 2882 matrix @D[4][4]; 2883 @D[1,3]=1; @D[2,4]=1; 2884 def @S = nc_algebra(1,@D); 2935 def @S = Weyl(); 2885 2936 setring @S; 2886 2937 ideal IAppel2 = … … 2901 2952 proc appelF4() 2902 2953 "USAGE: appelF4(); 2903 RETURN: ring (and exports an ideal into it) 2904 PURPOSE: define the ideal in a parametric Weyl algebra, 2905 @* which annihilates Appel F4 hypergeometric function 2906 NOTE: the ideal called IAppel4 is exported to the output ring 2907 EXAMPLE: example appelF4; shows examples 2954 RETURN: ring (a parametric Weyl algebra) containing an ideal 'IAppel4' 2955 PURPOSE: defines the ideal in a parametric Weyl algebra, 2956 @* which annihilates Appel F4 hypergeometric function 2957 NOTE: The output ring is a parametric Weyl algebra. It contains an ideal 2958 @* 'IAappel4' annihilating Appel F4 hypergeometric function. 2959 @* See (SST) p. 39. 2960 EXAMPLE: example appelF4; shows example 2908 2961 " 2909 2962 { 2910 2963 // Appel F4, d = c', SST, p. 39 2911 2964 ring @r = (0,a,b,c,d),(x,y,Dx,Dy),(a(0,0,1,1),a(0,0,1,0),dp); 2912 matrix @D[4][4]; 2913 @D[1,3]=1; @D[2,4]=1; 2914 def @S = nc_algebra(1,@D); 2965 def @S = Weyl(); 2915 2966 setring @S; 2916 2967 ideal IAppel4 = … … 2934 2985 proc charVariety(ideal I, list #) 2935 2986 "USAGE: charVariety(I [,eng]); I an ideal, eng an optional int 2936 RETURN: ring 2937 PURPOSE: compute the characteristic variety of the D-module D/I 2938 ASSUME: The basering is the n-th Weyl algebra in characteristic 0 and for all 2939 @* 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 holds, i.e. the 2940 @* sequence of variables is given by x(1),...,x(n),D(1),...,D(n), 2941 @* where D(i) is the differential operator belonging to x(i). 2942 NOTE: The output ring is commutative. It contains an object @code{charVar} of 2943 @* type @code{ideal}, whose zero set is the characteristic variety of I in 2944 @* the sense of D-module theory. 2945 @* In this procedure, the initial ideal of I wrt weight 0 for x(i) and 2946 @* weight 1 for D(i) is computed. 2987 RETURN: ring (commutative) containing an ideal 'charVar' 2988 PURPOSE: computes an ideal whose zero set is the characteristic variety of I in 2989 @* the sense of D-module theory 2990 ASSUME: The basering is the n-th Weyl algebra over a field of characteristic 0 2991 @* and for all 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 2992 @* holds, i.e. the sequence of variables is given by 2993 @* x(1),...,x(n),D(1),...,D(n), where D(i) is the differential operator 2994 @* belonging to x(i). 2995 NOTE: The output ring is commutative. It contains an ideal 'charVar'. 2947 2996 @* If eng<>0, @code{std} is used for Groebner basis computations, 2948 2997 @* otherwise, and by default, @code{slimgb} is used. 2949 @*If @code{printlevel}=1, progress debug messages will be printed,2998 DISPLAY: If @code{printlevel}=1, progress debug messages will be printed, 2950 2999 @* if @code{printlevel}>=2, all the debug messages will be printed. 3000 SEE ALSO: charInfo 2951 3001 EXAMPLE: example charVariety; shows examples 2952 3002 " … … 2956 3006 if (size(#)>0) 2957 3007 { 2958 if ( typeof(#[1])=="int" || typeof(#[1])=="number")3008 if (intLike(#[1])) 2959 3009 { 2960 3010 eng = int(#[1]); … … 2977 3027 intvec uv = u,v; 2978 3028 charVar = inForm(charVar,uv); 2979 charVar = engine(charVar,eng);3029 charVar = groebner(charVar); 2980 3030 export(charVar); 2981 3031 setring save; … … 2994 3044 setring CA; CA; // commutative ring 2995 3045 charVar; 2996 dim(charVar); 3046 dim(charVar); // hence I is holonomic 2997 3047 } 2998 3048 2999 3049 proc charInfo(ideal I) 3000 3050 "USAGE: charInfo(I); I an ideal 3001 RETURN: ring 3002 PURPOSE: compute the characteristic information for I 3003 ASSUME: The basering is the n-th Weyl algebra in characteristic 0 and for all 3004 @* 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 holds, i.e. the 3005 @* sequence of variables is given by x(1),...,x(n),D(1),...,D(n), 3006 @* where D(i) is the differential operator belonging to x(i). 3007 NOTE: Activate the output ring with the @code{setring} command. 3008 @* In the output (in a commutative ring): 3009 @* - the ideal charVar is the characteristic variety char(I), 3010 @* - the ideal SingLoc is the singular locus of char(I), 3011 @* - the list primDec is the primary decomposition of char(I). 3012 @* If @code{printlevel}=1, progress debug messages will be printed, 3051 RETURN: ring (commut.) containing ideals 'charVar','singLoc' and list 'primDec' 3052 PURPOSE: computes characteristic variety of I (in the sense of D-module theory), 3053 @* its singular locus and primary decomposition 3054 ASSUME: The basering is the n-th Weyl algebra over a field of characteristic 0 3055 @* and for all 1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 3056 @* holds, i.e. the sequence of variables is given by 3057 @* x(1),...,x(n),D(1),...,D(n), where D(i) is the differential operator 3058 @* belonging to x(i). 3059 NOTE: In the output ring, which is commutative: 3060 @* - the ideal 'charVar' is the characteristic variety char(I), 3061 @* - the ideal 'SingLoc' is the singular locus of char(I), 3062 @* - the list 'primDec' is the primary decomposition of char(I). 3063 DISPLAY: If @code{printlevel}=1, progress debug messages will be printed, 3013 3064 @* if @code{printlevel}>=2, all the debug messages will be printed. 3014 3065 EXAMPLE: example charInfo; shows examples … … 3024 3075 dbprint(ppl,"// computing singular locus..."); 3025 3076 ideal singLoc = slocus(charVar); 3026 singLoc = std(singLoc);3077 singLoc = groebner(singLoc); 3027 3078 dbprint(ppl,"// ...done"); 3028 3079 dbprint(ppl-1,"// Got: " + string(singLoc)); … … 3115 3166 setring R; 3116 3167 DLoc(I,F); 3117 LD0; BS;3118 3168 } 3119 3169 … … 3147 3197 setring R; 3148 3198 DLoc(I,F); 3149 LD0; BS;3150 3199 } 3151 3200
Note: See TracChangeset
for help on using the changeset viewer.