Changeset 1625c1 in git


Ignore:
Timestamp:
Jul 19, 2007, 7:18:30 PM (16 years ago)
Author:
Motsak Oleksandr <motsak@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
3eadab96fecbb57aa75151e22b15ce9249b408b6
Parents:
5b4439ab0ec54203e3aae4c8eb6af146fe1b11d5
Message:
*motsak: chages to SuperCommutative, IsSCA, ParseSCA.
! major changes due to the fact that commutative rings are super-commutative itself.
+ minor tests and warnings.


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/nctools.lib

    r5b4439 r1625c1  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: nctools.lib,v 1.27 2007-07-13 14:05:14 motsak Exp $";
     2version="$Id: nctools.lib,v 1.28 2007-07-19 17:18:30 motsak Exp $";
    33category="Noncommutative";
    44info="
     
    723723PURPOSE:  create the super-commutative algebra (as a GR-algebra) 'over' a basering,
    724724NOTE: activate this qring with the \"setring\" command.
    725 NOTE: as a side effect the basering will be changed to bo the basis G-algebra (without factor).
     725NOTE: as a side effect the basering will be changed (if not in a commutative case) to bo the ground G-algebra (without factor).
     726NOTE: if b==e then the resulting ring is commutative.
    726727THEORY: given a basering, this procedure introduces the anticommutative relations x(j)x(i)=-x(i)x(j) for all e>=j>i>=b,
    727728@* moreover, creates a factor algebra modulo the two-sided ideal, generated by x(b)^2, ..., x(e)^2[ + Q]
     
    729730"
    730731{
     732  int fprot = (find(option(),"prot") != 0);
     733 
    731734  string rname=nameof(basering);
     735 
    732736  if ( rname == "basering") // i.e. no ring has been set yet
    733737  {
     
    735739    return();
    736740  }
    737   int N = nvars(basering);
    738 
     741
     742  def saveRing = basering;
     743 
     744  int N = nvars(saveRing);
    739745  int b = 1;
    740746  int e = N;
    741747
    742   def saveRing = basering;
    743748  ideal Q = 0;
    744749
     
    749754      ERROR("First argument 'b' must be an integer!");
    750755      return();
    751     }
     756    }   
    752757    b = #[1];
     758
     759    if((b < 1)||(b > N))
     760    {
     761      ERROR("First argument 'b' must within [1..nvars(basering)]!");
     762      return();
     763    }   
     764   
    753765  }
    754766
     
    757769    if(typeof(#[2]) != "int")
    758770    {
    759       ERROR("Last argument 'e' must be an integer!");
     771      ERROR("Second argument 'e' must be an integer!");
    760772      return();
    761773    }
    762774    e = #[2];
     775
     776    if((e < 1)||(e > N))
     777    {
     778      ERROR("Second argument 'e' must within [1..nvars(basering)]!");
     779      return();
     780    }
     781   
     782    if(e < b)
     783    {
     784      ERROR("Second argument 'e' must be bigger or equal to 'b'!");
     785      return();
     786    }
     787
    763788  }
    764789
     
    773798  }
    774799
     800  if( b == e ) // commutative ring!!!
     801  {
     802    if( fprot == 1)
     803    {
     804      print("Warning: b==e means that the resulting ring will be commutative!");
     805    }
     806    Q = std(Q + (var(b)^2));
     807    qring @EA = Q; // and it will be internally commutative as well!!!
     808    return(@EA);   
     809  }
     810
    775811/*
    776   // Singular'(Hans) politics: no ring copyes!
     812  // Singular'(H.S.) politics: no ring copies!
    777813  // in future ncalgebra() should return a new ring!!!
    778814  list CurrRing = ringlist(basering);
     
    793829  }
    794830
    795   ncalgebra(@E, 0);
    796 
    797   ideal Q = fetch(saveRing, Q);
    798   j = ncols(Q) + 1;
     831  ncalgebra(@E, 0); // define ground G-algebra!
     832
     833  ideal @Q = fetch(saveRing, Q);
     834 
     835  j = ncols(@Q) + 1;
    799836
    800837  for ( i=e; i>=b; i--, j++ )
    801838  {
    802     Q[j] = var(i)^2;
    803   }
    804   Q = twostd(Q);
    805   qring @EA = Q;
     839    @Q[j] = var(i)^2;
     840  }
     841
     842  if( (fprot == 1) and (attrib(basering, "global") != 1) )
     843  {
     844    print("Warning: Since the current ordering is not global there might be problems computing twostd(Q)!");
     845    print("Q:", @Q);
     846  }
     847 
     848  @Q = twostd(@Q); // must be computed within the ground G-algebra => problems with local orderings!
     849 
     850  qring @EA = @Q;
    806851
    807852//   "Alternating variables: [", AltVarStart(), ",", AltVarEnd(), "].";
     
    832877"
    833878RETURN: list {AltVarStart, AltVarEnd} is currRing is SCA, returns undef otherwise.
     879NOTE: rings with only one non-commutative variable are commutative rings which are super-sommutative itself!
    834880"
    835881{
    836882  def saveRing = basering;
    837   list L = ringlist(saveRing);
    838 
    839   if( size(L)!=6 )
    840   {
    841     return("The current ring is commutative!");
    842   }
    843 
    844   module D = simplify(L[6], 2 + 4);
    845 
    846   if( size(D)>0 )
    847   {
    848     return("The current ring is not SCA! (D!=0)");
    849   }
    850883
    851884  int i, j;
     
    854887  int b = N+1;
    855888  int e =  -1;
     889
     890  int fprot = (find(option(),"prot") != 0);
     891
     892
     893  if( size(ideal(saveRing)) == 0 )
     894  {
     895    return("SCA rings are factors by (at least) squares!"); // no squares in the factor ideal!
     896  }
     897 
     898  list L = ringlist(saveRing);
     899
     900  if( size(L)!=6 )
     901  {
     902    if(fprot)
     903    {
     904      print("Warning: The current ring is internally commutative!");
     905    }
     906
     907    for( i = N; i > 0; i-- )
     908    {
     909      if( NF(var(i)^2, std(0)) == 0 )
     910      {
     911        if( (fprot == 1) and (i > 1) )
     912        {         
     913          print("Warning: the SCA representation of the current commutative factor ring may be ambiguous!");
     914        }
     915                     
     916        return( list(i, i) ); // this is not unique in this case! there may be other squares in the factor ideal!
     917      }
     918    }   
     919
     920    return("The current commutative ring is not SCA! (Wrong quotient ideal)"); // no squares in the factor ideal!
     921  }
     922
     923  module D = simplify(L[6], 2 + 4);
     924
     925  if( size(D)>0 )
     926  {
     927    return("The current ring is not SCA! (D!=0)");
     928  }
    856929
    857930  matrix C = L[5];
     
    887960  if( (b > N) || (e < 1))
    888961  {
    889     return("The current ring is commutative!");
     962    if(fprot)
     963    {
     964      print("Warning: The current ring is a commutative GR-algebra!");
     965    }
     966
     967    for( i = N; i > 0; i-- )
     968    {
     969      if( NF(var(i)^2, std(0)) == 0 )
     970      {
     971        if( (fprot == 1) and (i > 1) )
     972        {         
     973          print("Warning: the SCA representation of the current factor ring may be ambiguous!");
     974        }
     975                     
     976        return( list(i, i) ); // this is not unique in this case! there may be other squares in the factor ideal!
     977      }
     978    }
     979
     980    return("The current commutative GR-algebra is not SCA! (Wrong quotient ideal)"); // no squares in the factor ideal!
    890981  }
    891982
     
    9121003  }
    9131004
    914   list LL = list(L[1], L[2], L[3], ideal(0), L[5], L[6]);
    915   ideal Q = L[4];
    916 //  "Q = ", string(Q);
    917 
    918   def  E = ring(LL);
    919   setring E; // not a qring!
    920 //  E;
    921 
    922   ideal Q = fetch(saveRing, Q); // should belong to E!
    923   Q = twostd(Q);
    924 
    925 //  "Q = ", string(Q);
    926 
    9271005  for( i = b; i <= e; i++ )
    9281006  {
    929     if( NF(var(i)^2, Q) != 0 )
    930     {
    931       setring saveRing;
     1007    if( NF(var(i)^2, std(0)) != 0 )
     1008    {
    9321009      return("The current ring is not SCA! (Wrong quotient ideal)");
    9331010    }
     
    9371014  // ok. it is a SCA!!!
    9381015
    939   ideal QQ;
    940 
    941   for( i = e; i >= b; i-- )
    942   {
    943     QQ[i - b + 1] = var(i)^2;
    944   }
    945 
    946   QQ = twostd(QQ);
    947   Q = simplify(NF(Q, QQ),  1 + 2 + 4);
    948 
    949   setring saveRing;
    950 
    951   ideal QQ = fetch(E, Q);
    952 
    953   return(list(b, e, QQ));
    954 }
    955 
    956 
    957 
     1016  return(list(b, e));
     1017}
    9581018
    9591019///////////////////////////////////////////////////////////////////////////////
     
    10181078RETURN:  int
    10191079PURPOSE:  returns 1 if basering is a supercommutative algebra and 0 otherwise.
    1020 NOTE:     no error message!
     1080NOTE:     shows hint message for non-SCA algebras if the 'prot' option is on.
    10211081EXAMPLE: example IsSCA; shows examples
    10221082"
     
    10271087  {
    10281088    return(1);
     1089  }
     1090
     1091  if( find(option(),"prot") != 0 )
     1092  {
     1093    print(l);
    10291094  }
    10301095
Note: See TracChangeset for help on using the changeset viewer.