Changeset 2a5ce36 in git


Ignore:
Timestamp:
Mar 6, 2009, 6:51:27 PM (15 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
dfb2c646c61802722d29569f2e01d9a2fe1af023
Parents:
15ac1ca9c4ddde1e5e7ae4229db9244d9e470c6b
Message:
*levandov: two new proc from bfun, isCommutative and isWeyl


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/nctools.lib

    r15ac1c r2a5ce36  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: nctools.lib,v 1.40 2009-01-14 16:07:05 Singular Exp $";
     2version="$Id: nctools.lib,v 1.41 2009-03-06 17:51:27 levandov Exp $";
    33category="Noncommutative";
    44info="
     
    2626
    2727AUXILIARY PROCEDURES:
    28 ncRelations(r);         recover the non-commutative relations of a G-algebra,
    29 isCentral(p);           check for the commutativity of a polynomial in the G-algebra,
     28ncRelations(r);      recover the non-commutative relations of a G-algebra,
     29isCentral(p);         check for the commutativity of a polynomial in the G-algebra,
    3030isNC();                 check whether basering is noncommutative,
    31 UpOneMatrix(N);         return NxN matrix with 1's in the whole upper triagle,
    32 AltVarStart();          return first alternating variable of a super-commutative algebra,
    33 AltVarEnd();            return last alternating variable of a super-commutative algebra,
    34 IsSCA();                checks whether current ring is a super-commutative algebra
     31isCommutative();  check whether basering is commutative
     32isWeyl();               check whether basering is a Weyl algebra
     33UpOneMatrix(N);   return NxN matrix with 1's in the whole upper triagle,
     34AltVarStart();        return first alternating variable of a super-commutative algebra,
     35AltVarEnd();          return last alternating variable of a super-commutative algebra,
     36IsSCA();                check whether current ring is a super-commutative algebra
    3537";
    3638
     
    14611463
    14621464//////////////////////////////////////////////////////////////////////
     1465
     1466proc isCommutative ()
     1467"USAGE:  isCommutative();
     1468RETURN:  int, 1 if basering is commutative, or 0 otherwise
     1469PURPOSE: check whether basering is commutative
     1470EXAMPLE: example isCommutative; shows an example
     1471"
     1472{
     1473  int iscom = 1;
     1474  list L = ringlist(basering);
     1475  if (size(L) > 4) // basering is nc_algebra
     1476  {
     1477    matrix C = L[5];
     1478    matrix D = L[6];
     1479    if (size(module(D)) <> 0) { iscom = 0; }
     1480    else
     1481    {
     1482      matrix U = UpOneMatrix(nvars(basering));
     1483      if (size(module(C-U)) <> 0) { iscom = 0; }
     1484    }
     1485  }
     1486  return(iscom);
     1487}
     1488example
     1489{
     1490  "EXAMPLE:"; echo = 2;
     1491  ring r = 0,(x,y),dp;
     1492  isCommutative();
     1493  def D = Weyl(); setring D;
     1494  isCommutative();
     1495  setring r;
     1496  def R = nc_algebra(1,0); setring R;
     1497  isCommutative();
     1498}
     1499
     1500//////////////////////////////////////////////////////////////////////
     1501
     1502proc isWeyl ()
     1503"USAGE:  isWeyl();
     1504RETURN:  int, 1 if basering is a Weyl algebra, or 0 otherwise
     1505PURPOSE: check whether basering is a Weyl algebra
     1506EXAMPLE: example isWeyl; shows an example
     1507"
     1508{
     1509  int i,j;
     1510  int notW = 0;
     1511  int N = nvars(basering);
     1512  if (N mod 2 <> 0) { return(notW); } // odd number of generators
     1513  int n = N/2;
     1514  list L = ringlist(basering);
     1515  if (size(L) < 6) { return(notW); } // basering is commutative
     1516  matrix C = L[5];
     1517  matrix D = L[6];
     1518  matrix U = UpOneMatrix(N);
     1519  if (size(ideal(C-U)) <> 0) { return(notW); } // lt(xy)<>lt(yx)
     1520  ideal I = D;
     1521  if (size(I) <> n) { return(notW); } // not n entries<>0
     1522  I = simplify(I,4+2);
     1523  int sI = size(I);
     1524  if (sI > 2) { return(notW); }  // more than 2 distinct entries
     1525  for (i=1; i<=sI; i++)
     1526  {
     1527    if (I[i]<>1 && I[i]<>-1) { return (notW); } // other values apart from 1,-1
     1528  }
     1529  ideal Ro,Co;
     1530  for (i=1; i<=N; i++)
     1531  {
     1532    Ro = D[1..N,i];
     1533    Co = D[i,1..N];
     1534    if (size(Ro)>1 || size(Co)>1)
     1535    {
     1536      return(int(0)); // var(i) doesn't commute with more than 1 other vars
     1537    }
     1538  }
     1539  return(int(1)); // all tests passed: basering is Weyl algebra
     1540}
     1541example
     1542{
     1543  "EXAMPLE:"; echo = 2;
     1544  ring r = 0,(a,b,c,d),dp;
     1545  isWeyl();
     1546  def D = Weyl(1); setring D; //make from r a Weyl algebra
     1547  b*a;
     1548  isWeyl();
     1549  ring t = 0,(Dx,x,y,Dy),dp;
     1550  matrix M[4][4]; M[1,2]=-1; M[3,4]=1;
     1551  def T = nc_algebra(1,M); setring T;
     1552  isWeyl();
     1553}
Note: See TracChangeset for help on using the changeset viewer.