Changeset d69ff5 in git for Singular/LIB/primdecint.lib
- Timestamp:
- Sep 30, 2010, 4:10:51 PM (13 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 5e2dd1408b0e0191298d3cb3cb7327a1ff7c9464
- Parents:
- 9d58ee75e7b3473e2e455debed865a8f8a4c97b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/primdecint.lib
r9d58ee7 rd69ff5 5 5 LIBRARY: primdecint.lib primary decomposition over the integers 6 6 7 AUTHORS: G. Pfister pfister@mathematik.uni-kl.de8 @* A. Sadiq afshanatiq@gmail.com9 @* S. Steidel steidel@mathematik.uni-kl.de7 AUTHORS: G. Pfister pfister@mathematik.uni-kl.de 8 @* A. Sadiq afshanatiq@gmail.com 9 @* S. Steidel steidel@mathematik.uni-kl.de 10 10 11 11 OVERVIEW: 12 12 13 A library for computing the primary decomposition of an ideal in the polynomial14 ring over the integers, Z[x_1,...,x_n].13 A library for computing the primary decomposition of an ideal in the 14 polynomial ring over the integers, Z[x_1,...,x_n]. 15 15 16 16 PROCEDURES: … … 20 20 heightZ(I); compute the height of I 21 21 equidimZ(I); compute the equidimensional part of I 22 intersectZ(I,J) compute the intersection of I and J 22 23 "; 23 24 … … 29 30 "USAGE: primdecZ(I); I ideal 30 31 NOTE: If size(#) > 0, then #[1] is the number of available processors for 31 the computation. Parallelization is just applicable using 32-bit Singular 32 version since MP-links are not compatible with 64-bit Singular version. 32 the computation. Parallelization is just applicable using 32-bit 33 Singular version since MP-links are not compatible with 64-bit Singular 34 version. 33 35 RETURN: a list pr of primary ideals and their associated primes: 34 36 @format … … 41 43 if(size(I)==0){return(list(ideal(0),ideal(0)));} 42 44 43 45 //-------------------- Initialize optional parameters ------------------------ 44 46 if(size(#) > 0) 45 47 { … … 49 51 if((n > 1) && (1 - system("with","MP"))) 50 52 { 51 52 53 54 53 "========================================================================"; 54 "There is no MP available on your system. Since this is necessary to "; 55 "parallelize the algorithm, the computation will be done without forking."; 56 "========================================================================"; 55 57 n = 1; 56 58 } … … 62 64 if((n > 1) && (1 - system("with","MP"))) 63 65 { 64 65 66 67 66 "========================================================================"; 67 "There is no MP available on your system. Since this is necessary to "; 68 "parallelize the algorithm, the computation will be done without forking."; 69 "========================================================================"; 68 70 n = 1; 69 71 } … … 128 130 129 131 //----- Create n1 links l(1),...,l(n1), open all of them and compute --------- 130 //----- standard basis for the primes L[1][2],...,L[1][n + 1]. 132 //----- standard basis for the primes L[1][2],...,L[1][n + 1]. --------- 131 133 132 134 for(i = 1; i <= n; i++) … … 199 201 for(i=1;i<=size(A);i++) 200 202 { 201 //=== computes for all p in L the minimal associated primes of IZ/p[variables] 203 //=== computes for all p in L the minimal associated primes of 204 //=== IZ/p[variables] 202 205 p = int(A[i][2]); 203 206 if(printlevel >= 10) … … 315 318 ideal J=imap(R,J); 316 319 J=std(J); 317 //=== the primary decomposition over Q which gives the primary decomposition318 //=== of I:h for a suitable integer h320 //=== the primary decomposition over Q which gives the primary 321 //=== decomposition of I:h for a suitable integer h 319 322 list pr=primdecGTZ(J); 320 323 for(i=1;i<=size(pr);i++) … … 384 387 } 385 388 386 /////////////////////////////////////////////////////////////////////////////// 389 //////////////////////////////////////////////////////////////////////////////// 387 390 388 391 proc minAssZ(ideal I) … … 419 422 for(i=1;i<=size(L);i++) 420 423 { 421 //=== computes for all p in L the minimal associated primes of IZ/p[variables] 424 //=== computes for all p in L the minimal associated primes of 425 //=== IZ/p[variables] 422 426 p=int(L[i]); 423 427 setring R; … … 451 455 ideal J=imap(R,J); 452 456 J=std(J); 453 //=== the primary decomposition over Q which gives the primary decomposition454 //=== of I:h for a suitable integer h457 //=== the primary decomposition over Q which gives the primary 458 //=== decomposition of I:h for a suitable integer h 455 459 list pr=minAssGTZ(J); 456 460 for(i=1;i<=size(pr);i++) … … 519 523 } 520 524 521 /////////////////////////////////////////////////////////////////////////////// 525 //////////////////////////////////////////////////////////////////////////////// 522 526 523 527 proc heightZ(ideal I) … … 611 615 } 612 616 613 /////////////////////////////////////////////////////////////////////////////// 617 //////////////////////////////////////////////////////////////////////////////// 614 618 615 619 proc radicalZ(ideal I) … … 711 715 } 712 716 713 /////////////////////////////////////////////////////////////////////////////// 717 //////////////////////////////////////////////////////////////////////////////// 714 718 715 719 proc equidimZ(ideal I) … … 766 770 for(i=1;i<=size(L);i++) 767 771 { 768 //=== computes for all p in L the minimal associated primes of IZ/p[variables] 772 //=== computes for all p in L the minimal associated primes of 773 //=== IZ/p[variables] 769 774 p=int(L[i]); 770 775 j=Le[i]; … … 844 849 ideal J=imap(R,J); 845 850 J=std(J); 846 //=== the equidimensional part over Q which gives the equdimensional part847 //=== of I:h for a suitable integer h851 //=== the equidimensional part over Q which gives the equdimensional 852 //=== part of I:h for a suitable integer h 848 853 ideal E=1; 849 854 if(nvars(R)-he==dim(J)) … … 888 893 } 889 894 890 /////////////////////////////////////////////////////////////////////////////// 895 //////////////////////////////////////////////////////////////////////////////// 896 897 proc intersectZ(ideal I, ideal J) 898 "USAGE: intersectZ(I,J); I,J ideals 899 RETURN: the intersection of the input ideals 900 NOTE: this is needed because intersect(I,J) does not work, should be replaced 901 by intersect later 902 EXAMPLE: example intersectZ; shows an example 903 { 904 def R = basering; 905 execute("ring S=integer,(t,"+varstr(R)+"),(dp(1),dp(nvars(R)));"); 906 ideal I=imap(R,I); 907 ideal J=imap(R,J); 908 ideal K=addIdealZ(t*I,(1-t)*J); 909 K=stdZ(K); 910 int i; 911 ideal L; 912 for(i=1;i<=size(K);i++) 913 { 914 if(lead(K[i])/t==0){L[size(L)+1]=K[i];} 915 } 916 setring R; 917 ideal L=imap(S,L); 918 return(L); 919 } 920 example 921 { "EXAMPLE:"; echo = 2; 922 ring R=integer,(a,b,c,d),dp; 923 ideal I1=9,a,b; 924 ideal I2=3,c; 925 ideal I3=11,2a,7b; 926 ideal I4=13a2,17b4; 927 ideal I5=9c5,6d5; 928 ideal I6=17,a15,b15,c15,d15; 929 ideal I=intersectZ(I1,I2); I; 930 I=intersectZ(I,I3); I; 931 I=intersectZ(I,I4); I; 932 I=intersectZ(I,I5); I; 933 I=intersectZ(I,I6); I; 934 } 935 936 //////////////////////////////////////////////////////////////////////////////// 891 937 892 938 static proc modp(ideal J, int p, int nu) … … 921 967 static proc coefPrimeZ(ideal I) 922 968 { 923 //=== computes the primes occuring in the product of the leading coefficients of I 969 //=== computes the primes occuring in the product of the leading coefficients 970 //=== of I 924 971 number h=1; 925 972 int i; 926 973 for(i=1;i<=size(I);i++) 927 974 { 928 h=h*leadcoef(I[i]); //besser machen (gleich zerlegen, nict ausmultiplizieren) 975 h=h*leadcoef(I[i]); // besser machen (gleich zerlegen, 976 // nicht ausmultiplizieren) 929 977 } 930 978 def R=basering; … … 937 985 } 938 986 939 /////////////////////////////////////////////////////////////////////////////// 987 //////////////////////////////////////////////////////////////////////////////// 940 988 941 989 static proc coefZ(ideal I) … … 943 991 //=== assume IQ[variables]=<g_1,...,g_s>, Groebner basis, g_i in Z[variables] 944 992 //=== computes an integer h such that 945 //=== <g_1,...,g_s>Z[variables]:h^infinity = IQ[variables] intersected with Z[variables] 993 //=== <g_1,...,g_s>Z[variables]:h^infinity = IQ[variables] intersected 994 //=== with Z[variables] 946 995 //=== returns a list with IQ[variables] intersected with Z[variables] and h 947 996 int h=1; … … 978 1027 } 979 1028 980 /////////////////////////////////////////////////////////////////////////////// 1029 //////////////////////////////////////////////////////////////////////////////// 981 1030 982 1031 static proc specialPowerZ(ideal I, int m) … … 991 1040 } 992 1041 993 /////////////////////////////////////////////////////////////////////////////// 1042 //////////////////////////////////////////////////////////////////////////////// 994 1043 995 1044 static proc separatorsZ(int j, list B) … … 1015 1064 } 1016 1065 1017 /////////////////////////////////////////////////////////////////////////////// 1066 //////////////////////////////////////////////////////////////////////////////// 1018 1067 1019 1068 static proc extractZ(ideal J, int j, list L, list B) 1020 1069 { 1021 //=== P is an associated prime of J, the corresponding primary ideal is computed 1070 //=== P is an associated prime of J, the corresponding primary ideal is 1071 //=== computed, 1022 1072 //=== L is a list of maximal independent sets for P in Z/p[variables] 1023 1073 def R=basering; … … 1036 1086 if(L[1][3]!=0) 1037 1087 { 1038 //=== if u in x is an independent set of L then we compute a Groebnerbasis in Z[u][x-u] 1088 //=== if u in x is an independent set of L then we compute a Groebner 1089 //=== Basis in Z[u][x-u] 1039 1090 execute("ring S=integer,("+L[1][1]+"),lp;"); 1040 1091 ideal I=imap(R,I); … … 1080 1131 for(i=1;i<=size(C);i++) 1081 1132 { 1082 if(deg(C[i])>0){h=h*C[i];} //das muss noch besser gemacht werden, nicht ausmultiplizieren! 1133 if(deg(C[i])>0){h=h*C[i];} // das muss noch besser gemacht werden, 1134 // nicht ausmultiplizieren! 1083 1135 } 1084 1136 setring Shelp; … … 1095 1147 return(I); 1096 1148 } 1097 /////////////////////////////////////////////////////////////////////////////// 1149 //////////////////////////////////////////////////////////////////////////////// 1098 1150 1099 1151 static proc normalizeZ(ideal I) 1100 1152 { 1101 //=== if I[1]=q in Z, it replaces all other coeffs of polys in I by there value mod q 1102 //=== std should do this automatically and then tis procedure should be removed 1153 //=== if I[1]=q in Z, it replaces all other coeffs of polys in I by there value 1154 //=== mod q, std should do this automatically and then this procedure should be 1155 //=== removed 1103 1156 if(deg(I[1])>0){return(I);} 1104 1157 int i,j; … … 1119 1172 } 1120 1173 1121 /////////////////////////////////////////////////////////////////////////////// 1174 //////////////////////////////////////////////////////////////////////////////// 1122 1175 1123 1176 static proc satZ(ideal I,poly h) … … 1134 1187 } 1135 1188 1136 /////////////////////////////////////////////////////////////////////////////// 1189 //////////////////////////////////////////////////////////////////////////////// 1137 1190 1138 1191 static proc prepareQuotientring (int nnp) … … 1163 1216 } 1164 1217 1165 /////////////////////////////////////////////////////////////////////////////// 1218 //////////////////////////////////////////////////////////////////////////////// 1166 1219 1167 1220 static proc maxIndependSet (ideal j) … … 1216 1269 } 1217 1270 1218 /////////////////////////////////////////////////////////////////////////////// 1271 //////////////////////////////////////////////////////////////////////////////// 1219 1272 1220 1273 static proc quotientOneZ(ideal I, poly f) … … 1225 1278 int i; 1226 1279 ideal K=intersectZ(I,ideal(f)); 1227 //=== K[i]/f; does not work in rings with integer! This should be replaced later 1280 //=== K[i]/f; does not work in rings with integer! This should be replaced 1281 //=== later 1228 1282 execute("ring Rhelp=0,("+varstr(R)+"),dp;"); 1229 1283 ideal K=imap(R,K); … … 1238 1292 } 1239 1293 1240 /////////////////////////////////////////////////////////////////////////////// 1294 //////////////////////////////////////////////////////////////////////////////// 1241 1295 1242 1296 static proc quotientZ(ideal I, ideal J) … … 1253 1307 } 1254 1308 1255 /////////////////////////////////////////////////////////////////////////////// 1309 //////////////////////////////////////////////////////////////////////////////// 1256 1310 1257 1311 static proc reduceZ(poly f, ideal I) … … 1299 1353 } 1300 1354 1301 /////////////////////////////////////////////////////////////////////////////// 1355 //////////////////////////////////////////////////////////////////////////////// 1302 1356 1303 1357 static proc stdZ(ideal I) … … 1318 1372 } 1319 1373 1320 /////////////////////////////////////////////////////////////////////////////// 1321 1322 proc intersectZ(ideal I, ideal J) 1323 { 1324 //=== this is needed because intersect(I,J) does not work, should be replaced 1325 //=== by intersect later 1326 def R = basering; 1327 execute("ring S=integer,(t,"+varstr(R)+"),(dp(1),dp(nvars(R)));"); 1328 ideal I=imap(R,I); 1329 ideal J=imap(R,J); 1330 ideal K=addIdealZ(t*I,(1-t)*J); 1331 K=stdZ(K); 1332 int i; 1333 ideal L; 1334 for(i=1;i<=size(K);i++) 1335 { 1336 if(lead(K[i])/t==0){L[size(L)+1]=K[i];} 1337 } 1338 setring R; 1339 ideal L=imap(S,L); 1340 return(L); 1341 } 1342 1343 /////////////////////////////////////////////////////////////////////////////// 1374 //////////////////////////////////////////////////////////////////////////////// 1344 1375 1345 1376 static proc addIdealZ(ideal I,ideal J) … … 1354 1385 } 1355 1386 1356 /////////////////////////////////////////////////////////////////////////////// 1387 //////////////////////////////////////////////////////////////////////////////// 1357 1388 1358 1389 static proc testPrimaryZ(ideal I, list L) … … 1370 1401 } 1371 1402 1372 /////////////////////////////////////////////////////////////////////////////// 1403 //////////////////////////////////////////////////////////////////////////////// 1373 1404 1374 1405 /* … … 1397 1428 ring R3=integer,(w,z,y,x),dp; 1398 1429 ideal I=xzw+(-y^2+y)*z^2, 1399 1400 1401 1430 (-x^2+x)*w^2+yzw, 1431 ((y^4-2*y^3+y^2)*x-y^4+y^3)*z^3, 1432 y2z2w+(-y*4+2*y^3-y^2)*z3; 1402 1433 1403 1434 ring R4=integer,(w,z,y,x),dp; 1404 1435 ideal I=-2*yxzw+(-yx-y^2+y)*z^2, 1405 1406 1407 1436 xw^2-yz^2, 1437 (yx^2-(2*y^2+2*y)*x+y^3-2*y^2+y)*z^3, 1438 (-2*y^2+2*y)*z^2*w+(yx-3*y^2-y)*z^3; 1408 1439 1409 1440 ring R5=integer,(x,y,z),dp; … … 1449 1480 ring R11=integer,(w,z,y,x),dp; 1450 1481 ideal I=(4*y^2*x^2+(4*y^3+4*y^2-y)*x-y^2-y)*z^2, 1451  1452  1453 1454 1455 1456 1482  (x+y+1)*zw+(-4*y^2*x-4*y^3-4*y^2)*z^2, 1483  (-x-2*y^2 - 2*y - 1)*zw + (8*y^3*x + 8*y^4 + 8*y^3 + 2*y^2+y)*z^2, 1484 ((y^3 + y^2)*x - y^2 - y)*z^2, 1485 (y +1)*zw + (-y^3 -y^2)*z^2, 1486 (x + 1)*zw +(- y^2 -y)*z^2, 1487 (x^2 +x)*w^2 + (-yx - y)*zw; 1457 1488 1458 1489 ring R12=integer,(w,z,y,x),dp; … … 1463 1494 1464 1495 ring R13=integer,(w,z,y,x),dp; 1465 ideal I= 1496 ideal I=(((12*y+8)*x^2 +(2*y+2)*x)*zw +((-15*y^2 -4*y)*x-4*y^2 -y)*z^2, 1466 1497 -x*w^2 +((-12*y -8)*x+2*y)*zw +(15*y^2+4*y)*z^2, 1467 1498 (81*y^4*x^2 +(-54*y^3 -12*y^2)*x-12*y^3 -3*y^2)*z^3, 1468 1499 (-24*yx+6*y^2-6*y)*z^2*w + (-81*y^4*x + 81*y^3 + 24*y^2)*z^3, 1469 (48*x^2 + (-30*y + 12)*x - 6*y)*z^2*w + ((81*y^3 -54*y^2 -24*y)*x-21*y^2 -6*y)*z^3, 1470 (-96*yx-18*y^3 +18*y^2-24*y)*z^2*w +(243*y^5*x-243*y^4 +72*y^3+48*y^2)*z^3, 1471 6*y*z^2*w^2 +((576*y+384)*x^2 + (-81*y^3 -306*y^2 -168*y+96)*x+81*y^2-18*y)*z^3*w +((-720*y^2 - 192*y)*x + 450*y^3 - 60*y^2 - 48*y)*z^4); 1500 (48*x^2 + (-30*y + 12)*x - 6*y)*z^2*w + ((81*y^3 -54*y^2 -24*y)*x 1501 -21*y^2 -6*y)*z^3, 1502 (-96*yx-18*y^3 +18*y^2-24*y)*z^2*w +(243*y^5*x-243*y^4 +72*y^3 1503 +48*y^2)*z^3, 1504 6*y*z^2*w^2 +((576*y+384)*x^2 + (-81*y^3 -306*y^2 -168*y+96)*x+81*y^2 1505 -18*y)*z^3*w +((-720*y^2 - 192*y)*x + 450*y^3 - 60*y^2 - 48*y)*z^4); 1472 1506 1473 1507 ring R14=integer,(x(1),x(2),x(3),x(4)),dp; 1474 ideal I= 1475 1476 1477 1478 1479 1480 1481 1482 1508 ideal I=181*49^2, 1509 x(4)^4, 1510 x(1)*x(4)^3, 1511 x(1)*x(2)*x(4)^2, 1512 x(2)^2*x(4)^2, 1513 x(2)^2*x(3)*x(4), 1514 x(1)*x(2)*x(3)*x(4), 1515 x(1)*x(3)^2*x(4), 1516 x(3)^3*x(4); 1483 1517 1484 1518 … … 1489 1523 (z^3 - z^2)*x^4 + (2*z^3 -2*z^2)*x^3 + (z^3 -z^2)*x^2, 1490 1524 z*y^2*x^2, z*y*x^4 +z*y*x^3, 1491 2*y^2*x^4 +6*y^2*x^3 +6*y^2*x^2 + (y^3 +y^2)*x, z*x^5 + (z^2 +z)*x^4 + (2*z^2 -z)*x^3 + (z^2 -z)*x^2, 1525 2*y^2*x^4 +6*y^2*x^3 +6*y^2*x^2 + (y^3 +y^2)*x, z*x^5 + (z^2 +z)*x^4 1526 + (2*z^2 -z)*x^3 + (z^2 -z)*x^2, 1492 1527 y*x^6 + 3*y*x^5 + 3*y*x^4 + y*x^3; 1493 1528
Note: See TracChangeset
for help on using the changeset viewer.