Changeset f2ed2d in git


Ignore:
Timestamp:
Apr 9, 2010, 11:22:04 PM (14 years ago)
Author:
Motsak Oleksandr <motsak@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
a0f5849764a78dfc4f5394cbc998a82eefdd6644
Parents:
7d9253b1d9528cb0ec8435d0e009b4bc3b24d9ae
Message:
fixed help, examples + attributes

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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/nctools.lib

    r7d9253 rf2ed2d  
    2222Exterior();               return qring, the exterior algebra of a basering,
    2323findimAlgebra(M,[r]);     create finite dimensional algebra structure from the basering and the multiplication matrix M,
    24 superCommutative([b,e,Q]);  return qring, the super-commutative algebra over a basering,
     24superCommutative([b,e,Q]);  return qring, a super-commutative algebra over a basering,
    2525rightStd(I);              compute a right Groebner basis of an ideal,
    2626
     
    733733///////////////////////////////////////////////////////////////////////////////
    734734proc superCommutative(list #)
    735 "USAGE:   superCommutative([b,[e, [Q, [flag]]]]);
     735"USAGE:   superCommutative([b,[e, [Q]]]);
    736736RETURN:  qring
    737737PURPOSE:  create a super-commutative algebra (as a GR-algebra) over a basering,
    738738NOTE: activate this qring with the \"setring\" command.
    739 NOTE: if b==e then the resulting ring is commutative unless 'flag' is given and non-zero.
    740 @* By default, @code{b=1, e=nvars(basering), Q=0}, and @code{flag=0}.
    741 THEORY: given a basering, this procedure introduces the anticommutative relations x(j)x(i)=-x(i)x(j) for all e>=j>i>=b,
    742 @* moreover, creates a factor algebra modulo the two-sided ideal, generated by x(b)^2, ..., x(e)^2[ + Q]
     739NOTE: if b==e then the resulting ring is commutative.
     740@* By default, @code{b=1, e=nvars(basering), Q=0}.
     741THEORY: given a basering, this procedure introduces the anti-commutative relations
     742@* var(j)var(i)=-var(i)var(j) for all e>=j>i>=b and creates the quotient
     743@* of the anti-commutative algebra modulo the two-sided ideal, generated by
     744@* x(b)^2, ..., x(e)^2[ + Q]
    743745DISPLAY: If @code{printlevel} > 1, warning debug messages will be printed
    744746EXAMPLE: example superCommutative; shows examples
     
    813815  }
    814816
    815   if(size(#)>3)
     817/*  if(size(#)>3)
    816818  {
    817819    if(typeof(#[4]) != "int")
     
    822824    flag = #[4];
    823825  }
     826*/
    824827
    825828  int iSavedDegBoung = degBound;
     
    848851  setring @R; // @R;
    849852*/
     853  int i, j;
    850854
    851855  if( (char(basering)==2) && (flag == 0) )// commutative ring!!!
     
    856860    }
    857861
    858     int j = ncols(Q) + 1;
    859 
    860     for ( int i=e; i>=b; i--, j++ )
    861     {
    862       Q[j] = var(i)^2;
     862    ideal I;
     863
     864    for (i = e - b + 1; i > 0; i--)
     865    {
     866      I[i] = var(i + b - 1)^2;
    863867    }
    864868
    865869    degBound=0;
    866     Q = std(Q);
     870    Q = std(I + Q);
    867871    degBound = iSavedDegBoung;
    868872
     
    872876
    873877
    874   int i, j;
    875878
    876879  if( (b == 1) && (e == N) ) // just an exterior algebra?
     
    893896  }
    894897
    895   ideal @Q = fetch(saveRing, Q);
    896 
    897   j = ncols(@Q) + 1;
    898 
    899   for ( i=e; i>=b; i--, j++ )
    900   {
    901     @Q[j] = var(i)^2;
    902   }
    903 
    904   if( (fprot == 1) and (attrib(basering, "global") != 1) )
    905   {
    906     print("Warning: Since the current ordering is not global there might be problems computing twostd(Q)!");
    907     "Q:";
    908     @Q;
    909   }
     898  ideal @I;
     899
     900  for (i = e - b + 1; i > 0; i--)
     901  {
     902    @I[i] = var(i + b - 1)^2;
     903  }
     904
    910905
    911906  degBound=0;
    912   @Q = twostd(@Q); // must be computed within the ground G-algebra => problems with local orderings!
     907  @I = twostd(@I); // must be computed within the ground G-algebra => problems with local orderings!
    913908  degBound = iSavedDegBoung;
    914909
    915   qring @EA = @Q;
     910  qring @EA = @I;
     911
     912  ideal @Q = twostd(fetch(saveRing, Q));
     913 
     914  if( size(@Q) > 0 )
     915  {
     916    qring @EA2 = @Q; 
     917  }
     918 
     919  attrib(basering, "isSCA", 1==1);
     920  attrib(basering, "iAltVarStart", b);
     921  attrib(basering, "iAltVarEnd", e);
    916922
    917923//   "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "].";
    918   return(@EA);
     924  return(basering);
    919925}
    920926example
     
    931937  "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "].";
    932938  kill R; kill ER;
    933   ring R = 0,(x(1..6)),(ls(2), dp(2), lp(2)); // local!
    934   def ER = superCommutative(3,4); // b = 3, e = 4
     939  ring R = 0,(x, y, z),(ds(1), dp(2)); // mixed!
     940  def ER = superCommutative(2,3); // b = 2, e = 3
    935941  setring ER; ER;
    936942  "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "].";
     943  x + 1 + z + y; // ordering on variables: y > z > 1 > x
     944  std(x - x*x*x);
     945  std(ideal(x - x*x*x, x*x*z + y, z + y*x*x));
    937946  kill R; kill ER;
     947  ring R = 0,(x, y, z),(ds(1), dp(2)); // mixed!
     948  def ER = superCommutative(2, 3, ideal(x - x*x, x*x*z + y, z + y*x*x )); // b = 2, e = 3
     949  setring ER; ER;
     950  "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 
    938951}
    939952
    940953// Please, don't throw this away!!! Needed for backward compatibility.
    941954proc SuperCommutative(list #)
    942 {
    943   // "Please use superCommutative instead";
     955"USAGE:   please use @code{superCommutative} instead
     956"
     957{
     958  "// This procedure is deprecated. Please use superCommutative instead";
    944959  return( superCommutative(#) );
    945960}
    946 
     961example
     962{
     963  "EXAMPLE:";
     964  "Procedure is deprecated. Please use superCommutative instead";
     965}
    947966
    948967static proc ParseSCA()
     
    952971"
    953972{
     973  if(typeof(attrib(basering, "isSCA"))=="int") // workaround, if(defined()) doesn't work!!!!
     974  {
     975    if(typeof(attrib(basering, "iAltVarStart"))=="int")
     976    {
     977      if(typeof(attrib(basering, "iAltVarEnd"))=="int")
     978      {
     979        if(attrib(basering, "isSCA"))
     980        {
     981          return(list(
     982            attrib(basering, "iAltVarStart"),
     983            attrib(basering, "iAltVarEnd")
     984                 ));
     985        }
     986      }
     987    }
     988  }
     989
    954990  def saveRing = basering;
    955991
     
    960996  int e =  -1;
    961997
    962   int fprot = (find(option(),"prot") != 0);
     998  int fprot = 0; // (find(option(),"prot") != 0);
    963999
    9641000
     
    9741010    if(fprot)
    9751011    {
    976       print("Warning: The current ring is internally commutative!");
     1012      print("// Warning: The current ring is internally commutative!");
    9771013    }
    9781014
     
    9831019        if( (fprot == 1) and (i > 1) )
    9841020        {
    985           print("Warning: the SCA representation of the current commutative factor ring may be ambiguous!");
     1021          print("// Warning: the SCA representation of the current commutative factor ring may be ambiguous!");
    9861022        }
    9871023
     
    10841120
    10851121  ////////////////////////////////////////////////////////////////////////
    1086   // ok. it is a SCA!!!
     1122  // ok. this is a SCA!!!
    10871123
    10881124  return(list(b, e));
     
    10941130RETURN:  int
    10951131PURPOSE:  returns the number of the first alternating variable of basering
    1096 NOTE:  basering should be a super-commutative algebra with at most one block of anti-commutative variables
    1097 @* For commutative rings, @code{nvars(basering)+1} will be returned.
     1132NOTE:  basering should be a super-commutative algebra constructed by
     1133@*     the procedure @code{superCommutative}, emits an error otherwise
    10981134EXAMPLE: example AltVarStart; shows examples
    10991135"
     
    11161152  setring ER; ER;
    11171153  "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "].";
     1154  setring R;
     1155  "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 
     1156  kill R, ER;
     1157  //////////////////////////////////////////////////////////////////
     1158  ring R = 2,(x(1..4)),dp; // the same in char. = 2!
     1159  def ER = superCommutative(2); // (b = 2, e = N)
     1160  setring ER; ER;
     1161  "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "].";
     1162  setring R;
     1163  "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 
    11181164}
    11191165
     
    11231169RETURN:  int
    11241170PURPOSE:  returns the number of the last alternating variable of basering
    1125 NOTE:  basering should be a super-commutative algebra with at most one block of anti-commutative variables
    1126 @* returns -1 for commutative rings
     1171NOTE:  basering should be a super-commutative algebra constructed by
     1172@*     the procedure @code{superCommutative}, emits an error otherwise
    11271173EXAMPLE: example AltVarEnd; shows examples
    11281174"
     
    11451191  setring ER; ER;
    11461192  "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "].";
     1193  setring R;
     1194  "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 
     1195  kill R, ER;
     1196  //////////////////////////////////////////////////////////////////
     1197  ring R = 2,(x(1..4)),dp; // the same in char. = 2!
     1198  def ER = superCommutative(2); // (b = 2, e = N)
     1199  setring ER; ER;
     1200  "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "].";
     1201  setring R;
     1202  "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; 
    11471203}
    11481204
     
    11511207"USAGE:   IsSCA();
    11521208RETURN:  int
    1153 PURPOSE:  returns 1 if basering is a super-commutative algebra and 0 otherwise.
    1154 NOTE:     shows hint message for non-SCA algebras if the 'prot' option is on.
     1209PURPOSE:  returns 1 if basering is a super-commutative algebra and 0 otherwise
    11551210EXAMPLE: example IsSCA; shows examples
    11561211"
Note: See TracChangeset for help on using the changeset viewer.