Changeset 3c4dcc in git for Singular/LIB/involut.lib
- Timestamp:
- May 6, 2005, 4:39:20 PM (19 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 0d217d3f1cc4c0449bdb078c65fd1f43cd1a2b84
- Parents:
- e6fb5315eb32da00236163ce10f9bdafaaa0bd47
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/involut.lib
re6fb531 r3c4dcc 1 version="$Id: involut.lib,v 1. 3 2005-04-27 19:32:14 levandovExp $";1 version="$Id: involut.lib,v 1.4 2005-05-06 14:38:40 hannes Exp $"; 2 2 category="Noncommutative"; 3 3 info=" 4 LIBRARY: involution.lib Procedures for Computations and Operations with Involutions 4 LIBRARY: involution.lib Procedures for Computations and Operations with Involutions 5 5 AUTHORS: Oleksandr Iena, yena@mathematik.uni-kl.de, 6 6 @* Markus Becker, mbecker@mathematik.uni-kl.de, … … 32 32 EXAMPLE: example ncdetection; shows an example 33 33 "{ 34 // in this procedure an involution map is generated from the NCRelations 34 // in this procedure an involution map is generated from the NCRelations 35 35 // that will be used in the function involution 36 36 // in dieser proc. wird eine matrix erzeugt, die in der i-ten zeile die indices 37 37 // der differential-, shift- oder advance-operatoren enthaelt mit denen die i-te 38 // variable nicht kommutiert. 38 // variable nicht kommutiert. 39 39 int i,j,k,LExp; 40 40 int NVars = nvars(r); … … 42 42 intmat M[NVars][3]; 43 43 int NRows = nrows(rel); 44 intvec v,w; 44 intvec v,w; 45 45 poly d,d_lead; 46 46 ideal I; … … 53 53 continue; 54 54 } 55 for( i=1; i<j; i++ ) 55 for( i=1; i<j; i++ ) 56 56 { 57 57 if( rel[i,j]==1 ) //relation of type var(j)*var(i) = var(i)*var(j) +1 … … 125 125 { 126 126 I[M[i,1]] = -var(M[i,1]); 127 } 128 if( ( (M[i,2]!=0) && (M[i,3]==0) )|| ( (M[i,2]!=0) && (M[i,3]==0) ) 127 } 128 if( ( (M[i,2]!=0) && (M[i,3]==0) )|| ( (M[i,2]!=0) && (M[i,3]==0) ) 129 129 ) 130 130 { … … 143 143 { 144 144 I[i] = -var(i); 145 } 145 } 146 146 } 147 147 } … … 149 149 } 150 150 example 151 { 151 { 152 152 "EXAMPLE:"; echo = 2; 153 153 ring r=0,(x,y,z,D(1..3)),dp; … … 187 187 { 188 188 if (v[j]!=0) 189 { 189 { 190 190 pp = l[j]; 191 191 zz = zz*(pp^v[j]); 192 192 } 193 } 193 } 194 194 nn = nn + (leadcoef(mm[i])*zz); 195 i++; 195 i++; 196 196 } 197 197 return(nn); … … 216 216 { 217 217 if (v[j]!=0) 218 { 218 { 219 219 pp = l[j]; 220 220 zz = (pp^v[j])*zz; 221 221 } 222 } 222 } 223 223 nn = nn + (leadcoef(mm[i])*zz); 224 i++; 224 i++; 225 225 } 226 226 return(nn); … … 253 253 // { 254 254 // if (v[j]!=0) 255 // { 256 // p = var(j); 255 // { 256 // p = var(j); 257 257 // p = theta(p); 258 258 // z = z*(p^v[j]); 259 259 // } 260 // } 260 // } 261 261 // n = n + (leadcoef(m[i])*z); 262 // i++; 262 // i++; 263 263 // } 264 264 // return(n); … … 271 271 EXAMPLE: example involution; shows an example 272 272 "{ 273 // applies the involution map theta to m, 273 // applies the involution map theta to m, 274 274 // where m= vector, polynomial, module, matrix, ideal 275 275 int i,j; … … 278 278 if (typeof(m)=="poly") 279 279 { 280 return (invo_poly(m,theta)); 280 return (invo_poly(m,theta)); 281 281 } 282 282 if ( typeof(m)=="ideal" ) … … 286 286 { 287 287 n[i] = invo_poly(m[i], theta); 288 } 288 } 289 289 return(n); 290 290 } … … 295 295 m[i] = invo_poly(m[i], theta); 296 296 } 297 return (m); 297 return (m); 298 298 } 299 299 if ( (typeof(m)=="matrix") || (typeof(m)=="module")) 300 { 300 { 301 301 matrix n = matrix(m); 302 302 int @R=nrows(n); … … 306 306 for(j=1; j<=@C; j++) 307 307 { 308 309 310 311 308 if (m[i,j]!=0) 309 { 310 n[i,j] = invo_poly( m[i,j], theta); 311 } 312 312 } 313 313 } … … 326 326 } 327 327 example 328 { 328 { 329 329 "EXAMPLE:";echo = 2; 330 330 ring r = 0,(x,d),dp; … … 345 345 module IM = involution(M,F); 346 346 print(IM); 347 print(M - involution(IM,F)); 347 print(M - involution(IM,F)); 348 348 } 349 349 /////////////////////////////////////////////////////////////////////////////////// … … 362 362 { 363 363 s = s+ ","+NVAR(i,j); 364 }; 364 }; 365 365 }; 366 366 }; … … 400 400 }; 401 401 }; 402 return(Rel); 402 return(Rel); 403 403 }; 404 404 ///////////////////////////////////////////////////////////////// 405 405 proc find_invo() 406 "USAGE: find_invo(); 406 "USAGE: find_invo(); 407 407 PURPOSE: describes a variety of linear involutions on a basering 408 408 RETURN: a ring together with a list of pairs L, where 409 409 @* L[i][1] = Groebner Basis of an i-th associated prime, 410 410 @* L[i][2] = matrix, defining a linear map, with entries, reduced with respect to L[i][1] 411 NOTE: for convenience, the full ideal of relations @code{idJ} 411 NOTE: for convenience, the full ideal of relations @code{idJ} 412 412 and the initial matrix with indeterminates @code{matD} are exported in the output ring. 413 413 "{ … … 415 415 int NVars = nvars(@B); //number of variables in basering 416 416 int i, j; 417 417 418 418 matrix Rel = RelMatr(); //the matrix of relations 419 419 420 420 string s = new_var(); //string of new variables 421 421 string Par = parstr(@B); //string of parameters in old ring 422 422 423 423 if (Par=="") // if there are no parameters 424 { 424 { 425 425 execute("ring @@K=0,("+varstr(@B)+","+s+"), dp;"); //new ring with new variables 426 426 } 427 427 else //if there exist parameters 428 { 428 { 429 429 execute("ring @@K=(0,"+Par+") ,("+varstr(@B)+","+s+"), dp;");//new ring with new variables 430 430 }; 431 431 432 432 matrix Rel = imap(@B, Rel); //consider the matrix of relations in new ring 433 433 434 434 int Sz = NVars*NVars+NVars; // number of variables in new ring 435 435 436 436 matrix M[Sz][Sz]; //to be the matrix of relations in new ring 437 437 438 438 for(i=1; i<NVars; i++) //initialize that matrix of relations 439 439 { … … 443 443 }; 444 444 }; 445 445 446 446 ncalgebra(1, M); //now new ring @@K become a noncommutative ring 447 447 448 448 list l; //list to define an involution 449 449 poly @@F; … … 454 454 { 455 455 execute( "@@F = @@F+"+NVAR(i,j)+"*"+string( var(j) )+";" ); 456 }; 457 l=l+list(@@F); 458 }; 459 456 }; 457 l=l+list(@@F); 458 }; 459 460 460 matrix N = Rel; //imap(@B,Rel); 461 462 for(i=1; i<NVars; i++)//get matrix by applying the involution to relations 461 462 for(i=1; i<NVars; i++)//get matrix by applying the involution to relations 463 463 { 464 464 for(j=i+1; j<=NVars; j++) … … 470 470 //--------------------------------------------- 471 471 //get the ideal of coefficients of N 472 ideal J; 472 ideal J; 473 473 ideal idN = simplify(ideal(N),2); 474 474 J = ideal(coeffs( idN, var(1) ) ); 475 475 for(i=2; i<=NVars; i++) 476 476 { 477 J = ideal( coeffs( J, var(i) ) ); 477 J = ideal( coeffs( J, var(i) ) ); 478 478 }; 479 479 J = simplify(J,2); 480 480 //------------------------------------------------- 481 if ( Par=="" ) //initializes the ring of relations 481 if ( Par=="" ) //initializes the ring of relations 482 482 { 483 483 execute("ring @@KK=0,("+s+"), dp;"); … … 490 490 string snv = "["+string(NVars)+"]"; 491 491 execute("matrix @@D"+snv+snv+"="+s+";"); // matrix with entries=new variables 492 492 493 493 J = J, ideal( @@D*@@D-matrix( freemodule(NVars) ) ); // add the condition that involution to square is just identity 494 494 J = simplify(J,2); // without extra zeros 495 495 list mL = minAssGTZ(J); // components not in GB 496 int sL = size(mL); 496 int sL = size(mL); 497 497 option(redSB); // important for reduced GBs 498 498 option(redTail); … … 533 533 @* L[i][1] = Groebner Basis of an i-th associated prime, 534 534 @* L[i][2] = matrix, defining a linear map, with entries, reduced with respect to L[i][1] 535 NOTE: for convenience, the full ideal of relations @code{idJ} 535 NOTE: for convenience, the full ideal of relations @code{idJ} 536 536 and the initial matrix with indeterminates @code{matD} are exported in the output ring. 537 537 "{ … … 539 539 int NVars = nvars(@B); //number of variables in basering 540 540 int i, j; 541 541 542 542 matrix Rel = RelMatr(); //the matrix of relations 543 543 544 544 string s = new_var_special(); //string of new variables 545 545 string Par = parstr(@B); //string of parameters in old ring 546 546 547 547 if (Par=="") // if there are no parameters 548 { 548 { 549 549 execute("ring @@K=0,("+varstr(@B)+","+s+"), dp;"); //new ring with new variables 550 550 } 551 551 else //if there exist parameters 552 { 552 { 553 553 execute("ring @@K=(0,"+Par+") ,("+varstr(@B)+","+s+"), dp;");//new ring with new variables 554 554 }; 555 555 556 556 matrix Rel = imap(@B, Rel); //consider the matrix of relations in new ring 557 557 558 558 int Sz = 2*NVars; // number of variables in new ring 559 559 560 560 matrix M[Sz][Sz]; //to be the matrix of relations in new ring 561 561 for(i=1; i<NVars; i++) //initialize that matrix of relations … … 566 566 }; 567 567 }; 568 568 569 569 ncalgebra(1, M); //now new ring @@K become a noncommutative ring 570 570 571 571 list l; //list to define an involution 572 572 … … 574 574 { 575 575 execute( "l["+string(i)+"]="+NVAR(i,i)+"*"+string( var(i) )+";" ); 576 576 577 577 }; 578 578 matrix N = Rel; //imap(@B,Rel); 579 580 for(i=1; i<NVars; i++)//get matrix by applying the involution to relations 579 580 for(i=1; i<NVars; i++)//get matrix by applying the involution to relations 581 581 { 582 582 for(j=i+1; j<=NVars; j++) … … 589 589 //get the ideal of coefficients of N 590 590 591 ideal J; 591 ideal J; 592 592 ideal idN = simplify(ideal(N),2); 593 593 J = ideal(coeffs( idN, var(1) ) ); 594 594 for(i=2; i<=NVars; i++) 595 595 { 596 J = ideal( coeffs( J, var(i) ) ); 596 J = ideal( coeffs( J, var(i) ) ); 597 597 }; 598 598 J = simplify(J,2); 599 599 //------------------------------------------------- 600 601 if ( Par=="" ) //initializes the ring of relations 600 601 if ( Par=="" ) //initializes the ring of relations 602 602 { 603 603 execute("ring @@KK=0,("+s+"), dp;"); … … 607 607 execute("ring @@KK=(0,"+Par+"),("+s+"), dp;"); 608 608 }; 609 609 610 610 ideal J = imap(@@K,J); // ideal, considered in @@KK now 611 611 612 612 matrix @@D[NVars][NVars]; // matrix with entries=new variables to square i.e. @@D=@@D^2 613 613 for(i=1;i<=NVars;i++) … … 617 617 J = J, ideal( @@D*@@D - matrix( freemodule(NVars) ) ); // add the condition that involution to square is just identity 618 618 J = simplify(J,2); // without extra zeros 619 619 620 620 list mL = minAssGTZ(J); // components not in GB 621 int sL = size(mL); 621 int sL = size(mL); 622 622 option(redSB); // important for reduced GBs 623 623 option(redTail); 624 624 matrix IM = @@D; // involution map 625 625 list L = list(); // the answer 626 list TL; 626 list TL; 627 627 ideal tmp = 0; 628 628 for (i=1; i<=sL; i++) // compute GBs of components … … 658 658 @* L[i][1] = Groebner Basis of an i-th associated prime, 659 659 @* L[i][2] = matrix, defining a linear map, with entries, reduced with respect to L[i][1] 660 NOTE: for convenience, the full ideal of relations @code{idJ} 660 NOTE: for convenience, the full ideal of relations @code{idJ} 661 661 and the initial matrix with indeterminates @code{matD} are exported in the output ring. 662 662 "{ … … 664 664 int NVars = nvars(@B); //number of variables in basering 665 665 int i, j; 666 666 667 667 matrix Rel = RelMatr(); //the matrix of relations 668 668 669 669 string s = new_var(); //string of new variables 670 670 string Par = parstr(@B); //string of parameters in old ring 671 671 672 672 if (Par=="") // if there are no parameters 673 { 673 { 674 674 execute("ring @@K=0,("+varstr(@B)+","+s+"), dp;"); //new ring with new variables 675 675 } 676 676 else //if there exist parameters 677 { 677 { 678 678 execute("ring @@K=(0,"+Par+") ,("+varstr(@B)+","+s+"), dp;");//new ring with new variables 679 679 }; 680 680 681 681 matrix Rel = imap(@B, Rel); //consider the matrix of relations in new ring 682 682 683 683 int Sz = NVars*NVars+NVars; // number of variables in new ring 684 684 685 685 matrix M[Sz][Sz]; //to be the matrix of relations in new ring 686 686 687 687 for(i=1; i<NVars; i++) //initialize that matrix of relations 688 688 { … … 692 692 }; 693 693 }; 694 694 695 695 ncalgebra(1, M); //now new ring @@K become a noncommutative ring 696 696 697 697 list l; //list to define a homomorphism(isomorphism) 698 698 poly @@F; … … 703 703 { 704 704 execute( "@@F = @@F+"+NVAR(i,j)+"*"+string( var(j) )+";" ); 705 }; 706 l=l+list(@@F); 707 }; 708 705 }; 706 l=l+list(@@F); 707 }; 708 709 709 matrix N = Rel; //imap(@B,Rel); 710 711 for(i=1; i<NVars; i++)//get matrix by applying the homomorphism to relations 710 711 for(i=1; i<NVars; i++)//get matrix by applying the homomorphism to relations 712 712 { 713 713 for(j=i+1; j<=NVars; j++) … … 719 719 //--------------------------------------------- 720 720 //get the ideal of coefficients of N 721 ideal J; 721 ideal J; 722 722 ideal idN = simplify(ideal(N),2); 723 723 J = ideal(coeffs( idN, var(1) ) ); 724 724 for(i=2; i<=NVars; i++) 725 725 { 726 J = ideal( coeffs( J, var(i) ) ); 726 J = ideal( coeffs( J, var(i) ) ); 727 727 }; 728 728 J = simplify(J,2); 729 729 //------------------------------------------------- 730 if ( Par=="" ) //initializes the ring of relations 730 if ( Par=="" ) //initializes the ring of relations 731 731 { 732 732 execute("ring @@KK=0,("+s+"), dp;"); … … 739 739 string snv = "["+string(NVars)+"]"; 740 740 execute("matrix @@D"+snv+snv+"="+s+";"); // matrix with entries=new variables 741 741 742 742 J = J, ideal( @@D*@@D-matrix( freemodule(NVars) ) ); // add the condition that homomorphism to square is just identity 743 743 J = simplify(J,2); // without extra zeros 744 744 list mL = minAssGTZ(J); // components not in GB 745 int sL = size(mL); 745 int sL = size(mL); 746 746 option(redSB); // important for reduced GBs 747 747 option(redTail); 748 748 matrix IM = @@D; // map 749 749 list L = list(); // the answer 750 list TL; 750 list TL; 751 751 ideal tmp = 0; 752 752 for (i=1; i<=sL; i++)// compute GBs of components
Note: See TracChangeset
for help on using the changeset viewer.