Changeset db0c264 in git
- Timestamp:
- Dec 26, 2008, 7:15:40 PM (14 years ago)
- Branches:
- (u'spielwiese', '91fdef05f09f54b8d58d92a472e9c4a43aa4656f')
- Children:
- 71f00c5a36fdd606bb3fc447fc1a8f2b52ad9bad
- Parents:
- cd7c3e1402405720676241fb8f28bc815d655626
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/freegb.lib
rcd7c3e1 rdb0c264 1 1 ////////////////////////////////////////////////////////////////////////////// 2 version="$Id: freegb.lib,v 1.1 2 2008-10-06 17:04:27 SingularExp $";2 version="$Id: freegb.lib,v 1.13 2008-12-26 18:15:40 levandov Exp $"; 3 3 category="Noncommutative"; 4 4 info=" … … 7 7 8 8 PROCEDURES: 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 9 freegbRing(d); creates a ring with d blocks of shifted original variables 10 freegbasis(L, int n); compute two-sided Groebner basis of ideal, encoded via L, up to degree n 11 12 AUXILIARY PROCEDURES: 13 14 lp2lstr(K, s); convert letter-place ideal to a list of modules 15 lst2str(L[, n]); convert a list (of modules) into polynomials in free algebra 16 mod2str(M[, n]); convert a module into a polynomial in free algebra 17 vct2str(M[, n]); convert a vector into a word in free algebra 18 Liebr(a,b[, N]); compute Lie bracket ab-ba of two letterplace polynomials 19 Serre(A,z); compute the ideal of Serre's relations associated to a generalized Cartan matrix A 20 isVar(p); check whether p is a power of a single variable 21 22 SEE ALSO: User manual, section Noncommutative Subsystem, subsection Letterplace 18 23 " 19 24 … … 28 33 LIB "qhmoduli.lib"; // for Max 29 34 35 proc 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 30 49 31 50 // obsolete? 32 51 33 proc lshift(module M, int s, string varing, def lpring)52 static proc lshift(module M, int s, string varing, def lpring) 34 53 { 35 54 // FINALLY IMPLEMENTED AS A PART OT THE CODE … … 76 95 } 77 96 78 proc skip0(vector v)97 static proc skip0(vector v) 79 98 { 80 99 // skips zeros in a vector, producing another vector … … 224 243 for (i=1; i<=s-1; i++) 225 244 { 226 p = IsVar(v[i+1]);245 p = isVar(v[i+1]); 227 246 if (p==0) 228 247 { … … 288 307 } 289 308 290 proc IsVar(poly p) 309 proc isVar(poly p) 310 "USAGE: isVar(p); poly p 311 RETURN: int 312 PURPOSE: 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. 314 EXAMPLE: example isVar; shows examples 315 " 291 316 { 292 317 // checks whether p is a variable indeed … … 317 342 ring r = 0,(x,y),dp; 318 343 poly f = xy+1; 319 IsVar(f);344 isVar(f); 320 345 poly g = xy; 321 IsVar(g);346 isVar(g); 322 347 poly h = y^3; 323 IsVar(h);348 isVar(h); 324 349 poly i = 1; 325 IsVar(i);350 isVar(i); 326 351 } 327 352 328 353 // new conversion routines 329 354 330 proc id2words(ideal I, int d)355 static proc id2words(ideal I, int d) 331 356 { 332 357 // NOT FINISHED … … 371 396 } 372 397 373 proc mono2word(poly p, int d)398 static proc mono2word(poly p, int d) 374 399 { 375 400 } … … 645 670 } 646 671 647 proc crs(list LM, int d)672 static proc crs(list LM, int d) 648 673 "USAGE: crs(L, d); L a list of modules, d an integer 649 674 RETURN: ring … … 794 819 } 795 820 796 proc polylen(ideal I)821 static proc polylen(ideal I) 797 822 { 798 823 // returns the ideal of length of polys … … 888 913 } 889 914 890 proc ex_shift() 915 /* EXAMPLES: 916 917 //static proc ex_shift() 891 918 { 892 919 LIB "freegb.lib"; … … 909 936 } 910 937 911 proc test_shrink()938 //static proc test_shrink() 912 939 { 913 940 LIB "freegb.lib"; … … 936 963 } 937 964 938 proc ex2()965 //static proc ex2() 939 966 { 940 967 option(prot); … … 946 973 } 947 974 948 proc ex_nonhomog()975 //static proc ex_nonhomog() 949 976 { 950 977 option(prot); … … 964 991 } 965 992 966 proc ex_nonhomog_comm()993 //static proc ex_nonhomog_comm() 967 994 { 968 995 option(prot); … … 974 1001 } 975 1002 976 proc ex_nonhomog_h()1003 //static proc ex_nonhomog_h() 977 1004 { 978 1005 option(prot); … … 984 1011 } 985 1012 986 proc ex_nonhomog_h2()1013 //static proc ex_nonhomog_h2() 987 1014 { 988 1015 option(prot); … … 1003 1030 1004 1031 1005 proc ex_nonhomog_3()1032 //static proc ex_nonhomog_3() 1006 1033 { 1007 1034 option(prot); … … 1022 1049 } 1023 1050 1024 proc ex_densep_2()1051 //static proc ex_densep_2() 1025 1052 { 1026 1053 option(prot); … … 1038 1065 } 1039 1066 1067 // END COMMENTED EXAMPLES 1068 1069 */ 1040 1070 1041 1071 // 1. form a new ring … … 1046 1076 // 6. return the result 1047 1077 1048 proc freegbold(list LM, int d)1078 static proc freegbold(list LM, int d) 1049 1079 "USAGE: freegbold(L, d); L a list of modules, d an integer 1050 1080 RETURN: ring … … 1304 1334 } 1305 1335 1306 proc sgb(ideal I, int d)1336 static proc sgb(ideal I, int d) 1307 1337 { 1308 1338 // new code … … 1327 1357 } 1328 1358 1329 1330 1331 1359 static proc checkCeq() 1332 1360 { … … 1342 1370 } 1343 1371 1344 1345 proc exHom1() 1372 static proc exHom1() 1346 1373 { 1347 1374 // we start with … … 1420 1447 } 1421 1448 1422 proc schur2-3()1449 static proc schur2-3() 1423 1450 { 1424 1451 // nonhomog: … … 1430 1457 1431 1458 proc adem(int i, int j) 1459 "USAGE: adem(i,j); i,j int 1460 RETURN: ideal 1461 ASSUME: there are at least i+j variables in the basering 1462 PURPOSE: compute the ideal of Adem relations for i<2j in characteristic 0 1463 EXAMPLE: example adem; shows examples 1464 " 1432 1465 { 1433 1466 // produces Adem relations for i<2j in char 0 … … 1496 1529 */ 1497 1530 1498 proc adem2mod(int n) 1499 { 1500 // Adem rels modulo 2 1501 } 1502 1531 // Adem rels modulo 2 are interesting 1532 1533 //static 1503 1534 proc stringpoly2lplace(string s) 1504 1535 { … … 1647 1678 } 1648 1679 1649 proc addplaces(list L)1680 static proc addplaces(list L) 1650 1681 { 1651 1682 // adds places to the list of strings … … 1675 1706 } 1676 1707 1708 //static 1677 1709 proc sent2lplace(string s) 1678 1710 { … … 1694 1726 } 1695 1727 1696 proc testnumber(string s)1728 static proc testnumber(string s) 1697 1729 { 1698 1730 string t; … … 1821 1853 } 1822 1854 1823 proc strpower2rep(string s)1855 static proc strpower2rep(string s) 1824 1856 { 1825 1857 // makes x*x*x*x out of x^4 ., rep statys for repetitions … … 1932 1964 1933 1965 proc Liebr(poly a, poly b, list #) 1966 "USAGE: Liebr(a,b[,N]); a,b letterplace polynomials, N an optional integer 1967 RETURN: poly 1968 PURPOSE: compute the Lie bracket [a,b] = ab - ba between letterplace polynomials 1969 NOTE: if N>1 is specified, then the left normed bracket [a,[...[a,b]]]] is computed. 1970 EXAMPLE: example Liebr; shows examples 1971 " 1934 1972 { 1935 1973 // alias ppLiebr; … … 1971 2009 } 1972 2010 1973 proc pmLiebr(poly a, poly b)2011 static proc pmLiebr(poly a, poly b) 1974 2012 { 1975 2013 // a poly, b mono … … 1984 2022 1985 2023 //proc pshift(poly a, int i, int uptodeg, int lV) 1986 proc pshift(poly a, int i)2024 static proc pshift(poly a, int i) 1987 2025 { 1988 2026 // shifts a monomial a by i … … 1991 2029 } 1992 2030 1993 proc mmLiebr(poly a, poly b)2031 static proc mmLiebr(poly a, poly b) 1994 2032 { 1995 2033 // a,b, monomials … … 2016 2054 2017 2055 proc Serre(intmat A, int zu) 2056 "USAGE: Serre(A,z); A an intmat, z an int 2057 RETURN: ideal 2058 ASSUME: basering has a letterplace ring structure and 2059 @* A is a generalized Cartan matrix with integer entries 2060 PURPOSE: compute the ideal of Serre's relations associated to A 2061 EXAMPLE: example Serre; shows examples 2062 " 2018 2063 { 2019 2064 // zu = 1 -> with commutators [f_i,f_j]; zu == 0 without them … … 2023 2068 int ppl = printlevel-voice+2; 2024 2069 int n = ncols(A); // hence n variables 2025 int i,j,k, l;2070 int i,j,k,el; 2026 2071 poly p,q; 2027 2072 ideal I; … … 2030 2075 for (j=1; j<=n; j++) 2031 2076 { 2032 l = 1 - A[i,j];2077 el = 1 - A[i,j]; 2033 2078 // 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); 2035 2080 // if ((i!=j) && (l >0)) 2036 2081 // if ( (i!=j) && ( ((zu ==0) && (l >=2)) || ((zu ==1) && (l >=1)) ) ) 2037 if ((i!=j) && ( l >0))2082 if ((i!=j) && (el >0)) 2038 2083 { 2039 2084 q = Liebr(var(j),var(i)); 2040 // printf("first bracket: %s",q);2041 2085 dbprint(ppl,"first bracket: ",q); 2042 2086 // if (l >=2) 2043 2087 // { 2044 for (k=1; k<= l-1; k++)2088 for (k=1; k<=el-1; k++) 2045 2089 { 2046 2090 q = Liebr(var(j),q); 2047 // printf("further bracket: %s",q);2048 2091 dbprint(ppl,"further bracket:",q); 2049 2092 } … … 2059 2102 { 2060 2103 "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; 2064 2110 export uptodeg; export lV; 2065 2111 def R = freegbRing(uptodeg); 2066 2112 setring R; 2067 ideal I = Serre(A,1); 2113 ideal I = Serre(A,1); I = simplify(I,1+2+8); 2068 2114 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 */ 2071 2122 2072 2123 proc 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 2125 RETURN: nothing (exports object LN into s) 2126 ASSUME: basering has a letterplace ring structure 2127 PURPOSE: converts letterplace ideal to list of modules 2128 NOTE: useful as preprocessing to 'lst2str' 2076 2129 EXAMPLE: example lp2lstr; shows examples 2077 2130 " … … 2230 2283 2231 2284 proc file2lplace(string fname) 2285 "USAGE: file2lplace(fnm); fnm a string 2286 RETURN: ideal 2287 PURPOSE: convert the contents of the file fnm into ideal of polynomials in free algebra 2288 EXAMPLE: example file2lplace; shows examples 2289 " 2232 2290 { 2233 2291 // format: from the usual string to letterplace … … 2287 2345 } 2288 2346 2289 static proc get_ls3nilp() 2347 /* EXAMPLES AGAIN: 2348 //static proc get_ls3nilp() 2290 2349 { 2291 2350 //first app of file2lplace … … 2301 2360 } 2302 2361 2303 static proc doc_example 2362 //static proc doc_example() 2304 2363 { 2305 2364 LIB "freegb.lib"; … … 2318 2377 } 2319 2378 2320 2379 */ 2321 2380 2322 2381 // TODO: -
kernel/kstd2.cc
rcd7c3e1 rdb0c264 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.7 8 2008-12-10 19:48:51levandov Exp $ */4 /* $Id: kstd2.cc,v 1.79 2008-12-26 18:15:40 levandov Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 1660 1660 /* check whether the ideal is in V */ 1661 1661 1662 if (0)1663 //if (! ideal_isInV(I,lVblock) )1662 // if (0) 1663 if (! ideal_isInV(I,lVblock) ) 1664 1664 { 1665 1665 WerrorS("The input ideal contains incorrectly encoded elements! ");
Note: See TracChangeset
for help on using the changeset viewer.