Changeset 805b2d5 in git
- Timestamp:
- Mar 10, 2009, 7:15:13 PM (14 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 808b4e3d84e15799d00c2dbe5ac2b08aefa48d3f
- Parents:
- ecf319831bc643539b3751c9a97ccf85d1bca4df
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/freegb.lib
recf3198 r805b2d5 1 1 ////////////////////////////////////////////////////////////////////////////// 2 version="$Id: freegb.lib,v 1.1 8 2009-03-06 20:54:45levandov Exp $";2 version="$Id: freegb.lib,v 1.19 2009-03-10 18:15:13 levandov Exp $"; 3 3 category="Noncommutative"; 4 4 info=" … … 21 21 vct2str(M[, n]); convert a vector into a word in free algebra 22 22 lieBracket(a,b[, N]); compute Lie bracket ab-ba of two letterplace polynomials 23 serreRelations(A,z); 24 isVar(p); check whether p is a power of a single variable25 adem (i,j);compute the ideal of Adem relations for i<2j in char 023 serreRelations(A,z); compute the ideal of Serre's relations associated to a generalized Cartan matrix A 24 isVar(p); check whether p is a power of a single variable 25 ademRelations(i,j); compute the ideal of Adem relations for i<2j in char 0 26 26 27 27 SEE ALSO: LETTERPLACE … … 136 136 { 137 137 // skips zeros in a vector, producing another vector 138 if ( (v[1]==0) || (v==0) ) { return(vector(0)); } 138 139 int sv = nrows(v); 139 140 int sw = size(v); … … 170 171 if ( size(#)>0 ) 171 172 { 173 if ( typeof(#[1]) != "int") 174 { 175 ERROR("Second argument of type int expected"); 176 } 172 177 if (#[1]) 173 178 { … … 177 182 int i; 178 183 int s = size(L); 184 if (s<1) { return(list(""));} 179 185 list N; 180 186 for(i=1; i<=s; i++) … … 212 218 " 213 219 { 220 if (size(M)==0) { return(""); } 214 221 // returns a string 215 222 // a sentence in words built from M … … 218 225 if ( size(#)>0 ) 219 226 { 227 if ( typeof(#[1]) != "int") 228 { 229 ERROR("Second argument of type int expected"); 230 } 220 231 if (#[1]) 221 232 { … … 236 247 else 237 248 { 238 t = t + "+" + mp; 249 if (mp != "") 250 { 251 t = t + "+" + mp; 252 } 239 253 } 240 254 } … … 262 276 " 263 277 { 278 if (v==0) { return(""); } 264 279 // if #[1] = 1, use * between generators 265 280 int useStar = 0; … … 275 290 // produces a string for it 276 291 v = skip0(v); 292 if (v==0) { return(string(""));} 277 293 number cf = leadcoef(v[1]); 278 294 int s = size(v); … … 284 300 if (p==0) 285 301 { 286 err = "Error: monomial expected at" + string(i+1); 287 dbprint(ppl,err); 288 return("_"); 302 err = "Error: monomial expected at nonzero position " + string(i+1); 303 ERROR(err+" in vct2str"); 304 // dbprint(ppl,err); 305 // return("_"); 289 306 } 290 307 if (p==1) … … 324 341 { 325 342 scf = string(cf); 326 if ( cf == 1)343 if ( (cf == 1) && (size(vs)>0) ) 327 344 { 328 345 scf = ""; … … 348 365 "USAGE: isVar(p); poly p 349 366 RETURN: int 350 PURPOSE: check s whether p is a power of a single variable from the basering.351 @* Returns the exponent or 0 is p is not a power of a single variable.367 PURPOSE: check, whether leading monomial of p is a power of a single variable 368 @* from the basering. Returns the exponent or 0 if p is multivariate. 352 369 EXAMPLE: example isVar; shows examples 353 370 " … … 381 398 poly f = xy+1; 382 399 isVar(f); 383 poly g = xy;400 poly g = y^3; 384 401 isVar(g); 385 poly h = y^3;402 poly h = 7*x^3; 386 403 isVar(h); 387 404 poly i = 1; … … 1506 1523 end older procs and tests */ 1507 1524 1508 proc adem (int i, int j)1509 "USAGE: adem (i,j); i,j int1525 proc ademRelations(int i, int j) 1526 "USAGE: ademRelations(i,j); i,j int 1510 1527 RETURN: ring (and exports ideal) 1511 1528 ASSUME: there are at least i+j variables in the basering 1512 1529 PURPOSE: compute the ideal of Adem relations for i<2j in characteristic 0 1513 1530 @* the ideal is exported under the name AdemRel in the output ring 1514 EXAMPLE: example adem ; shows examples1531 EXAMPLE: example ademRelations; shows examples 1515 1532 " 1516 1533 { … … 1545 1562 { 1546 1563 "EXAMPLE:"; echo = 2; 1547 def A = adem (2,5);1564 def A = ademRelations(2,5); 1548 1565 setring A; 1549 1566 AdemRel; … … 2526 2543 return(0); 2527 2544 } 2545 2546 // alias libs for compatibility with older examples 2547 proc freegbRing(int d) 2548 { 2549 return(makeLetterplaceRing(d)); 2550 } 2551 2552 proc freegbasis( list L, int n) 2553 { 2554 return(freeGBasis(L, n)); 2555 }
Note: See TracChangeset
for help on using the changeset viewer.