Changeset 45df9b3 in git for Singular


Ignore:
Timestamp:
May 13, 2015, 5:44:20 PM (9 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
f255f00715b2e38983ecf37e5ec5aaea460c09d8
Parents:
49b7480ebc6b89c61ea6555f8f339873abbac069
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2015-05-13 17:44:20+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2015-05-27 21:55:26+02:00
Message:
Working on ZERO modules for gradedModules.lib
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/gradedModules.lib

    r49b748 r45df9b3  
    2323    grobj(M,w[,d])  construct a graded object (map) given by matrix M
    2424    grtest(A)       check whether A is a valid graded object
    25     grisequal(A,B)  check whether A is exactly eqal to B? TODO: isomorphic!
    2625    grdeg(M)        compute graded degrees of columns of the map M
    2726    grview(M)       view the graded structure of map M
     
    5756    matrixpres(a)      matrix presentation of direct sum of Omega^{a[i]}(i)
    5857";
     58   
     59//    grisequal(A,B)  check whether A is exactly eqal to B? TODO: isomorphic!
    5960
    6061LIB "matrix.lib"; // ?
     
    7374"direct sum_i=1^size R(-v[i]), for source and targets of graded objects"
    7475{
     76  int n = size(v);
     77  if (n == 0) { return ("0"); }
     78  ASSUME(0, n > 0 );
     79
    7580  if (R == "")
    7681  {
     
    8085  ASSUME(0, defined(R) && (R != "") );
    8186
    82   int n = size(v);
    83 
    84   if (n == 0) { return ("0"); }
    85 
    86   ASSUME(0, n > 0 );
    87  
    8887  v = -v; // NOTE: due to Mathematical meanings of Singular data
    8988 
     
    178177  string R = nameof(basering);
    179178
    180   if( typeof( N ) == "list" )
    181   {
    182     msg = msg + " resolution";  // TODO: what about chain maps?
     179  if( typeof( N ) == "list" ) // TODO: find a better DS for graded resolutions / chain map !?
     180  {
     181    int n = size(N); ASSUME(0, n > 0);
     182   
     183    string msg1 = "";
    183184    if( size(R) >= 2 )
    184185    {
    185       msg = msg + "(let R:="+R+")";
    186       R = "R";
     186      msg1 = msg1 + "(let R:="+R+")";
     187      R = "R"; // !!!
     188    }   
     189    msg1 = msg1 + ": " ;
     190
     191   
     192
     193    list arr; arr[n] = list();
     194    int exact = (1==1);
     195   
     196    int i = 1;
     197   
     198    ASSUME(1, grtest(N[i]));
     199   
     200    string dst = grsumstr(R, grrange(N[i]));
     201    string src = grsumstr(R, grdeg(N[i]));
     202   
     203    arr[i] = list(dst,  src);
     204
     205    i = i + 1;
     206   
     207    while( i <= n )
     208    {
     209      ASSUME(1, grtest(N[i]));
     210     
     211      dst = grsumstr(R, grrange(N[i]));
     212     
     213      if( exact && (src != dst) )
     214      {
     215//        "src: [" + src+ "] != [" + dst + "] :(!!";
     216        exact = (1==0);
     217      }
     218
     219      src = grsumstr(R, grdeg(N[i]));
     220     
     221      arr[i] = list(dst,  src);
     222
     223      i = i + 1;
     224    };
     225
     226    string o = "";
     227
     228    if( exact )
     229    { // complex?
     230      msg = msg + " resolution" + msg1;
     231
     232      o = "d";
     233
     234      for( i = 1; i <= n; i++ )
     235      {
     236        msg = msg + newline + arr[i][1] + " <-- "+o+"_" + string(i) + " --";
     237      };
     238     
     239      msg =  msg + newline + arr[n][2];
     240      msg = msg + ", given by maps: ";
     241    } else
     242    {
     243//      print(arr);
     244
     245      msg = msg + "-object collection";     
     246      o = "o";
     247     
     248//      for( i = 1; i <= n; i++ )
     249//      {
     250//        msg = msg + newline + arr[i][1] + " <-- "+o+"_" + string(i) + " -- " + arr[i][2];
     251//      };     
     252      msg = msg + ", given by the following maps (named here as "+o+"_[1 .. "+string(n)+"]): ";
    187253    }
    188254
    189 
    190     int i = 1;  int n = size(N);
    191     string dst;
    192    
    193     msg = msg + ": " + newline + grsumstr(R, grrange(N[i])) + " <-- d_" + string(i) + " -- " ;
    194     for( ; i < n; i++ )
    195     {
    196       dst = grsumstr(R, grdeg(N[i])) +  " <-- d_" + string(i+1) + " --";
    197       msg = msg + newline + dst;
    198     };
    199 
    200     msg = msg + newline + grsumstr(R, grdeg(N[i])) + ", given by maps: ";
    201255
    202256    print(msg);
     
    204258    for( i = 1; i <= size(N); i++ )
    205259    {
    206       "d_" + string(i) + " :"; grview(N[i]);
     260      print( o+"_" + string(i) + " :" );
     261      grview( N[i] );
    207262    };
    208263
     
    393448  }
    394449
    395 /*
    396   if( flag ) // output details in case of non-identical permutation?
    397   {
    398     // grades & ordering permutation : gr[pivot] should be sorted:
    399     "s: ", s;
    400     "gr: ", gr;
    401     "pivot: ",    pivot;
    402   }
    403 */
    404450  ASSUME(1, issorted(intvec(gr[pivot]), 1));
    405451
     
    407453}
    408454
    409 // Q@Wolfram: what should be done with zero gens!?
    410455proc grdeg(M)
    411456"USAGE:  grdeg(M), graded object M
    412457RETURN:  intvec of degrees
    413 PURPOSE: graded degrees of columns (generators) of M
     458PURPOSE: graded degrees of columns (generators) of M, describing the source of M
    414459ASSUME:  M must be a graded object (matrix/module/ideal/mapping)
    415460NOTE:    if M has zero cols it shoud have attrib(M,'degHomog') set.
     
    423468    def t = attrib(M, "degHomog"); // graded degrees
    424469
    425     if( ncols(M) == 0 )    {     return (t);    } // for now
     470    if( size(t) == 0 ){ return (t); } // ZERO!
    426471   
    427     ASSUME(0, ncols(M) == size(t) );
     472    ASSUME(2, ncols(M) == size(t) );
    428473    return (t);
    429474  }
    430  
     475
     476  if( ncols(M) == 0 ) { return (0:0); } // FIXME: Why???
     477
    431478  ASSUME(0, ncols(M) > 0);
    432 
    433479  ASSUME(0, ncols(M) == size(M) );
    434480
     
    747793/////////////////////////////////////////////////////////
    748794
    749 // Q@Woflram?
    750795proc grzero()
    751796"USAGE:  grzero()
     
    755800"
    756801{
    757  return ( grobj(module([0]), intvec(0), intvec(0)) );
     802 return ( grobj(freemodule(0), intvec(0:0), intvec(0:0)) );
    758803}
    759804example
     
    762807  ring r=32003,(x,y,z),dp;
    763808
    764   def M = grpower( grshift( grzero(), 10), 5 );
    765 
    766   print(M);
    767 
    768   grview(M);
     809
     810  grview( grobj(freemodule(0), intvec(0:0), intvec(0:0)) );
     811  grview( grobj(freemodule(0), intvec(0:0)) );
     812
     813  grview( grzero() );
     814
     815//  def M = grpower( grshift( grzero(), 3), 2 ); grview(M);
     816}
     817
     818proc grtwists(intvec v)
     819"USAGE:  grtwists(v), intvec v
     820RETURN:  graded object representing S(v[1]) + ... + S(v[size(v)])
     821PURPOSE: compute presentation of S(v[1]) + ... + S(v[size(v)])
     822EXAMPLE: example grtwists; shows an example
     823"
     824{
     825  matrix m[size(v)][0];
     826  return( grobj(m, -v) ); // will set the rank as well
     827}
     828example
     829{ "EXAMPLE:"; echo = 2;
     830
     831  ring r=32003,(x,y,z),dp;
     832 
     833  grview( grtwists ( intvec(-4, 1, 6 )) );
     834
     835  grview( grtwists ( intvec(0:0) ) );
     836}
     837
     838proc grtwist(int a, int d)
     839"USAGE:  grtwist(a,d), int a, d
     840RETURN:  graded object representing S(d)^a
     841PURPOSE: compute presentation of S(d)^a
     842EXAMPLE: example grtwist; shows an example
     843"
     844{
     845  ASSUME(0, a > 0); 
     846  def Z = grtwists( intvec(d:a) ); // will set the rank as well
     847//  ASSUME(2, grisequal(Z, grpower( grshift(grzero(), d), a ) )); // optional check
     848  return(Z);
     849}
     850example
     851{ "EXAMPLE:"; echo = 2;
     852
     853  ring r=32003,(x,y,z),dp;
     854
     855//  grview(grpower( grshift(grzero(), 10), 5 ) );
     856
     857  grview( grtwist (5, 10) );
    769858}
    770859
     
    827916  intvec b = grrange(B);
    828917  intvec c = a,b;
    829   int r = nrows(A);
    830 
    831   module T = align(module(B), r); //  T;  print(T);  nrows(T); // BUG!!!!
    832   module S = module(A), T;
     918
     919  if( (ncols(B)>0) && (size(B)>0) )
     920  {
     921    int r = nrows(A);
     922    module T = align(module(B), r); //  T;  print(T);  nrows(T); // BUG!!!!
     923    module S = module(A), T;
     924  }
     925  else { def S = A; }
    833926
    834927  intvec da = grdeg(A);
     
    836929  intvec dc = da, db;
    837930
    838   return(grobj(S, c, dc));
     931
     932  def SS = grobj(S, c, dc);
     933 
     934  ASSUME(0, size( grrange(SS) ) == (size(a) + size(b)) );
     935  ASSUME(0, size( grdeg(SS) ) == (size(da) + size(db)) );
     936  ASSUME(0, ncols( SS ) == size( grdeg(SS) ) );
     937  ASSUME(0, nrows( SS ) == size( grrange(SS) ) );
     938 
     939  return(SS);
    839940}
    840941example
     
    883984{
    884985  ASSUME(1, grtest(M) );
     986           
     987           
    885988
    886989  intvec a = grrange(M);
     990  intvec t = grdeg(M);
     991
     992  if( size(a) == 0 && size(t) == 0 )
     993  {
     994    "!! Warning: shifting '0 <- 0' leaves it as it unchanged!";
     995    return (M);   
     996  }
     997 
    887998  a = a - intvec(d:size(a));
    888 
    889   intvec t = attrib(M, "degHomog");
    890999  t = t - intvec(d:size(t));
    8911000
     
    9041013
    9051014  grview(S);
     1015
     1016  grview( grshift( grzero(), 100 ) ); // does nothing...
    9061017}
    9071018
     
    9341045example
    9351046{ "EXAMPLE:"; echo = 2;
    936   TODO
    937 }
    938 
    939 proc grtwist(int a, int d)
    940 "USAGE:  grtwist(a,d), int a, d
    941 RETURN:  graded object representing S(d)^a
    942 PURPOSE: compute presentation of S(d)^a
    943 EXAMPLE: example grtwist; shows an example
    944 "
    945 {
    946   ASSUME(0, a > 0);
    947 
    948   module Z; Z[a] = [0];
    949   intvec w = -intvec(d:a);
    950   Z = grobj(Z, w, w); // will set the rank as well
    951   ASSUME(2, grisequal(Z, grpower( grshift(grzero(), d), a ) )); // optional check
    952   return(Z);
    953 }
    954 example
    955 { "EXAMPLE:"; echo = 2;
    956 
    957   ring r=32003,(x,y,z),dp;
    958 
    959   grview(grpower( grshift(grzero(), 10), 5 ) );
    960 
    961   grview( grtwist (5, 10) );
     1047//  TODO
    9621048}
    9631049
     
    9691055"
    9701056{
    971   if( ncols(A) == 0 )
    972   {
    973     ASSUME(0, size(w) == nrows(A) );
    974     attrib(A, "isHomog", w);
    975     attrib(A, "degHomog", intvec(0)); // FIXME: just for now: no intvec of 0-size :(
    976     ASSUME(0, grtest(A) );
    977     return (A);
    978   }
     1057  ASSUME(0, size(w) >= nrows(A) );
    9791058 
    9801059  module M = module(A);
    981   ASSUME(0, size(w) >= nrows(M) );
    9821060
    9831061  attrib( M, "rank", size(w) );
    9841062  attrib( M, "isHomog", w );
    9851063
     1064  intvec @ww = 0:0;
     1065 
    9861066  if( size(#) > 0 )
    9871067  {
    9881068    ASSUME(0, typeof(#[1]) == "intvec" );
    989     ASSUME(0, size(#[1]) == ncols(M) );
    990     attrib(M, "degHomog", #[1]);
     1069   
     1070    @ww = intvec( #[1] );
     1071
     1072    if( size(@ww) != ncols(M) )
     1073    {
     1074      if( (size(M) == 0) && (ncols(M) <= 1) && (size(w) == 0) && (size(@ww) > 0) )
     1075      {
     1076        matrix m[size(w)][size(@ww)]; M = module(m); attrib( M, "isHomog", w );
     1077      }
     1078    }
     1079   
     1080    ASSUME(0, size(@ww) == ncols(M) );
    9911081  }
    9921082  else
    9931083  {
    994     ASSUME(0, /* no zero cols please! */ size(M) == ncols(M) );
    995     attrib(M, "degHomog", grdeg(M));
    996   }
     1084    if( size(M) == ncols(M) ) /* no zero cols? */
     1085    {
     1086      @ww = grdeg(M); // let us compute them all :)
     1087    } else
     1088    {
     1089      if( (ncols(M) == 1) && (size(M) == 0) )
     1090      {
     1091        M = freemodule(0);
     1092      }
     1093     
     1094      attrib( M, "rank", size(w) );
     1095      attrib( M, "isHomog", w );
     1096     
     1097//      ASSUME(0, /* PROBLEM WITH ZERO COLUMNS / THEIR DEGREES! */ (ncols(M) == 0) );
     1098    }
     1099  }
     1100 
     1101//  type(@ww);  type(M);
     1102 
     1103  ASSUME(0, size(@ww) == ncols(M) ); // ?!
     1104 
     1105  attrib(M, "degHomog", @ww);
    9971106
    9981107  ASSUME(0, grtest(M) );
     
    10201129
    10211130  // Zero object:
    1022   matrix z[3][0];
    1023   def zz = grobj( z, intvec(1,2,3) ); // intvec() ??
    1024   grview(zz); 
     1131  matrix z[3][0];  grview( grobj( z, intvec(1,2,3) ) );
     1132  grview( grobj( freemodule(0), intvec(1,2,3) ) );
     1133
     1134  matrix z1[0][3]; grview( grobj( z1, 0:0, intvec(1,2,3) ) );
     1135  grview( grobj( freemodule(0), 0:0, intvec(1,2,3) ) );
     1136
     1137  matrix z0[0][0]; grview( grobj( z0, 0:0 ) );
     1138  grview( grobj( freemodule(0), 0:0 ) );
     1139 
     1140 
    10251141
    10261142}
     
    10671183  {
    10681184    intvec T = attrib(N, "degHomog"); // graded degrees
     1185
     1186    if( (ncols(N) == 1) && (size(T) == 0) && (size(N) == 0) )
     1187    {
     1188      //  if(b) { "Input seems to be a valid graded ZERO-arrow!"; };
     1189      return (1);
     1190    }
    10691191   
    10701192    if ( ncols(N) != size(T) )
     
    11201242  // the following calls will fail due to tests in grtest:
    11211243
     1244 grobj( module([x+y, x, 0, 0], [0, x+y, y, 0]), intvec(0,0,0,0) ); // enough row weights
    11221245// grobj( module([x+y, x, 0, 0], [0, x+y, y, 0]), intvec(0,0) ); // not enough row weights
    11231246// grobj( module([x,0], [0,0,0], [0, y]), intvec(1,2,3) ); // zero column needs (otherwise optional) total degrees
    1124 // grobj( module([x,0], [0,0,0], [0, y]), intvec(1,2,3), intvec(1, 1, 1) ); // incompatible total degrees (on non-zero columns)
     1247 grobj( module([x,0], [0,0,0], [0, y]), intvec(1,2,3), intvec(2, 10, 3) ); // compatible total degrees (on non-zero columns)
     1248// grobj( module([x,0], [0,0,0], [0, y]), intvec(1,2,3), intvec(2-1, 10, 3+1) ); // incompatible total degrees (on both non-zero columns)
    11251249
    11261250}
     
    11431267    return (B);   
    11441268  }
    1145 
    11461269 
    11471270  module T; T[d] = 0;
     
    11511274example
    11521275{ "EXAMPLE:"; echo = 2;
     1276
    11531277  ring r;
    1154   matrix m[1][0];
    1155   align(m, 3);
     1278  matrix m[2][0];
     1279  type( align(m, 3) );
     1280
     1281  matrix m[0][2];
     1282  type( align(m, 3) );
    11561283
    11571284
     
    11801307}
    11811308
    1182 
    1183 proc grtwists(intvec v)
    1184 "USAGE:  grtwists(v), intvec v
    1185 RETURN:  graded object representing S(v[1]) + ... + S(v[size(v)])
    1186 PURPOSE: compute presentation of S(v[1]) + ... + S(v[size(v)])
    1187 EXAMPLE: example grtwists; shows an example
    1188 "
    1189 {
    1190   int l = size(v);
    1191   module Z; Z[l] = [0];
    1192   Z = grobj(Z, -v, -v); // will set the rank as well
    1193   return(Z);
    1194 }
    1195 example
    1196 { "EXAMPLE:"; echo = 2;
    1197 
    1198   ring r=32003,(x,y,z),dp;
    1199  
    1200   grview( grtwists ( intvec(-4, 1, 6 )) );
    1201 }
    1202 
    1203 
    12041309proc grsyz(A)
    12051310"USAGE:  grsyz(M), graded object M
     
    12101315{
    12111316  ASSUME(1, grtest(A));
    1212   intvec v = grdeg(A);
    1213 
    1214 //  grrange(A);
    1215  
    1216   module M = syz(A);
    1217 //  print(M);
    1218  
    1219   if( size(M) > 0 ) { return( grobj( M, v ) ); }
    1220 
    1221   // zero syzygy?
    1222   return( grtwists(-v) ); // ???
     1317  return( grobj( syz(A), grdeg(A) ) );
     1318
     1319//   if( size(syz(A)) == 0 ) : zero syzygy? //  return( grtwists( -grdeg(A) ) );
    12231320}
    12241321example
     
    12271324  ring r=32003,(x,y,z),dp;
    12281325
    1229   module A = grobj( module([x+y, x, 0, 3], [0, x+y, y, 2], [y, y, z, 1]), intvec(0,0,0,1) );
     1326  module A = grgroebner( grobj( module([x+y, x, 0, 3], [0, x+y, y, 2], [y, y, z, 1]), intvec(0,0,0,1) ) );
    12301327  grview(A);
    12311328 
    1232   module B = grgroebner(A);
    1233   grview(B);
    1234 
    1235   module C = grsyz(B); 
    1236   grview(C);
     1329  grview(grsyz(A));
     1330 
     1331  module X = grgroebner( grobj( module([x]), intvec(2) ) );
     1332  grview(X);
     1333
     1334  // syzygy module should be zero!
     1335  grview(grsyz(X));
     1336 
     1337 
    12371338}
    12381339
     
    12481349  ASSUME(1, grtest(B));
    12491350
    1250   // TODO: ASSUME(0, grdeg() == grrange());!!!
     1351  intvec a = grdeg(A);
     1352  intvec b = grrange(B);
     1353 
     1354  ASSUME(0, (size(a) == size(b)) && (a == b));  // == for intvec :(
    12511355
    12521356  return ( grobj( A*B, grrange(A), grdeg(B) ) );
     
    12761380
    12771381
     1382// TODO: think about a proper data structure for a graded resolution!?
    12781383proc grres(def A, int l, list #)
    12791384"USAGE:  grres(M, l[, b]), graded object M, int l, int b
     
    12911396  if(b) { list r = res(A, l, #[1]); } else { list r = res(A, l); }
    12921397
    1293 //  r;  v;
    1294 
    12951398  l = size(r);
    12961399 
    1297   int i; module m;
     1400  int i;
    12981401 
    12991402  for ( i = 1; i <= l; i++ )
    13001403  {
    1301     if( size(r[i]) == 0 ){ r[i] = grtwists(-v); i++; break;   }
     1404    if( size(r[i]) == 0 )
     1405    {
     1406      r[i] = grobj(freemodule(0), v); // grtwists(-v);
     1407      i++;
     1408      break;
     1409    }
    13021410
    13031411    r[i] = grobj(r[i], v); v = grdeg(r[i]);
    13041412  }
     1413 
    13051414  i = i-1;
    13061415
     
    13261435
    13271436proc grtranspose(def M)
    1328 "
    1329 USAGE:   grtranspose(M), graded object M
     1437"USAGE:   grtranspose(M), graded object M
    13301438RETURN:  graded object
    13311439PURPOSE: graded transpose of M
     
    13511459 
    13521460
    1353   module A = grobj( module([x+y, x, 0, 3], [0, x+y, y, 2], [y, y, z, 1]), intvec(0,0,0,1) ); A = grgroebner(A); grview(A);
    1354 
    1355   "graded transpose: "; module B = grtranspose(A); grview( B ); print(B);
    1356 
    1357   "... syzygy: "; module C = grsyz(B); grview(C);
    1358 
    1359   "... transposed: "; module D = grtranspose(C); grview( D ); print (D);
    1360 
    1361   "... and back to presentation: "; module E = grsyz( D ); grview(E); print(E);
    1362 
    1363   module F = grgens( E ); grview(F); print(F);
    1364  
    1365   module G = grpres( F ); grview(G); print(G);
     1461  // Corner cases: 0 <- 0!
     1462  module Z = grzero(); grview(Z);
     1463  grview( grtranspose( Z ) );
     1464
     1465 
     1466  // Corner cases: * <- 0
     1467  matrix M1[3][0];
     1468 
     1469  module Z1 = grobj( M1, intvec(-1, 0, 1) ); grview(Z1);
     1470  grview( grtranspose( Z1 ) );
     1471 
     1472 
     1473  // Corner cases: 0 <- *
     1474  matrix M2[0][3];
     1475
     1476  module Z2 = grobj( M2, 0:0, intvec(-1, 0, 1) ); grview(Z2);
     1477  grview( grtranspose( Z2 ) );
     1478 
    13661479}
    13671480
    13681481
    13691482proc grgens(def M)
    1370 "
    1371 USAGE:   grgens(M), graded object M (map)
     1483"USAGE:   grgens(M), graded object M (map)
    13721484RETURN:  graded object 
    13731485PURPOSE: try compute graded generators of coker(M) and return them as columns
     
    14041516
    14051517  grview( B ); print(B); // Ups :( != A
     1518
     1519  grview( grgens( grzero() ) );
    14061520 
    14071521}
     
    14091523
    14101524proc grpres(def M)
    1411 "
    1412 USAGE:   grpres(M), graded object M (submodule gens)
     1525"USAGE:   grpres(M), graded object M (submodule gens)
    14131526RETURN:  graded module (via coker)
    14141527PURPOSE: compute graded presentation matrix of submodule generated by columns of M
     
    14181531  ASSUME(1, grtest(M) );
    14191532
    1420   module N = grsyz(M);
     1533  def N = grsyz(M);
    14211534
    14221535//  ASSUME(3, grisequal( M, grgens( N ) ) );
     
    14291542  ring r=32003,(x,y,z),dp;
    14301543
    1431   module M = grtwists( intvec(-2, 0, 4, 4) ); grview(M);
    1432 
    1433   module N = grgens(M); grview( N ); print(N);
    1434 
    1435   module L = grpres( N ); grview( L ); print(L);
    1436 
    1437 
    1438   module A = grobj( module([x+y, x, 0, 3], [0, x+y, y, 2], [y, y, z, 1]), intvec(0,0,0,1) );
    1439 
    1440   A = grgroebner(A); grview(A);
    1441 
    1442   module B = grgens(A); grview( B ); print(B);
    1443 
    1444   module C = grpres( B ); grview( C ); print(C);
     1544  def A = grgroebner( grobj( module([x+y, x, 0, 3], [0, x+y, y, 2], [y, y, z, 1]), intvec(0,0,0,1) ) );
     1545  grview(A);
     1546
     1547  "graded transpose: "; def B = grtranspose(A); grview( B ); print(B);
     1548
     1549  "... syzygy: "; def C = grsyz(B); grview(C);
     1550
     1551  "... transposed: "; def D = grtranspose(C); grview( D ); print (D);
     1552
     1553  "... and back to presentation: "; def E = grsyz( D ); grview(E); print(E);
     1554
     1555  def F = grgens( E ); grview(F); print(F);
     1556  def G = grpres( F ); grview(G); print(G);
     1557
     1558
     1559  def M = grtwists( intvec(-2, 0, 4, 4) ); grview(M);
     1560 
     1561  def N = grgens(M); grview( N ); print(N);
     1562 
     1563  def L = grpres( N ); grview( L ); print(L); 
    14451564}
    14461565
     
    15041623}
    15051624
    1506 //
    1507 
    1508 
     1625// TODO: remove the following?
    15091626proc KeneshlouMatrixPresentation(intvec a)
    1510 "USAGE: intvec a.
     1627"USAGE: KeneshlouMatrixPresentation(intvec a), intvec a.
    15111628RETURN: graded object
    15121629PURPOSE: matrix presentation for direct sum of omega^a[i](i) in form of a graded object
     
    16751792
    16761793proc grrange(M)
     1794"USAGE: grrange(M), graded object M
     1795RETURN: intvec
     1796PURPOSE: get weights of module units, thus describing the target of M
     1797EXAMPLE: example grrange; shows an example
     1798"
    16771799{
    16781800//  ASSUME(1, grtest(M)); // Leads to recursive call due to grtest...
    16791801  return( attrib(M, "isHomog") );
    16801802}
     1803example
     1804{ "EXAMPLE:"; echo = 2;
     1805
     1806  ring r=32003,(x,y,z),dp;
     1807
     1808  module Z = grobj(freemodule(0),intvec(0:0),intvec(0:0));
     1809 
     1810  grrange(Z);
     1811  grdeg(Z);
     1812 
     1813  grview(Z);
     1814
     1815  module P=grobj(module([xy,0,xz]),intvec(0,1,0));
     1816
     1817  grrange(P);
     1818  grdeg(P);
     1819
     1820  grview(P);
     1821}
    16811822
    16821823proc grlift0(M, N, alpha1)
    1683 "PURPOSE: generic random alpha0 : coker(M) -> coker(N) from random alpha1
     1824"USAGE: grlift0(M, N, alpha1) TODO!
     1825PURPOSE: generic random alpha0 : coker(M) -> coker(N) from random alpha1
    16841826NOTE: this proc can work only if some assumptions are fulfilled (due
    16851827to Wolfram)! e.g. at the end of a resolution for the source module...
     
    17331875
    17341876proc grlifting(M,N)
    1735 "USAGE: graded objects M and N
     1877"USAGE: grlifting(M,N), graded objects M and N
    17361878RETURN: map of chain complexes (as a list)
    17371879PURPOSE: construct a map of chain complexes between free resolutions of Img(M) and Img(N).
     
    18231965
    18241966proc mappingcone(M,N)
    1825 "USAGE:M,N graded objects
     1967"USAGE: mappingcone(M,N), M,N graded objects
    18261968RETURN: chain complex (as a list)
    18271969PURPOSE: construct a free resolution of the cokernel of a random map between Img(M), and Img(N).
     
    18852027// correct
    18862028proc grrndmap(def S, def D, list #)
    1887 "USAGE: (S,D), graded objects S and D
     2029"USAGE: grrndmap(S,D), graded objects S and D
    18882030RETURN: graded object
    18892031PURPOSE: construct a random 0-deg graded homomorphism src(S) -> src(D)
     
    19192061
    19202062proc grrndmap2(def D, def S, list #)
    1921 "USAGE: (D,S), graded objects S and D
     2063"USAGE: grrndmap2(D,S), graded objects S and D
    19222064RETURN: graded object
    19232065PURPOSE: construct a random 0-deg graded homomorphism between target of D and S.
     
    19552097//
    19562098proc grlifting2(A,B)
    1957 "USAGE: (A,B), graded objects A and B (matrices defining maps)
     2099"USAGE: grlifting2(A,B), graded objects A and B (matrices defining maps)
    19582100RETURN: map of chain complexes (as a list)
    19592101PURPOSE: construct a map of chain complexes between free resolution of
     
    20282170// G0<-----F0+G1<------F1+G2<-------F2+G3<-----
    20292171proc mappingcone2(A,B)
    2030 "USAGE: (A,B), graded objects A and B (matrices defining maps)
     2172"USAGE: mappingcone2(A,B), graded objects A and B (matrices defining maps)
    20312173RETURN: chain complex (as a list)
    20322174PURPOSE: construct the free resolution of a cokernel of a random map between M=coker(A), and N=coker(B)
     
    21982340//G0<-----F0+G1<------F1+G2<-------F2+G3<-----
    21992341proc mappingcone3(A,B)
    2200 "USAGE: (A,B), graded objects A and B (matrices defining maps)
     2342"USAGE: mappingcone3(A,B), graded objects A and B (matrices defining maps)
    22012343RETURN: chain complex (as a list)
    22022344PURPOSE: construct a free resolution of the cokernel of a random map between M=coker(A), and N=coker(B)
     
    22902432// TODO: Please decide between KeneshlouMatrixPresentation and matrixpres, and replace one with the other!
    22912433proc matrixpres(intvec a)
    2292 "USAGE:  intvec a
     2434"USAGE:  matrixpres(a), intvec a
    22932435RETURN:  graded object
    22942436PURPOSE: matrix presentation for direct sum of omega^a[i](i) in form of a graded object
Note: See TracChangeset for help on using the changeset viewer.