Changeset db0c264 in git


Ignore:
Timestamp:
Dec 26, 2008, 7:15:40 PM (15 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
71f00c5a36fdd606bb3fc447fc1a8f2b52ad9bad
Parents:
cd7c3e1402405720676241fb8f28bc815d655626
Message:
*levandov: letterplace changes related to docu


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/freegb.lib

    rcd7c3e1 rdb0c264  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="$Id: freegb.lib,v 1.12 2008-10-06 17:04:27 Singular Exp $";
     2version="$Id: freegb.lib,v 1.13 2008-12-26 18:15:40 levandov Exp $";
    33category="Noncommutative";
    44info="
     
    77
    88PROCEDURES:
    9 freegbRing(int d);    creates a ring with d blocks of shifted original variables
    10 freegbasis(list L, int n);   compute two-sided Groebner basis of ideal, encoded via L, up to degree n
    11 
    12 CONVERSION ROUTINES:
    13 
    14 lp2lstr(ideal K, def save): converts letter-place ideal to a list of modules
    15 lst2str(list L[,int n]);            convert a list (of modules) into polynomials in free algebra
    16 mod2str(module M[,int n]);  convert a module into a polynomial in free algebra
    17 vct2str(module M[,int n]);  convert a vector into a word in free algebra
     9freegbRing(d);    creates a ring with d blocks of shifted original variables
     10freegbasis(L, int n);   compute two-sided Groebner basis of ideal, encoded via L, up to degree n
     11
     12AUXILIARY PROCEDURES:
     13
     14lp2lstr(K, s);      convert letter-place ideal to a list of modules
     15lst2str(L[, n]);     convert a list (of modules) into polynomials in free algebra
     16mod2str(M[, n]); convert a module into a polynomial in free algebra
     17vct2str(M[, n]);   convert a vector into a word in free algebra
     18Liebr(a,b[, N]);    compute Lie bracket ab-ba of two letterplace polynomials
     19Serre(A,z);          compute the ideal of Serre's relations associated to a generalized Cartan matrix A
     20isVar(p);             check whether p is a power of a single variable
     21
     22SEE ALSO: User manual, section Noncommutative Subsystem, subsection Letterplace
    1823"
    1924
     
    2833LIB "qhmoduli.lib"; // for Max
    2934
     35proc testfreegblib()
     36{
     37  example freegbRing;
     38  example freegbasis;
     39    "AUXILIARY PROCEDURES: ";
     40  example lp2lstr;
     41  example lst2str;
     42  example mod2str;
     43  example vct2str;
     44  example Liebr;
     45  example Serre;
     46  example isVar;
     47}
     48
    3049
    3150// obsolete?
    3251
    33 proc lshift(module M, int s, string varing, def lpring)
     52static proc lshift(module M, int s, string varing, def lpring)
    3453{
    3554  // FINALLY IMPLEMENTED AS A PART OT THE CODE
     
    7695}
    7796
    78 proc skip0(vector v)
     97static proc skip0(vector v)
    7998{
    8099  // skips zeros in a vector, producing another vector
     
    224243  for (i=1; i<=s-1; i++)
    225244  {
    226     p     = IsVar(v[i+1]);
     245    p     = isVar(v[i+1]);
    227246    if (p==0)
    228247    {
     
    288307}
    289308
    290 proc IsVar(poly p)
     309proc isVar(poly p)
     310"USAGE:  isVar(p);  poly p
     311RETURN:  int
     312PURPOSE: checks whether p is a power of a single variable from the basering.
     313@* Returns the exponent or 0 is p is not a power of  a single variable.
     314EXAMPLE: example isVar; shows examples
     315"
    291316{
    292317  // checks whether p is a variable indeed
     
    317342  ring r = 0,(x,y),dp;
    318343  poly f = xy+1;
    319   IsVar(f);
     344  isVar(f);
    320345  poly g = xy;
    321   IsVar(g);
     346  isVar(g);
    322347  poly h = y^3;
    323   IsVar(h);
     348  isVar(h);
    324349  poly i = 1;
    325   IsVar(i);
     350  isVar(i);
    326351}
    327352
    328353// new conversion routines
    329354
    330 proc id2words(ideal I, int d)
     355static proc id2words(ideal I, int d)
    331356{
    332357  // NOT FINISHED
     
    371396}
    372397
    373 proc mono2word(poly p, int d)
     398static proc mono2word(poly p, int d)
    374399{
    375400}
     
    645670}
    646671
    647 proc crs(list LM, int d)
     672static proc crs(list LM, int d)
    648673"USAGE:  crs(L, d);  L a list of modules, d an integer
    649674RETURN:  ring
     
    794819}
    795820
    796 proc polylen(ideal I)
     821static proc polylen(ideal I)
    797822{
    798823  // returns the ideal of length of polys
     
    888913}
    889914
    890 proc ex_shift()
     915/* EXAMPLES:
     916
     917//static proc ex_shift()
    891918{
    892919  LIB "freegb.lib";
     
    909936}
    910937
    911 proc test_shrink()
     938//static proc test_shrink()
    912939{
    913940  LIB "freegb.lib";
     
    936963}
    937964
    938 proc ex2()
     965//static proc ex2()
    939966{
    940967  option(prot);
     
    946973}
    947974
    948 proc ex_nonhomog()
     975//static proc ex_nonhomog()
    949976{
    950977  option(prot);
     
    964991}
    965992
    966 proc ex_nonhomog_comm()
     993//static proc ex_nonhomog_comm()
    967994{
    968995  option(prot);
     
    9741001}
    9751002
    976 proc ex_nonhomog_h()
     1003//static proc ex_nonhomog_h()
    9771004{
    9781005  option(prot);
     
    9841011}
    9851012
    986 proc ex_nonhomog_h2()
     1013//static proc ex_nonhomog_h2()
    9871014{
    9881015  option(prot);
     
    10031030
    10041031
    1005 proc ex_nonhomog_3()
     1032//static proc ex_nonhomog_3()
    10061033{
    10071034  option(prot);
     
    10221049}
    10231050
    1024 proc ex_densep_2()
     1051//static proc ex_densep_2()
    10251052{
    10261053  option(prot);
     
    10381065}
    10391066
     1067// END COMMENTED EXAMPLES
     1068
     1069*/
    10401070
    10411071// 1. form a new ring
     
    10461076// 6. return the result
    10471077
    1048 proc freegbold(list LM, int d)
     1078static proc freegbold(list LM, int d)
    10491079"USAGE:  freegbold(L, d);  L a list of modules, d an integer
    10501080RETURN:  ring
     
    13041334}
    13051335
    1306 proc sgb(ideal I, int d)
     1336static proc sgb(ideal I, int d)
    13071337{
    13081338  // new code
     
    13271357}
    13281358
    1329 
    1330 
    13311359static proc checkCeq()
    13321360{
     
    13421370}
    13431371
    1344 
    1345 proc exHom1()
     1372static proc exHom1()
    13461373{
    13471374  // we start with
     
    14201447}
    14211448
    1422 proc schur2-3()
     1449static proc schur2-3()
    14231450{
    14241451  // nonhomog:
     
    14301457
    14311458proc adem(int i, int j)
     1459"USAGE:  adem(i,j); i,j int
     1460RETURN:  ideal
     1461ASSUME: there are at least i+j variables in the basering
     1462PURPOSE: compute the ideal of Adem relations for i<2j in characteristic 0
     1463EXAMPLE: example adem; shows examples
     1464"
    14321465{
    14331466  // produces Adem relations for i<2j in char 0
     
    14961529 */
    14971530
    1498 proc adem2mod(int n)
    1499 {
    1500   // Adem rels modulo 2
    1501 }
    1502 
     1531  // Adem rels modulo 2 are interesting
     1532
     1533//static
    15031534proc stringpoly2lplace(string s)
    15041535{
     
    16471678}
    16481679
    1649 proc addplaces(list L)
     1680static proc addplaces(list L)
    16501681{
    16511682  // adds places to the list of strings
     
    16751706}
    16761707
     1708//static
    16771709proc sent2lplace(string s)
    16781710{
     
    16941726}
    16951727
    1696 proc testnumber(string s)
     1728static proc testnumber(string s)
    16971729{
    16981730  string t;
     
    18211853}
    18221854
    1823 proc strpower2rep(string s)
     1855static proc strpower2rep(string s)
    18241856{
    18251857  // makes x*x*x*x out of x^4 ., rep statys for repetitions
     
    19321964
    19331965proc Liebr(poly a, poly b, list #)
     1966"USAGE:  Liebr(a,b[,N]); a,b letterplace polynomials, N an optional integer
     1967RETURN:  poly
     1968PURPOSE: compute the Lie bracket [a,b] = ab - ba between letterplace polynomials
     1969NOTE: if N>1 is specified, then the left normed bracket [a,[...[a,b]]]] is computed.
     1970EXAMPLE: example Liebr; shows examples
     1971"
    19341972{
    19351973  // alias ppLiebr;
     
    19712009}
    19722010
    1973 proc pmLiebr(poly a, poly b)
     2011static proc pmLiebr(poly a, poly b)
    19742012{
    19752013  //  a poly, b mono
     
    19842022
    19852023//proc pshift(poly a, int i, int uptodeg, int lV)
    1986 proc pshift(poly a, int i)
     2024static proc pshift(poly a, int i)
    19872025{
    19882026  // shifts a monomial a by i
     
    19912029}
    19922030
    1993 proc mmLiebr(poly a, poly b)
     2031static proc mmLiebr(poly a, poly b)
    19942032{
    19952033  // a,b, monomials
     
    20162054
    20172055proc Serre(intmat A, int zu)
     2056"USAGE:  Serre(A,z); A an intmat, z an int
     2057RETURN:  ideal
     2058ASSUME: basering has a letterplace ring structure and
     2059@*    A is a generalized Cartan matrix with integer entries
     2060PURPOSE: compute the ideal of Serre's relations associated to A
     2061EXAMPLE: example Serre; shows examples
     2062"
    20182063{
    20192064  // zu = 1 -> with commutators [f_i,f_j]; zu == 0 without them
     
    20232068  int ppl = printlevel-voice+2;
    20242069  int n = ncols(A); // hence n variables
    2025   int i,j,k,l;
     2070  int i,j,k,el;
    20262071  poly p,q;
    20272072  ideal I;
     
    20302075    for (j=1; j<=n; j++)
    20312076    {
    2032       l = 1 - A[i,j];
     2077      el = 1 - A[i,j];
    20332078      //     printf("i:%s, j: %s, l: %s",i,j,l);
    2034       dbprint(ppl,"i, j, l: ",i,j,l);
     2079      dbprint(ppl,"i, j, l: ",i,j,el);
    20352080      //      if ((i!=j) && (l >0))
    20362081      //      if ( (i!=j) &&  ( ((zu ==0) &&  (l >=2)) || ((zu ==1) &&  (l >=1)) ) )
    2037       if ((i!=j) && (l >0))
     2082      if ((i!=j) && (el >0))
    20382083      {
    20392084        q = Liebr(var(j),var(i));
    2040         //        printf("first bracket: %s",q);
    20412085        dbprint(ppl,"first bracket: ",q);
    20422086        //        if (l >=2)
    20432087        //        {
    2044           for (k=1; k<=l-1; k++)
     2088          for (k=1; k<=el-1; k++)
    20452089          {
    20462090            q = Liebr(var(j),q);
    2047             //            printf("further bracket: %s",q);
    20482091            dbprint(ppl,"further bracket:",q);
    20492092          }
     
    20592102{
    20602103  "EXAMPLE:"; echo = 2;
    2061   intmat A[2][2] = 2, -1, -1, 2; // sl_3 == A_2
    2062   ring r = 0,(f1,f2),dp;
    2063   int uptodeg = 3; int lV = 2;
     2104  intmat A[3][3] = 
     2105    2, -1, 0,
     2106    -1, 2, -3,
     2107    0, -1, 2; // G^1_2 Cartan matrix
     2108  ring r = 0,(f1,f2,f3),dp;
     2109  int uptodeg = 5; int lV = 3;
    20642110  export uptodeg; export lV;
    20652111  def R = freegbRing(uptodeg);
    20662112  setring R;
    2067   ideal I = Serre(A,1);
     2113  ideal I = Serre(A,1); I = simplify(I,1+2+8);
    20682114  I;
    2069   Serre(A,0);
    2070 }
     2115}
     2116
     2117/* setup for older example:
     2118  intmat A[2][2] = 2, -1, -1, 2; // sl_3 == A_2
     2119  ring r = 0,(f1,f2),dp;
     2120  int uptodeg = 5; int lV = 2;
     2121*/
    20712122
    20722123proc lp2lstr(ideal K, def save)
    2073 "USAGE:  lp2lstr(K,save); K an ideal, save a ring
    2074 RETURN:  nothing (exports object LN into save)
    2075 PURPOSE: converts letter-place ideal to list of modules
     2124"USAGE:  lp2lstr(K,s); K an ideal, s a ring
     2125RETURN:  nothing (exports object LN into s)
     2126ASSUME: basering has a letterplace ring structure
     2127PURPOSE: converts letterplace ideal to list of modules
     2128NOTE: useful as preprocessing to 'lst2str'
    20762129EXAMPLE: example lp2lstr; shows examples
    20772130"
     
    22302283
    22312284proc file2lplace(string fname)
     2285"USAGE:  file2lplace(fnm);  fnm a string
     2286RETURN:  ideal
     2287PURPOSE: convert the contents of the file fnm into ideal of polynomials in free algebra
     2288EXAMPLE: example file2lplace; shows examples
     2289"
    22322290{
    22332291  // format: from the usual string to letterplace
     
    22872345}
    22882346
    2289 static proc get_ls3nilp()
     2347/* EXAMPLES AGAIN:
     2348//static proc get_ls3nilp()
    22902349{
    22912350//first app of file2lplace
     
    23012360}
    23022361
    2303 static proc doc_example
     2362//static proc doc_example()
    23042363{
    23052364  LIB "freegb.lib";
     
    23182377}
    23192378
    2320 
     2379*/
    23212380
    23222381// TODO:
  • kernel/kstd2.cc

    rcd7c3e1 rdb0c264  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd2.cc,v 1.78 2008-12-10 19:48:51 levandov Exp $ */
     4/* $Id: kstd2.cc,v 1.79 2008-12-26 18:15:40 levandov Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
     
    16601660  /* check whether the ideal is in V */
    16611661
    1662   if (0)
    1663   //  if (! ideal_isInV(I,lVblock) )
     1662//  if (0)
     1663  if (! ideal_isInV(I,lVblock) )
    16641664  {
    16651665    WerrorS("The input ideal contains incorrectly encoded elements! ");
Note: See TracChangeset for help on using the changeset viewer.