Changeset 4a2a46 in git


Ignore:
Timestamp:
Sep 23, 2010, 6:52:22 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
c9596d5d9f74406f38b139e32dafc0539966cbcc
Parents:
388ce56d044bd18ba5403f3ab15af580030d66d8
Message:
synatx fix

git-svn-id: file:///usr/local/Singular/svn/trunk@13270 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/multigrading.lib

    r388ce5 r4a2a46  
    9797{
    9898  "EXAMPLE:"; echo=2;
    99 
    10099  ring R = 0, (x, y, z), dp;
    101 
    102100  // Weights of variables
    103101  intmat M[3][3] =
     
    105103    0, 1, 0,
    106104    0, 0, 1;
    107 
    108105  // Torsion:
    109106  intmat L[3][2] =
     
    111108    1, 3,
    112109    1, 5;
    113 
    114110  // attaches M & L to R (==basering):
    115111  setBaseMultigrading(M, L); // Grading: Z^3/L
    116 
    117112  // Weights are accessible via "getVariableWeights()":
    118113  getVariableWeights() == M;
    119114  getVariableWeights(R) == M;
    120115  getVariableWeights(basering) == M;
    121 
    122116  // Torsion is accessible via "getTorsion()":
    123117  getTorsion() == L;
    124118  getTorsion(R) == L;
    125119  getTorsion(basering) == L;
    126 
    127120  // And its hermite NF via getTorsion("hermite"):
    128121  intmat H = hermite(L);
     
    130123  getTorsion(R, "hermite") == H;
    131124  getTorsion(basering, "hermite") == H;
    132 
    133 
    134 
    135125  kill L, M;
    136 
    137126  // ----------- isomorphic multigrading -------- //
    138 
    139127  // Weights of variables
    140128  intmat M[2][3] =
    141129    1, -2, 1,
    142130    1,  1, 0;
    143 
    144131  // Torsion:
    145132  intmat L[2][1] =
    146133    0,
    147134    2;
    148 
    149135  // attaches M & L to R (==basering):
    150136  setBaseMultigrading(M, L); // Grading: Z + (Z/2Z)
    151 
    152137  // Weights are accessible via "getVariableWeights()":
    153138  getVariableWeights() == M;
    154 
    155139  // Torsion is accessible via "getTorsion()":
    156140  getTorsion() == L;
    157 
    158141  kill L, M;
    159142  // ----------- extreme case ------------ //
    160 
    161143  // Weights of variables
    162144  intmat M[1][3] =
    163145    1,  -1, 10;
    164 
    165146  // Torsion:
    166147  intmat L[1][1] =
    167148    0;
    168 
    169149  // attaches M & L to R (==basering):
    170150  setBaseMultigrading(M); // Grading: Z^3
    171 
    172151  // Weights are accessible via "getVariableWeights()":
    173152  getVariableWeights() == M;
    174 
    175153  // Torsion is accessible via "getTorsion()":
    176154  getTorsion() == L;
     
    212190{
    213191  "EXAMPLE:"; echo=2;
    214 
    215192  ring R = 0, (x, y, z), dp;
    216 
    217193  // Weights of variables
    218194  intmat M[3][3] =
     
    220196    0, 1, 0,
    221197    0, 0, 1;
    222 
    223198  // Torsion:
    224199  intmat L[3][2] =
     
    226201    1, 3,
    227202    1, 5;
    228 
    229203  // attaches M & L to R (==basering):
    230204  setBaseMultigrading(M, L); // Grading: Z^3/L
    231 
    232205  // Weights are accessible via "getVariableWeights()":
    233206  getVariableWeights() == M;
    234 
    235207  kill L, M;
    236 
    237208  // ----------- isomorphic multigrading -------- //
    238 
    239209  // Weights of variables
    240210  intmat M[2][3] =
    241211    1, -2, 1,
    242212    1,  1, 0;
    243 
    244213  // Torsion:
    245214  intmat L[2][1] =
    246215    0,
    247216    2;
    248 
    249217  // attaches M & L to R (==basering):
    250218  setBaseMultigrading(M, L); // Grading: Z + (Z/2Z)
    251 
    252219  // Weights are accessible via "getVariableWeights()":
    253220  getVariableWeights() == M;
    254 
    255221  kill L, M;
    256 
    257222  // ----------- extreme case ------------ //
    258 
    259223  // Weights of variables
    260224  intmat M[1][3] =
    261225    1,  -1, 10;
    262 
    263226  // Torsion:
    264227  intmat L[1][1] =
    265228    0;
    266 
    267229  // attaches M & L to R (==basering):
    268230  setBaseMultigrading(M); // Grading: Z^3
    269 
    270231  // Weights are accessible via "getVariableWeights()":
    271232  getVariableWeights() == M;
     
    326287{
    327288  "EXAMPLE:"; echo=2;
    328 
    329289  ring R = 0, (x, y, z), dp;
    330 
    331290  // Weights of variables
    332291  intmat M[3][3] =
     
    334293    0, 1, 0,
    335294    0, 0, 1;
    336 
    337295  // Torsion:
    338296  intmat L[3][2] =
     
    340298    1, 3,
    341299    1, 5;
    342 
    343300  // attaches M & L to R (==basering):
    344301  setBaseMultigrading(M, L); // Grading: Z^3/L
    345 
    346302  // Torsion is accessible via "getTorsion()":
    347303  getTorsion() == L;
    348 
    349304  // its hermite NF:
    350305  print(getTorsion("hermite"));
    351 
    352306  kill L, M;
    353 
    354307  // ----------- isomorphic multigrading -------- //
    355 
    356308  // Weights of variables
    357309  intmat M[2][3] =
    358310    1, -2, 1,
    359311    1,  1, 0;
    360 
    361312  // Torsion:
    362313  intmat L[2][1] =
    363314    0,
    364315    2;
    365 
    366316  // attaches M & L to R (==basering):
    367317  setBaseMultigrading(M, L); // Grading: Z + (Z/2Z)
    368 
    369318  // Torsion is accessible via "getTorsion()":
    370319  getTorsion() == L;
    371 
    372320  // its hermite NF:
    373321  print(getTorsion("hermite"));
    374 
    375322  kill L, M;
    376 
    377323  // ----------- extreme case ------------ //
    378 
    379324  // Weights of variables
    380325  intmat M[1][3] =
    381326    1,  -1, 10;
    382 
    383327  // Torsion:
    384328  intmat L[1][1] =
    385329    0;
    386 
    387330  // attaches M & L to R (==basering):
    388331  setBaseMultigrading(M); // Grading: Z^3
    389 
    390332  // Torsion is accessible via "getTorsion()":
    391333  getTorsion() == L;
    392 
    393334  // its hermite NF:
    394335  print(getTorsion("hermite"));
     
    434375{
    435376  "EXAMPLE:"; echo=2;
    436 
    437377   ring R = 0, (x,y), dp;
    438378   intmat M[2][2]=
     
    442382     1,  2,  3,  4, 0,
    443383     0, 10, 20, 30, 1;
    444 
    445384   setBaseMultigrading(M, T);
    446 
    447385   ideal I = x, y, xy^5;
    448386   isHomogenous(I);
    449 
    450387   intmat V = mDeg(I); print(V);
    451 
    452388   module S = syz(I); print(S);
    453 
    454389   S = setModuleGrading(S, V);
    455 
    456390   getModuleGrading(S) == V;
    457 
    458391   vector v = setModuleGrading(S[1], V);
    459392   getModuleGrading(v) == V;
    460393   isHomogenous(v);
    461394   print( mDeg(v) );
    462 
    463395   isHomogenous(S);
    464396   print( mDeg(S) );
     
    486418{
    487419  "EXAMPLE:"; echo=2;
    488 
    489420   ring R = 0, (x,y), dp;
    490421   intmat M[2][2]=
     
    494425     1,  2,  3,  4, 0,
    495426     0, 10, 20, 30, 1;
    496 
    497427   setBaseMultigrading(M, T);
    498 
    499428   ideal I = x, y, xy^5;
    500429   intmat V = mDeg(I);
    501 
    502430   // V == M; modulo T
    503431   print(V);
    504 
    505432   module S = syz(I);
    506 
    507433   S = setModuleGrading(S, V);
    508434   getModuleGrading(S) == V;
    509 
    510435   print(S);
    511 
    512436   vector v = S[1]; v = setModuleGrading(v, V);
    513437   getModuleGrading(v) == V;
    514 
    515438   print( mDeg(v) );
    516 
    517439   isHomogenous(S);
    518 
    519440   print( mDeg(S) );
    520441}
     
    558479{
    559480  "EXAMPLE:"; echo=2;
    560 
    561481   ring R = 0,(x,y),dp;
    562482   intmat M[2][2]=
     
    566486     1, 2, 3, 4, 0,
    567487     0,10,20,30, 1;
    568 
    569488   setBaseMultigrading(M,T);
    570 
    571489   // Is the resulting group torsion free?
    572490   isTorsionFree();
    573 
    574491   kill R, M, T;
    575492   ///////////////////////////////////////////
    576 
    577493   ring R=0,(x,y,z),dp;
    578494   intmat A[3][3] =
     
    587503   // Is the resulting group torsion free?
    588504   isTorsionFree();
    589 
    590505   kill R, A, B;
    591506}
     
    688603{
    689604  "EXAMPLE:"; echo=2;
    690 
    691605   intmat M[2][5] =
    692606     1, 2, 3, 4, 0,
    693607     0,10,20,30, 1;
    694 
    695608   // Hermite Normal Form of M:
    696609   print(hermite(M));
    697 
    698610   intmat T[3][4] =
    699611     3,3,3,3,
    700612     2,1,3,0,
    701613     1,2,0,3;
    702 
    703614   // Hermite Normal Form of T:
    704615   print(hermite(T));
    705 
    706616   intmat A[4][5] =
    707617     1,2,3,2,2,
     
    709619     0,5,4,2,1,
    710620     3,2,4,0,2;
    711 
    712621   // Hermite Normal Form of A:
    713622   print(hermite(A));
     
    757666{
    758667 "EXAMPLE:"; echo=2;
    759 
    760668  ring r = 0,(x,y,z),dp;
    761 
    762669  intmat g[2][3]=
    763670    1,0,1,
     
    766673    -2,
    767674    1;
    768 
    769675  setBaseMultigrading(g,t);
    770 
    771676  poly a = x10yz;
    772677  poly b = x8y2z;
     
    775680  poly e = x2y2;
    776681  poly f = z2;
    777 
    778682  intvec v1 = mDeg(a) - mDeg(b);
    779683  v1;
    780684  isTorsionElement(v1);
    781 
    782685  intvec v2 = mDeg(a) - mDeg(c);
    783686  v2;
    784687  isTorsionElement(v2);
    785 
    786688  intvec v3 = mDeg(e) - mDeg(f);
    787689  v3;
    788690  isTorsionElement(v3);
    789 
    790691  intvec v4 = mDeg(c) - mDeg(d);
    791692  v4;
     
    831732{
    832733  "EXAMPLE:"; echo=2;
    833 
    834734  ring r =0,(x,y,z),dp;
    835735  intmat grad[2][3] =
    836736    1,0,1,
    837737    0,1,1;
    838 
    839738  setBaseMultigrading(grad);
    840 
    841739  poly f = x2y3-z5+x-3zx;
    842 
    843740  intmat M = defineHomogenous(f);
    844741  M;
    845742  defineHomogenous(f, grad) == M;
    846 
    847743  isHomogenous(f);
    848744  setBaseMultigrading(grad, M);
     
    950846{
    951847  "EXAMPLE:"; echo=2;
    952 
    953848  // Setting degrees for preimage ring.;
    954849  intmat grad[3][3] =
     
    956851    0,1,0,
    957852    0,0,1;
    958 
    959853  ring r = 0,(x,y,z),dp;
    960   keepring(r);
     854  if (voice>1) {keepring(r);}
    961855  setBaseMultigrading(grad);
    962 
    963856  // grading on r:
    964857  getVariableWeights();
    965858  getTorsion();
    966 
    967859  ring R = 0,(a,b),dp;
    968860  ideal i=a2-b2+a6-b5+ab3,a7b+b15-ab6+a6b6;
    969 
    970861  // The quotient ring by this ideal will become our image ring.;
    971862  qring Q = std(i);
    972863  map f = r,-a2b6+b5+a3b+a2+ab,-a2b7-3a2b5+b4+a,a6-b6-b3+a2;
    973864  f;
    974 
    975865  // Pushing forward f:
    976866  pushForward(f);
    977 
    978867  // due to pushForward we have got new grading on Q
    979868  getVariableWeights();
    980869  getTorsion();
    981 
    982870  // TODO: Unfortunately this is not a very spectacular example.;
    983 
    984871}
    985872
     
    1041928{
    1042929  "EXAMPLE:"; echo=2;
    1043 
    1044930  ring r = 0,(x,y,z),dp;
    1045 
    1046931  intmat g[2][3]=
    1047932    1,0,1,
    1048933    0,1,1;
    1049 
    1050934  intmat t[2][1]=
    1051935    -2,
    1052936    1;
    1053 
    1054937  setBaseMultigrading(g,t);
    1055 
    1056938  poly a = x10yz;
    1057939  poly b = x8y2z;
     
    1060942  poly e = x2y2;
    1061943  poly f = z2;
    1062 
    1063 
    1064944  equalMDeg(leadexp(a), leadexp(b));
    1065945  equalMDeg(leadexp(a), leadexp(c));
     
    1067947  equalMDeg(leadexp(a), leadexp(e));
    1068948  equalMDeg(leadexp(a), leadexp(f));
    1069 
    1070949  equalMDeg(leadexp(b), leadexp(c));
    1071950  equalMDeg(leadexp(b), leadexp(d));
    1072951  equalMDeg(leadexp(b), leadexp(e));
    1073952  equalMDeg(leadexp(b), leadexp(f));
    1074 
    1075953  equalMDeg(leadexp(c), leadexp(d));
    1076954  equalMDeg(leadexp(c), leadexp(e));
    1077955  equalMDeg(leadexp(c), leadexp(f));
    1078 
    1079956  equalMDeg(leadexp(d), leadexp(e));
    1080957  equalMDeg(leadexp(d), leadexp(f));
    1081 
    1082958  equalMDeg(leadexp(e), leadexp(f));
    1083 
    1084959}
    1085960
     
    11671042{
    11681043  "EXAMPLE:"; echo=2;
    1169 
    11701044  ring r = 0,(x,y,z),dp;
    1171 
    11721045  //Grading and Torsion matrices:
    11731046  intmat M[3][3] =
     
    11751048    0,1,0,
    11761049    0,0,1;
    1177 
    11781050  intmat T[3][1] =
    11791051    1,2,3;
    1180 
    11811052  setBaseMultigrading(M,T);
    1182 
    11831053  attrib(r);
    1184 
    11851054  poly f = x-yz;
    1186 
    11871055  mDegPartition(f);
    11881056  print(mDeg(_));
    1189 
    11901057  isHomogenous(f);   // f: is not homogenous
    1191 
    11921058  poly g = 1-xy2z3;
    11931059  isHomogenous(g); // g: is homogenous
    11941060  mDegPartition(g);
    1195 
    11961061  kill T;
    11971062  /////////////////////////////////////////////////////////
     
    12011066    2,1,3,0,
    12021067    1,2,0,3;
    1203 
    12041068  setBaseMultigrading(M,T);
    1205 
    12061069  f;
    12071070  isHomogenous(f);
    12081071  mDegPartition(f);
    1209 
    12101072  // ---------------------
    12111073  g;
    12121074  isHomogenous(g);
    12131075  mDegPartition(g);
    1214 
    12151076  kill r, T, M;
    1216 
    12171077  ring R = 0, (x,y,z), dp;
    1218 
    12191078  intmat A[2][3] =
    12201079    0,0,1,
     
    12241083     4;
    12251084  setBaseMultigrading(A, T);
    1226 
    12271085  isHomogenous(ideal(x2 - y3 -xy +z, x*y-z, x^3 - y^2*z + x^2 -y^3)); // 1
    12281086  isHomogenous(ideal(x2 - y3 -xy +z, x*y-z, x^3 - y^2*z + x^2 -y^3), "checkGens");
    12291087  isHomogenous(ideal(x+y, x2 - y2)); // 0
    1230 
    12311088  // Degree partition:
    12321089  mDegPartition(x2 - y3 -xy +z);
    12331090  mDegPartition(x3 -y2z + x2 -y3 + z + 1);
    1234 
    1235 
    12361091  module N = gen(1) + (x+y) * gen(2), z*gen(3);
    1237 
    12381092  intmat V[2][3] = 0; // 1, 2, 3,  4, 5, 6; //  column-wise weights of components!!??
    1239 
    12401093  vector v1, v2;
    1241 
    12421094  v1 = setModuleGrading(N[1], V); v1;
    12431095  mDegPartition(v1);
    12441096  print( mDeg(_) );
    1245 
    12461097  v2 = setModuleGrading(N[2], V); v2;
    12471098  mDegPartition(v2);
    12481099  print( mDeg(_) );
    1249 
    12501100  N = setModuleGrading(N, V);
    12511101  isHomogenous(N);
    12521102  print( mDeg(N) );
    1253 
    12541103  ///////////////////////////////////////
    1255 
    12561104  V =
    12571105    1, 2, 3,
    12581106    4, 5, 6;
    1259 
    12601107  v1 = setModuleGrading(N[1], V); v1;
    12611108  mDegPartition(v1);
    12621109  print( mDeg(_) );
    1263 
    12641110  v2 = setModuleGrading(N[2], V); v2;
    12651111  mDegPartition(v2);
    12661112  print( mDeg(_) );
    1267 
    12681113  N = setModuleGrading(N, V);
    12691114  isHomogenous(N);
    12701115  print( mDeg(N) );
    1271 
    12721116  ///////////////////////////////////////
    1273 
    12741117  V =
    12751118    0, 0, 0,
    12761119    4, 1, 0;
    1277 
    12781120  N = gen(1) + x * gen(2), z*gen(3);
    1279 
    12801121  N = setModuleGrading(N, V); N;
    12811122  isHomogenous(N);
    12821123  print( mDeg(N) );
    1283 
    12841124  v1 = setModuleGrading(N[1], V); v1;
    12851125  mDegPartition(v1);
    12861126  print( mDeg(_) );
    1287 
    12881127  N = setModuleGrading(N, V); N;
    12891128  isHomogenous(N);
     
    14171256{
    14181257  "EXAMPLE:"; echo=2;
    1419 
    14201258  ring r = 0,(x, y), dp;
    1421 
    14221259  intmat A[2][2] = 1, 0, 0, 1;
    14231260  print(A);
    1424 
    14251261  intmat Ta[2][1] = 0, 3;
    14261262  print(Ta);
    1427 
    14281263  //   attrib(A, "torsion", Ta); // to think about
    1429 
    14301264//  "poly:";
    14311265  setBaseMultigrading(A);
    1432 
    1433 
    14341266  mDeg( x*x, A );
    14351267  mDeg( y*y*y, A );
    1436 
    14371268  setBaseMultigrading(A, Ta);
    1438 
    14391269  mDeg( x*x*y );
    1440 
    14411270  mDeg( y*y*y*x );
    1442 
    14431271  mDeg( x*y + x + 1 );
    1444 
    14451272  mDegPartition(x*y + x + 1);
    1446 
    14471273  print ( mDeg(0) );
    14481274  poly zero = 0;
    14491275  print ( mDeg(zero) );
    1450 
    14511276//  "ideal:";
    1452 
    14531277  ideal I = y*x*x, x*y*y*y;
    14541278  print( mDeg(I) );
    1455 
    14561279  print ( mDeg(ideal(0)) );
    14571280  print ( mDeg(ideal(0,0,0)) );
    1458 
    14591281//  "vectors:";
    1460 
    14611282  intmat B[2][2] = 0, 1, 1, 0;
    14621283  print(B);
    1463 
    14641284  mDeg( setModuleGrading(y*y*y*gen(2), B ));
    14651285  mDeg( setModuleGrading(x*x*gen(1), B ));
    1466 
    1467 
    14681286  vector V = x*gen(1) + y*gen(2);
    14691287  V = setModuleGrading(V, B);
    14701288  mDeg( V );
    1471 
    14721289  vector v1 = setModuleGrading([0, 0, 0], B);
    14731290  print( mDeg( v1 ) );
    1474 
    14751291  vector v2 = setModuleGrading([0], B);
    14761292  print( mDeg( v2 ) );
    1477 
    14781293//  "module:";
    1479 
    14801294  module D = x*gen(1), y*gen(2);
    14811295  D;
    14821296  D = setModuleGrading(D, B);
    14831297  print( mDeg( D ) );
    1484 
    1485 
    14861298  module DD = [0, 0],[0, 0, 0];
    14871299  DD = setModuleGrading(DD, B);
    14881300  print( mDeg( DD ) );
    1489 
    14901301  module DDD = [0, 0];
    14911302  DDD = setModuleGrading(DDD, B);
    14921303  print( mDeg( DDD ) );
    1493 
    14941304};
    14951305
     
    15771387{
    15781388  "EXAMPLE:"; echo=2;
    1579 
    15801389  ring r = 0,(x,y,z),dp;
    1581 
    15821390  intmat g[2][3]=
    15831391    1,0,1,
     
    15861394    -2,
    15871395    1;
    1588 
    15891396  setBaseMultigrading(g,t);
    1590 
    15911397  poly f = x10yz+x8y2z-x4z2+y5+x2y2-z2+x17z3-y6;
    1592 
    15931398  mDegPartition(f);
    1594 
    15951399  vector v = xy*gen(1)-x3y2*gen(2)+x4y*gen(3);
    15961400  intmat B[2][3]=1,-1,-2,0,0,1;
    15971401  v = setModuleGrading(v,B);
    15981402  getModuleGrading(v);
    1599 
    16001403  mDegPartition(v, B);
    16011404}
     
    16931496{
    16941497  "EXAMPLE:"; echo=2;
    1695 
    16961498  ring r = 0,(x, y), dp;
    16971499  qring q  = std(x^2 - y);
    1698 
    16991500  finestMDeg(q);
    1700 
    17011501}
    17021502
     
    17651565{
    17661566  "EXAMPLE:"; echo=2;
    1767 
    17681567  ring r= 0,(x,y,z),dp;
    17691568  matrix M[3][1] = x,y,z;
     
    18981697{
    18991698  "EXAMPLE:"; echo=2;
    1900 
    19011699   ring r=0,(x1,x2,x3,x4,x5,x6,x7,x8,x9),dp;
    19021700   intmat M[7][9]=
     
    20611859{
    20621860  "EXAMPLE:"; echo=2;
    2063 
    20641861  ring R = 0, (x, y), dp;
    2065 
    20661862  intmat g1[2][2]=1,0,0,1;
    20671863  intmat t[2][1]=2,0;
     
    20691865  intvec v1=4,0;
    20701866  intvec v2=4,4;
    2071 
    20721867  intmat g3[1][2]=1,1;
    20731868  setBaseMultigrading(g3);
     
    20751870  v3;
    20761871  mDegBasis(v3);
    2077 
    20781872  setBaseMultigrading(g1,t);
    20791873  mDegBasis(v1);
    20801874  setBaseMultigrading(g2);
    20811875  mDegBasis(v2);
    2082 
    20831876  intmat M[2][2] = 1, -1, -1, 1;
    20841877  intvec d = -2, 2;
    2085 
    20861878  setBaseMultigrading(M);
    2087 
    20881879  mDegBasis(d);
    20891880  attrib(_, "ZeroPart");
    2090 
    20911881  kill R;
    20921882  ring R = 0, (x, y, z), dp;
    2093 
    20941883  intmat M[2][3] = 1, -2, 1,     1, 1, 0;
    2095 
    20961884  intmat T[2][1] = 0, 2;
    2097 
    20981885  intvec d = 4, 1;
    2099 
    21001886  setBaseMultigrading(M, T);
    2101 
    21021887  mDegBasis(d);
    21031888  attrib(_, "ZeroPart");
    2104 
    2105 
    21061889  kill R;
    2107 
    21081890  ring R = 0, (x, y, z), dp;
    21091891  qring Q = std(ideal( y^6+ x*y^3*z-x^2*z^2 ));
    2110 
    2111 
    21121892  intmat M[2][3] = 1, 1, 2,     2, 1, 1;
    21131893  //  intmat T[2][1] = 0, 2;
    2114 
    21151894  setBaseMultigrading(M);
    2116 
    21171895  intvec d = 6, 6;
    21181896  mDegBasis(d);
    21191897  attrib(_, "ZeroPart");
    2120 
    2121 
    2122 
    21231898  kill R;
    21241899  ring R = 0, (x, y, z), dp;
    21251900  qring Q = std(ideal( x*z^3 - y *z^6, x*y*z  - x^4*y^2 ));
    2126 
    2127 
    21281901  intmat M[2][3] = 1, -2, 1,     1, 1, 0;
    21291902  intmat T[2][1] = 0, 2;
    2130 
    21311903  intvec d = 4, 1;
    2132 
    21331904  setBaseMultigrading(M, T);
    2134 
    21351905  mDegBasis(d);
    21361906  attrib(_, "ZeroPart");
     
    21561926{
    21571927  "EXAMPLE:"; echo=2;
    2158 
    2159 
    21601928  ring r = 0,(x,y,z,w),dp;
    2161 
    2162   intmat M[2][4]=
     1929  intmat MM[2][4]=
    21631930    1,1,1,1,
    21641931    0,1,3,4;
    2165 
    2166   setBaseMultigrading(M);
    2167 
    2168 
     1932  setBaseMultigrading(MM);
    21691933  module M = ideal(  xw-yz, x2z-y3, xz2-y2w, yw2-z3);
    2170 
    2171 
    21721934  intmat v[2][nrows(M)]=
    21731935    1,
    21741936    0;
    2175 
    21761937  M = setModuleGrading(M, v);
    2177 
    21781938  isHomogenous(M);
    21791939  "Multidegrees: "; print(mDeg(M));
    2180 
    21811940  // Let's compute Syzygy!
    21821941  def S = mDegSyzygy(M); S;
    21831942  "Module Units Multigrading: "; print( getModuleGrading(S) );
    21841943  "Multidegrees: "; print(mDeg(S));
    2185 
    21861944  isHomogenous(S);
    21871945}
     
    22151973  ring r = 0,(x,y,z,w),dp;
    22161974
    2217   intmat M[2][4]=
     1975  intmat MM[2][4]=
    22181976    1,1,1,1,
    22191977    0,1,3,4;
    22201978
    2221   setBaseMultigrading(M);
     1979  setBaseMultigrading(MM);
    22221980
    22231981
     
    23002058{
    23012059  "EXAMPLE:"; echo=2;
    2302 
    23032060  ring r = 0,(x,y,z,w),dp;
    2304 
    23052061  intmat M[2][4]=
    23062062    1,1,1,1,
    23072063    0,1,3,4;
    2308 
    23092064  setBaseMultigrading(M);
    2310 
    2311 
    23122065  module m= ideal(  xw-yz, x2z-y3, xz2-y2w, yw2-z3);
    2313 
    23142066  isHomogenous(ideal(  xw-yz, x2z-y3, xz2-y2w, yw2-z3), "checkGens");
    2315 
    23162067  ideal A = xw-yz, x2z-y3, xz2-y2w, yw2-z3;
    2317 
    23182068  int j;
    2319 
    23202069  for(j=1; j<=ncols(A); j++)
    23212070  {
    23222071    mDegPartition(A[j]);
    23232072  }
    2324 
    23252073  intmat v[2][1]=
    23262074    1,
    23272075    0;
    2328 
    23292076  m = setModuleGrading(m, v);
    2330 
    23312077  // Let's compute Syzygy!
    23322078  def S = mDegSyzygy(m); S;
    23332079  "Module Units Multigrading: "; print( getModuleGrading(S) );
    23342080  "Multidegrees: "; print(mDeg(S));
    2335 
    23362081  /////////////////////////////////////////////////////////////////////////////
    2337 
    23382082  S = mDegGroebner(S); S;
    23392083  "Module Units Multigrading: "; print( getModuleGrading(S) );
    23402084  "Multidegrees: "; print(mDeg(S));
    2341 
    23422085  /////////////////////////////////////////////////////////////////////////////
    2343 
    23442086  def L = mDegResolution(m, 0, 1);
    2345 
    23462087  for( j =1; j<=size(L); j++)
    23472088  {
     
    23512092    "Multigrading: "; print(mDeg(L[j]));
    23522093  }
    2353 
    23542094  /////////////////////////////////////////////////////////////////////////////
    2355 
    23562095  L = mDegResolution(maxideal(1), 0, 1);
    2357 
    23582096  for( j =1; j<=size(L); j++)
    23592097  {
     
    23632101    "Multigrading: "; print(mDeg(L[j]));
    23642102  }
    2365 
    23662103  kill v;
    2367 
    2368 
    23692104  def h = hilbertSeries(m);
    23702105  setring h;
    2371 
    23722106  numerator1;
    23732107  factorize(numerator1);
    2374 
    23752108  denominator1;
    23762109  factorize(denominator1);
    2377 
    23782110  numerator2;
    23792111  factorize(numerator2);
    2380 
    23812112  denominator2;
    23822113  factorize(denominator2);
     
    25492280{
    25502281  "EXAMPLE:"; echo=2;
    2551 
    25522282  ring r = 0,(x,y,z,w),dp;
    25532283  intmat g[2][4]=
     
    25552285    0,1,3,4;
    25562286  setBaseMultigrading(g);
    2557 
    25582287  module M = ideal(xw-yz, x2z-y3, xz2-y2w, yw2-z3);
    25592288  intmat V[2][1]=
    25602289    1,
    25612290    0;
    2562 
    25632291  M = setModuleGrading(M, V);
    2564 
    25652292  def h = hilbertSeries(M); setring h;
    2566 
    25672293  factorize(numerator2);
    25682294  factorize(denominator2);
    2569 
    25702295  kill g, h; setring r;
    2571 
    25722296  intmat g[2][4]=
    25732297    1,2,3,4,
    25742298    0,0,5,8;
    2575 
    25762299  setBaseMultigrading(g);
    2577 
    25782300  ideal I = x^2, y, z^3;
    25792301  I = std(I);
    25802302  def L = mDegResolution(I, 0, 1);
    2581 
    25822303  for( int j = 1; j<=size(L); j++)
    25832304  {
     
    25872308    "Multigrading: "; print(mDeg(L[j]));
    25882309  }
    2589 
    25902310  mDeg(I);
    25912311  def h = hilbertSeries(I); setring h;
    2592 
    25932312  factorize(numerator2);
    25942313  factorize(denominator2);
    2595 
    25962314  kill r, h, g, V;
    25972315  ////////////////////////////////////////////////
    2598   ////////////////////////////////////////////////
    2599 
    26002316  ring R = 0,(x,y,z),dp;
    26012317  intmat W[2][3] =
     
    26042320  setBaseMultigrading(W);
    26052321  ideal I = x3y,yz2,y2z,z4;
    2606 
    26072322  def h = hilbertSeries(I); setring h;
    2608 
    26092323  factorize(numerator2);
    26102324  factorize(denominator2);
    2611 
    26122325  kill R, W, h;
    26132326  ////////////////////////////////////////////////
    2614   ////////////////////////////////////////////////
    2615 
    26162327  ring R = 0,(x,y,z,a,b,c),dp;
    26172328  intmat W[2][6] =
     
    26202331  setBaseMultigrading(W);
    26212332  ideal I = x3y,yz2,y2z,z4;
    2622 
    26232333  def h = hilbertSeries(I); setring h;
    2624 
    26252334  factorize(numerator2);
    26262335  factorize(denominator2);
    2627 
    26282336  kill R, W, h;
    2629 
    2630   ////////////////////////////////////////////////
    2631   ////////////////////////////////////////////////
    26322337  ////////////////////////////////////////////////
    26332338  // This is example 5.3.9. from Robbianos book.
    2634 
    26352339  ring R = 0,(x,y,z,w),dp;
    26362340  intmat W[1][4] =
     
    26382342  setBaseMultigrading(W);
    26392343  ideal I = z3,y3zw2,x2y4w2xyz2;
    2640 
    26412344  hilb(std(I));
    2642 
    26432345  def h = hilbertSeries(I); setring h;
    2644 
    26452346  numerator1;
    26462347  denominator1;
    2647 
    26482348  factorize(numerator2);
    26492349  factorize(denominator2);
    2650 
    2651 
    26522350  kill h;
    26532351  ////////////////////////////////////////////////
    26542352  setring R;
    2655 
    26562353  ideal I2 = x2,y2,z2; I2;
    2657 
    26582354  hilb(std(I2));
    2659 
    26602355  def h = hilbertSeries(I2); setring h;
    2661 
    26622356  numerator1;
    26632357  denominator1;
    2664 
    2665 
    26662358  kill h;
    26672359  ////////////////////////////////////////////////
    26682360  setring R;
    2669 
    26702361  W = 2,2,2,2;
    2671 
    26722362  setBaseMultigrading(W);
    2673 
    26742363  getVariableWeights();
    2675 
    26762364  intvec w = 2,2,2,2;
    2677 
    26782365  hilb(std(I2), 1, w);
    2679 
    26802366  kill w;
    2681 
    2682 
    26832367  def h = hilbertSeries(I2); setring h;
    2684 
    2685 
    26862368  numerator1; denominator1;
    26872369  kill h;
    2688 
    2689 
    26902370  kill R, W;
    2691 
    26922371  ////////////////////////////////////////////////
    2693   ////////////////////////////////////////////////
    2694   ////////////////////////////////////////////////
    2695 
    26962372  ring R = 0,(x),dp;
    26972373  intmat W[1][1] =
    26982374     1;
    26992375  setBaseMultigrading(W);
    2700 
    27012376  ideal I;
    2702 
    27032377  I = 1; I;
    2704 
    27052378  hilb(std(I));
    2706 
    27072379  def h = hilbertSeries(I); setring h;
    2708 
    27092380  numerator1; denominator1;
    2710 
    27112381  kill h;
    27122382  ////////////////////////////////////////////////
    27132383  setring R;
    2714 
    27152384  I = x; I;
    2716 
    27172385  hilb(std(I));
    2718 
    27192386  def h = hilbertSeries(I); setring h;
    2720 
    27212387  numerator1; denominator1;
    2722 
    27232388  kill h;
    27242389  ////////////////////////////////////////////////
    27252390  setring R;
    2726 
    27272391  I = x^5; I;
    2728 
    27292392  hilb(std(I));
    27302393  hilb(std(I), 1);
    2731 
    27322394  def h = hilbertSeries(I); setring h;
    2733 
    27342395  numerator1; denominator1;
    2735 
    2736 
    27372396  kill h;
    27382397  ////////////////////////////////////////////////
    27392398  setring R;
    2740 
    27412399  I = x^10; I;
    2742 
    27432400  hilb(std(I));
    2744 
    27452401  def h = hilbertSeries(I); setring h;
    2746 
    27472402  numerator1; denominator1;
    2748 
    27492403  kill h;
    27502404  ////////////////////////////////////////////////
    27512405  setring R;
    2752 
    27532406  module M = 1;
    2754 
    27552407  M = setModuleGrading(M, W);
    2756 
    2757 
    27582408  hilb(std(M));
    2759 
    27602409  def h = hilbertSeries(M); setring h;
    2761 
    27622410  numerator1; denominator1;
    2763 
    27642411  kill h;
    27652412  ////////////////////////////////////////////////
    27662413  setring R;
    2767 
    27682414  kill M; module M = x^5*gen(1);
    2769 
    27702415//  intmat V[1][3] = 0; // TODO: this would lead to a wrong result!!!?
    2771 
    27722416  intmat V[1][1] = 0; // all gen(i) of degree 0!
    2773 
    27742417  M = setModuleGrading(M, V);
    2775 
    27762418  hilb(std(M));
    2777 
    27782419  def h = hilbertSeries(M); setring h;
    2779 
    27802420  numerator1; denominator1;
    2781 
    27822421  kill h;
    27832422  ////////////////////////////////////////////////
    27842423  setring R;
    2785 
    27862424  module N = x^5*gen(3);
    2787 
    27882425  kill V;
    2789 
    27902426  intmat V[1][3] = 0; // all gen(i) of degree 0!
    2791 
    27922427  N = setModuleGrading(N, V);
    2793 
    27942428  hilb(std(N));
    2795 
    27962429  def h = hilbertSeries(N); setring h;
    2797 
    27982430  numerator1; denominator1;
    2799 
    28002431  kill h;
    28012432  ////////////////////////////////////////////////
    28022433  setring R;
    2803 
    2804 
    28052434  module S = M + N;
    2806 
    28072435  S = setModuleGrading(S, V);
    2808 
    28092436  hilb(std(S));
    2810 
    28112437  def h = hilbertSeries(S); setring h;
    2812 
    28132438  numerator1; denominator1;
    2814 
    28152439  kill h;
    2816 
    28172440  kill V;
    28182441  kill R, W;
    2819 
    28202442}
    28212443
Note: See TracChangeset for help on using the changeset viewer.