Changeset 6691c7 in git
- Timestamp:
- Oct 15, 2010, 1:22:02 PM (14 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- fa932acebab34d79952f33e66135a857adfb0248
- Parents:
- a7856c6b936881a3ab41d46e27dbe1e57518bda6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/sagbi.lib
ra7856c r6691c7 3 3 category="Commutative Algebra"; 4 4 info=" 5 LIBRARY: sagbi.lib Compute SAGBI basis (subalgebra bases analogous to 6 Groebner bases for ideals) of a subalgebra 5 LIBRARY: sagbi.lib Compute SAGBI basis (subalgebra bases analogous to Groebner bases for ideals) of a subalgebra 7 6 AUTHORS: Jan Hackfeld, Jan.Hackfeld@rwth-aachen.de 8 7 Gerhard Pfister, pfister@mathematik.uni-kl.de … … 11 10 OVERVIEW: 12 11 SAGBI stands for 'subalgebra bases analogous to Groebner bases for ideals'. 13 It is an important tool in working with finitely presented subalgebras, 14 many properties of SAGBI bases are analogously important to Groebner bases 15 of ideals. Note, that due to absence of Noetherian property, SAGBI basis 16 of a finite number of generators of a subalgebra may be infinite. 17 Hence we provide procedures, which perform a given number of steps in 18 computations. 19 20 Guide: new implementations of sagbi, sagbiPart, sagbiReduce, sagbiSPoly 21 as well as algebraicDependence by Jan Hackfeld do not support computations 22 over a quotient ring yet. On the contrary, sagbiReduction and sagbiNF do 23 work over any ring. 12 SAGBI bases provide important tools for working with finitely presented 13 subalgebras of a polynomial ring. Note that in contrast to Groebner 14 bases, SAGBI bases may be infinite. 15 16 REFERENCES: 17 Ana Bravo: Some Facts About Canonical Subalgebra Bases, 18 MSRI Publications 51, p. 247-254 24 19 25 20 PROCEDURES: 26 sagbiSPoly(A [,r,m]); computes SAGBI S-polynomials of A 27 sagbiNF(id,dom,k[,n]); computes SAGBI normal form of id wrt dom 21 sagbiSPoly(A [,r,m]); computes SAGBI S-polynomials of A 28 22 sagbiReduce(I,A [,t,mt]); performs subalgebra reduction of I by A 29 sagbiReduction(I,A [,n]); performs subalgebra reduction of I by A in a 30 quotient ring 31 sagbi(A [,m,t]); computes SAGBI basis for A 32 sagbiPart(A,k[,m]); computes partial SAGBI basis for A 33 algebraicDependence(I,it); performs iterations of SAGBI for algebraic 34 dependencies of I 23 sagbi(A [,m,t]); computes SAGBI basis for A 24 sagbiPart(A,k[,m]); computes partial SAGBI basis for A 25 algebraicDependence(I,it); performs iterations of SAGBI for algebraic dependencies of I 35 26 36 27 SEE ALSO: algebra_lib 37 28 "; 38 29 39 40 //AUXILIARY PROCEDURES: 41 //uniqueVariableName(s) adds character "@" at the beginning of 42 // string s until this is a unique new 43 // variable name 44 //extendRing(r, ...) creates a new ring, which is an extension 45 // of r 46 //stdKernPhi(kernNew, kernOld,...) computes Groebner basis of kernNew+kernOld 47 //spolynomialsGB(A,...) computes the SAGBI S-polynomials of the 48 // subalgebra defined by the generators in A 49 // using Groebner bases 50 //spolynomialsToric(A) computes the SAGBI S-polynomials of the 51 // subalgebra defined by the generators in A 52 // using toric.lib 53 //reductionGB(ideal F, ideal A,....) performs subalgebra reduction of F by A 54 //reduceByMonomials(A) performs subalgebra reduction of all 55 // polynomials in A by the subset of 56 // monomials 57 58 LIB "elim.lib"; //for nselect 59 LIB "toric.lib"; //for toric_ideal 30 LIB "elim.lib"; 31 LIB "toric.lib"; 60 32 LIB "algebra.lib"; 61 33 ////////////////////////////////////////////////////////////////////////////// 62 34 63 64 //static65 proc tst_sagbi()66 {67 example sagbiSPoly;68 example sagbiNF;69 example sagbiReduce;70 example sagbiReduction;71 example sagbi;72 example sagbiPart;73 example algebraicDependence;74 }75 76 35 static proc assumeQring() 77 36 { … … 85 44 static proc uniqueVariableName (string variableName) 86 45 { 87 //Adds character "@" at the beginning of variableName until this name is 88 //unique (not contained in the names of the ring variables or description 89 //of the coefficient field) 46 //Adds character "@" at the beginning of variableName until this name ist unique 47 //(not contained in the names of the ring variables or description of the coefficient field) 90 48 string ringVars = charstr(basering) + "," + varstr(basering); 91 49 while (find(ringVars,variableName) <> 0) … … 97 55 98 56 static proc extendRing(r, ideal leadTermsAlgebra, int method) { 99 /* Extends ring r with additional variables. If k=ncols(leadTermsAlgebra) 100 * and r contains already m additional variables @y, the procedure adds101 * k-m variables@y(m+1)...@y(k) to the ring.57 /* Extends ring r with additional variables. If k=ncols(leadTermsAlgebra) and 58 * r contains already m additional variables @y, the procedure adds k-m variables 59 * @y(m+1)...@y(k) to the ring. 102 60 * The monomial ordering of the extended ring depends on method. 103 * Important: When calling this function, the basering (where algebra is 104 * defined) has to be active 61 * Important: When calling this function, the basering (where algebra is defined) has to be active 105 62 */ 106 63 def br=basering; … … 108 65 ideal varsBasering=maxideal(1); 109 66 int numTotalAdditionalVars=ncols(leadTermsAlgebra); 110 string variableName=uniqueVariableName("@y"); //get a variable name 111 //different from existing 112 //variables 113 114 //-------- extend current baserring r with new variables @y, one for each 115 // new element in ideal algebra ------------- 67 string variableName=uniqueVariableName("@y"); //get a variable name different from existing variables 68 69 //-------- extend current baserring r with new variables @y, one for each new element in ideal algebra ------------- 116 70 list l = ringlist(r); 117 71 for (i=nvars(r)-nvars(br)+1; i<=numTotalAdditionalVars;i++) … … 127 81 } 128 82 else 129 { //overwrite existing order for @y(i) to only get one block for 130 //the @y 83 { //overwrite existing order for @y(i) to only get one block for the @y 131 84 l[3][size(l[3])-1]=list("dp",intvec(1:numTotalAdditionalVars)); 132 85 } … … 142 95 143 96 144 static proc stdKernPhi(ideal kernNew, ideal kernOld, ideal leadTermsAlgebra, 145 int method) 146 { 147 /* Computes Groebner basis of kernNew+kernOld, where kernOld already is a 148 * Groebner basis and kernNew contains elements of the form 149 * @y(i)-leadTermsAlgebra[i] added to it. 97 static proc stdKernPhi(ideal kernNew, ideal kernOld, ideal leadTermsAlgebra,int method) 98 { 99 /* Computes Groebner basis of kernNew+kernOld, where kernOld already is a Groebner basis 100 * and kernNew contains elements of the form @y(i)-leadTermsAlgebra[i] added to it. 150 101 * The techniques chosen is specified by the integer method 151 102 */ … … 157 108 kern=kernOld+kernNew; 158 109 kern=std(kern); 159 //kern=std(kernOld,kernNew); //Found bug using this method. TODO Change 160 //if bug is removed 161 //this call of std return Groebner Basis of ideal kernNew+kernOld given 162 //that kernOld is a Groebner basis 110 //kern=std(kernOld,kernNew); //Found bug using this method. TODO Change if bug is removed 111 //this call of std return Groebner Basis of ideal kernNew+kernOld given that kernOld is a Groebner basis 163 112 } 164 113 if (method==1) … … 173 122 static proc spolynomialsGB(ideal algebra,r,int method) 174 123 { 175 /* This procedure does the actual S-polynomial calculation using Groebner 176 * basis methods and is called by the procedures sagbiSPoly, sagbi and 177 * sagbiPart. As this procedure is called at each step of the SAGBI 178 * construction algorithm, we can reuse the information already calculated 124 /* This procedure does the actual S-polynomial calculation using Groebner basis methods and is 125 * called by the procedures sagbiSPoly,sagbi and sagbiPart. As this procedure is called 126 * at each step of the SAGBI construction algorithm, we can reuse the information already calculated 179 127 * which is contained in the ring r. This is done in the following order 180 * 1. If r already contain m additional variables and m'=number of elements 181 * in algebra, extend r with variables @y(m+1),...,@y(m') 182 * 2. Transfer all objects to this ring, kernOld=kern is the Groebnerbasis 183 * already computed 184 * 3. Define ideal kernNew containing elements of the form 185 * leadTermsAlgebra(m+1)-@y(m+1),...,leadTermsAlgebra(m')-@y(m') 128 * 1. If r already contain m additional variables and m'=number of elements in algebra, extend r with variables @y(m+1),...,@y(m') 129 * 2. Transfer all objects to this ring, kernOld=kern is the Groebnerbasis already computed 130 * 3. Define ideal kernNew containing elements of the form leadTermsAlgebra(m+1)-@y(m+1),...,leadTermsAlgebra(m')-@y(m') 186 131 * 4. Compute Groebnerbasis of kernOld+kernNew 187 132 * 5. Compute the new algebraic relations … … 190 135 ideal varsBasering=maxideal(1); 191 136 ideal leadTermsAlgebra=lead(algebra); 192 //save leading terms as ordering in ring extension may not be compatible 193 //with ordering in basering 137 //save leading terms as ordering in ring extension may not be compatible with ordering in basering 194 138 int numGenerators=ncols(algebra); 195 139 196 def rNew=extendRing(r,leadTermsAlgebra,method); // important: br has to be 197 // active here 140 def rNew=extendRing(r,leadTermsAlgebra,method); // important: br has to be active here 198 141 setring r; 199 if (!defined(kern)) // only true for first run of spolynomialGB in sagbi 200 // construction algorithms 142 if (!defined(kern)) //only true for first run of spolynomialGB in sagbi construction algorithms 201 143 { 202 144 ideal kern=0; … … 204 146 } 205 147 setring rNew; 206 //-------------------------- transfer object to new ring rNew --------------- 148 //-------------------------- transfer object to new ring rNew ---------------------------------------- 207 149 ideal varsBasering=fetch(br,varsBasering); 208 150 ideal kernOld,algebraicRelationsOld; 209 kernOld=fetch(r,kern); //kern is Groebner basis of the kernel of the map 210 //Phi:r->K[x_1,...,x_n], x(i)->x(i),@y(i) 211 // ->leadTermsAlgebra(i) 151 kernOld=fetch(r,kern); //kern is Groebner basis of the kernel of the map Phi:r->K[x_1,...,x_n], x(i)->x(i), @y(i)->leadTermsAlgebra(i) 212 152 algebraicRelationsOld=fetch(r,algebraicRelations); 213 153 ideal leadTermsAlgebra=fetch(br,leadTermsAlgebra); 214 154 ideal listOfVariables=maxideal(1); 215 //-----------------------define kernNew containing elements to be added to 216 // the ideal kern ------------- 155 //-----------------------define kernNew containing elements to be added to the ideal kern ------------- 217 156 ideal kernNew; 218 157 for (int i=nvars(r)-nvars(br)+1; i<=numGenerators; i++) 219 158 { 220 kernNew[i-nvars(r)+nvars(br)]= 221 leadTermsAlgebra[i]-listOfVariables[i+nvars(br)]; 222 } 223 //-------------------------- calulate kernel of Phi depending on method 224 // choosen ----------------------- 159 kernNew[i-nvars(r)+nvars(br)]=leadTermsAlgebra[i]-listOfVariables[i+nvars(br)]; 160 } 161 //-------------------------- calulate kernel of Phi depending on method choosen ----------------------- 225 162 226 163 attrib(kernOld,"isSB",1); 227 164 ideal kern=stdKernPhi(kernNew,kernOld,leadTermsAlgebra,method); 228 //-------------------------- calulate algebraic relations ------------------- 165 //-------------------------- calulate algebraic relations ----------------------- 229 166 ideal algebraicRelations=nselect(kern,1..nvars(br)); 230 167 attrib(algebraicRelationsOld,"isSB",1); 231 168 ideal algebraicRelationsNew=reduce(algebraicRelations,algebraicRelationsOld); 232 /* algebraicRelationsOld is a groebner basis by construction (as 233 * variable ordering is block ordering we have an elemination 234 * ordering for the varsBasering) 169 /* algebraicRelationsOld is a groebner basis by construction (as variable ordering is 170 * block ordering we have an elemination ordering for the varsBasering) 235 171 * Therefore, to only get the new algebraic relations, calculate 236 * <algebraicRelations>\<algebraicRelationsOld> using groebner 237 * reduction 172 * <algebraicRelations>\<algebraicRelationsOld> using groebner reduction 238 173 */ 239 174 kill kernOld,kernNew,algebraicRelationsOld,listOfVariables; … … 244 179 245 180 static proc spolynomialsToric(ideal algebra) { 246 /* This procedure does the actual S-polynomial calculation using toric.lib 247 * forcomputation of a Groebner basis for the toric ideal kern(phi), where181 /* This procedure does the actual S-polynomial calculation using toric.lib for 182 * computation of a Groebner basis for the toric ideal kern(phi), where 248 183 * phi:K[y_1,...,y_m]->K[x_1,...,x_n], y_i->leadmonom(algebra[i]) 249 184 * By suitable substitutions we obtain the kernel of the map … … 269 204 } 270 205 } 271 //The columns of the matrix A are now the exponent vectors of the leadings 272 //monomials in algebra. 206 //The columns of the matrix A are now the exponent vectors of the leadings monomials in algebra. 273 207 intmat A[n][m]=intmat(tempVec,n,m); 274 208 //Create the preimage ring K[@y(1),...,@y(m)], where m=ncols(algebra). … … 291 225 if (leadCoefficients[i]!=0) 292 226 { 293 algebraicRelations=subst(algebraicRelations,var(i), 294 1/leadCoefficients[i]*var(i)); 227 algebraicRelations=subst(algebraicRelations,var(i),1/leadCoefficients[i]*var(i)); 295 228 } 296 229 } … … 300 233 301 234 302 static proc reductionGB(ideal F, ideal algebra,r, int tailreduction, 303 int method,int parRed) 304 { 305 /* This procedure does the actual SAGBI/subalgebra reduction using Groebner 306 * basis methods and is called by the procedures sagbiReduce, sagbi and 307 * sagbiPart 308 * If r already is an extension of the basering and contains the ideal kern 309 * needed for the subalgebra reduction, the reduction can be started 310 * directly, at each reduction step using the fact that 235 static proc reductionGB(ideal F, ideal algebra,r, int tailreduction,int method,int parRed) 236 { 237 /* This procedure does the actual SAGBI/subalgebra reduction using Groebner basis methods and is 238 * called by the procedures sagbiReduce,sagbi and sagbiPart 239 * If r already is an extension of the basering and contains the ideal kern needed for the subalgebra reduction, 240 * the reduction can be started directly, at each reduction step using the fact that 311 241 * p=reduce(leadF,kern) in K[@y(1),...,@y(m)] <=> leadF in K[lead(algebra)] 312 242 * Otherwise some precomputation has to be done, outlined below. … … 319 249 if (numVarsBasering==nvars(r)) 320 250 { 321 /* Case that ring r is the same ring as the basering. Using proc 322 * extendRing, stdKernPhi one construct the extension of the current 323 * baserring with new variables @y, one for each element in ideal algebra 324 * and calculates the kernel of Phi, where 325 * Phi: r---->br, x_i-->x_i, y_i-->f_i, algebra={f_1,...f_m}, 326 * br=K[x1,...,x_n] und r=K[x1,...x_n,@y1,...@y_m] 327 * This is similarly done (however step by step for each run of the 328 * SAGBI construction algorithm) in the procedure spolynomialsGB 251 /* Case that ring r is the same ring as the basering. Using proc extendRing, stdKernPhi 252 * one construct the extension of the current baserring with new variables @y, one for each element 253 * in ideal algebra and calculates the kernel of Phi, where 254 * Phi: r---->br, x_i-->x_i, y_i-->f_i, algebra={f_1,...f_m}, br=K[x1,...,x_n] und r=K[x1,...x_n,@y1,...@y_m] 255 * This is similarly done (however step by step for each run of the SAGBI construction algorithm) in the procedure spolynomialsGB 329 256 */ 330 257 ideal leadTermsAlgebra=lead(algebra); … … 348 275 poly p,normalform,leadF; 349 276 intvec tempExp; 350 //------------------algebraic reduction for each polynomial F[i] ------------ 277 //------------------algebraic reduction for each polynomial F[i] --------------------------------------- 351 278 for (i=1; i<=ncols(F);i++) 352 279 { … … 355 282 { 356 283 leadF=lead(F[i]); 357 if(leadmonom(leadF)==1) { //K is always contained in the subalgebra, 358 //thus the remainder is zero in this case 284 if(leadmonom(leadF)==1) { //K is always contained in the subalgebra, thus the remainder is zero in this case 359 285 if (parRed) { break; } 360 286 else { F[i]=0; break; } 361 287 } 362 //note: as the ordering in br and r might not be compatible it can be 363 //that lead(F[i]) in r is different from lead(F[i]) in br. To take the 364 //"correct" leading term therefore take lead(F[i]) in br and transfer 365 //it to the extension r 288 //note: as the ordering in br and r might not be compatible it can be that lead(F[i]) in r is 289 //different from lead(F[i]) in br. To take the "correct" leading term therefore take lead(F[i]) 290 //in br and transfer it to the extension r 366 291 setring r; 367 292 leadF=fetch(br,leadF); 368 293 p=reduce(leadF,kern); 369 294 if (leadmonom(p)<varsBasering[numVarsBasering]) 370 { //as choosen ordering is a block ordering, 371 //lm(p) in K[y_1...y_m] is equivalent to lm(p)<x_n 295 { //as choosen ordering is a block ordering, lm(p) in K[y_1...y_m] is equivalent to lm(p)<x_n 372 296 //Needs to be changed, if no block ordering is used! 373 297 setring br; … … 398 322 399 323 static proc reduceByMonomials(ideal algebra) 400 /* This procedures uses the sagbiReduce procedure to reduce all polynomials401 * in algebra, whichare not monomials, by the subset of all monomials.324 /*This procedures uses the sagbiReduce procedure to reduce all polynomials in algebra, which 325 * are not monomials, by the subset of all monomials. 402 326 */ 403 327 { … … 416 340 } 417 341 } 418 //Monomials now contains the subset of all monomials in algebra, algebra 419 //contains the non-monomials. 342 //Monomials now contains the subset of all monomials in algebra, algebra contains the non-monomials. 420 343 if(size(monomials)>0) 421 344 { … … 435 358 436 359 static proc sagbiConstruction(ideal algebra, int iterations, int tailreduction, int method,int parRed) 437 /* This procedure is the SAGBI construction algorithm and does the actual 438 * computation both for the procedure sagbi and sagbiPart. 439 * - If the sagbi procedure calls this procedure, iterations==-1 and this 440 * procedure only stops if all S-Polynomials reduce to zero (criterion for 441 * termination of SAGBI construction algorithm). 442 * - If the sagbiPart procedure calls this procedure, iterations>=0 and 443 * iterations specifies the number of iterations. A degree boundary is not 444 * used here. 445 * Note that parRed is used for testing a special modification and can be 446 * ignored (assume parRed==0). 360 /* This procedure is the SAGBI construction algorithm and does the actual computation both for 361 * the procedure sagbi and sagbiPart. 362 * - If the sagbi procedure calls this procedure, iterations==-1 and this procedure only stops 363 * if all S-Polynomials reduce to zero (criterion for termination of SAGBI construction algorithm). 364 * - If the sagbiPart procedure calls this procedure, iterations>=0 and iterations specifies the 365 * number of iterations. A degree boundary is not used here. 366 * Note that parRed is used for testing a special modification and can be ignored (assume parRed==0). 447 367 */ 448 368 { … … 464 384 iterations=1; 465 385 } 466 ideal P=1; //note: P is initialized this way, so that the while loop is 467 //entered. P gets overriden there, anyhow. 386 ideal P=1; //note: P is initialized this way, so that the while loop is entered. P gets overriden there, anyhow. 468 387 ideal varsBasering=maxideal(1); 469 388 map phi; … … 478 397 phi=r,varsBasering,algebra; 479 398 spolynomialsNew=simplify(phi(algebraicRelationsNew),6); 480 //By construction spolynomialsNew only contains the spolynomials, that 481 // have not alreadybeen calculated in the steps before.399 //By construction spolynomialsNew only contains the spolynomials, that have not already 400 //been calculated in the steps before. 482 401 P=reductionGB(spolynomialsNew,algebra,r,tailreduction,method,parRed); 483 402 if (parRed) … … 495 414 if (parRed==0) 496 415 { 497 P=reduceByMonomials(P); //Reducing with monomials is cheap and can 498 //only result in less terms 499 P=simplify(simplify(P,3),4); //Avoid that zeros are added to the bases 500 //or one element in P more than once 416 P=reduceByMonomials(P); //Reducing with monomials is cheap and can only result in less terms 417 P=simplify(simplify(P,3),4); //Avoid that zeros are added to the bases or one element in P more than once 501 418 } 502 419 else … … 504 421 P=simplify(P,6); 505 422 } 506 algebra=algebra,P; //Note that elements and order of elements must 507 //in algebra must not be changed, otherwise the 508 //already calculated 509 //ideal in r will give wrong results. Thus it is important to use a komma 510 //here. 423 algebra=algebra,P; //Note that elements and order of elements must in algebra must not be changed, otherwise the already calculated 424 //ideal in r will give wrong results. Thus it is important to use a komma here. 511 425 i=i+step; 512 426 } … … 516 430 { 517 431 dbprint(4-voice, 518 "//SAGBI construction algorithm terminated after " 519 +string(i-1)+" iterations, as all SAGBI S-polynomials reduced" 520 +" to 0. //Returned generators therefore are a SAGBI basis."); 432 "//SAGBI construction algorithm terminated after "+string(i-1)+" iterations, as all SAGBI S-polynomials reduced to 0. 433 //Returned generators therefore are a SAGBI basis."); 521 434 } 522 435 else 523 436 { 524 437 dbprint(4-voice, 525 "//SAGBI construction algorithm stopped as it reached the limit" 526 +" of "+string(iterations)+" iterations. //In general the" 527 +" returned generators are no SAGBI basis for the given" 528 +" algebra."); 438 "//SAGBI construction algorithm stopped as it reached the limit of "+string(iterations)+" iterations. 439 //In general the returned generators are no SAGBI basis for the given algebra."); 529 440 } 530 441 } … … 540 451 541 452 proc sagbiSPoly(ideal algebra,list #) 542 "USAGE: sagbiSPoly(A[, returnRing, meth]); A is an ideal, returnRing and 543 meth are integers. 453 "USAGE: sagbiSPoly(A[, returnRing, meth]); A is an ideal, returnRing and meth are integers. 544 454 RETURN: ideal or ring 545 455 ASSUME: basering is not a qring 546 PURPOSE: Returns SAGBI S-polynomials of the leading terms of given ideal A if 547 returnRing=0. 456 PURPOSE: Returns SAGBI S-polynomials of the leading terms of a given ideal A if returnRing=0. 548 457 @* Otherwise returns a new ring containing the ideals algebraicRelations 549 458 @* and spolynomials, where these objects are explained by their name. … … 649 558 PURPOSE: 650 559 @format 651 The optional argument tr=tailred determines whether tail reduction will 652 be performed. 560 The optional argument tr=tailred determines whether tail reduction will be performed. 653 561 - If (tailred=0), no tail reduction is done. 654 562 - If (tailred<>0), tail reduction is done. … … 732 640 ideal P=p1,p2; 733 641 //--------------------------------------------- 734 //SAGBI reduction of polynomial p1 by algebra A. Default call, that is, no 735 //tail-reduction is done. 642 //SAGBI reduction of polynomial p1 by algebra A. Default call, that is, no tail-reduction is done. 736 643 sagbiReduce(p1,A); 737 644 //--------------------------------------------- 738 //SAGBI reduction of set of polynomials P by algebra A, now tail-reduction 739 //is done. 645 //SAGBI reduction of set of polynomials P by algebra A, now tail-reduction is done. 740 646 sagbiReduce(P,A,1); 741 647 } … … 745 651 RETURN: ideal, a SAGBI basis for A 746 652 ASSUME: basering is not a qring 747 PURPOSE: Computes a SAGBI basis for the subalgebra given by the generators 748 in A. 653 PURPOSE: Computes a SAGBI basis for the subalgebra given by the generators in A. 749 654 @format 750 The optional argument tr=tailred determines whether tail reduction will 751 be performed. 655 The optional argument tr=tailred determines whether tail reduction will be performed. 752 656 - If (tailred=0), no tail reduction is performed, 753 657 - If (tailred<>0), tail reduction is performed. … … 812 716 RETURN: ideal 813 717 ASSUME: basering is not a qring 814 PURPOSE: Performs k iterations of the SAGBI construction algorithm for the 815 subalgebra given by the generators given by A. 718 PURPOSE: Performs k iterations of the SAGBI construction algorithm for the subalgebra given by the generators given by A. 816 719 @format 817 The optional argument tr=tailred determines if tail reduction will be 818 performed. 720 The optional argument tr=tailred determines if tail reduction will be performed. 819 721 - If (tailred=0), no tail reduction is performed, 820 722 - If (tailred<>0), tail reduction is performed. … … 890 792 RETURN: ring 891 793 ASSUME: basering is not a qring 892 PURPOSE: In @code{it} iterations, compute algebraic dependencies between 893 elements of I 794 PURPOSE: In @code{it} iterations, compute algebraic dependencies between elements of I 894 795 EXAMPLE: example algebraicDependence; shows an example" 895 796 { … … 1042 943 1043 944 //In quotient rings, SINGULAR, usually does not reduce polynomials w.r.t the 1044 //quotient ideal,therefore we should first reduce ,when it is necessary for 1045 // computations, to have a uniquely determined representant for each1046 // equivalent class,which is the case of this algorithm.945 //quotient ideal,therefore we should first reduce ,when it is necessary for computations, 946 // to have a uniquely determined representant for each equivalent 947 //class,which is the case of this algorithm. 1047 948 1048 949 if(b !=0) //means that the basering is a quotient ring … … 1096 997 1097 998 //------------- change the basering bsr to bsr[@(0),...,@(z)] ---------- 1098 execute("ring s=("+charstr(basering)+"),("+varstr(basering) 1099 +",@(0..z)),dp;"); 1100 // Ev hier die Reihenfolge der Vars aendern. Dazu muss unten aber 1101 // entsprechend geaendert werden: 1102 // execute("ring s="+charstr(basering)+",(@(0..z)," 1103 // +varstr(basering)+"),dp;"); 999 execute("ring s=("+charstr(basering)+"),("+varstr(basering)+",@(0..z)),dp;"); 1000 // Ev hier die Reihenfolge der Vars aendern. Dazu muss unten aber entsprechend 1001 // geaendert werden: 1002 // execute("ring s="+charstr(basering)+",(@(0..z),"+varstr(basering)+"),dp;"); 1104 1003 1105 1004 //constructs the leading ideal of dom=(p-@(0),dom[1]-@(1),...,dom[z]-@(z)) … … 1121 1020 if(choose==2) 1122 1021 { 1123 ideal kern= nselect(groebner(dom),1..n);//"nselect" is combinatorial 1124 // command which uses the internal1125 // command"simplify"1022 ideal kern= nselect(groebner(dom),1..n);//"nselect" is combinatorial command 1023 //which uses the internal command 1024 // "simplify" 1126 1025 } 1127 1026 … … 1170 1069 1171 1070 proc sagbiNF(id,ideal dom,int k,list#) 1172 "USAGE: sagbiNF(id,dom,k[,n]); id either poly or ideal,dom ideal, k and n 1173 positive intergers. 1071 "USAGE: sagbiNF(id,dom,k[,n]); id either poly or ideal,dom ideal, k and n positive intergers. 1174 1072 RETURN: same as type of id; ideal or polynomial. 1175 1073 PURPOSE:
Note: See TracChangeset
for help on using the changeset viewer.