Changeset 4a2a46 in git
 Timestamp:
 Sep 23, 2010, 6:52:22 PM (13 years ago)
 Branches:
 (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
 Children:
 c9596d5d9f74406f38b139e32dafc0539966cbcc
 Parents:
 388ce56d044bd18ba5403f3ab15af580030d66d8
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/multigrading.lib
r388ce5 r4a2a46 97 97 { 98 98 "EXAMPLE:"; echo=2; 99 100 99 ring R = 0, (x, y, z), dp; 101 102 100 // Weights of variables 103 101 intmat M[3][3] = … … 105 103 0, 1, 0, 106 104 0, 0, 1; 107 108 105 // Torsion: 109 106 intmat L[3][2] = … … 111 108 1, 3, 112 109 1, 5; 113 114 110 // attaches M & L to R (==basering): 115 111 setBaseMultigrading(M, L); // Grading: Z^3/L 116 117 112 // Weights are accessible via "getVariableWeights()": 118 113 getVariableWeights() == M; 119 114 getVariableWeights(R) == M; 120 115 getVariableWeights(basering) == M; 121 122 116 // Torsion is accessible via "getTorsion()": 123 117 getTorsion() == L; 124 118 getTorsion(R) == L; 125 119 getTorsion(basering) == L; 126 127 120 // And its hermite NF via getTorsion("hermite"): 128 121 intmat H = hermite(L); … … 130 123 getTorsion(R, "hermite") == H; 131 124 getTorsion(basering, "hermite") == H; 132 133 134 135 125 kill L, M; 136 137 126 //  isomorphic multigrading  // 138 139 127 // Weights of variables 140 128 intmat M[2][3] = 141 129 1, 2, 1, 142 130 1, 1, 0; 143 144 131 // Torsion: 145 132 intmat L[2][1] = 146 133 0, 147 134 2; 148 149 135 // attaches M & L to R (==basering): 150 136 setBaseMultigrading(M, L); // Grading: Z + (Z/2Z) 151 152 137 // Weights are accessible via "getVariableWeights()": 153 138 getVariableWeights() == M; 154 155 139 // Torsion is accessible via "getTorsion()": 156 140 getTorsion() == L; 157 158 141 kill L, M; 159 142 //  extreme case  // 160 161 143 // Weights of variables 162 144 intmat M[1][3] = 163 145 1, 1, 10; 164 165 146 // Torsion: 166 147 intmat L[1][1] = 167 148 0; 168 169 149 // attaches M & L to R (==basering): 170 150 setBaseMultigrading(M); // Grading: Z^3 171 172 151 // Weights are accessible via "getVariableWeights()": 173 152 getVariableWeights() == M; 174 175 153 // Torsion is accessible via "getTorsion()": 176 154 getTorsion() == L; … … 212 190 { 213 191 "EXAMPLE:"; echo=2; 214 215 192 ring R = 0, (x, y, z), dp; 216 217 193 // Weights of variables 218 194 intmat M[3][3] = … … 220 196 0, 1, 0, 221 197 0, 0, 1; 222 223 198 // Torsion: 224 199 intmat L[3][2] = … … 226 201 1, 3, 227 202 1, 5; 228 229 203 // attaches M & L to R (==basering): 230 204 setBaseMultigrading(M, L); // Grading: Z^3/L 231 232 205 // Weights are accessible via "getVariableWeights()": 233 206 getVariableWeights() == M; 234 235 207 kill L, M; 236 237 208 //  isomorphic multigrading  // 238 239 209 // Weights of variables 240 210 intmat M[2][3] = 241 211 1, 2, 1, 242 212 1, 1, 0; 243 244 213 // Torsion: 245 214 intmat L[2][1] = 246 215 0, 247 216 2; 248 249 217 // attaches M & L to R (==basering): 250 218 setBaseMultigrading(M, L); // Grading: Z + (Z/2Z) 251 252 219 // Weights are accessible via "getVariableWeights()": 253 220 getVariableWeights() == M; 254 255 221 kill L, M; 256 257 222 //  extreme case  // 258 259 223 // Weights of variables 260 224 intmat M[1][3] = 261 225 1, 1, 10; 262 263 226 // Torsion: 264 227 intmat L[1][1] = 265 228 0; 266 267 229 // attaches M & L to R (==basering): 268 230 setBaseMultigrading(M); // Grading: Z^3 269 270 231 // Weights are accessible via "getVariableWeights()": 271 232 getVariableWeights() == M; … … 326 287 { 327 288 "EXAMPLE:"; echo=2; 328 329 289 ring R = 0, (x, y, z), dp; 330 331 290 // Weights of variables 332 291 intmat M[3][3] = … … 334 293 0, 1, 0, 335 294 0, 0, 1; 336 337 295 // Torsion: 338 296 intmat L[3][2] = … … 340 298 1, 3, 341 299 1, 5; 342 343 300 // attaches M & L to R (==basering): 344 301 setBaseMultigrading(M, L); // Grading: Z^3/L 345 346 302 // Torsion is accessible via "getTorsion()": 347 303 getTorsion() == L; 348 349 304 // its hermite NF: 350 305 print(getTorsion("hermite")); 351 352 306 kill L, M; 353 354 307 //  isomorphic multigrading  // 355 356 308 // Weights of variables 357 309 intmat M[2][3] = 358 310 1, 2, 1, 359 311 1, 1, 0; 360 361 312 // Torsion: 362 313 intmat L[2][1] = 363 314 0, 364 315 2; 365 366 316 // attaches M & L to R (==basering): 367 317 setBaseMultigrading(M, L); // Grading: Z + (Z/2Z) 368 369 318 // Torsion is accessible via "getTorsion()": 370 319 getTorsion() == L; 371 372 320 // its hermite NF: 373 321 print(getTorsion("hermite")); 374 375 322 kill L, M; 376 377 323 //  extreme case  // 378 379 324 // Weights of variables 380 325 intmat M[1][3] = 381 326 1, 1, 10; 382 383 327 // Torsion: 384 328 intmat L[1][1] = 385 329 0; 386 387 330 // attaches M & L to R (==basering): 388 331 setBaseMultigrading(M); // Grading: Z^3 389 390 332 // Torsion is accessible via "getTorsion()": 391 333 getTorsion() == L; 392 393 334 // its hermite NF: 394 335 print(getTorsion("hermite")); … … 434 375 { 435 376 "EXAMPLE:"; echo=2; 436 437 377 ring R = 0, (x,y), dp; 438 378 intmat M[2][2]= … … 442 382 1, 2, 3, 4, 0, 443 383 0, 10, 20, 30, 1; 444 445 384 setBaseMultigrading(M, T); 446 447 385 ideal I = x, y, xy^5; 448 386 isHomogenous(I); 449 450 387 intmat V = mDeg(I); print(V); 451 452 388 module S = syz(I); print(S); 453 454 389 S = setModuleGrading(S, V); 455 456 390 getModuleGrading(S) == V; 457 458 391 vector v = setModuleGrading(S[1], V); 459 392 getModuleGrading(v) == V; 460 393 isHomogenous(v); 461 394 print( mDeg(v) ); 462 463 395 isHomogenous(S); 464 396 print( mDeg(S) ); … … 486 418 { 487 419 "EXAMPLE:"; echo=2; 488 489 420 ring R = 0, (x,y), dp; 490 421 intmat M[2][2]= … … 494 425 1, 2, 3, 4, 0, 495 426 0, 10, 20, 30, 1; 496 497 427 setBaseMultigrading(M, T); 498 499 428 ideal I = x, y, xy^5; 500 429 intmat V = mDeg(I); 501 502 430 // V == M; modulo T 503 431 print(V); 504 505 432 module S = syz(I); 506 507 433 S = setModuleGrading(S, V); 508 434 getModuleGrading(S) == V; 509 510 435 print(S); 511 512 436 vector v = S[1]; v = setModuleGrading(v, V); 513 437 getModuleGrading(v) == V; 514 515 438 print( mDeg(v) ); 516 517 439 isHomogenous(S); 518 519 440 print( mDeg(S) ); 520 441 } … … 558 479 { 559 480 "EXAMPLE:"; echo=2; 560 561 481 ring R = 0,(x,y),dp; 562 482 intmat M[2][2]= … … 566 486 1, 2, 3, 4, 0, 567 487 0,10,20,30, 1; 568 569 488 setBaseMultigrading(M,T); 570 571 489 // Is the resulting group torsion free? 572 490 isTorsionFree(); 573 574 491 kill R, M, T; 575 492 /////////////////////////////////////////// 576 577 493 ring R=0,(x,y,z),dp; 578 494 intmat A[3][3] = … … 587 503 // Is the resulting group torsion free? 588 504 isTorsionFree(); 589 590 505 kill R, A, B; 591 506 } … … 688 603 { 689 604 "EXAMPLE:"; echo=2; 690 691 605 intmat M[2][5] = 692 606 1, 2, 3, 4, 0, 693 607 0,10,20,30, 1; 694 695 608 // Hermite Normal Form of M: 696 609 print(hermite(M)); 697 698 610 intmat T[3][4] = 699 611 3,3,3,3, 700 612 2,1,3,0, 701 613 1,2,0,3; 702 703 614 // Hermite Normal Form of T: 704 615 print(hermite(T)); 705 706 616 intmat A[4][5] = 707 617 1,2,3,2,2, … … 709 619 0,5,4,2,1, 710 620 3,2,4,0,2; 711 712 621 // Hermite Normal Form of A: 713 622 print(hermite(A)); … … 757 666 { 758 667 "EXAMPLE:"; echo=2; 759 760 668 ring r = 0,(x,y,z),dp; 761 762 669 intmat g[2][3]= 763 670 1,0,1, … … 766 673 2, 767 674 1; 768 769 675 setBaseMultigrading(g,t); 770 771 676 poly a = x10yz; 772 677 poly b = x8y2z; … … 775 680 poly e = x2y2; 776 681 poly f = z2; 777 778 682 intvec v1 = mDeg(a)  mDeg(b); 779 683 v1; 780 684 isTorsionElement(v1); 781 782 685 intvec v2 = mDeg(a)  mDeg(c); 783 686 v2; 784 687 isTorsionElement(v2); 785 786 688 intvec v3 = mDeg(e)  mDeg(f); 787 689 v3; 788 690 isTorsionElement(v3); 789 790 691 intvec v4 = mDeg(c)  mDeg(d); 791 692 v4; … … 831 732 { 832 733 "EXAMPLE:"; echo=2; 833 834 734 ring r =0,(x,y,z),dp; 835 735 intmat grad[2][3] = 836 736 1,0,1, 837 737 0,1,1; 838 839 738 setBaseMultigrading(grad); 840 841 739 poly f = x2y3z5+x3zx; 842 843 740 intmat M = defineHomogenous(f); 844 741 M; 845 742 defineHomogenous(f, grad) == M; 846 847 743 isHomogenous(f); 848 744 setBaseMultigrading(grad, M); … … 950 846 { 951 847 "EXAMPLE:"; echo=2; 952 953 848 // Setting degrees for preimage ring.; 954 849 intmat grad[3][3] = … … 956 851 0,1,0, 957 852 0,0,1; 958 959 853 ring r = 0,(x,y,z),dp; 960 keepring(r);854 if (voice>1) {keepring(r);} 961 855 setBaseMultigrading(grad); 962 963 856 // grading on r: 964 857 getVariableWeights(); 965 858 getTorsion(); 966 967 859 ring R = 0,(a,b),dp; 968 860 ideal i=a2b2+a6b5+ab3,a7b+b15ab6+a6b6; 969 970 861 // The quotient ring by this ideal will become our image ring.; 971 862 qring Q = std(i); 972 863 map f = r,a2b6+b5+a3b+a2+ab,a2b73a2b5+b4+a,a6b6b3+a2; 973 864 f; 974 975 865 // Pushing forward f: 976 866 pushForward(f); 977 978 867 // due to pushForward we have got new grading on Q 979 868 getVariableWeights(); 980 869 getTorsion(); 981 982 870 // TODO: Unfortunately this is not a very spectacular example.; 983 984 871 } 985 872 … … 1041 928 { 1042 929 "EXAMPLE:"; echo=2; 1043 1044 930 ring r = 0,(x,y,z),dp; 1045 1046 931 intmat g[2][3]= 1047 932 1,0,1, 1048 933 0,1,1; 1049 1050 934 intmat t[2][1]= 1051 935 2, 1052 936 1; 1053 1054 937 setBaseMultigrading(g,t); 1055 1056 938 poly a = x10yz; 1057 939 poly b = x8y2z; … … 1060 942 poly e = x2y2; 1061 943 poly f = z2; 1062 1063 1064 944 equalMDeg(leadexp(a), leadexp(b)); 1065 945 equalMDeg(leadexp(a), leadexp(c)); … … 1067 947 equalMDeg(leadexp(a), leadexp(e)); 1068 948 equalMDeg(leadexp(a), leadexp(f)); 1069 1070 949 equalMDeg(leadexp(b), leadexp(c)); 1071 950 equalMDeg(leadexp(b), leadexp(d)); 1072 951 equalMDeg(leadexp(b), leadexp(e)); 1073 952 equalMDeg(leadexp(b), leadexp(f)); 1074 1075 953 equalMDeg(leadexp(c), leadexp(d)); 1076 954 equalMDeg(leadexp(c), leadexp(e)); 1077 955 equalMDeg(leadexp(c), leadexp(f)); 1078 1079 956 equalMDeg(leadexp(d), leadexp(e)); 1080 957 equalMDeg(leadexp(d), leadexp(f)); 1081 1082 958 equalMDeg(leadexp(e), leadexp(f)); 1083 1084 959 } 1085 960 … … 1167 1042 { 1168 1043 "EXAMPLE:"; echo=2; 1169 1170 1044 ring r = 0,(x,y,z),dp; 1171 1172 1045 //Grading and Torsion matrices: 1173 1046 intmat M[3][3] = … … 1175 1048 0,1,0, 1176 1049 0,0,1; 1177 1178 1050 intmat T[3][1] = 1179 1051 1,2,3; 1180 1181 1052 setBaseMultigrading(M,T); 1182 1183 1053 attrib(r); 1184 1185 1054 poly f = xyz; 1186 1187 1055 mDegPartition(f); 1188 1056 print(mDeg(_)); 1189 1190 1057 isHomogenous(f); // f: is not homogenous 1191 1192 1058 poly g = 1xy2z3; 1193 1059 isHomogenous(g); // g: is homogenous 1194 1060 mDegPartition(g); 1195 1196 1061 kill T; 1197 1062 ///////////////////////////////////////////////////////// … … 1201 1066 2,1,3,0, 1202 1067 1,2,0,3; 1203 1204 1068 setBaseMultigrading(M,T); 1205 1206 1069 f; 1207 1070 isHomogenous(f); 1208 1071 mDegPartition(f); 1209 1210 1072 //  1211 1073 g; 1212 1074 isHomogenous(g); 1213 1075 mDegPartition(g); 1214 1215 1076 kill r, T, M; 1216 1217 1077 ring R = 0, (x,y,z), dp; 1218 1219 1078 intmat A[2][3] = 1220 1079 0,0,1, … … 1224 1083 4; 1225 1084 setBaseMultigrading(A, T); 1226 1227 1085 isHomogenous(ideal(x2  y3 xy +z, x*yz, x^3  y^2*z + x^2 y^3)); // 1 1228 1086 isHomogenous(ideal(x2  y3 xy +z, x*yz, x^3  y^2*z + x^2 y^3), "checkGens"); 1229 1087 isHomogenous(ideal(x+y, x2  y2)); // 0 1230 1231 1088 // Degree partition: 1232 1089 mDegPartition(x2  y3 xy +z); 1233 1090 mDegPartition(x3 y2z + x2 y3 + z + 1); 1234 1235 1236 1091 module N = gen(1) + (x+y) * gen(2), z*gen(3); 1237 1238 1092 intmat V[2][3] = 0; // 1, 2, 3, 4, 5, 6; // columnwise weights of components!!?? 1239 1240 1093 vector v1, v2; 1241 1242 1094 v1 = setModuleGrading(N[1], V); v1; 1243 1095 mDegPartition(v1); 1244 1096 print( mDeg(_) ); 1245 1246 1097 v2 = setModuleGrading(N[2], V); v2; 1247 1098 mDegPartition(v2); 1248 1099 print( mDeg(_) ); 1249 1250 1100 N = setModuleGrading(N, V); 1251 1101 isHomogenous(N); 1252 1102 print( mDeg(N) ); 1253 1254 1103 /////////////////////////////////////// 1255 1256 1104 V = 1257 1105 1, 2, 3, 1258 1106 4, 5, 6; 1259 1260 1107 v1 = setModuleGrading(N[1], V); v1; 1261 1108 mDegPartition(v1); 1262 1109 print( mDeg(_) ); 1263 1264 1110 v2 = setModuleGrading(N[2], V); v2; 1265 1111 mDegPartition(v2); 1266 1112 print( mDeg(_) ); 1267 1268 1113 N = setModuleGrading(N, V); 1269 1114 isHomogenous(N); 1270 1115 print( mDeg(N) ); 1271 1272 1116 /////////////////////////////////////// 1273 1274 1117 V = 1275 1118 0, 0, 0, 1276 1119 4, 1, 0; 1277 1278 1120 N = gen(1) + x * gen(2), z*gen(3); 1279 1280 1121 N = setModuleGrading(N, V); N; 1281 1122 isHomogenous(N); 1282 1123 print( mDeg(N) ); 1283 1284 1124 v1 = setModuleGrading(N[1], V); v1; 1285 1125 mDegPartition(v1); 1286 1126 print( mDeg(_) ); 1287 1288 1127 N = setModuleGrading(N, V); N; 1289 1128 isHomogenous(N); … … 1417 1256 { 1418 1257 "EXAMPLE:"; echo=2; 1419 1420 1258 ring r = 0,(x, y), dp; 1421 1422 1259 intmat A[2][2] = 1, 0, 0, 1; 1423 1260 print(A); 1424 1425 1261 intmat Ta[2][1] = 0, 3; 1426 1262 print(Ta); 1427 1428 1263 // attrib(A, "torsion", Ta); // to think about 1429 1430 1264 // "poly:"; 1431 1265 setBaseMultigrading(A); 1432 1433 1434 1266 mDeg( x*x, A ); 1435 1267 mDeg( y*y*y, A ); 1436 1437 1268 setBaseMultigrading(A, Ta); 1438 1439 1269 mDeg( x*x*y ); 1440 1441 1270 mDeg( y*y*y*x ); 1442 1443 1271 mDeg( x*y + x + 1 ); 1444 1445 1272 mDegPartition(x*y + x + 1); 1446 1447 1273 print ( mDeg(0) ); 1448 1274 poly zero = 0; 1449 1275 print ( mDeg(zero) ); 1450 1451 1276 // "ideal:"; 1452 1453 1277 ideal I = y*x*x, x*y*y*y; 1454 1278 print( mDeg(I) ); 1455 1456 1279 print ( mDeg(ideal(0)) ); 1457 1280 print ( mDeg(ideal(0,0,0)) ); 1458 1459 1281 // "vectors:"; 1460 1461 1282 intmat B[2][2] = 0, 1, 1, 0; 1462 1283 print(B); 1463 1464 1284 mDeg( setModuleGrading(y*y*y*gen(2), B )); 1465 1285 mDeg( setModuleGrading(x*x*gen(1), B )); 1466 1467 1468 1286 vector V = x*gen(1) + y*gen(2); 1469 1287 V = setModuleGrading(V, B); 1470 1288 mDeg( V ); 1471 1472 1289 vector v1 = setModuleGrading([0, 0, 0], B); 1473 1290 print( mDeg( v1 ) ); 1474 1475 1291 vector v2 = setModuleGrading([0], B); 1476 1292 print( mDeg( v2 ) ); 1477 1478 1293 // "module:"; 1479 1480 1294 module D = x*gen(1), y*gen(2); 1481 1295 D; 1482 1296 D = setModuleGrading(D, B); 1483 1297 print( mDeg( D ) ); 1484 1485 1486 1298 module DD = [0, 0],[0, 0, 0]; 1487 1299 DD = setModuleGrading(DD, B); 1488 1300 print( mDeg( DD ) ); 1489 1490 1301 module DDD = [0, 0]; 1491 1302 DDD = setModuleGrading(DDD, B); 1492 1303 print( mDeg( DDD ) ); 1493 1494 1304 }; 1495 1305 … … 1577 1387 { 1578 1388 "EXAMPLE:"; echo=2; 1579 1580 1389 ring r = 0,(x,y,z),dp; 1581 1582 1390 intmat g[2][3]= 1583 1391 1,0,1, … … 1586 1394 2, 1587 1395 1; 1588 1589 1396 setBaseMultigrading(g,t); 1590 1591 1397 poly f = x10yz+x8y2zx4z2+y5+x2y2z2+x17z3y6; 1592 1593 1398 mDegPartition(f); 1594 1595 1399 vector v = xy*gen(1)x3y2*gen(2)+x4y*gen(3); 1596 1400 intmat B[2][3]=1,1,2,0,0,1; 1597 1401 v = setModuleGrading(v,B); 1598 1402 getModuleGrading(v); 1599 1600 1403 mDegPartition(v, B); 1601 1404 } … … 1693 1496 { 1694 1497 "EXAMPLE:"; echo=2; 1695 1696 1498 ring r = 0,(x, y), dp; 1697 1499 qring q = std(x^2  y); 1698 1699 1500 finestMDeg(q); 1700 1701 1501 } 1702 1502 … … 1765 1565 { 1766 1566 "EXAMPLE:"; echo=2; 1767 1768 1567 ring r= 0,(x,y,z),dp; 1769 1568 matrix M[3][1] = x,y,z; … … 1898 1697 { 1899 1698 "EXAMPLE:"; echo=2; 1900 1901 1699 ring r=0,(x1,x2,x3,x4,x5,x6,x7,x8,x9),dp; 1902 1700 intmat M[7][9]= … … 2061 1859 { 2062 1860 "EXAMPLE:"; echo=2; 2063 2064 1861 ring R = 0, (x, y), dp; 2065 2066 1862 intmat g1[2][2]=1,0,0,1; 2067 1863 intmat t[2][1]=2,0; … … 2069 1865 intvec v1=4,0; 2070 1866 intvec v2=4,4; 2071 2072 1867 intmat g3[1][2]=1,1; 2073 1868 setBaseMultigrading(g3); … … 2075 1870 v3; 2076 1871 mDegBasis(v3); 2077 2078 1872 setBaseMultigrading(g1,t); 2079 1873 mDegBasis(v1); 2080 1874 setBaseMultigrading(g2); 2081 1875 mDegBasis(v2); 2082 2083 1876 intmat M[2][2] = 1, 1, 1, 1; 2084 1877 intvec d = 2, 2; 2085 2086 1878 setBaseMultigrading(M); 2087 2088 1879 mDegBasis(d); 2089 1880 attrib(_, "ZeroPart"); 2090 2091 1881 kill R; 2092 1882 ring R = 0, (x, y, z), dp; 2093 2094 1883 intmat M[2][3] = 1, 2, 1, 1, 1, 0; 2095 2096 1884 intmat T[2][1] = 0, 2; 2097 2098 1885 intvec d = 4, 1; 2099 2100 1886 setBaseMultigrading(M, T); 2101 2102 1887 mDegBasis(d); 2103 1888 attrib(_, "ZeroPart"); 2104 2105 2106 1889 kill R; 2107 2108 1890 ring R = 0, (x, y, z), dp; 2109 1891 qring Q = std(ideal( y^6+ x*y^3*zx^2*z^2 )); 2110 2111 2112 1892 intmat M[2][3] = 1, 1, 2, 2, 1, 1; 2113 1893 // intmat T[2][1] = 0, 2; 2114 2115 1894 setBaseMultigrading(M); 2116 2117 1895 intvec d = 6, 6; 2118 1896 mDegBasis(d); 2119 1897 attrib(_, "ZeroPart"); 2120 2121 2122 2123 1898 kill R; 2124 1899 ring R = 0, (x, y, z), dp; 2125 1900 qring Q = std(ideal( x*z^3  y *z^6, x*y*z  x^4*y^2 )); 2126 2127 2128 1901 intmat M[2][3] = 1, 2, 1, 1, 1, 0; 2129 1902 intmat T[2][1] = 0, 2; 2130 2131 1903 intvec d = 4, 1; 2132 2133 1904 setBaseMultigrading(M, T); 2134 2135 1905 mDegBasis(d); 2136 1906 attrib(_, "ZeroPart"); … … 2156 1926 { 2157 1927 "EXAMPLE:"; echo=2; 2158 2159 2160 1928 ring r = 0,(x,y,z,w),dp; 2161 2162 intmat M[2][4]= 1929 intmat MM[2][4]= 2163 1930 1,1,1,1, 2164 1931 0,1,3,4; 2165 2166 setBaseMultigrading(M); 2167 2168 1932 setBaseMultigrading(MM); 2169 1933 module M = ideal( xwyz, x2zy3, xz2y2w, yw2z3); 2170 2171 2172 1934 intmat v[2][nrows(M)]= 2173 1935 1, 2174 1936 0; 2175 2176 1937 M = setModuleGrading(M, v); 2177 2178 1938 isHomogenous(M); 2179 1939 "Multidegrees: "; print(mDeg(M)); 2180 2181 1940 // Let's compute Syzygy! 2182 1941 def S = mDegSyzygy(M); S; 2183 1942 "Module Units Multigrading: "; print( getModuleGrading(S) ); 2184 1943 "Multidegrees: "; print(mDeg(S)); 2185 2186 1944 isHomogenous(S); 2187 1945 } … … 2215 1973 ring r = 0,(x,y,z,w),dp; 2216 1974 2217 intmat M [2][4]=1975 intmat MM[2][4]= 2218 1976 1,1,1,1, 2219 1977 0,1,3,4; 2220 1978 2221 setBaseMultigrading(M );1979 setBaseMultigrading(MM); 2222 1980 2223 1981 … … 2300 2058 { 2301 2059 "EXAMPLE:"; echo=2; 2302 2303 2060 ring r = 0,(x,y,z,w),dp; 2304 2305 2061 intmat M[2][4]= 2306 2062 1,1,1,1, 2307 2063 0,1,3,4; 2308 2309 2064 setBaseMultigrading(M); 2310 2311 2312 2065 module m= ideal( xwyz, x2zy3, xz2y2w, yw2z3); 2313 2314 2066 isHomogenous(ideal( xwyz, x2zy3, xz2y2w, yw2z3), "checkGens"); 2315 2316 2067 ideal A = xwyz, x2zy3, xz2y2w, yw2z3; 2317 2318 2068 int j; 2319 2320 2069 for(j=1; j<=ncols(A); j++) 2321 2070 { 2322 2071 mDegPartition(A[j]); 2323 2072 } 2324 2325 2073 intmat v[2][1]= 2326 2074 1, 2327 2075 0; 2328 2329 2076 m = setModuleGrading(m, v); 2330 2331 2077 // Let's compute Syzygy! 2332 2078 def S = mDegSyzygy(m); S; 2333 2079 "Module Units Multigrading: "; print( getModuleGrading(S) ); 2334 2080 "Multidegrees: "; print(mDeg(S)); 2335 2336 2081 ///////////////////////////////////////////////////////////////////////////// 2337 2338 2082 S = mDegGroebner(S); S; 2339 2083 "Module Units Multigrading: "; print( getModuleGrading(S) ); 2340 2084 "Multidegrees: "; print(mDeg(S)); 2341 2342 2085 ///////////////////////////////////////////////////////////////////////////// 2343 2344 2086 def L = mDegResolution(m, 0, 1); 2345 2346 2087 for( j =1; j<=size(L); j++) 2347 2088 { … … 2351 2092 "Multigrading: "; print(mDeg(L[j])); 2352 2093 } 2353 2354 2094 ///////////////////////////////////////////////////////////////////////////// 2355 2356 2095 L = mDegResolution(maxideal(1), 0, 1); 2357 2358 2096 for( j =1; j<=size(L); j++) 2359 2097 { … … 2363 2101 "Multigrading: "; print(mDeg(L[j])); 2364 2102 } 2365 2366 2103 kill v; 2367 2368 2369 2104 def h = hilbertSeries(m); 2370 2105 setring h; 2371 2372 2106 numerator1; 2373 2107 factorize(numerator1); 2374 2375 2108 denominator1; 2376 2109 factorize(denominator1); 2377 2378 2110 numerator2; 2379 2111 factorize(numerator2); 2380 2381 2112 denominator2; 2382 2113 factorize(denominator2); … … 2549 2280 { 2550 2281 "EXAMPLE:"; echo=2; 2551 2552 2282 ring r = 0,(x,y,z,w),dp; 2553 2283 intmat g[2][4]= … … 2555 2285 0,1,3,4; 2556 2286 setBaseMultigrading(g); 2557 2558 2287 module M = ideal(xwyz, x2zy3, xz2y2w, yw2z3); 2559 2288 intmat V[2][1]= 2560 2289 1, 2561 2290 0; 2562 2563 2291 M = setModuleGrading(M, V); 2564 2565 2292 def h = hilbertSeries(M); setring h; 2566 2567 2293 factorize(numerator2); 2568 2294 factorize(denominator2); 2569 2570 2295 kill g, h; setring r; 2571 2572 2296 intmat g[2][4]= 2573 2297 1,2,3,4, 2574 2298 0,0,5,8; 2575 2576 2299 setBaseMultigrading(g); 2577 2578 2300 ideal I = x^2, y, z^3; 2579 2301 I = std(I); 2580 2302 def L = mDegResolution(I, 0, 1); 2581 2582 2303 for( int j = 1; j<=size(L); j++) 2583 2304 { … … 2587 2308 "Multigrading: "; print(mDeg(L[j])); 2588 2309 } 2589 2590 2310 mDeg(I); 2591 2311 def h = hilbertSeries(I); setring h; 2592 2593 2312 factorize(numerator2); 2594 2313 factorize(denominator2); 2595 2596 2314 kill r, h, g, V; 2597 2315 //////////////////////////////////////////////// 2598 ////////////////////////////////////////////////2599 2600 2316 ring R = 0,(x,y,z),dp; 2601 2317 intmat W[2][3] = … … 2604 2320 setBaseMultigrading(W); 2605 2321 ideal I = x3y,yz2,y2z,z4; 2606 2607 2322 def h = hilbertSeries(I); setring h; 2608 2609 2323 factorize(numerator2); 2610 2324 factorize(denominator2); 2611 2612 2325 kill R, W, h; 2613 2326 //////////////////////////////////////////////// 2614 ////////////////////////////////////////////////2615 2616 2327 ring R = 0,(x,y,z,a,b,c),dp; 2617 2328 intmat W[2][6] = … … 2620 2331 setBaseMultigrading(W); 2621 2332 ideal I = x3y,yz2,y2z,z4; 2622 2623 2333 def h = hilbertSeries(I); setring h; 2624 2625 2334 factorize(numerator2); 2626 2335 factorize(denominator2); 2627 2628 2336 kill R, W, h; 2629 2630 ////////////////////////////////////////////////2631 ////////////////////////////////////////////////2632 2337 //////////////////////////////////////////////// 2633 2338 // This is example 5.3.9. from Robbianos book. 2634 2635 2339 ring R = 0,(x,y,z,w),dp; 2636 2340 intmat W[1][4] = … … 2638 2342 setBaseMultigrading(W); 2639 2343 ideal I = z3,y3zw2,x2y4w2xyz2; 2640 2641 2344 hilb(std(I)); 2642 2643 2345 def h = hilbertSeries(I); setring h; 2644 2645 2346 numerator1; 2646 2347 denominator1; 2647 2648 2348 factorize(numerator2); 2649 2349 factorize(denominator2); 2650 2651 2652 2350 kill h; 2653 2351 //////////////////////////////////////////////// 2654 2352 setring R; 2655 2656 2353 ideal I2 = x2,y2,z2; I2; 2657 2658 2354 hilb(std(I2)); 2659 2660 2355 def h = hilbertSeries(I2); setring h; 2661 2662 2356 numerator1; 2663 2357 denominator1; 2664 2665 2666 2358 kill h; 2667 2359 //////////////////////////////////////////////// 2668 2360 setring R; 2669 2670 2361 W = 2,2,2,2; 2671 2672 2362 setBaseMultigrading(W); 2673 2674 2363 getVariableWeights(); 2675 2676 2364 intvec w = 2,2,2,2; 2677 2678 2365 hilb(std(I2), 1, w); 2679 2680 2366 kill w; 2681 2682 2683 2367 def h = hilbertSeries(I2); setring h; 2684 2685 2686 2368 numerator1; denominator1; 2687 2369 kill h; 2688 2689 2690 2370 kill R, W; 2691 2692 2371 //////////////////////////////////////////////// 2693 ////////////////////////////////////////////////2694 ////////////////////////////////////////////////2695 2696 2372 ring R = 0,(x),dp; 2697 2373 intmat W[1][1] = 2698 2374 1; 2699 2375 setBaseMultigrading(W); 2700 2701 2376 ideal I; 2702 2703 2377 I = 1; I; 2704 2705 2378 hilb(std(I)); 2706 2707 2379 def h = hilbertSeries(I); setring h; 2708 2709 2380 numerator1; denominator1; 2710 2711 2381 kill h; 2712 2382 //////////////////////////////////////////////// 2713 2383 setring R; 2714 2715 2384 I = x; I; 2716 2717 2385 hilb(std(I)); 2718 2719 2386 def h = hilbertSeries(I); setring h; 2720 2721 2387 numerator1; denominator1; 2722 2723 2388 kill h; 2724 2389 //////////////////////////////////////////////// 2725 2390 setring R; 2726 2727 2391 I = x^5; I; 2728 2729 2392 hilb(std(I)); 2730 2393 hilb(std(I), 1); 2731 2732 2394 def h = hilbertSeries(I); setring h; 2733 2734 2395 numerator1; denominator1; 2735 2736 2737 2396 kill h; 2738 2397 //////////////////////////////////////////////// 2739 2398 setring R; 2740 2741 2399 I = x^10; I; 2742 2743 2400 hilb(std(I)); 2744 2745 2401 def h = hilbertSeries(I); setring h; 2746 2747 2402 numerator1; denominator1; 2748 2749 2403 kill h; 2750 2404 //////////////////////////////////////////////// 2751 2405 setring R; 2752 2753 2406 module M = 1; 2754 2755 2407 M = setModuleGrading(M, W); 2756 2757 2758 2408 hilb(std(M)); 2759 2760 2409 def h = hilbertSeries(M); setring h; 2761 2762 2410 numerator1; denominator1; 2763 2764 2411 kill h; 2765 2412 //////////////////////////////////////////////// 2766 2413 setring R; 2767 2768 2414 kill M; module M = x^5*gen(1); 2769 2770 2415 // intmat V[1][3] = 0; // TODO: this would lead to a wrong result!!!? 2771 2772 2416 intmat V[1][1] = 0; // all gen(i) of degree 0! 2773 2774 2417 M = setModuleGrading(M, V); 2775 2776 2418 hilb(std(M)); 2777 2778 2419 def h = hilbertSeries(M); setring h; 2779 2780 2420 numerator1; denominator1; 2781 2782 2421 kill h; 2783 2422 //////////////////////////////////////////////// 2784 2423 setring R; 2785 2786 2424 module N = x^5*gen(3); 2787 2788 2425 kill V; 2789 2790 2426 intmat V[1][3] = 0; // all gen(i) of degree 0! 2791 2792 2427 N = setModuleGrading(N, V); 2793 2794 2428 hilb(std(N)); 2795 2796 2429 def h = hilbertSeries(N); setring h; 2797 2798 2430 numerator1; denominator1; 2799 2800 2431 kill h; 2801 2432 //////////////////////////////////////////////// 2802 2433 setring R; 2803 2804 2805 2434 module S = M + N; 2806 2807 2435 S = setModuleGrading(S, V); 2808 2809 2436 hilb(std(S)); 2810 2811 2437 def h = hilbertSeries(S); setring h; 2812 2813 2438 numerator1; denominator1; 2814 2815 2439 kill h; 2816 2817 2440 kill V; 2818 2441 kill R, W; 2819 2820 2442 } 2821 2443
Note: See TracChangeset
for help on using the changeset viewer.