Changeset 0fbdd1 in git for Singular/LIB/sing.lib
- Timestamp:
- Sep 12, 1997, 9:40:37 AM (26 years ago)
- Branches:
- (u'spielwiese', 'a719bcf0b8dbc648b128303a49777a094b57592c')
- Children:
- 3ca4229c4e4d8d84ca999ef93aec635eb84259c6
- Parents:
- 4a81eccd72975057d29a44244958cdc9a450eb71
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/sing.lib
r4a81ec r0fbdd1 1 // $Id: sing.lib,v 1. 3 1997-05-01 17:49:56Singular Exp $1 // $Id: sing.lib,v 1.4 1997-09-12 07:40:37 Singular Exp $ 2 2 //system("random",787422842); 3 3 //(GMG/BM, last modified 26.06.96) … … 6 6 LIBRARY: sing.lib PROCEDURES FOR SINGULARITIES 7 7 8 codim (id1, id2); vector space dimension of of id2/id1 if finite 8 9 deform(i); infinitesimal deformations of ideal i 9 10 dim_slocus(i); dimension of singular locus of ideal i … … 16 17 nf_icis(i); generic combinations of generators; get ICIS in nf 17 18 slocus(i); ideal of singular locus of ideal i 19 spectrum(f,w); spectrum numbers of w-homogeneous polynomial f 18 20 Tjurina(i); SB of Tjurina module of ideal i (assume i is ICIS) 19 21 tjurina(i); Tjurina number of ideal i (assume i is ICIS) … … 21 23 T2((i); T2-module of ideal i 22 24 T12(i); T1- and T2-module of ideal i 23 codim (id1, id2); codimension of of id2 in id124 25 25 26 LIB "inout.lib"; 26 27 LIB "random.lib"; 28 /////////////////////////////////////////////////////////////////////////////// 29 30 proc codim (id1, id2) 31 USAGE: codim(id1,id2); id1,id2 ideal or module 32 ASSUME: both must be standard bases w.r.t. ordering ds or Ds or homogeneous 33 and standardbases w.r.t. ordering dp or Dp 34 RETURN: int, which is: 35 1. the codimension of id2 in id1, i.e. the vectorspace dimension of 36 id1/id2 if id2 is contained in id1 and if this number is finite 37 2. -1 if the dimension of id1/id2 is infinite 38 3. -2 if id2 is not contained in id1, 39 COMPUTE: consider the two hilberseries iv1(t) and iv2(t), then, in case 1., 40 q(t)=(iv2(t)-iv1(t))/(1-t)^n must be rational, and the result is the 41 sum of the coefficients of q(t) (n number of variables) 42 NOTE: As always, id1 and id2 must be consider as ideals in the localization 43 of the polynomial ring w.r.t. the monomial ordering 44 EXAMPLE: example codim; shows an example 45 { 46 intvec iv1, iv2, iv; 47 int i, d1, d2, dd, i1, i2, ia, ie; 48 //--------------------------- check id2 < id1 ------------------------------- 49 ideal led = lead(id1); 50 attrib(led, "isSB",1); 51 i = size(NF(lead(id2),led)); 52 if ( i > 0 ) 53 { 54 return(-2); 55 } 56 //--------------------------- 1. check finiteness --------------------------- 57 i1 = dim(id1); 58 i2 = dim(id2); 59 if (i1 < 0) 60 { 61 if (i2 == 0) 62 { 63 return vdim(id2); 64 } 65 else 66 { 67 return(-1); 68 } 69 } 70 if (i2 != i1) 71 { 72 return(-1); 73 } 74 if (i2 <= 0) 75 { 76 return(vdim(id2)-vdim(id1)); 77 } 78 //--------------------------- module --------------------------------------- 79 d1 = nrows(id1); 80 d2 = nrows(id2); 81 dd = 0; 82 if (d1 > d2) 83 { 84 id2=id2,maxideal(1)*gen(d1); 85 dd = -1; 86 } 87 if (d2 > d1) 88 { 89 id1=id1,maxideal(1)*gen(d2); 90 dd = 1; 91 } 92 //--------------------------- compute first hilbertseries ------------------ 93 iv1 = hilb(id1,1); 94 i1 = size(iv1); 95 iv2 = hilb(id2,1); 96 i2 = size(iv2); 97 //--------------------------- difference of hilbertseries ------------------ 98 if (i2 > i1) 99 { 100 for ( i=1; i<=i1; i=i+1) 101 { 102 iv2[i] = iv2[i]-iv1[i]; 103 } 104 ie = i2; 105 iv = iv2; 106 } 107 else 108 { 109 for ( i=1; i<=i2; i=i+1) 110 { 111 iv1[i] = iv2[i]-iv1[i]; 112 } 113 iv = iv1; 114 for (ie=i1;ie>=0;ie=ie-1) 115 { 116 if (ie == 0) 117 { 118 return(0); 119 } 120 if (iv[ie] != 0) 121 { 122 break; 123 } 124 } 125 } 126 ia = 1; 127 while (iv[ia] == 0) { ia=ia+1; } 128 //--------------------------- ia <= nonzeros <= ie ------------------------- 129 iv1 = iv[ia]; 130 for(i=ia+1;i<=ie;i=i+1) 131 { 132 iv1=iv1,iv[i]; 133 } 134 //--------------------------- compute second hilbertseries ----------------- 135 iv2 = hilb(iv1); 136 //--------------------------- check finitenes ------------------------------ 137 i2 = size(iv2); 138 i1 = ie - ia + 1 - i2; 139 if (i1 != nvars(basering)) 140 { 141 return(-1); 142 } 143 //--------------------------- compute result ------------------------------- 144 i1 = 0; 145 for ( i=1; i<=i2; i=i+1) 146 { 147 i1 = i1 + iv2[i]; 148 } 149 return(i1+dd); 150 } 151 example 152 { "EXAMPLE:"; echo = 2; 153 ring r = 0,(x,y,z),dp; 154 ideal j = y6,x4; 155 ideal m = x,y; 156 attrib(m,"isSB",1); //let Singular know that ideals are a standard basis 157 attrib(j,"isSB",1); 158 codim(m,j); // should be 23 (Milnor number -1 of y7-x5) 159 } 27 160 /////////////////////////////////////////////////////////////////////////////// 28 161 … … 362 495 /////////////////////////////////////////////////////////////////////////////// 363 496 497 proc spectrum (poly f, intvec w) 498 USAGE: spectrum(f,w); f=poly, w=intvec; 499 ASSUME: f is a weighted homogeneous isolated singularity w.r.t. the weights 500 given by w; w must consist of as many positive integers as there 501 are variables of the basering 502 COMPUTE: the spectral numbers of the w-homogeneous polynomial f, computed in a 503 ring of charcteristik 0 504 RETURN: intvec d,s1,...,su where: 505 d = w-degree(f) and si/d = ith spectral-number(f) 506 No return value if basering has parameters or if f is no isolated 507 singularity, displays a warning in this case 508 EXAMPLE: example spectrum; shows an example 509 { 510 int i,d,W; 511 intvec sp; 512 def r = basering; 513 if( find(charstr(r),",")!=0 ) 514 { 515 "// coefficient field must not have parameters!"; 516 return(); 517 } 518 ring s = 0,x(1..nvars(r)),ws(w); 519 map phi = r,maxideal(1); 520 poly f = phi(f); 521 d = ord(f); 522 W = sum(w)-d; 523 ideal k = std(jacob(f)); 524 if( vdim(k) == -1 ) 525 { 526 "// f is no isolated singuarity!"; 527 return(); 528 } 529 k = kbase(k); 530 for (i=1; i<=size(k); i++) 531 { 532 sp[i]=W+ord(k[i]); 533 } 534 list L = sort(sp); 535 sp = d,L[1]; 536 return(sp); 537 } 538 example 539 { "EXAMPLE:"; echo = 2; 540 ring r; 541 poly f=x3+y5+z2; 542 intvec w=10,6,15; 543 spectrum(f,w); 544 // the spectrum numbers are: 545 // 1/30,7/30,11/30,13/30,17/30,19/30,23/30,29/30 546 } 547 /////////////////////////////////////////////////////////////////////////////// 548 364 549 proc Tjurina (id, list #) 365 550 USAGE: Tjurina(id[,<any>]); id=ideal or poly … … 459 644 module nb = [1]; module pnb; 460 645 dbprint(printlevel-voice+3,"// dim T1 = "+string(vdim(t1))); 461 if( size(#)>0 ) { return(t1*gen(1),nb,pnb); } 646 if( size(#)>0 ) 647 { 648 module st1 = t1*gen(1); 649 attrib(st1,"isSB",1); 650 return(st1,nb,pnb); 651 } 462 652 return(t1); 463 653 } … … 656 846 /////////////////////////////////////////////////////////////////////////////// 657 847 proc codim (id1, id2) 658 USAGE: codim(id1,id2); id1,id2 ideal or module, both result of std 659 RETURN: result is the number of elements in id1 but not in id2 if finite, 660 conditions: 661 1. id2 is contained in id1, if not return -2 662 2. finiteness 663 consider the two hilberseries iv1(t) and iv2(t) 664 q(t)=(iv2(t)-iv1(t))/(1-t)^n must be rational, if not return -1 665 (n dimension of basering) 666 then the result is the sum of the coeff. of q(t) 848 USAGE: codim(id1,id2); id1,id2 ideal or module, both must be standard bases 849 RETURN: int, which is: 850 1. the codimension of id2 in id1, i.e. the vectorspace dimension of 851 id1/id2 if id2 is contained in id1 and if this number is finite 852 2. -1 if the dimension of id1/id2 is infinite 853 3. -2 if id2 is not contained in id1, 854 COMPUTE: consider the two hilberseries iv1(t) and iv2(t), then, in case 1., 855 q(t)=(iv2(t)-iv1(t))/(1-t)^n must be rational, and the result is the 856 sum of the coefficients of q(t) (n dimension of basering) 857 EXAMPLE: example codim; shows an example 667 858 { 668 859 intvec iv1, iv2, iv; 669 860 int i, d1, d2, dd, i1, i2, ia, ie; 670 //--------------------------- check id2 < id1 ------------------------------ 671 i = size(NF(lead(id2),lead(id1))); 861 //--------------------------- check id2 < id1 ------------------------------- 862 ideal led = lead(id1); 863 attrib(led, "isSB",1); 864 i = size(NF(lead(id2),led)); 672 865 if ( i > 0 ) 673 866 { … … 696 889 return(vdim(id2)-vdim(id1)); 697 890 } 698 699 700 701 891 // if (mult(id2) != mult(id1)) 892 //{ 893 // return(-1); 894 // } 702 895 //--------------------------- module --------------------------------------- 703 896 d1 = nrows(id1); … … 773 966 return(i1+dd); 774 967 } 775 968 example 969 { "EXAMPLE:"; echo = 2; 970 ring r = 0,(x,y,z),dp; 971 ideal j = y6,x4; 972 ideal m = x,y; 973 attrib(m,"isSB",1); //let Singular know that ideals are a standard basis 974 attrib(j,"isSB",1); 975 codim(m,j); // should be 23 (Milnor number -1 of y7-x5) 976 }
Note: See TracChangeset
for help on using the changeset viewer.