Changeset c591ad0 in git


Ignore:
Timestamp:
Feb 1, 2007, 12:56:34 AM (16 years ago)
Author:
Motsak Oleksandr <motsak@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
bad2940b7a43a19da887b39672e04919a2b3a28c
Parents:
86016dc267659b0c4d7155a4accd5fb595c04de7
Message:
*motsak:
 !+!: support for factors of SCA!
  * : unified NC setup.


git-svn-id: file:///usr/local/Singular/svn/trunk@9793 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/nctools.lib

    r86016d rc591ad0  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: nctools.lib,v 1.22 2007-01-23 15:03:36 Singular Exp $";
     2version="$Id: nctools.lib,v 1.23 2007-01-31 23:56:33 motsak Exp $";
    33category="Noncommutative";
    44info="
     
    1919Exterior();               return qring, the exterior algebra of a basering,
    2020findimAlgebra(M,[r]);     create finite dimensional algebra structure from the basering and the multiplication matrix M,
    21 SuperCommutative([b,e]);  return qring, the super-commutative algebra over a basering,
     21SuperCommutative([b,e, Q]);  return qring, the super-commutative algebra over a basering,
    2222rightStd(I);              compute a right Groebner basis of an ideal,
    2323
     
    716716///////////////////////////////////////////////////////////////////////////////
    717717proc SuperCommutative(list #)
    718 "USAGE:   SuperCommutative([b,[e]]);
     718"USAGE:   SuperCommutative([b,[e, [Q]]]);
    719719RETURN:  qring
    720720PURPOSE:  create the super-commutative algebra over a basering,
    721721NOTE:  activate this qring with the \"setring\" command
    722722THEORY: given a basering, this procedure introduces the anticommutative relations x(j)x(i)=-x(i)x(j) for all e>=j>i>=b,
    723 @* moreover, creates a factor algebra modulo the two-sided ideal, generated by x(b)^2, ..., x(e)^2
     723@* moreover, creates a factor algebra modulo the two-sided ideal, generated by x(b)^2, ..., x(e)^2[ + Q]
    724724EXAMPLE: example SuperCommutative; shows examples
    725725"
    726726{
    727 
    728727  string rname=nameof(basering);
    729728  if ( rname == "basering") // i.e. no ring has been set yet
     
    737736  int e = N;
    738737
     738        def saveRing = basering;
     739  ideal Q = 0;
     740
    739741  if(size(#)>0)
    740742  {
    741743    if(typeof(#[1]) != "int")
    742744    {
    743       ERROR("First argument 'b' must be integter!");
     745      ERROR("First argument 'b' must be an integer!");
    744746      return();
    745747    }
    746748    b = #[1];
    747 
    748 
    749     if(size(#)>1)
    750     {
    751       if(typeof(#[2]) != "int")
    752       {
    753         ERROR("Last argument 'e' must be integter!");
    754         return();
    755       }
    756       e = #[2];
    757     }
    758   }
    759 
    760 
     749  }
     750
     751        if(size(#)>1)
     752        {
     753          if(typeof(#[2]) != "int")
     754          {
     755            ERROR("Last argument 'e' must be an integer!");
     756            return();
     757          }
     758          e = #[2];
     759        }
     760
     761        if(size(#)>2)
     762        {
     763          if(typeof(#[3]) != "ideal")
     764          {
     765            ERROR("Last argument 'Q' must be an ideal!");
     766            return();
     767          }
     768          Q = #[3];
     769        }
     770       
    761771  list CurrRing = ringlist(basering);
    762772  def @R = ring(CurrRing);
     
    775785  }
    776786
    777   ncalgebra(@E,0);
    778 
    779   ideal Q;
    780 
    781   for ( i=e; i>=b; i-- )
    782   {
    783     Q[i-b+1] = var(i)^2;
     787  ncalgebra(@E, 0);
     788
     789        ideal Q = fetch(saveRing, Q); 
     790        j = ncols(Q) + 1;
     791
     792  for ( i=e; i>=b; i--, j++ )
     793  {
     794    Q[j] = var(i)^2;
    784795  }
    785796  Q = twostd(Q);
     
    815826"
    816827{
    817   def rRing = basering;
    818   list L = ringlist(rRing);
     828  def saveRing = basering;
     829  list L = ringlist(saveRing);
    819830
    820831  if( size(L)!=6 )
     
    831842
    832843  int i, j;
    833   int N = nvars(rRing);
     844  int N = nvars(saveRing);
    834845
    835846  int b = N+1;
    836   int e = 0;
    837 
    838   poly p;
    839 
    840   ideal I = sort(L[4])[1];
    841 
    842 //   "Q = ", string(I);
    843 
    844   intvec exp;
    845   int d;
    846   int n = 0;
    847 
    848   for( i = size(I); i > 0; i-- )
    849   {
    850     p = I[i];
    851 //     p;
    852 
    853     if( size(p) != 1 )
    854     {
    855       return("The current ring is not SCA! (Wrong quotient ideal, not monomial)");
    856     }
    857 
    858     exp = leadexp(p);
    859 //     exp;
    860     d = 0;
    861     for( j = size(exp); j >= 1; j-- )
    862     {
    863       d = d + exp[j];
    864 //       d;
    865 
    866       if( (d!=2) && (d!=0) )
     847  int e =  -1;
     848
     849  matrix C = L[5];
     850  poly c;
     851
     852  for( i = 1; i < N; i++ )
     853  {
     854    for( j = i+1; j <= N; j++ )
     855    {
     856      c = C[i, j];
     857     
     858      if( c == -1 )
    867859      {
    868         return("The current ring is not SCA! (Wrong quotient ideal, wrong leading exponent)");
    869       }
    870 
    871       if(exp[j] == 2)
    872       {
    873         if(b > j)
     860        if(i < b)
     861        {
     862                b = i;         
     863        }
     864       
     865        if(j > e)
     866        {
     867                e = j;         
     868        }
     869      } else
     870      { // should commute
     871        if( c!=1 )
    874872        {
    875           b = j; // min
    876           n = n + 1;
    877         }
    878         if(e < j)
    879         {
    880           e = j; // max
    881           n = n + 1; // => n = n + 1 twice for the 1st one
     873          return("The current ring is not SCA! (C["+ string(i)+"," + string(j)+"]!=1)");
    882874        }
    883875      }
    884876    }
    885 
    886     if( d!=2 )
    887     {
    888       return("The current ring is not SCA! (Wrong quotient ideal, wrong leading exponent)");
    889     }
    890   }
    891 
    892 //   b, e, n;
    893 
    894   if(size(I) == 0)
    895   {
    896     b = N+1;
    897     e = N+1;
    898     n = 2;
    899   }
    900 
    901 //   if( (e < 1) || (b > N) )
    902 //   {
    903 //     ERROR("The current ring is not SCA! (wrong quotient ideal, bad squares)");
    904 //     return();
    905 //   }
    906 
    907   if( (e - b + 2) != n ) // +2 instead of +1!
    908   {
    909     return("The current ring is not SCA! (wrong quotient ideal, bad range)");
    910   }
    911 
    912 
    913   matrix C = L[5];
    914   poly c;
    915 
     877  }
     878
     879  if( (b > N) || (e < 1))
     880  {
     881    return("The current ring is commutative!");
     882  }
     883 
    916884  for( i = 1; i < N; i++ )
    917885  {
     
    935903    }
    936904  }
    937 
    938   if( (b > N) || (e > N))
    939   {
    940     return("The current ring is commutative!");
    941   }
    942 
    943   return(list(b, e));
     905 
     906  list LL = list(L[1], L[2], L[3], ideal(0), L[5], L[6]);
     907  ideal Q = L[4];
     908//  "Q = ", string(Q);
     909 
     910  def  E = ring(LL);
     911  setring E; // not a qring!
     912//  E;
     913
     914        ideal Q = fetch(saveRing, Q); // should belong to E!
     915        Q = twostd(Q);
     916
     917//  "Q = ", string(Q);
     918
     919  for( i = b; i <= e; i++ )
     920  {
     921    if( NF(var(i)^2, Q) != 0 )
     922    {
     923        setring saveRing;
     924      return("The current ring is not SCA! (Wrong quotient ideal)");
     925    }
     926  }
     927
     928        //////////////////////////////////////////////////////////////////////// 
     929  // ok. it is a SCA!!!
     930 
     931  ideal QQ;
     932 
     933  for( i = e; i >= b; i-- )
     934  {
     935    QQ[i - b + 1] = var(i)^2;
     936  }
     937 
     938  QQ = twostd(QQ);
     939  Q = simplify(NF(Q, QQ),  1 + 2 + 4);
     940 
     941  setring saveRing;
     942 
     943  ideal QQ = fetch(E, Q);
     944
     945  return(list(b, e, QQ));
    944946}
    945947
     
    10691071  setring ER; ER;
    10701072  if(IsSCA())
    1071     { "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; }
     1073    { "This is a SCA! Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "]."; }
    10721074  else
    10731075    { "Not a supercommutative algebra!!!"; }
  • Singular/ipassign.cc

    r86016d rc591ad0  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipassign.cc,v 1.87 2007-01-29 18:34:45 Singular Exp $ */
     4/* $Id: ipassign.cc,v 1.88 2007-01-31 23:56:34 motsak Exp $ */
    55
    66/*
     
    587587    }
    588588
    589     // is this an exterior algebra or a commutative polynomial ring \otimes exterior algebra?
    590     // we should check whether qr->qideal is of the form: y_i^2, y_{i+1}^2, \ldots, y_j^2 (j > i)
    591     //.if yes, setup qr->nc->type, etc.
    592     sca_SetupSCA(qr, currRing);
     589    nc_SetupQuotient(qr, currRing);
    593590  }
    594591  #endif
Note: See TracChangeset for help on using the changeset viewer.