Changeset eaf8f8 in git
- Timestamp:
- Mar 9, 2009, 7:34:52 PM (14 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- b22a72d3cf5f625b056ece9285f0442601763cf0
- Parents:
- e6d283f58657a6d67f7a592a1e62a50f9464d936
- Location:
- Singular/LIB
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/bfun.lib
re6d283f reaf8f8 1 1 ////////////////////////////////////////////////////////////////////////////// 2 version="$Id: bfun.lib,v 1. 3 2009-03-06 20:32:28levandov Exp $";2 version="$Id: bfun.lib,v 1.4 2009-03-09 18:34:51 levandov Exp $"; 3 3 category="Noncommutative"; 4 4 info=" … … 56 56 LIB "dmod.lib"; // for SannfsBFCT etc 57 57 LIB "dmodapp.lib"; // for initialIdealW etc 58 LIB "nctools.lib"; // for isWeyl etc58 LIB "nctools.lib"; // for isWeyl etc 59 59 60 60 /////////////////////////////////////////////////////////////////////////////// … … 149 149 static proc safeVarName (string s) 150 150 { 151 string cv= "," + charstr(basering) + "," + varstr(basering) + ",";151 string S = "," + charstr(basering) + "," + varstr(basering) + ","; 152 152 s = "," + s + ","; 153 while (find( cv,s) <> 0)153 while (find(S,s) <> 0) 154 154 { 155 155 s[1] = "@"; … … 903 903 } 904 904 905 proc pIntersectSyz (poly s, ideal I I, list #)905 proc pIntersectSyz (poly s, ideal I, list #) 906 906 "USAGE: pIntersectSyz(f, I [,p,s,t]); f poly, I ideal, p,t optial ints, p prime 907 907 RETURN: vector, coefficient vector of the monic polynomial 908 908 PURPOSE: compute the intersection of an ideal I with the subalgebra K[f] 909 ASSUME: I is given as Groebner basis , basering is free of parameters.909 ASSUME: I is given as Groebner basis. 910 910 NOTE: If the intersection is zero, this procedure might not terminate. 911 911 @* If p>0 is given, this proc computes the generator of the intersection in 912 912 @* char p first and then only searches for a generator of the obtained 913 913 @* degree in the basering. Otherwise, it searched for all degrees by 914 @* computing syzygies. 914 @* computing syzygies. Note that the basering must be free of parameters to 915 @* use this modular method. 915 916 @* If s<>0, @code{std} is used for Groebner basis computations in char 0, 916 917 @* otherwise, and by default, @code{slimgb} is used. … … 923 924 { 924 925 // assume I is given in Groebner basis 925 ideal I = II;926 926 if (attrib(I,"isSB") <> 1) 927 927 { … … 962 962 newNF = NF(s,I); 963 963 NI[2] = newNF; 964 list l = ringlist(save); 965 if (typeof(l[1]) == "int") { l[1] = solveincharp; } 966 else // parameters in basering: problems with mappings from Q(a_i)->Z/p(a_i) 967 { 968 if (solveincharp <> 0) 969 { 970 print("// basering must be free of parameters to use modular method"); 971 print("// solving in characteristic of basering only..."); 972 solveincharp = 0; 973 } 974 } 964 975 if (solveincharp<>0) 965 976 { 966 list l = ringlist(save); 967 l[1] = solveincharp; 968 matrix l5 = l[5]; 969 matrix l6 = l[6]; 977 if (size(l)>4) 978 { 979 matrix l5 = l[5]; 980 matrix l6 = l[6]; 981 } 970 982 def @Rp = ring(l); 971 983 setring @Rp; 972 984 list l = ringlist(@Rp); 973 l[5] = fetch(save,l5); 974 l[6] = fetch(save,l6); 985 setring save; 986 if (size(l)>4) 987 { 988 setring @Rp; 989 l[5] = fetch(save,l5); 990 l[6] = fetch(save,l6); 991 } 992 setring @Rp; 975 993 def Rp = ring(l); 976 994 setring Rp; 977 995 kill @Rp; 978 dbprint(ppl +1,"// solving in ring ", Rp);996 dbprint(ppl-1,"// solving in ring ", Rp); 979 997 vector v; 980 998 map phi = save,maxideal(1); … … 984 1002 } 985 1003 i = 1; 986 dbprint(ppl +1,"// pIntersectSyz starts...");987 dbprint(ppl +1,"// with ideal I=", I);1004 dbprint(ppl,"// pIntersectSyz starts..."); 1005 dbprint(ppl-1,"// with ideal I=", I); 988 1006 while (1) 989 1007 { 990 dbprint(ppl,"// i:"+string(i));1008 dbprint(ppl,"// testing degree: "+string(i)); 991 1009 if (i>1) 992 1010 { … … 1004 1022 } 1005 1023 // look for a solution 1006 dbprint(ppl ,"// linSyzSolve starts with: "+string(matrix(NI)));1024 dbprint(ppl-1,"// linSyzSolve starts with: "+string(matrix(NI))); 1007 1025 if (solveincharp<>0) // modular method 1008 1026 { … … 1031 1049 } 1032 1050 matrix MM[1][nrows(v)] = matrix(v); 1033 dbprint(ppl ,"// linSyzSolve ready with: "+string(MM));1051 dbprint(ppl-1,"// linSyzSolve ready with: "+string(MM)); 1034 1052 kill MM; 1035 1053 // "linSyzSolve ready with"; print(v); … … 1057 1075 i++; 1058 1076 } 1059 dbprint(ppl +1,"// pIntersectSyz finished");1077 dbprint(ppl,"// pIntersectSyz finished"); 1060 1078 return(v); 1061 1079 } … … 1190 1208 print("// basering is qring:"); 1191 1209 print("// discarding the quotient and proceeding..."); 1192 L[4] = 0;1210 L[4] = ideal(0); 1193 1211 qr = 1; 1194 def save2 = ring(L); 1195 setring save2; 1212 def save2 = ring(L); setring save2; 1196 1213 poly f = imap(save,f); 1197 1214 } … … 1214 1231 ideal J = LD; 1215 1232 kill LD; 1233 poly s = var(2*n+1); 1216 1234 } 1217 1235 vector b; … … 1221 1239 if (pIntersectchar == 0) // pIntersectSyz::modular 1222 1240 { 1223 int lb = 30000; 1224 int ub = 536870909; 1225 i = 1; 1226 list usedprimes; 1227 while (b == 0) 1228 { 1229 dbprint(ppl,"// number of run in the loop: "+string(i)); 1230 int q = prime(random(lb,ub)); 1231 if (findFirst(usedprimes,q)==0) // if q was not already used 1232 { 1233 usedprimes = usedprimes,q; 1234 dbprint(ppl,"// used prime is: "+string(q)); 1235 b = pIntersectSyz(s,J,q,whichengine,modengine); 1241 list L = ringlist(D); 1242 if (typeof(L[1])=="int") 1243 { 1244 int lb = 10000; 1245 int ub = 536870909; 1246 i = 1; 1247 list usedprimes; 1248 matrix L5 = L[5]; matrix L6 = L[6]; 1249 int sJ = size(J); int sJq; 1250 while (b == 0) 1251 { 1252 dbprint(ppl,"// number of run in the loop: "+string(i)); 1253 int q = prime(random(lb,ub)); 1254 if (findFirst(usedprimes,q)==0) // if q was not already used 1255 { 1256 usedprimes = usedprimes,q; 1257 dbprint(ppl,"// using prime: "+string(q)); 1258 L[1] = q; 1259 def @Rq = ring(L); setring @Rq; 1260 list lq = ringlist(@Rq); 1261 lq[5] = fetch(D,L5); lq[6] = fetch(D,L6); 1262 def Rq = ring(lq); 1263 setring Rq; kill @Rq; 1264 ideal Jq = fetch(D,J); 1265 sJq = size(lead(Jq)); 1266 setring D; kill Rq; 1267 if (sJq <> sJ) 1268 { 1269 dbprint(ppl,"// " +string(q) + " is unlucky"); 1270 b = 0; 1271 } 1272 else 1273 { 1274 b = pIntersectSyz(s,J,q,whichengine,modengine); 1275 } 1276 } 1277 i++; 1236 1278 } 1237 i++; 1238 } 1239 } 1240 else // pIntersectSyz::non-modular 1279 } 1280 else //parameters: problem when mapping Q(a_i) -> Z/p(a_i) 1281 { 1282 print("// basering must be free of parameters to use modular method"); 1283 print("// solving only in char 0..."); 1284 b = pIntersectSyz(s,J,0,whichengine); 1285 } 1286 } 1287 else // pIntersectSyz::non-modular else // parameters in basering: problems with mappings 1241 1288 { 1242 1289 b = pIntersectSyz(s,J,0,whichengine); … … 1247 1294 b = pIntersect(s,J); 1248 1295 } 1249 if (qr == 1) { setring save2; }1250 else { setring save; }1251 vector b = imap(D,b);1252 1296 if (inorann == 0) { list l = listofroots(b,1); } 1253 1297 else { list l = listofroots(b,0); } 1254 if (qr == 1) 1255 { 1256 setring save; 1257 list l = imap(save2,l); 1258 } 1298 setring save; 1299 list l = imap(D,l); 1259 1300 return(l); 1260 1301 } … … 1343 1384 @* If t<>0, the computation of the intersection is solely performed over 1344 1385 @* charasteristic 0, otherwise and by default, a modular method is used. 1386 @* Note that in this case, the basering must be free of parameters. 1345 1387 @* If u<>0 and by default, @code{std} is used for GB computations in 1346 1388 @* characteristic >0, otherwise, @code{slimgb} is used. … … 1469 1511 { 1470 1512 print("// given ideal is not holonomic"); 1471 print("// setting bound for degree of b-fu bction to 10 and proceeding");1513 print("// setting bound for degree of b-function to 10 and proceeding"); 1472 1514 isH = 10; 1473 1515 } … … 1526 1568 { 1527 1569 int ppl = printlevel - voice +2; 1528 if ( isCommutative() == 0) { ERROR("basering must be commutative"); }1570 if (!isCommutative()) { ERROR("Basering must be commutative"); } 1529 1571 def save = basering; 1530 1572 int n = nvars(save); … … 1539 1581 print("// basering is qring:"); 1540 1582 print("// discarding the quotient and proceeding..."); 1541 L[4] = 0;1583 L[4] = ideal(0); 1542 1584 qr = 1; 1543 1585 def save2 = ring(L); … … 1545 1587 poly f = imap(save,f); 1546 1588 } 1547 int noofvars= 2*n+4;1589 int N = 2*n+4; 1548 1590 int i; 1549 1591 int whichengine = 0; // default … … 1563 1605 } 1564 1606 } 1565 intvec uv; 1566 uv[n+3] = 1; 1567 ring r = 0,(x(1..n)),dp; 1568 poly f = fetch(save,f); 1569 uv[1] = -1; uv[noofvars] = 0; 1570 // for the ordering 1571 intvec @a; @a = 1:noofvars; @a[2] = 2; 1607 // creating the homogenized extended Weyl algebra 1608 // create names for vars 1609 list Lvar; 1610 Lvar[1] = safeVarName("t"); 1611 Lvar[2] = safeVarName("s"); 1612 Lvar[n+3] = safeVarName("D"+Lvar[1]); 1613 Lvar[N] = safeVarName("h"); 1614 for (i=1; i<=n; i++) 1615 { 1616 Lvar[i+2] = string(var(i)); 1617 Lvar[i+n+3] = safeVarName("D" + string(var(i))); 1618 } 1619 // create ordering 1620 intvec uv = -1; uv[n+3] = 1; uv[N] = 0; 1621 intvec @a = 1:N; @a[2] = 2; 1572 1622 intvec @a2 = @a; @a2[2] = 0; @a2[2*n+4] = 0; 1623 list Lord; 1624 Lord[1] = list("a",@a); Lord[2] = list("a",@a2); 1573 1625 if (methodord == 0) // default: block ordering 1574 1626 { 1575 ring @Dh = 0,(t,s,x(n..1),Dt,D(n..1),h),(a(@a),a(@a2),a(uv),dp(noofvars-1),lp(1)); 1627 //ring @Dh = 0,(t,s,x(n..1),Dt,D(n..1),h),(a(@a),a(@a2),a(uv),dp(N-1),lp(1)); 1628 Lord[3] = list("a",uv); 1629 Lord[4] = list("dp",intvec(1:(N-1))); 1630 Lord[5] = list("lp",intvec(1)); 1631 Lord[6] = list("C",intvec(0)); 1576 1632 } 1577 1633 else // M() ordering 1578 1634 { 1579 intmat @Ord[noofvars][noofvars]; 1580 @Ord[1,1..noofvars] = uv; 1581 @Ord[2,1..noofvars] = 1:(noofvars-1); 1582 for (i=1; i<=noofvars-2; i++) 1583 { 1584 @Ord[2+i,noofvars - i] = -1; 1585 } 1635 intmat @Ord[N][N]; 1636 @Ord[1,1..N] = uv; @Ord[2,1..N] = 1:(N-1); 1637 for (i=1; i<=N-2; i++) { @Ord[2+i,N - i] = -1; } 1586 1638 dbprint(ppl,"// weights for ordering: "+string(transpose(@a))); 1587 1639 dbprint(ppl,"// the ordering matrix:",@Ord); 1588 ring @Dh = 0,(t,s,x(n..1),Dt,D(n..1),h),(a(@a),a(@a2),M(@Ord)); 1589 } 1590 dbprint(ppl,"// the ring Dh:",Dh); 1591 // non-commutative relations 1592 matrix @relD[noofvars][noofvars]; 1593 @relD[1,2] = t*h^2;// s*t = t*s+t*h^2 1594 @relD[2,n+3] = Dt*h^2;// Dt*s = s*Dt+h^2 1595 @relD[1,n+3] = h^2; 1640 //ring @Dh = 0,(t,s,x(n..1),Dt,D(n..1),h),(a(@a),a(@a2),M(@Ord)); 1641 Lord[3] = list("M",intvec(@Ord)); 1642 Lord[4] = list("C",intvec(0)); 1643 } 1644 // create commutative ring 1645 list L@Dh = ringlist(basering); 1646 L@Dh = L@Dh[1..4]; // if basering is commutative nc_algebra 1647 L@Dh[2] = Lvar; L@Dh[3] = Lord; 1648 def @Dh = ring(L@Dh); setring @Dh; 1649 dbprint(ppl,"// the ring @Dh:",@Dh); 1650 // create non-commutative relations 1651 matrix @relD[N][N]; 1652 @relD[1,2] = var(1)*var(N)^2; // s*t = t*s + t*h^2 1653 @relD[2,n+3] = var(n+3)*var(N)^2; // Dt*s = s*Dt+Dt*h^2 1654 @relD[1,n+3] = var(N)^2; 1596 1655 for (i=1; i<=n; i++) 1597 1656 { 1598 @relD[i+2,n+3+i] = h^2;1657 @relD[i+2,n+3+i] = var(N)^2; 1599 1658 } 1600 1659 dbprint(ppl,"// nc relations:",@relD); 1601 1660 def Dh = nc_algebra(1,@relD); 1602 setring Dh; 1603 dbprint(ppl,"// computing in ring",DDh); 1604 ideal I; 1605 poly f = imap(r,f); 1606 kill r; 1661 setring Dh; kill @Dh; 1662 dbprint(ppl,"// computing in ring",Dh); 1663 poly f = imap(save,f); 1607 1664 f = homog(f,h); 1608 I = t - f, t*Dt - s; // defining the Malgrange ideal 1665 // create the Malgrange ideal 1666 ideal I = var(1) - f, var(1)*var(n+3) - var(2); 1609 1667 for (i=1; i<=n; i++) 1610 1668 { 1611 I = I, D(i)+diff(f,x(i))*Dt; 1612 } 1669 I[3+i] = var(i+n+3)+diff(f,var(i+2))*var(n+3); 1670 } 1671 dbprint(ppl-1, "// the Malgrange ideal: " +string(I)); 1672 // the hard part: Groebner basis computation 1613 1673 dbprint(ppl, "// starting Groebner basis computation with engine: "+string(whichengine)); 1614 1674 I = engine(I, whichengine); 1615 1675 dbprint(ppl, "// finished Groebner basis computation"); 1616 dbprint(ppl, "// I before dehomogenization: "+string(I));1617 1676 I = subst(I,h,1); // dehomogenization 1618 dbprint(ppl, "// I after dehomogenization: " +string(I)); 1619 I = inForm(I,uv); // we are only interested in the initial form w.r.t. uv 1677 dbprint(ppl-1,string(I)); 1678 // 3.3 the initial form 1679 I = inForm(I,uv); 1620 1680 dbprint(ppl, "// the initial ideal:", string(matrix(I))); 1681 // read off the solution 1621 1682 intvec tonselect = 1; 1622 1683 for (i=3; i<=2*n+4; i++) { tonselect = tonselect,i; } -
Singular/LIB/dmod.lib
re6d283f reaf8f8 1 1 ////////////////////////////////////////////////////////////////////////////// 2 version="$Id: dmod.lib,v 1.3 6 2009-03-06 21:05:54levandov Exp $";2 version="$Id: dmod.lib,v 1.37 2009-03-09 18:34:51 levandov Exp $"; 3 3 category="Noncommutative"; 4 4 info=" … … 28 28 @* PS*F^(s+1) = bs*F^s holds in K[x_1,...,x_n,1/F]*F^s. 29 29 30 @* We provide the following implementations: 31 @* OT) the classical Ann F^s algorithm from Oaku and Takayama (Journal of 30 REFERENCES: 31 @* We provide the following implementations of algorithms: 32 @* (OT) the classical Ann F^s algorithm from Oaku and Takayama (Journal of 32 33 @* Pure and Applied Math., 1999), 33 @* LOT) Levandovskyy's modification of the Oaku-Takayama algorithm (ISSAC 2007)34 @* BM) the Ann F^s algorithm by Briancon and Maisonobe (Remarques sur34 @* (LOT) Levandovskyy's modification of the Oaku-Takayama algorithm (ISSAC 2007) 35 @* (BM) the Ann F^s algorithm by Briancon and Maisonobe (Remarques sur 35 36 @* l'ideal de Bernstein associe a des polynomes, preprint, 2002) 37 @* (LM08) V. Levandovskyy and J. Martin-Morales, ISSAC 2008 38 @* (C) Countinho, A Primer of Algebraic D-Modules, 39 @* (SST) Saito, Sturmfels, Takayama 'Groebner Deformations of Hypergeometric 40 @* Differential Equations', Springer, 2000 41 36 42 37 43 GUIDE: … … 78 84 AUXILIARY PROCEDURES: 79 85 80 arrange(p); create a poly, describing a full hyperplane arrangement81 reiffen(p,q); create a poly, describing a Reiffen curve82 isHolonomic(M); 86 arrange(p); create a poly, describing a full hyperplane arrangement 87 reiffen(p,q); create a poly, describing a Reiffen curve 88 isHolonomic(M); check whether a module is holonomic 83 89 convloc(L); replace global orderings with local in the ringlist L 84 90 minIntRoot(P,fact); minimal integer root among the roots of a maximal ideal P 85 91 varnum(s); the number of the variable with the name s 86 92 isRational(n); check whether n is a rational number 87 93 88 94 SEE ALSO: gmssing_lib, bfun_lib, dmodapp_lib … … 97 103 LIB "control.lib"; // for genericity 98 104 LIB "dmodapp.lib"; // for e.g. engine 105 LIB "poly.lib"; 99 106 100 107 proc testdmodlib() … … 136 143 "USAGE: annfs(f [,S,eng]); f a poly, S a string, eng an optional int 137 144 RETURN: ring 138 PURPOSE: compute the D-module structure of basering[1/f]*f^s with the algorithm given in S and with the Groebner basis engine given in 'eng' 139 NOTE: activate the output ring with the @code{setring} command. 140 @* The value of a string S can be 141 @* 'bm' (default) - for the algorithm of Briancon and Maisonobe, 142 @* 'ot' - for the algorithm of Oaku and Takayama, 143 @* 'lot' - for the Levandovskyy's modification of the algorithm of Oaku and Takayama. 144 @* If eng <>0, @code{std} is used for Groebner basis computations, 145 @* otherwise and by default @code{slimgb} is used. 146 @* In the output ring: 147 @* - the ideal LD (which is a Groebner basis) is the needed D-module structure, 148 @* - the list BS is the list of roots and multiplicities of a Bernstein polynomial of f. 145 PURPOSE: compute the D-module structure of basering[1/f]*f^s with the algorithm 146 @* given in S and with the Groebner basis engine given in 'eng' 147 NOTE: activate the output ring with the @code{setring} command. 148 @* The value of a string S can be 149 @* 'bm' (default) - for the algorithm of Briancon and Maisonobe, 150 @* 'ot' - for the algorithm of Oaku and Takayama, 151 @* 'lot' - for the Levandovskyy's modification of the algorithm of OT. 152 @* If eng <>0, @code{std} is used for Groebner basis computations, 153 @* otherwise and by default @code{slimgb} is used. 154 @* In the output ring: 155 @* - the ideal LD (which is a Groebner basis) is the needed D-module structure, 156 @* - the list BS contains roots and multiplicities of a BS-polynomial of f. 149 157 DISPLAY: If @code{printlevel}=1, progress debug messages will be printed, 150 158 @* if @code{printlevel}>=2, all the debug messages will be printed. … … 259 267 "USAGE: Sannfs(f [,S,eng]); f a poly, S a string, eng an optional int 260 268 RETURN: ring 261 PURPOSE: compute the D-module structure of basering[f^s] with the algorithm given in S and with the Groebner basis engine given in eng 269 PURPOSE: compute the D-module structure of basering[f^s] with the algorithm 270 @* given in S and with the Groebner basis engine given in eng 262 271 NOTE: activate the output ring with the @code{setring} command. 263 272 @* The value of a string S can be 264 273 @* 'bm' (default) - for the algorithm of Briancon and Maisonobe, 265 @* 'lot' - for the Levandovskyy's modification of the algorithm of O aku and Takayama,274 @* 'lot' - for the Levandovskyy's modification of the algorithm of OT, 266 275 @* 'ot' - for the algorithm of Oaku and Takayama. 267 276 @* If eng <>0, @code{std} is used for Groebner basis computations, … … 377 386 "USAGE: Sannfslog(f [,eng]); f a poly, eng an optional int 378 387 RETURN: ring 379 PURPOSE: compute the D-module structure of basering[1/f]*f^s , where D is the Weyl algebra388 PURPOSE: compute the D-module structure of basering[1/f]*f^s 380 389 NOTE: activate this ring with the @code{setring} command. 381 @* In the ring D[s], the ideal LD1 is generated by the elements in Ann F^s in D[s] coming from logarithmic derivations. 390 @* In the output ring D[s], the ideal LD1 is generated by the elements 391 @* in Ann F^s in D[s], coming from logarithmic derivations. 382 392 @* If eng <>0, @code{std} is used for Groebner basis computations, 383 393 @* otherwise, and by default @code{slimgb} is used. … … 526 536 "USAGE: ALTannfsBM(f [,eng]); f a poly, eng an optional int 527 537 RETURN: ring 528 PURPOSE: compute the annihilator ideal of f^s in D[s], where D is the Weyl Algebra, according to the algorithm by Briancon and Maisonobe 529 NOTE: activate this ring with the @code{setring} command. In this ring, 538 PURPOSE: compute the annihilator ideal of f^s in D[s], where D is the Weyl 539 @* algebra, according to the algorithm by Briancon and Maisonobe 540 NOTE: Activate this ring with the @code{setring} command. In this ring, 530 541 @* - the ideal LD is the annihilator of f^s. 531 542 @* If eng <>0, @code{std} is used for Groebner basis computations, … … 716 727 proc bernsteinBM(poly F, list #) 717 728 "USAGE: bernsteinBM(f [,eng]); f a poly, eng an optional int 718 RETURN: list of roots of the Bernstein polynomial b and its multiplicies 719 PURPOSE: compute the global Bernstein-Sato polynomial for a hypersurface, defined by f, according to the algorithm by Briancon and Maisonobe 729 RETURN: list (of roots of the Bernstein polynomial b and its multiplicies) 730 PURPOSE: compute the global Bernstein-Sato polynomial for a hypersurface, 731 @* defined by f, according to the algorithm by Briancon and Maisonobe 720 732 NOTE: If eng <>0, @code{std} is used for Groebner basis computations, 721 733 @* otherwise, and by default @code{slimgb} is used. … … 942 954 RETURN: ring 943 955 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according 944 to the algorithm by Briancon and Maisonobe956 @* to the algorithm by Briancon and Maisonobe 945 957 NOTE: activate this ring with the @code{setring} command. In this ring, 946 958 @* - the ideal LD (which is a Groebner basis) is the needed D-module structure, … … 1239 1251 "USAGE: annfs2(I, F [,eng]); I an ideal, F a poly, eng an optional int 1240 1252 RETURN: ring 1241 PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra, based on the1242 output of Sannfs-like procedure1243 NOTE: activate this ring with the @code{setring} command. In this ring,1244 @* 1245 @* - the list BS contains the roots with multiplicities of a Bernstein polynomial of f.1246 @* 1247 @* 1248 @* annfs2 uses the shorter form ofexpressions in the variable s (the idea of Noro).1253 PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra, 1254 @* based on the output of Sannfs-like procedure 1255 NOTE: Activate this ring with the @code{setring} command. In this ring, 1256 @* - the ideal LD (which is a Groebner basis) is the annihilator of f^s, 1257 @* - the list BS contains the roots with multiplicities of the BS polynomial. 1258 @* If eng <>0, @code{std} is used for Groebner basis computations, 1259 @* otherwise and by default @code{slimgb} is used. 1260 @* annfs2 uses shorter expressions in the variable s (the idea of Noro). 1249 1261 DISPLAY: If @code{printlevel}=1, progress debug messages will be printed, 1250 1262 @* if @code{printlevel}>=2, all the debug messages will be printed. … … 1400 1412 "USAGE: annfsRB(I, F [,eng]); I an ideal, F a poly, eng an optional int 1401 1413 RETURN: ring 1402 PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra, based on the1403 output of Sannfs like procedure1414 PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra, 1415 @* based on the output of Sannfs like procedure 1404 1416 NOTE: activate this ring with the @code{setring} command. In this ring, 1405 1417 @* - the ideal LD (which is a Groebner basis) is the annihilator of f^s, … … 1589 1601 "USAGE: operatorBM(f [,eng]); f a poly, eng an optional int 1590 1602 RETURN: ring 1591 PURPOSE: compute the B-operator and other relevant data for Ann F^s, according to the algorithm by Briancon and Maisonobe 1603 PURPOSE: compute the B-operator and other relevant data for Ann F^s, 1604 @* using e.g. algorithm by Briancon and Maisonobe for Ann F^s and BS. 1592 1605 NOTE: activate this ring with the @code{setring} command. In this ring D[s] 1593 1606 @* - the polynomial F is the same as the input, … … 1982 1995 "USAGE: annfsParamBM(f [,eng]); f a poly, eng an optional int 1983 1996 RETURN: ring 1984 PURPOSE: compute the generic Ann F^s and exceptional parametric constellations of a polynomial with parametric coefficients, according to the algorithm by Briancon and Maisonobe 1997 PURPOSE: compute the generic Ann F^s and exceptional parametric constellations 1998 @* of a polynomial with parametric coefficients with the BM algorithm 1985 1999 NOTE: activate this ring with the @code{setring} command. In this ring, 1986 2000 @* - the ideal LD is the D-module structure oa Ann F^s … … 2224 2238 "USAGE: annfsBMI(F [,eng]); F an ideal, eng an optional int 2225 2239 RETURN: ring 2226 PURPOSE: compute the D-module structure of basering[1/f]*f^s where f = F[1]*..*F[P],2227 according to the algorithm by Briancon and Maisonobe.2240 PURPOSE: compute the D-module structure of basering[1/f]*f^s where 2241 @* f = F[1]*..*F[P], according to the algorithm by Briancon and Maisonobe. 2228 2242 NOTE: activate this ring with the @code{setring} command. In this ring, 2229 2243 @* - the ideal LD is the needed D-mod structure, … … 2553 2567 "USAGE: annfsOT(f [,eng]); f a poly, eng an optional int 2554 2568 RETURN: ring 2555 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according2556 to the algorithm by Oaku and Takayama2569 PURPOSE: compute the D-module structure of basering[1/f]*f^s, 2570 @* according to the algorithm by Oaku and Takayama 2557 2571 NOTE: activate this ring with the @code{setring} command. In this ring, 2558 2572 @* - the ideal LD (which is a Groebner basis) is the needed D-module structure, … … 2935 2949 "USAGE: SannfsOT(f [,eng]); f a poly, eng an optional int 2936 2950 RETURN: ring 2937 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the 1st step of the algorithm by Oaku and Takayama in the ring D[s], where D is the Weyl algebra 2951 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the 2952 @* 1st step of the algorithm by Oaku and Takayama in the ring D[s] 2938 2953 NOTE: activate this ring with the @code{setring} command. 2939 @* In the ring D[s], the ideal LD (which is NOT a Groebner basis) is the needed D-module structure. 2940 @* If eng <>0, @code{std} is used for Groebner basis computations, 2941 @* otherwise, and by default @code{slimgb} is used. 2942 @* If printlevel=1, progress debug messages will be printed, 2943 @* if printlevel>=2, all the debug messages will be printed. 2954 @* In the output ring D[s], the ideal LD (which is NOT a Groebner basis) 2955 @* is the needed D-module structure. 2956 @* If eng <>0, @code{std} is used for Groebner basis computations, 2957 @* otherwise, and by default @code{slimgb} is used. 2958 @* If printlevel=1, progress debug messages will be printed, 2959 @* if printlevel>=2, all the debug messages will be printed. 2944 2960 EXAMPLE: example SannfsOT; shows examples 2945 2961 " … … 3217 3233 "USAGE: SannfsBM(f [,eng]); f a poly, eng an optional int 3218 3234 RETURN: ring 3219 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the 1st step of the algorithm by Briancon and Maisonobe in the ring D[s], where D is the Weyl algebra 3220 NOTE: activate this ring with the @code{setring} command. 3221 @* In the ring D[s], the ideal LD (which is NOT a Groebner basis) is the needed D-module structure, 3222 @* If eng <>0, @code{std} is used for Groebner basis computations, 3223 @* otherwise, and by default @code{slimgb} is used. 3224 @* If printlevel=1, progress debug messages will be printed, 3225 @* if printlevel>=2, all the debug messages will be printed. 3235 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the 3236 @* 1st step of the algorithm by Briancon and Maisonobe in the ring D[s]. 3237 NOTE: Activate this ring with the @code{setring} command. 3238 @* In the output ring D[s], the ideal LD (which is NOT a Groebner basis) is 3239 @* the needed D-module structure. 3240 @* If eng <>0, @code{std} is used for Groebner basis computations, 3241 @* otherwise, and by default @code{slimgb} is used. 3242 @* If printlevel=1, progress debug messages will be printed, 3243 @* if printlevel>=2, all the debug messages will be printed. 3226 3244 EXAMPLE: example SannfsBM; shows examples 3227 3245 " … … 3422 3440 "USAGE: SannfsBFCT(f [,eng]); f a poly, eng an optional int 3423 3441 RETURN: ring 3424 PURPOSE: compute ann f^s and Groebner basis of ann f^s+f in D[s]3442 PURPOSE: compute Ann f^s and Groebner basis of Ann f^s+f in D[s] 3425 3443 NOTE: activate this ring with the @code{setring} command. 3426 @* This procedure, unlike SannfsBM, returns a ring with the degrevlex ordering in all variables. 3427 @* In the ring D[s], the ideal LD (which IS a Groebner basis) is the needed ideal. 3428 @* If eng <>0, @code{std} is used for Groebner basis computations, 3429 @* otherwise, and by default @code{slimgb} is used. 3444 @* This procedure, unlike SannfsBM, returns a ring with the degrevlex 3445 @* ordering in all variables. 3446 @* In the ring D[s], the ideal LD (which IS a Groebner basis) is the needed ideal. 3447 @* If eng <>0, @code{std} is used for Groebner basis computations, 3448 @* otherwise, and by default @code{slimgb} is used. 3449 DISPLAY: If printlevel=1, progress debug messages will be printed, 3450 @* if printlevel>=2, all the debug messages will be printed. 3451 EXAMPLE: example SannfsBFCT; shows examples 3452 " 3453 { 3454 // DEBUG INFO: ordering on the output ring = dp, engine on the sum of ideals is used 3455 // hence it's the situation for slimgb 3456 3457 int eng = 0; 3458 if ( size(#)>0 ) 3459 { 3460 if ( typeof(#[1]) == "int" ) 3461 { 3462 eng = int(#[1]); 3463 } 3464 } 3465 // returns a list with a ring and an ideal LD in it 3466 int ppl = printlevel-voice+2; 3467 // printf("plevel :%s, voice: %s",printlevel,voice); 3468 def save = basering; 3469 int N = nvars(basering); 3470 int Nnew = 2*N+2; 3471 int i,j; 3472 list RL = ringlist(basering); 3473 list L, Lord; 3474 L[1] = RL[1]; // char 3475 L[4] = RL[4]; // char, minpoly 3476 // check whether vars have admissible names 3477 list Name = RL[2]; 3478 list RName; 3479 RName[1] = "@t"; 3480 RName[2] = "@s"; 3481 list PName; 3482 int BadName; 3483 if (size(RL[1])>1) 3484 { 3485 PName = RL[1][2]; 3486 } 3487 // PName; 3488 for(i=1;i<=2;i++) 3489 { 3490 for(j=1; j<=N; j++) 3491 { 3492 if (Name[j] == RName[i]) 3493 { 3494 BadName = 1; 3495 break; 3496 } 3497 } 3498 for(j=1; j<=size(PName); j++) 3499 { 3500 if (PName[j] == RName[i]) 3501 { 3502 BadName = 1; 3503 break; 3504 } 3505 } 3506 } 3507 if (BadName == 1) 3508 { 3509 ERROR("Variable/parameter names should not include @t,@s"); 3510 } 3511 kill PName,BadName; 3512 // now, create the names for new vars 3513 list DName; 3514 for(i=1;i<=N;i++) 3515 { 3516 DName[i] = "D"+Name[i]; // concat 3517 } 3518 list NName = RName + DName + Name ; 3519 L[2] = NName; 3520 // Name, Dname will be used further 3521 kill NName; 3522 // block ord (lp(2),dp); 3523 Lord[1] = list("lp",intvec(1,1)); 3524 // continue with dp 1,1,1,1... 3525 Lord[2] = list("dp",intvec(1:Nnew)); 3526 Lord[3] = list("C",intvec(0)); 3527 L[3] = Lord; 3528 // we are done with the list 3529 def @R@ = ring(L); 3530 setring @R@; 3531 matrix @D[Nnew][Nnew]; 3532 @D[1,2] = var(1); 3533 for(i=1; i<=N; i++) 3534 { 3535 @D[2+i,N+2+i]=-1; 3536 } 3537 // L[5] = matrix(UpOneMatrix(Nnew)); 3538 // L[6] = @D; 3539 def @R = nc_algebra(1,@D); 3540 setring @R; 3541 kill @R@; 3542 dbprint(ppl,"// -1-1- the ring @R(@t,@s,_Dx,_x) is ready"); 3543 dbprint(ppl-1, @R); 3544 // create the ideal I 3545 poly F = imap(save,F); 3546 ideal I = var(1)*F+var(2); 3547 poly p; 3548 for(i=1; i<=N; i++) 3549 { 3550 p = var(1); // t 3551 p = diff(F,var(N+2+i))*p; 3552 I = I, var(2+i) + p; 3553 } 3554 // -------- the ideal I is ready ---------- 3555 dbprint(ppl,"// -1-2- starting the elimination of @t in @R"); 3556 dbprint(ppl-1, I); 3557 ideal J = engine(I,eng); 3558 ideal K = nselect(J,1); 3559 dbprint(ppl,"// -1-3- @t is eliminated"); 3560 dbprint(ppl-1, K); // K is without @t 3561 K = engine(K,eng); // std does the job too 3562 // now, we must change the ordering 3563 // and create a ring without @t 3564 // setring S; 3565 // ----------- the ring @R3 ------------ 3566 // _Dx,_x,s; +fast ord ! 3567 // keep: N, i,j,RL 3568 Nnew = 2*N+1; 3569 kill Lord, RName; 3570 list Lord; 3571 list L=imap(save,L); 3572 list RL=imap(save,RL); 3573 L[1] = RL[1]; 3574 L[4] = RL[4]; // char, minpoly 3575 // check whether vars hava admissible names -> done earlier 3576 // DName is defined earlier 3577 list NName = DName + Name + list(string(var(2))); 3578 L[2] = NName; 3579 kill NName; 3580 // just dp 3581 // block ord (dp(N),dp); 3582 Lord[1] = list("dp",intvec(1:Nnew)); 3583 Lord[2]= list("C",intvec(0)); 3584 L[3] = Lord; 3585 // we are done with the list. Now add a Plural part 3586 def @R2@ = ring(L); 3587 setring @R2@; 3588 matrix @D[Nnew][Nnew]; 3589 for (i=1; i<=N; i++) 3590 { 3591 @D[i,N+i]=-1; 3592 } 3593 def @R2 = nc_algebra(1,@D); 3594 setring @R2; 3595 kill @R2@; 3596 dbprint(ppl,"// -2-1- the ring @R2(_Dx,_x,@s) is ready"); 3597 dbprint(ppl-1, @R2); 3598 ideal MM = maxideal(1); 3599 MM = 0,var(Nnew),MM; 3600 map R01 = @R, MM; 3601 ideal K = R01(K); 3602 // total cleanup 3603 poly F = imap(save, F); 3604 ideal LD = K,F; 3605 dbprint(ppl,"// -2-2- start GB computations for Ann f^s + f"); 3606 dbprint(ppl-1, LD); 3607 LD = engine(LD,eng); 3608 dbprint(ppl,"// -2-3- finished GB computations for Ann f^s + f"); 3609 dbprint(ppl-1, LD); 3610 // make leadcoeffs positive 3611 for (i=1; i<= ncols(LD); i++) 3612 { 3613 if (leadcoef(LD[i]) <0 ) 3614 { 3615 LD[i] = -LD[i]; 3616 } 3617 } 3618 export LD; 3619 kill @R; 3620 return(@R2); 3621 } 3622 example 3623 { 3624 "EXAMPLE:"; echo = 2; 3625 ring r = 0,(x,y,z,w),Dp; 3626 poly F = x^3+y^3+z^3*w; 3627 printlevel = 0; 3628 def A = SannfsBFCT(F); setring A; 3629 intvec v = 1,2,3,4,5,6,7,8; 3630 // are there polynomials, depending on @s only? 3631 nselect(LD,v); 3632 // a fancier example: 3633 def R = reiffen(4,5); setring R; 3634 v = 1,2,3,4; 3635 RC; // the Reiffen curve in 4,5 3636 def B = SannfsBFCT(RC); 3637 setring B; 3638 // Are there polynomials, depending on @s only? 3639 nselect(LD,v); 3640 // It is not the case. Are there leading monomials in @s only? 3641 nselect(lead(LD),v); 3642 } 3643 3644 3645 proc SannfsBFCTstd(poly F, list #) 3646 "USAGE: SannfsBFCTstd(f [,eng]); f a poly, eng an optional int 3647 RETURN: ring 3648 PURPOSE: compute Ann f^s and Groebner basis of Ann f^s+f in D[s] 3649 NOTE: activate this ring with the @code{setring} command. 3650 @* This procedure, unlike SannfsBM, returns a ring with the degrevlex 3651 @* ordering in all variables. 3652 @* In the ring D[s], the ideal LD (which IS a Groebner basis) is the needed ideal. 3653 @* In this procedure @code{std} is used for Groebner basis computations. 3430 3654 DISPLAY: If printlevel=1, progress debug messages will be printed, 3431 3655 @* if printlevel>=2, all the debug messages will be printed. 3432 EXAMPLE: example SannfsBFCT ; shows examples3656 EXAMPLE: example SannfsBFCTstd; shows examples 3433 3657 " 3434 3658 { 3435 // DEBUG INFO: ordering on the output ring = dp, engine on the sum of ideals is used3436 // hence it's the situation for slimgb3659 // DEBUG INFO: ordering on the output ring = dp, 3660 // use std(K,F); for reusing the std property of K 3437 3661 3438 3662 int eng = 0; … … 3599 3823 // total cleanup 3600 3824 poly F = imap(save, F); 3601 ideal LD = K,F;3825 // ideal LD = K,F; 3602 3826 dbprint(ppl,"// -2-2- start GB computations for Ann f^s + f"); 3603 dbprint(ppl-1, LD); 3604 LD = engine(LD,eng); 3827 // dbprint(ppl-1, LD); 3828 ideal LD = std(K,F); 3829 // LD = engine(LD,eng); 3605 3830 dbprint(ppl,"// -2-3- finished GB computations for Ann f^s + f"); 3606 3831 dbprint(ppl-1, LD); … … 3633 3858 def B = SannfsBFCT(RC); 3634 3859 setring B; 3635 // are there polynomials, depending on s only?3860 // Are there polynomials, depending on s only? 3636 3861 nselect(LD,v); 3637 // it is not the case. Are there leading monomials in s only? 3638 nselect(lead(LD),v); 3639 } 3640 3641 proc SannfsBFCTstd(poly F, list #) 3642 "USAGE: SannfsBFCTstd(f [,eng]); f a poly, eng an optional int 3643 RETURN: ring 3644 PURPOSE: compute ann f^s and Groebner basis of ann f^s+f in D[s] 3645 NOTE: activate this ring with the @code{setring} command. 3646 @* This procedure, unlike SannfsBM, returns a ring with the degrevlex ordering in all variables. 3647 @* In the ring D[s], the ideal LD (which IS a Groebner basis) is the needed ideal. 3648 @* In this procedure @code{std} is used for Groebner basis computations. 3649 DISPLAY: If printlevel=1, progress debug messages will be printed, 3650 @* if printlevel>=2, all the debug messages will be printed. 3651 EXAMPLE: example SannfsBFCTstd; shows examples 3652 " 3653 { 3654 // DEBUG INFO: ordering on the output ring = dp, 3655 // use std(K,F); for reusing the std property of K 3656 3657 int eng = 0; 3658 if ( size(#)>0 ) 3659 { 3660 if ( typeof(#[1]) == "int" ) 3661 { 3662 eng = int(#[1]); 3663 } 3664 } 3665 // returns a list with a ring and an ideal LD in it 3666 int ppl = printlevel-voice+2; 3667 // printf("plevel :%s, voice: %s",printlevel,voice); 3668 def save = basering; 3669 int N = nvars(basering); 3670 int Nnew = 2*N+2; 3671 int i,j; 3672 string s; 3673 list RL = ringlist(basering); 3674 list L, Lord; 3675 list tmp; 3676 intvec iv; 3677 L[1] = RL[1]; // char 3678 L[4] = RL[4]; // char, minpoly 3679 // check whether vars have admissible names 3680 list Name = RL[2]; 3681 list RName; 3682 RName[1] = "@t"; 3683 RName[2] = "@s"; 3684 for(i=1;i<=N;i++) 3685 { 3686 for(j=1; j<=size(RName);j++) 3687 { 3688 if (Name[i] == RName[j]) 3689 { 3690 ERROR("Variable names should not include @t,@s"); 3691 } 3692 } 3693 } 3694 // now, create the names for new vars 3695 list DName; 3696 for(i=1;i<=N;i++) 3697 { 3698 DName[i] = "D"+Name[i]; // concat 3699 } 3700 tmp[1] = "t"; 3701 tmp[2] = "s"; 3702 list NName = tmp + DName + Name ; 3703 L[2] = NName; 3704 // Name, Dname will be used further 3705 kill NName; 3706 // block ord (lp(2),dp); 3707 tmp[1] = "lp"; // string 3708 iv = 1,1; 3709 tmp[2] = iv; //intvec 3710 Lord[1] = tmp; 3711 // continue with dp 1,1,1,1... 3712 tmp[1] = "dp"; // string 3713 s = "iv="; 3714 for(i=1;i<=Nnew;i++) 3715 { 3716 s = s+"1,"; 3717 } 3718 s[size(s)]= ";"; 3719 execute(s); 3720 kill s; 3721 tmp[2] = iv; 3722 Lord[2] = tmp; 3723 tmp[1] = "C"; 3724 iv = 0; 3725 tmp[2] = iv; 3726 Lord[3] = tmp; 3727 tmp = 0; 3728 L[3] = Lord; 3729 // we are done with the list 3730 def @R@ = ring(L); 3731 setring @R@; 3732 matrix @D[Nnew][Nnew]; 3733 @D[1,2]=t; 3734 for(i=1; i<=N; i++) 3735 { 3736 @D[2+i,N+2+i]=-1; 3737 } 3738 // L[5] = matrix(UpOneMatrix(Nnew)); 3739 // L[6] = @D; 3740 def @R = nc_algebra(1,@D); 3741 setring @R; 3742 kill @R@; 3743 dbprint(ppl,"// -1-1- the ring @R(t,s,_Dx,_x) is ready"); 3744 dbprint(ppl-1, @R); 3745 // create the ideal I 3746 poly F = imap(save,F); 3747 ideal I = t*F+s; 3748 poly p; 3749 for(i=1; i<=N; i++) 3750 { 3751 p = t; // t 3752 p = diff(F,var(N+2+i))*p; 3753 I = I, var(2+i) + p; 3754 } 3755 // -------- the ideal I is ready ---------- 3756 dbprint(ppl,"// -1-2- starting the elimination of t in @R"); 3757 dbprint(ppl-1, I); 3758 ideal J = engine(I,eng); 3759 ideal K = nselect(J,1); 3760 dbprint(ppl,"// -1-3- t is eliminated"); 3761 dbprint(ppl-1, K); // K is without t 3762 K = engine(K,eng); // std does the job too 3763 // now, we must change the ordering 3764 // and create a ring without t 3765 // setring S; 3766 // ----------- the ring @R3 ------------ 3767 // _Dx,_x,s; +fast ord ! 3768 // keep: N, i,j,s, tmp, RL 3769 Nnew = 2*N+1; 3770 kill Lord, tmp, iv, RName; 3771 list Lord, tmp; 3772 intvec iv; 3773 list L=imap(save,L); 3774 list RL=imap(save,RL); 3775 L[1] = RL[1]; 3776 L[4] = RL[4]; // char, minpoly 3777 // check whether vars hava admissible names -> done earlier 3778 // now, create the names for new var 3779 tmp[1] = "s"; 3780 // DName is defined earlier 3781 list NName = DName + Name + tmp; 3782 L[2] = NName; 3783 tmp = 0; 3784 // just dp 3785 // block ord (dp(N),dp); 3786 string s = "iv="; 3787 for (i=1; i<=Nnew; i++) 3788 { 3789 s = s+"1,"; 3790 } 3791 s[size(s)]=";"; 3792 execute(s); 3793 tmp[1] = "dp"; // string 3794 tmp[2] = iv; // intvec 3795 Lord[1] = tmp; 3796 kill s; 3797 kill NName; 3798 tmp[1] = "C"; 3799 Lord[2] = tmp; tmp = 0; 3800 L[3] = Lord; 3801 // we are done with the list. Now add a Plural part 3802 def @R2@ = ring(L); 3803 setring @R2@; 3804 matrix @D[Nnew][Nnew]; 3805 for (i=1; i<=N; i++) 3806 { 3807 @D[i,N+i]=-1; 3808 } 3809 def @R2 = nc_algebra(1,@D); 3810 setring @R2; 3811 kill @R2@; 3812 dbprint(ppl,"// -2-1- the ring @R2(_Dx,_x,s) is ready"); 3813 dbprint(ppl-1, @R2); 3814 ideal MM = maxideal(1); 3815 MM = 0,s,MM; 3816 map R01 = @R, MM; 3817 ideal K = R01(K); 3818 // total cleanup 3819 poly F = imap(save, F); 3820 // ideal LD = K,F; 3821 dbprint(ppl,"// -2-2- start GB computations for Ann f^s + f"); 3822 // dbprint(ppl-1, LD); 3823 ideal LD = std(K,F); 3824 // LD = engine(LD,eng); 3825 dbprint(ppl,"// -2-3- finished GB computations for Ann f^s + f"); 3826 dbprint(ppl-1, LD); 3827 // make leadcoeffs positive 3828 for (i=1; i<= ncols(LD); i++) 3829 { 3830 if (leadcoef(LD[i]) <0 ) 3831 { 3832 LD[i] = -LD[i]; 3833 } 3834 } 3835 export LD; 3836 kill @R; 3837 return(@R2); 3838 } 3839 example 3840 { 3841 "EXAMPLE:"; echo = 2; 3842 ring r = 0,(x,y,z,w),Dp; 3843 poly F = x^3+y^3+z^3*w; 3844 printlevel = 0; 3845 def A = SannfsBFCT(F); setring A; 3846 intvec v = 1,2,3,4,5,6,7,8; 3847 // are there polynomials, depending on s only? 3848 nselect(LD,v); 3849 // a fancier example: 3850 def R = reiffen(4,5); setring R; 3851 v = 1,2,3,4; 3852 RC; // the Reiffen curve in 4,5 3853 def B = SannfsBFCT(RC); 3854 setring B; 3855 // are there polynomials, depending on s only? 3856 nselect(LD,v); 3857 // it is not the case. Are there leading monomials in s only? 3862 // It is not the case. Are there leading monomials in s only? 3858 3863 nselect(lead(LD),v); 3859 3864 } … … 3864 3869 "USAGE: SannfsLOT(f [,eng]); f a poly, eng an optional int 3865 3870 RETURN: ring 3866 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the Levandovskyy's modification of the algorithm by Oaku and Takayama in the ring D[s], where D is the Weyl algebra 3871 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the 3872 @* Levandovskyy's modification of the algorithm by Oaku and Takayama in D[s] 3867 3873 NOTE: activate this ring with the @code{setring} command. 3868 @* In the ring D[s], the ideal LD (which is NOT a Groebner basis) is the needed D-module structure. 3869 @* If eng <>0, @code{std} is used for Groebner basis computations, 3870 @* otherwise, and by default @code{slimgb} is used. 3871 @* If printlevel=1, progress debug messages will be printed, 3872 @* if printlevel>=2, all the debug messages will be printed. 3874 @* In the ring D[s], the ideal LD (which is NOT a Groebner basis) is 3875 @* the needed D-module structure. 3876 @* If eng <>0, @code{std} is used for Groebner basis computations, 3877 @* otherwise, and by default @code{slimgb} is used. 3878 @* If printlevel=1, progress debug messages will be printed, 3879 @* if printlevel>=2, all the debug messages will be printed. 3873 3880 EXAMPLE: example SannfsLOT; shows examples 3874 3881 " … … 4319 4326 "USAGE: annfsLOT(F [,eng]); F a poly, eng an optional int 4320 4327 RETURN: ring 4321 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the Levandovskyy's modification of the algorithm by Oaku and Takayama 4328 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to 4329 @* the Levandovskyy's modification of the algorithm by Oaku and Takayama 4322 4330 NOTE: activate this ring with the @code{setring} command. In this ring, 4323 @* 4324 @* 4325 @* 4326 @* - the list BS contains the roots with multiplicities of a Bernsteinpolynomial of f.4327 @* 4328 @* 4329 @* 4330 @* 4331 @* - the ideal LD (which is a Groebner basis) is the needed D-module structure, 4332 @* which is obtained by substituting the minimal integer root of a Bernstein 4333 @* polynomial into the s-parametric ideal; 4334 @* - the list BS contains the roots with multiplicities of BS polynomial of f. 4335 @* If eng <>0, @code{std} is used for Groebner basis computations, 4336 @* otherwise and by default @code{slimgb} is used. 4337 @* If printlevel=1, progress debug messages will be printed, 4338 @* if printlevel>=2, all the debug messages will be printed. 4331 4339 EXAMPLE: example annfsLOT; shows examples 4332 4340 " … … 4363 4371 "USAGE: annfs0(I, F [,eng]); I an ideal, F a poly, eng an optional int 4364 4372 RETURN: ring 4365 PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra, based on the4366 output of Sannfs-like procedure4373 PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra, based 4374 @* on the output of Sannfs-like procedure 4367 4375 NOTE: activate this ring with the @code{setring} command. In this ring, 4368 @* 4369 @* - the list BS contains the roots with multiplicities of a Bernsteinpolynomial of f.4370 @* 4371 @* 4372 @* 4373 @* 4376 @* - the ideal LD (which is a Groebner basis) is the annihilator of f^s, 4377 @* - the list BS contains the roots with multiplicities of BS polynomial of f. 4378 @* If eng <>0, @code{std} is used for Groebner basis computations, 4379 @* otherwise and by default @code{slimgb} is used. 4380 @* If printlevel=1, progress debug messages will be printed, 4381 @* if printlevel>=2, all the debug messages will be printed. 4374 4382 EXAMPLE: example annfs0; shows examples 4375 4383 " … … 4807 4815 RETURN: list 4808 4816 PURPOSE: convert a ringlist L into another ringlist, 4809 where all the 'p' orderings are replaced with the 's' orderings.4817 @* where all the 'p' orderings are replaced with the 's' orderings. 4810 4818 ASSUME: L is a result of a ringlist command 4811 4819 EXAMPLE: example convloc; shows examples … … 4852 4860 "USAGE: annfspecial(I,F,mir,n); I an ideal, F a poly, int mir, number n 4853 4861 RETURN: ideal 4854 PURPOSE: compute the annihilator ideal of F^n in the Weyl Algebra for a rational number n 4855 ASSUME: the basering contains 's' as a variable 4856 NOTE: We assume that the basering is D[s], 4857 @* ideal I is the Ann F^s in D[s] (obtained with e.g. SannfsBM, SannfsLOT, SannfsOT) 4858 @* integer 'mir' is the minimal integer root of the Bernstein polynomial of F 4859 @* and the number n is rational. 4860 @* We compute the real annihilator for any rational value of n (both generic and exceptional). 4861 @* The implementation goes along the lines of Saito-Sturmfels-Takayama, Alg. 5.3.15 4862 PURPOSE: compute the annihilator ideal of F^n in the Weyl Algebra 4863 @* for the given rational number n 4864 ASSUME: The basering is D[s] and contains 's' explicitly as a variable, 4865 @* the ideal I is the Ann F^s in D[s] (obtained with e.g. SannfsBM), 4866 @* the integer 'mir' is the minimal integer root of the BS polynomial of F, 4867 @* and the number n is rational. 4868 NOTE: We compute the real annihilator for any rational value of n (both 4869 @* generic and exceptional). The implementation goes along the lines of 4870 @* the Algorithm 5.3.15 from Saito-Sturmfels-Takayama. 4862 4871 DISPLAY: If printlevel=1, progress debug messages will be printed, 4863 4872 @* if printlevel>=2, all the debug messages will be printed. … … 4865 4874 " 4866 4875 { 4876 4877 if (!isRational(n)) 4878 { 4879 "ERROR: n must be a rational number!"; 4880 } 4867 4881 int ppl = printlevel-voice+2; 4868 4882 // int mir = minIntRoot(L[1],0); … … 5023 5037 "USAGE: isHolonomic(M); M an ideal/module/matrix 5024 5038 RETURN: int, 1 if M is holonomic and 0 otherwise 5025 ASSUME: basering is a Weyl algebra 5039 ASSUME: basering is a Weyl algebra in characteristic 0 5026 5040 PURPOSE: check the modules for the property of holonomy 5027 5041 NOTE: M is holonomic, if 2*dim(M) = dim(R), where R is a … … 5030 5044 " 5031 5045 { 5046 if (dmodappassumeViolation()) 5047 { 5048 ERROR("Basering is inappropriate: characteristic>0 or qring present"); 5049 } 5050 if (!isWeyl(basering)) 5051 { 5052 ERROR("Basering is not a Weyl algebra"); 5053 } 5054 5032 5055 if ( (typeof(M) != "ideal") && (typeof(M) != "module") && (typeof(M) != "matrix") ) 5033 5056 { … … 5061 5084 RETURN: ring 5062 5085 PURPOSE: set up the polynomial, describing a Reiffen curve 5063 NOTE: activate this ring with the @code{setring} command and find the5064 curve as a polynomial RC 5065 @* aReiffen curve is defined as F = x^p + y^q + xy^{q-1}, q >= p+1 >= 55066 ASSUME: q >= p+1 >= 5. Otherwise an error message is returned 5086 NOTE: activate this ring with the @code{setring} command and 5087 @* find the curve as a polynomial RC. 5088 @* A Reiffen curve is defined as F = x^p + y^q + xy^{q-1}, q >= p+1 >= 5 5089 5067 5090 EXAMPLE: example reiffen; shows examples 5068 5091 " 5069 5092 { 5093 // we allow also other numbers, p \geq 1, q\geq 1 5070 5094 // a Reiffen curve is defined as 5071 5095 // F = x^p + y^q +x*y^{q-1}, q \geq p+1 \geq 5 5072 5096 5073 if ( (p<4) || (q<5) || (q-p<1) ) 5074 { 5075 ERROR("Some of conditions p>=4, q>=5 or q>=p+1 is not satisfied!"); 5097 // ASSUME: q >= p+1 >= 5. Otherwise an error message is returned 5098 5099 // if ( (p<4) || (q<5) || (q-p<1) ) 5100 // { 5101 // ERROR("Some of conditions p>=4, q>=5 or q>=p+1 is not satisfied!"); 5102 // } 5103 if ( (p<1) || (q<1) ) 5104 { 5105 ERROR("Some of conditions p>=1, q>=1 is not satisfied!"); 5076 5106 } 5077 5107 ring @r = 0,(x,y),dp; … … 5092 5122 RETURN: ring 5093 5123 PURPOSE: set up the polynomial, describing a hyperplane arrangement 5094 NOTE: must be executed in aring5095 ASSUME: basering is present 5124 NOTE: must be executed in a commutative ring 5125 ASSUME: basering is present and it is commutative 5096 5126 EXAMPLE: example arrange; shows examples 5097 5127 " … … 5155 5185 5156 5186 proc checkRoot(poly F, number a, list #) 5157 "USAGE: checkRoot(f,alpha [,S,eng]); f a poly, alpha a number, S a string , eng an optional int5187 "USAGE: checkRoot(f,alpha [,S,eng]); poly f, number alpha, string S, int eng 5158 5188 RETURN: int 5159 PURPOSE: check whether a rational is a root of the global Bernstein polynomial of f (and compute its multiplicity) 5160 with the algorithm given in S and with the Groebner basis engine given in eng 5161 NOTE: The annihilator of f^s in D[s] is needed and it is computed according to the algorithm by Briancon and Maisonobe 5162 @* The value of a string S can be 5163 @* 'alg1' (default) - for the algorithm 1 of J. Martin-Morales (unpublished) 5164 @* 'alg2' - for the algorithm 2 of J. Martin-Morales (unpublished) 5189 ASSUME: Basering is commutative ring, alpha is a rational number. 5190 PURPOSE: check whether a rational number alpha is a root of the global 5191 @* Bernstein-Sato polynomial of f and compute its multiplicity, 5192 @* with the algorithm given by S and with the Groebner basis engine given by eng. 5193 NOTE: The annihilator of f^s in D[s] is needed and hence it is computed with the 5194 @* algorithm by Briancon and Maisonobe. The value of a string S can be 5195 @* 'alg1' (default) - for the algorithm 1 of [LM08] 5196 @* 'alg2' - for the algorithm 2 of [LM08] 5165 5197 @* The output of type int is: 5166 @* 'alg1': 1 if -alpha is a root of the global Bernstein polynomial and 0 otherwise5167 @* 'alg2': the multiplicity of -alpha as a root of the global Bernstein polynomial of f.5168 @* (If -alpha is not a root, the output is 0)5198 @* 'alg1': 1 only if -alpha is a root of the global Bernstein-Sato polynomial 5199 @* 'alg2': the multiplicity of -alpha as a root of the global Bernstein-Sato 5200 @* polynomial of f. If -alpha is not a root, the output is 0. 5169 5201 @* If eng <>0, @code{std} is used for Groebner basis computations, 5170 5202 @* otherwise (and by default) @code{slimgb} is used. … … 5196 5228 { 5197 5229 // incorrect value of S 5198 print("Incorrect algorithm given, proceed with the default alg1 of J. MartÃn-Morales");5230 print("Incorrect algorithm given, proceed with the default alg1"); 5199 5231 algo = "alg1"; 5200 5232 } … … 5269 5301 5270 5302 proc checkRoot1(ideal I, poly F, number a, list #) 5271 "USAGE: checkRoot1(I,f,alpha [,eng]); I an ideal, f a poly, alpha a number, eng an optional int 5272 ASSUME: I is the annihilator of f^s in D[s], f is a polynomial in K[_x] 5273 RETURN: int, 1 if -alpha is a root of the global Bernstein polynomial of f and 0 otherwise 5274 PURPOSE: check whether a rational is a root of the global Bernstein polynomial of f 5275 NOTE: If eng <>0, @code{std} is used for Groebner basis computations, 5303 "USAGE: checkRoot1(I,f,alpha [,eng]); ideal I, poly f, number alpha, int eng 5304 ASSUME: Basering is D[s], I is the annihilator of f^s in D[s], 5305 @* that is basering and I are the output of Sannfs-like procedure, 5306 @* f is a polynomial in K[_x] and alpha is a rational number. 5307 RETURN: int, 1 if -alpha is a root of the Bernstein-Sato polynomial of f 5308 PURPOSE: check, whether alpha is a root of the global Bernstein-Sato polynomial of f 5309 NOTE: If eng <>0, @code{std} is used for Groebner basis computations, 5276 5310 @* otherwise (and by default) @code{slimgb} is used. 5277 5311 DISPLAY: If printlevel=1, progress debug messages will be printed, … … 5280 5314 " 5281 5315 { 5316 // to check: alpha is rational (has char 0 check inside) 5317 if (!isRational(a)) 5318 { 5319 "ERROR: alpha must be a rational number!"; 5320 } 5321 // no qring 5322 if ( size(ideal(basering)) >0 ) 5323 { 5324 "ERROR: no qring is allowed"; 5325 } 5282 5326 int eng = 0; 5283 5327 if ( size(#)>0 ) … … 5393 5437 5394 5438 proc checkRoot2 (ideal I, poly F, number a, list #) 5395 "USAGE: checkRoot2(I,f,alpha [,eng]); I an ideal, f a poly, alpha a number, eng an optional int 5396 ASSUME: I is the annihilator of f^s in D[s], f is a polynomial in K[_x] 5397 RETURN: int, the multiplicity of -alpha as a root of the global Bernstein polynomial of f. If -alpha is not a root, the output is 0 5398 PURPOSE: check whether a rational is a root of the global Bernstein polynomial of f and compute its multiplicity from the known Ann F^s in D[s] 5399 NOTE: If eng <>0, @code{std} is used for Groebner basis computations, 5439 "USAGE: checkRoot2(I,f,a [,eng]); I an ideal, f a poly, alpha a number, eng an optional int 5440 ASSUME: I is the annihilator of f^s in D[s], basering is D[s], 5441 @* that is basering and I are the output os Sannfs-like procedure, 5442 @* f is a polynomial in K[_x] and alpha is a rational number. 5443 RETURN: int, the multiplicity of -alpha as a root of the BS polynomial of f. 5444 PURPOSE: check whether a rational number alpha is a root of the global Bernstein- 5445 @* Sato polynomial of f and compute its multiplicity from the known Ann F^s in D[s] 5446 NOTE: If -alpha is not a root, the output is 0. 5447 @* If eng <>0, @code{std} is used for Groebner basis computations, 5400 5448 @* otherwise (and by default) @code{slimgb} is used. 5401 5449 DISPLAY: If printlevel=1, progress debug messages will be printed, … … 5404 5452 " 5405 5453 { 5454 5455 5456 // to check: alpha is rational (has char 0 check inside) 5457 if (!isRational(a)) 5458 { 5459 "ERROR: alpha must be a rational number!"; 5460 } 5461 // no qring 5462 if ( size(ideal(basering)) >0 ) 5463 { 5464 "ERROR: no qring is allowed"; 5465 } 5466 5406 5467 int eng = 0; 5407 5468 if ( size(#)>0 ) … … 5525 5586 proc checkFactor(ideal I, poly F, poly q, list #) 5526 5587 "USAGE: checkFactor(I,f,qs [,eng]); I an ideal, f a poly, qs a poly, eng an optional int 5527 ASSUME: I is the output of Sannfs, SannfsBM, SannfsLOT or SannfsOT, 5528 f is a polynomial in K[_x], qs is a polynomial in K[s] 5588 ASSUME: checkFactor is called from the basering, created by Sannfs-like proc, 5589 @* that is, from the Weyl algebra in x1,..,xN,d1,..,dN tensored with K[s]. 5590 @* The ideal I is the annihilator of f^s in D[s], that is the ideal, computed 5591 @* by Sannfs-like procedure (usually called LD there). 5592 @* Moreover, f is a polynomial in K[x1,..,xN] and qs is a polynomial in K[s]. 5529 5593 RETURN: int, 1 if qs is a factor of the global Bernstein polynomial of f and 0 otherwise 5530 PURPOSE: check whether a rational is a root of the global Bernstein polynomial of f and compute its multiplicity from the known Ann F^s in D[s] 5594 PURPOSE: check whether a univariate polynomial qs is a factor of the 5595 @* Bernstein-Sato polynomial of f without explicit knowledge of the latter. 5531 5596 NOTE: If eng <>0, @code{std} is used for Groebner basis computations, 5532 5597 @* otherwise (and by default) @code{slimgb} is used. … … 5536 5601 " 5537 5602 { 5603 5604 // ASSUME too complicated, cannot check it. 5605 5538 5606 int eng = 0; 5539 5607 if ( size(#)>0 ) … … 5595 5663 RETURN: int 5596 5664 PURPOSE: returns the number of the variable with the name s 5597 among the variables of basering or 0 if there is no such variable5665 @* among the variables of basering or 0 if there is no such variable 5598 5666 EXAMPLE: example varnum; shows examples 5599 5667 " … … 5621 5689 "USAGE: indAR(L,n); list L, int n 5622 5690 RETURN: list 5623 PURPOSE: computes arrangement inductively, using L and var(n) as the5624 next variable5691 PURPOSE: computes arrangement inductively, using L and 5692 @* var(n) as the next variable 5625 5693 ASSUME: L has a structure of an arrangement 5626 5694 EXAMPLE: example indAR; shows examples … … 5666 5734 M = indAR(M,4); 5667 5735 M; 5736 } 5737 5738 proc isRational(number n) 5739 "USAGE: isRational(n); n number 5740 RETURN: int 5741 PURPOSE: determine whether n is a rational number, 5742 @* that is it does not contain parameters. 5743 ASSUME: ground field is of characteristic 0 5744 EXAMPLE: example indAR; shows examples 5745 " 5746 { 5747 if (char(basering) != 0) 5748 { 5749 ERROR("The ground field must be of characteristic 0!"); 5750 } 5751 number dn = denominator(n); 5752 number nn = numerator(n); 5753 return( ((int(dn)==dn) && (int(nn)==nn)) ); 5754 } 5755 example 5756 { 5757 "EXAMPLE:"; echo = 2; 5758 ring r = (0,a),(x,y),dp; 5759 number n1 = 11/73; 5760 isRational(n1); 5761 number n2 = (11*a+3)/72; 5762 isRational(n2); 5668 5763 } 5669 5764 -
Singular/LIB/dmodapp.lib
re6d283f reaf8f8 1 1 ////////////////////////////////////////////////////////////////////////////// 2 version="$Id: dmodapp.lib,v 1.2 1 2009-03-06 20:32:29levandov Exp $";2 version="$Id: dmodapp.lib,v 1.22 2009-03-09 18:34:52 levandov Exp $"; 3 3 category="Noncommutative"; 4 4 info=" … … 1522 1522 } 1523 1523 } 1524 1524 1525 // 1. create homogenized Weyl algebra 1525 1526 // 1.1 create ordering … … 1556 1557 def Dh = nc_algebra(1,@relD); 1557 1558 setring Dh; kill @Dh; 1558 dbprint(ppl,"// computing in ring",D Dh);1559 dbprint(ppl,"// computing in ring",Dh); 1559 1560 // 2. Compute the initial ideal 1560 1561 ideal I = imap(save,I); … … 1653 1654 u0 = 1:n; 1654 1655 } 1655 if (isCommutative() == 0) { ERROR("basering must be commutative"); }1656 1656 if (char(save) <> 0) { ERROR("characteristic of basering has to be 0"); } 1657 1657 // creating the homogenized extended Weyl algebra 1658 1658 list RL = ringlist(save); 1659 RL = RL[1..4]; // if basering is commutative nc_algebra 1659 1660 list C0 = list("C",intvec(0)); 1660 1661 // 1. get the weighted degree of f … … 1779 1780 } 1780 1781 1781 staticproc dmodappassumeViolation()1782 proc dmodappassumeViolation() 1782 1783 { 1783 1784 // returns Boolean : yes/no [for assume violation] 1784 1785 // char K = 0 1785 1786 // no qring 1786 // input poly/ideal is nonzero ?1787 if ( (char(basering) !=0 ) || (nvars(basering) != gkdim(std(0)) ) )1788 {1787 if ( (size(ideal(basering)) >0) || (char(basering) >0) ) 1788 { 1789 // "ERROR: no qring is allowed"; 1789 1790 return(1); 1790 1791 }
Note: See TracChangeset
for help on using the changeset viewer.