Changeset 2b4755 in git
- Timestamp:
- Mar 19, 2004, 5:28:50 PM (20 years ago)
- Branches:
- (u'spielwiese', 'a719bcf0b8dbc648b128303a49777a094b57592c')
- Children:
- 20ee6d53a86cc7bbe5d1762a73628af8fb98231a
- Parents:
- 72391bbb1d0acd8a82fe089b6bb86b8c7e773a73
- Location:
- Singular/LIB
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/ncalg.lib
r72391b r2b4755 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: ncalg.lib,v 1. 1 2004-03-19 15:52:29 levandov Exp $";2 version="$Id: ncalg.lib,v 1.2 2004-03-19 16:28:49 levandov Exp $"; 3 3 category="Noncommutative"; 4 4 info=" … … 25 25 // functions for debug/logging 26 26 27 staticproc mySetRing (string @baseName, list #)27 proc mySetRing (string @baseName, list #) 28 28 // set @@@_RING to description of current ring 29 29 { … … 60 60 } 61 61 62 staticproc myGetRing ()62 proc myGetRing () 63 63 // get desription of current ring 64 64 { … … 70 70 } 71 71 72 staticproc myGetRingName ()72 proc myGetRingName () 73 73 // get desription of current ring, only family 74 74 { … … 81 81 } 82 82 83 staticproc myGetRingChar ()83 proc myGetRingChar () 84 84 // get desription of current ring, only family 85 85 { … … 93 93 94 94 95 staticproc myInt ( list # )95 proc myInt ( list # ) 96 96 // return 0 or int(#) 97 97 { -
Singular/LIB/nctools.lib
r72391b r2b4755 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: nctools.lib,v 1. 2 2004-03-18 21:34:03levandov Exp $";2 version="$Id: nctools.lib,v 1.3 2004-03-19 16:28:50 levandov Exp $"; 3 3 category="Noncommutative"; 4 4 info=" … … 23 23 24 24 AUXILIARY PROCEDURES: 25 wRing(r); alias to weightedRing,26 25 Newton(f); Newton diagram of a polynomial f, 27 26 NCRelations(r); Recovers the non-commutative relations of a G-algebra, 28 27 IsCentral(p,[v]); Check for the commutativity of polynomial p with the G-algebra, 29 28 UpOneMatrix(N); Returns NxN matrix with 1's in the whole upper triagle, 29 30 ALIAS PROCEDURES: 31 wRing(r); alias to weightedRing, 30 32 "; 31 33 32 ///////////////////////////////////////////////////////////////////////////////33 34 proc wRing(ring r)35 "USAGE: wRing(r); r a ring36 RETURN: the same ring r but the order37 NOTE: you have to activate this ring with the "setring" command38 EXAMPLE: example wRing; shows examples39 SEE ALSO: weightedRing, Gweights40 "{41 return(weightedRing(r));42 }43 example44 {45 "EXAMPLE:";echo=2;46 LIB "qmatrix.lib";47 def r=quant(3); // generate quant(3) and store it in r48 setring r; // set the ring r the active ring49 r;50 def s=wRing(r);51 setring s;52 s;53 }54 34 /////////////////////////////////////////////////////////////////////////////// 55 35 … … 179 159 /////////////////////////////////////////////////////////////////////////////// 180 160 161 proc wRing(def r) 162 "USAGE: see weightedRing 163 "{ 164 def a=weightedRing(r); 165 if (typeof(a)=="ring") { return(a); } 166 "Error"; 167 return(); 168 } 169 example 170 { 171 "EXAMPLE:";echo=2; 172 LIB "qmatrix.lib"; 173 def r=quant(3); // generate quant(3) and store it in r 174 setring r; // set the ring r the active ring 175 r; 176 def s=wRing(r); 177 setring s; 178 s; 179 } 180 181 /////////////////////////////////////////////////////////////////////////////// 182 181 183 // This procedure computes ei+ej-f with f running in Newton(pij) and deletes the zero rows 182 184 … … 358 360 if (n>1) 359 361 { 360 for (int i=2; i<=n; i++) 362 int i,j; 363 for (i=2; i<=n; i++) 361 364 { 362 for ( intj=1; j<i; j++)365 for (j=1; j<i; j++) 363 366 { 364 367 f=var(i)*var(j); // yx=c*xy+... … … 389 392 { 390 393 "EXAMPLE:";echo=2; 391 ring r = 0,(x,y,z), lp;394 ring r = 0,(x,y,z),dp; 392 395 matrix C[3][3]=0,1,2,0,0,-1,0,0,0; 393 396 print(C); … … 416 419 else 417 420 { 418 setring #[1]; 421 def @R1 = #[1]; 422 setring @R1; 419 423 } 420 424 } … … 493 497 "EXAMPLE:";echo=2; 494 498 ring r=0,(x,y,z),dp; 495 poly c=; 499 matrix D[3][3]=0; 500 D[1,2]=-z; 501 D[1,3]=2*x; 502 D[2,3]=-2*y; 503 ncalgebra(1,D); // this is U(sl_2) 504 poly c=4*x*y+z^2-2*z; 496 505 IsCentral(c,1); 497 506 } … … 605 614 return(0); 606 615 } 616 if (n<1) { return(0); } 607 617 number mp = par(1); 608 618 if (n==1) { return(mp-1); } 609 619 if (n==2) { return(mp+1); } 610 string OR = nameof(basering);620 def OldRing = basering; 611 621 string CH = charstr(basering); 612 622 string MCH; … … 616 626 MCH=MCH+CH[j]; j++; 617 627 } 618 string SR = "ring @@r ="+MCH+","+parstr(basering)+",dp;";628 string SR = "ring @@rR="+MCH+","+parstr(basering)+",dp;"; 619 629 execute(SR); 620 setring @@r;621 630 poly @t=var(1)^n-1; // (x^2i-1)=(x^i-1)(x^i+1) 622 631 list l=factorize(@t); … … 627 636 int cnt=1; 628 637 poly res; 629 for (j=s-1; j>=1;j--)638 for (j=s-1; j>=1; j--) 630 639 { 631 640 if ( deg(@l[j]) > d) { d=deg(@l[j]); } 632 641 } 633 for (j=1; j<=s;j++)642 for (j=1; j<=s; j++) 634 643 { 635 644 if ( deg(@l[j]) == d) { @d[cnt]=@l[j]; cnt++; } 636 645 } 637 if (size(@d)==1) { res = poly(@d[1]); } 646 if ( size(@d)==1 ) 647 { 648 res = poly(@d[1]); 649 } 638 650 else 639 651 { … … 647 659 res = @d[j]; 648 660 } 649 execute("setring "+OR);650 poly I = imap(@@r ,res);661 setring OldRing; 662 poly I = imap(@@rR,res); 651 663 mp = leadcoef(I); 652 kill @@r ;664 kill @@rR; 653 665 return(mp); 654 666 } … … 779 791 string NewRing = "ring @R=("+charstr(basering)+"),("+varstr(basering)+"),("+ordstr(basering)+");"; 780 792 execute(NewRing); 781 setring @R;782 793 matrix @E = UpOneMatrix(N); 783 794 @E = -1*(@E); -
Singular/LIB/qmatrix.lib
r72391b r2b4755 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: qmatrix.lib,v 1. 2 2004-03-18 21:36:09levandov Exp $";2 version="$Id: qmatrix.lib,v 1.3 2004-03-19 16:28:50 levandov Exp $"; 3 3 category="Noncommutative"; 4 4 info=" … … 19 19 "; 20 20 21 LIB "ncalg.lib"; 21 22 LIB "nctools.lib"; 22 23 23 /////////////////////////////////////////////////////////////////////////////// 24 24 … … 148 148 m[i,nv+1-i]=1; 149 149 } 150 int chr = myInt(#); 150 151 ring @rrr=(0,q),(y(1..nv)),Dp; 151 if (size(#)>0) 152 { 153 if ( typeof( #[1] ) == "int" ) 154 { 155 int chr = #[1]; 156 if (chr>1) 157 { 158 minpoly = RooOfUnity(chr); 159 } 160 else 161 { 162 "The degree of a root should be at least 2"; 163 } 164 } 165 } 166 setring @rrr; 152 minpoly = RootOfUnity(chr); 167 153 matrix C[nv][nv]=0; 168 154 matrix D[nv][nv]=0;
Note: See TracChangeset
for help on using the changeset viewer.