Changeset 238c959 in git
- Timestamp:
- Oct 1, 2008, 7:44:38 PM (15 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- e40f77ae12c0d4b4f8155bd7ecbcfb7139652262
- Parents:
- 49f94f3754d486ab94e553bfb86651899f334c83
- Location:
- Singular/LIB
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/bfct.lib
r49f94f r238c959 1 1 ////////////////////////////////////////////////////////////////////////////// 2 version="$Id: bfct.lib,v 1. 3 2008-08-22 09:31:56 SingularExp $";2 version="$Id: bfct.lib,v 1.4 2008-10-01 17:44:37 levandov Exp $"; 3 3 category="Noncommutative"; 4 4 info=" … … 19 19 20 20 bfct(f[,s,t,v]); compute the global Bernstein-Sato polynomial of a given poly 21 bfctsyz(f[,r,s,t, v]);compute the global Bernstein-Sato polynomial of a given poly21 bfctsyz(f[,r,s,t,u,v]); compute the global Bernstein-Sato polynomial of a given poly 22 22 bfctonestep(f[,s,t]); compute the global Bernstein-Sato polynomial of a given poly 23 23 bfctideal(I,w[,s,t]); compute the global b-function of a given ideal w.r.t. a given weight 24 minpol(f,I); compute the minimal polynomial of the endormorphism in basering modulo I given by f25 minpolsyz(f,I[,p, t]); compute the minimal polynomial of the endormorphism in basering modulo I given by f24 minpol(f,I); compute the minimal polynomial of the endormorphism in basering modulo ideal given by a poly 25 minpolsyz(f,I[,p,s,t]); compute the minimal polynomial of the endormorphism in basering modulo ideal given by a poly 26 26 linreduce(f,I[,s]); reduce a poly by linear reductions of its leading term 27 27 ncsolve(I[,s]); find and compute a linear dependency of the elements of an ideal … … 41 41 42 42 43 proc testbfctlib ()43 proc testbfctlib () 44 44 { 45 45 // tests all procs for consistency 46 46 "AUXILIARY PROCEDURES:"; 47 48 47 example ispositive; 49 48 example isin; … … 186 185 RETURN: an int, the standard scalar product of v and w 187 186 PURPOSE: compute the scalar product of two intvecs 187 NOTE: the arguments must have the same size 188 188 EXAMPLE: example scalarprod; shows examples 189 NOTE: the arguments must have the same size190 189 " 191 190 { … … 218 217 proc linreduce(poly f, ideal I, list #) 219 218 "USAGE: linreduce(f, I [,s]); f a poly, I an ideal, s an optional int 220 RETURN: a poly obtained by linear reductions of the leading term with I221 PURPOSE: reduce a poly by linear reductions of its leading term only219 RETURN: a poly obtained by linear reductions of the leading term of the given poly with an ideal 220 PURPOSE: reduce a poly only by linear reductions of its leading term 222 221 NOTE: If s<>0, a list consisting of the reduced poly and the vector of the used 223 222 @* reductions is returned. … … 280 279 ideal I = 1,y,xy; 281 280 poly f = 5xy+7y+3; 282 poly g = 5 xy+7x+3;281 poly g = 5y+7x+3; 283 282 linreduce(f,I); 284 283 linreduce(g,I); … … 349 348 dbprint(ppl, "ncsolve: starting Groebner basis computation with engine:", whichengine); 350 349 QQ = engine(QQ,whichengine); 351 dbprint(ppl, "QQ after groebner:", QQ); 352 // "QQ after groebner:"; QQ; 350 dbprint(ppl, "QQ after engine:", QQ); 353 351 if (dim(QQ) == -1) 354 352 { 355 353 dbprint(ppl+1, "no solutions by ncsolve"); 356 // "no solutions by ncsolve";357 354 // output zeroes 358 355 setring save; … … 362 359 // 4. in order to get the numeric values 363 360 matrix AA = matrix(maxideal(1)); 364 attrib(QQ,"isSB",1); // to suppress NF warnings365 AA = NF(AA, QQ);// todo: we still receive NF warnings361 module MQQ = std(module(QQ)); 362 AA = NF(AA,MQQ); // todo: we still receive NF warnings 366 363 dbprint(ppl, "AA after NF:",AA); 367 364 // "AA after NF:"; print(AA); … … 483 480 { 484 481 "EXAMPLE:"; echo = 2; 485 ring r = 0,(t,x,y,Dt,Dx,Dy),dp; 486 def D = Weyl(); 482 printlevel = 0; 483 ring r = 0,(x,y),dp; 484 poly f = x^2+y^3+x*y^2; 485 def D = initialmalgrange(f); 487 486 setring D; 488 ideal I = x*Dt,6*t*Dt+2*y*Dy+3*x*Dx+6,3*y^2*Dx-2*x*Dy,2*y*x*Dy+3*x^2*Dx+6*x,y^2*Dt,y^3+x^2,9*y*x^2*Dx^2+4*x^2*Dy^2+6*y^2*Dy+24*y*x*Dx+18*y,27*x^3*Dx^3-8*x^2*Dy^3-12*y^2*Dy^2+162*x^2*Dx^2-48*y*Dy+186*x*Dx; 489 // I is a Groebner basis of the initial Malgrange ideal of x2+y3 487 inF; 490 488 poly s = t*Dt; 491 vector m = minpol(s,I);m;489 minpol(s,inF); 492 490 } 493 491 494 492 proc minpolsyz (poly s, ideal II, list #) 495 "USAGE: minpolsyz(f, I [,p, t]); f a poly, I an ideal, p, t optial ints, p a prime number493 "USAGE: minpolsyz(f, I [,p,s,t]); f a poly, I an ideal, p, t optial ints, p a prime number 496 494 RETURN: coefficient vector of the minimal polynomial of the endomorphism of basering modulo I defined by f 497 495 PURPOSE: compute the minimal polynomial … … 502 500 @* Otherwise, it searched for all degrees. 503 501 @* This is done by computing syzygies. 504 @* If s<>0, @code{std} is used for Groebner basis computations, 505 @* otherwise @code{slimgb} is used. 506 @* By default, @code{slimgb} is used in char 0 and @code{std} in char p. 502 @* If s<>0, @code{std} is used for Groebner basis computations in char 0, 503 @* otherwise, and by default, @code{slimgb} is used. 504 @* If t<>0 and by default, @code{std} is used for Groebner basis computations in char >0, 505 @* otherwise, @code{slimgb} is used. 507 506 @* If printlevel=1, progress debug messages will be printed, 508 507 @* if printlevel>=2, all the debug messages will be printed. … … 515 514 int ppl = printlevel-voice+2; 516 515 int whichengine = 0; // default 517 int enginespec = 0; // default516 int modengine = 1; // default 518 517 int solveincharp = 0; // default 519 518 def save = basering; … … 522 521 if (typeof(#[1])=="int" || typeof(#[1])=="number") 523 522 { 524 solveincharp = int( 523 solveincharp = int(#[1]); 525 524 } 526 525 if (size(#)>1) … … 529 528 { 530 529 whichengine = int(#[2]); 531 enginespec = 1; 530 } 531 if (size(#)>2) 532 { 533 if (typeof(#[3])=="int" || typeof(#[3])=="number") 534 { 535 modengine = int(#[3]); 536 } 532 537 } 533 538 } … … 586 591 setring Rp; 587 592 NI[i+1] = phi(newNF); 588 if (enginespec==1) 589 { 590 v = ncsolve(NI,whichengine); 591 } 592 else 593 { 594 v = ncsolve(NI); 595 } 593 v = ncsolve(NI,modengine); 596 594 if (v!=0) // there is a modular solution 597 595 { … … 647 645 { 648 646 "EXAMPLE:"; echo = 2; 649 ring r = 0,(t,x,y,Dt,Dx,Dy),dp; 650 def D = Weyl(); 647 printlevel = 0; 648 ring r = 0,(x,y),dp; 649 poly f = x^2+y^3+x*y^2; 650 def D = initialmalgrange(f); 651 651 setring D; 652 ideal I = x*Dt,6*t*Dt+2*y*Dy+3*x*Dx+6,3*y^2*Dx-2*x*Dy,2*y*x*Dy+3*x^2*Dx+6*x,y^2*Dt,y^3+x^2,9*y*x^2*Dx^2+4*x^2*Dy^2+6*y^2*Dy+24*y*x*Dx+18*y,27*x^3*Dx^3-8*x^2*Dy^3-12*y^2*Dy^2+162*x^2*Dx^2-48*y*Dy+186*x*Dx; 653 // I is a Groebner basis of the initial Malgrange ideal of x2+y3 652 inF; 654 653 poly s = t*Dt; 655 minpolsyz(s, I);654 minpolsyz(s,inF); 656 655 int p = prime(20000); 657 minpolsyz(s, I,p,0);656 minpolsyz(s,inF,p,0,0); 658 657 } 659 658 … … 685 684 map @m = save,J; 686 685 poly p = @m(p); 687 if (substitution == 1)686 if (substitution == 1) 688 687 { 689 688 p = subst(p,s,-s-1); … … 706 705 } 707 706 708 static proc bfctengine (poly f, int whichengine, int methodord, int methodminpol, int minpolchar, int vec u0)707 static proc bfctengine (poly f, int whichengine, int methodord, int methodminpol, int minpolchar, int modengine, intvec u0) 709 708 { 710 709 int ppl = printlevel - voice +2; … … 735 734 usedprimes = usedprimes,q; 736 735 dbprint(ppl,"used prime is: "+string(q)); 737 b = minpolsyz(s,inI,q,whichengine );736 b = minpolsyz(s,inI,q,whichengine,modengine); 738 737 } 739 738 i++; … … 756 755 757 756 proc bfct (poly f, list #) 758 "USAGE: bfct(f [,s,t,v]); f a poly, r,s,t optional ints, v an optional intvec759 RETURN: list of roots of the Bernstein-Sato polynomial bs(f) and itsmultiplicies757 "USAGE: bfct(f [,s,t,v]); f a poly, s,t optional ints, v an optional intvec 758 RETURN: list of roots of the Bernstein-Sato polynomial bs(f) and their multiplicies 760 759 PURPOSE: compute the global Bernstein-Sato polynomial for a hypersurface, defined by f, according to the algorithm by Masayuki Noro 761 760 NOTE: In this proc, a system of linear equations is solved by linear reductions. … … 802 801 } 803 802 } 804 list b = bfctengine(f,whichengine,methodord,0,0, u0);803 list b = bfctengine(f,whichengine,methodord,0,0,0,u0); 805 804 return(b); 806 805 } … … 809 808 "EXAMPLE:"; echo = 2; 810 809 ring r = 0,(x,y),dp; 811 poly f = x 2+y3+x*y^2;810 poly f = x^2+y^3+x*y^2; 812 811 bfct(f); 813 bfct(f,1,1); 812 intvec v = 3,2; 813 bfct(f,1,0,v); 814 814 } 815 815 816 816 proc bfctsyz (poly f, list #) 817 "USAGE: bfctsyz(f [,r,s,t, v]); f a poly, r,s,toptional ints, v an optional intvec817 "USAGE: bfctsyz(f [,r,s,t,u,v]); f a poly, r,s,t,u optional ints, v an optional intvec 818 818 RETURN: list of roots of the Bernstein-Sato polynomial bs(f) and its multiplicies 819 819 PURPOSE: compute the global Bernstein-Sato polynomial for a hypersurface, defined by f, according to the algorithm by Masayuki Noro … … 825 825 @* If t<>0, the minimal polynomial computation is solely performed over charasteristic 0, 826 826 @* otherwise and by default, a modular method is used. 827 @* If u<>0 , @code{std} is used for Groebner basis computations in characteristic >0,828 @* otherwise, and by default,@code{slimgb} is used.827 @* If u<>0 and by default, @code{std} is used for Groebner basis computations in characteristic >0, 828 @* otherwise, @code{slimgb} is used. 829 829 @* If v is a positive weight vector, v is used for homogenization computations, 830 830 @* otherwise and by default, no weights are used. … … 847 847 int methodord = 0; // default 848 848 int minpolchar = 0; // default 849 int modengine = 1; // default 849 850 intvec u0 = 0; // default 850 851 if (size(#)>0) … … 866 867 minpolchar = int(#[3]); 867 868 } 868 869 if (size(#)>3) 869 870 { 870 if (typeof(#[4])=="int vec" && size(#[4])==n && ispositive(#[4])==1)871 if (typeof(#[4])=="int" || typeof(#[4])=="number") 871 872 { 872 u0 = #[4]; 873 modengine = int(#[4]); 874 } 875 if (size(#)>4) 876 { 877 if (typeof(#[5])=="intvec" && size(#[5])==n && ispositive(#[5])==1) 878 { 879 u0 = #[5]; 880 } 873 881 } 874 882 } … … 876 884 } 877 885 } 878 list b = bfctengine(f,whichengine,methodord,1,minpolchar, u0);886 list b = bfctengine(f,whichengine,methodord,1,minpolchar,modengine,u0); 879 887 return(b); 880 888 } … … 883 891 "EXAMPLE:"; echo = 2; 884 892 ring r = 0,(x,y),dp; 885 poly F = x2+y3; 886 bfctsyz(F); 887 bfctsyz(F,1,1,1); 893 poly f = x^2+y^3+x*y^2; 894 bfctsyz(f); 895 intvec v = 3,2; 896 bfctsyz(f,0,1,1,0,v); 888 897 } 889 898 890 899 proc bfctideal (ideal I, intvec w, list #) 891 "USAGE: bfctideal(I,w[,s,t]); I an ideal, r,soptional ints892 RETURN: list of roots and its multiplicies of the global b-function of I w.r.t. to the weight -w,w893 PURPOSE: compute the global b-function of an ideal according to the algorithm by M asayukiNoro900 "USAGE: bfctideal(I,w[,s,t]); I an ideal, w an intvec, s,t optional ints 901 RETURN: list of roots and their multiplicies of the global b-function of I w.r.t. the weight vector (-w,w) 902 PURPOSE: compute the global b-function of an ideal according to the algorithm by M. Noro 894 903 NOTE: Assume, I is an ideal in the n-th Weyl algebra where the sequence of the 895 904 @* variables is x(1),...,x(n),D(1),...,D(n). … … 937 946 "EXAMPLE:"; echo = 2; 938 947 ring @D = 0,(x,y,Dx,Dy),dp; 939 def D D= Weyl();940 setring D D;948 def D = Weyl(); 949 setring D; 941 950 ideal I = 3*x^2*Dy+2*y*Dx,2*x*Dx+3*y*Dy+6; 942 951 intvec w1 = 1,1; … … 944 953 intvec w3 = 2,3; 945 954 bfctideal(I,w1); 946 bfctideal(I,w2 );947 bfctideal(I,w3 );955 bfctideal(I,w2,1); 956 bfctideal(I,w3,0,1); 948 957 } 949 958 … … 984 993 def DDh = initialidealengine("bfctonestep", whichengine, methodord, f); 985 994 setring DDh; 995 dbprint(ppl, "the initial ideal:", string(matrix(inF))); 986 996 inF = nselect(inF,3,2*n+4); 987 997 inF = nselect(inF,1); … … 1000 1010 "EXAMPLE:"; echo = 2; 1001 1011 ring r = 0,(x,y),dp; 1002 poly f = x 2+y3;1012 poly f = x^2+y^3+x*y^2; 1003 1013 bfctonestep(f); 1014 bfctonestep(f,1,1); 1004 1015 } 1005 1016 -
Singular/LIB/dmodapp.lib
r49f94f r238c959 1 1 ////////////////////////////////////////////////////////////////////////////// 2 version="$Id: dmodapp.lib,v 1. 7 2008-08-08 12:57:31 SingularExp $";2 version="$Id: dmodapp.lib,v 1.8 2008-10-01 17:44:38 levandov Exp $"; 3 3 category="Noncommutative"; 4 4 info=" … … 19 19 initialideal(I,u,v[,s,t]); compute the initial ideal of a given ideal w.r.t. given weights 20 20 21 SECONDARY PROCEDURES FOR D-MODULES: 21 SECONDARY PROCEDURES FOR D-MODULES: //todo: no seperate paragraph on web page 22 22 isFsat(I, F); check whether the ideal I is F-saturated 23 23 SDLoc(I, F); compute a generic presentation of the localization of D/I w.r.t. f^s, for D a Weyl algebra … … 66 66 67 67 proc initialideal (ideal I, intvec u, intvec v, list #) 68 "USAGE: initialideal(I, [,s,t]); I an ideal, s,t optional ints69 RETURN: an ideal, the initial ideal of the input ideal w.r.t. the weights u and v68 "USAGE: initialideal(I,u,v [,s,t]); I an ideal, u,v intvecs, s,t optional ints 69 RETURN: an ideal, a Broebner basis of the initial ideal of the input ideal w.r.t. the weights u and v 70 70 PURPOSE: compute the initial ideal 71 71 NOTE: Assume, I is an ideal in the n-th Weyl algebra where the sequence of the 72 @* variables is x(1),...,x(n),D(1),...,D(n).72 @* indeterminates is x(1),...,x(n),D(1),...,D(n). 73 73 @* Further assume that u is the weight for the x(i) and v the weight for the D(i). 74 74 @* Note that the returned ideal is not a D-ideal but an ideal in the associated 75 @* graded ring .75 @* graded ring while the Groebner basis is a subset of D. 76 76 @* If s<>0, @code{std} is used for Groebner basis computations, otherwise, 77 77 @* and by default, @code{slimgb} is used. … … 119 119 proc initialmalgrange (poly f,list #) 120 120 "USAGE: initialmalgrange(f, [,s,t,u,v]); f a poly, s,t,u optional ints, v an optional intvec 121 RETURN: a ring, the Weyl algebra induced by the basering, extended in the variables t and Dt122 PURPOSE: compute the initial Malgrange ideal of a given poly w.r.t. t o the weight vector121 RETURN: a ring, the Weyl algebra induced by the basering, extended in the indeterminates t and Dt 122 PURPOSE: compute the initial Malgrange ideal of a given poly w.r.t. the weight vector 123 123 @* (-1,0...,0,1,0,...,0) such that the weight of t is -1 and the weight of Dt is 1. 124 124 NOTE: Activate the output ring with the @code{setring} command. … … 184 184 "EXAMPLE:"; echo = 2; 185 185 ring r = 0,(x,y),dp; 186 poly f = x 2+y3;186 poly f = x^2+y^3+x*y^2; 187 187 def D = initialmalgrange(f); 188 188 setring D; 189 189 inF; 190 190 setring r; 191 def D2 = initialmalgrange(f,1,1,1); 191 intvec v = 3,2; 192 def D2 = initialmalgrange(f,1,0,1,v); 192 193 setring D2; 193 194 inF; … … 218 219 { 219 220 poly f = #[1]; 220 uv[n+2] = 1;221 221 if (calledfrom == "initialmalgrange") 222 222 { 223 uv[n+2] = 1; 223 224 noofvars = 2*n+3; 224 225 intvec u0 = #[4]; … … 438 439 proc InForm (list #) 439 440 "USAGE: InForm(f,w) or InForm(I,w); f a poly, I an ideal, w an intvec 440 RETURN: the initial of f or I w.r.t. to the weightw441 PURPOSE: compute the initial form of a poly or ideal w.r.t a given weight441 RETURN: the initial form of f or I w.r.t. the weight vector w 442 PURPOSE: compute the initial form of a poly or an ideal w.r.t a given weight 442 443 NOTE: the size of the weight vector must be equal to the number of variables of the basering 443 444 EXAMPLE: example InForm; shows examples … … 628 629 629 630 630 proc AppelF1() 631 proc AppelF1() //todo: create help string 631 632 //(number a,b,c,d) 632 633 { … … 654 655 } 655 656 656 proc AppelF2() 657 proc AppelF2() //todo: create help string 657 658 //(number a,b,c) 658 659 { … … 679 680 } 680 681 681 proc AppelF4() 682 proc AppelF4() //todo: create help string 682 683 //number a,b,c,d - ? 683 684 { … … 742 743 PURPOSE: check whether the ideal I is F-saturated 743 744 NOTE: 1 is returned if I is F-saturated, otherwise 0 is returned 744 * we check indeed that Ker(D --F--> D/I) is (0) 745 * we check indeed that Ker(D --F--> D/I) is (0) //todo: * or @* ?? 745 746 EXAMPLE: example isFsat; shows examples 746 747 " … … 1358 1359 RLD; 1359 1360 // Now, compare with the output of Macaulay2: 1360 ideal tst = 3*x*Dx + 2*y*Dy + 1, y^3*Dy^2 - x^2*Dy^2 + 6*y^2*Dy + 6*y, 9*y^2*Dx^2*Dy - 4*y*Dy^3 + 27*y*Dx^2 + 2*Dy^2, 9*y^3*Dx^2 - 4*y^2*Dy^2 + 10*y*Dy -10;1361 ideal tst = 3*x*Dx + 2*y*Dy + 1, y^3*Dy^2 - x^2*Dy^2 + 6*y^2*Dy + 6*y, 9*y^2*Dx^2*Dy - 4*y*Dy^3 + 27*y*Dx^2 + 2*Dy^2, 9*y^3*Dx^2 - 4*y^2*Dy^2 + 10*y*Dy -10; //todo: maybe a bit too long 1361 1362 option(redSB); 1362 1363 option(redTail); … … 1523 1524 } 1524 1525 1525 proc engine(ideal I, int i) 1526 proc engine(ideal I, int i) //todo: create help string 1526 1527 { 1527 1528 /* std - slimgb mix */ … … 1540 1541 return(J); 1541 1542 } 1542 example 1543 example //todo: strange: example not showing on web page 1543 1544 { 1544 1545 "EXAMPLE:"; echo = 2;
Note: See TracChangeset
for help on using the changeset viewer.