Changeset 3eadab in git
- Timestamp:
- Jul 20, 2007, 12:02:38 PM (16 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 26508d901cc18abe14e76ed21fab5d60a21684ed
- Parents:
- 1625c14e1865ffd016b1b23fc908e7e790e66291
- Location:
- Singular/LIB
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/atkins.lib
r1625c1 r3eadab 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: atkins.lib,v 1. 2 2007-01-09 12:42:22 pfister Exp $";2 version="$Id: atkins.lib,v 1.3 2007-07-20 10:02:38 Singular Exp $"; 3 3 category="Teaching"; 4 4 info=" … … 14 14 15 15 PROCEDURES: 16 new(L,D) checks if number D already exists in list L 17 bubblesort(L) sorts elements of the list L 18 disc(N,k) generates a list of negative discriminants 19 Cornacchia(d,p) computes solution (x,y) for x^2+d*y^2=p 20 CornacchiaModified(D,p) computes solution (x,y) for x^2+|D|*y^2=4p 21 maximum(L) computes the maximal number contained in L 22 cmod(x,y) computes x mod y 23 sqr(w,k) computes the square root of w 24 e(z,k) computes exp(z) 25 jot(t,k) computes the j-invariant of t 26 round(r) rounds r to the nearest number out of Z 27 HilbertClassPolynomial(D,k) computes the Hilbert Class Polynomial 28 RootsModp(p,P) computes roots of the polynomial P modulo p 29 w(D) computes the number of units in Q(sqr(D)) 30 Atkin(N,K,B) tries to prove that N is prime 16 newTest(L,D) checks if number D already exists in list L 17 bubblesort(L) sorts elements of the list L 18 disc(N,k) generates a list of negative discriminants 19 Cornacchia(d,p) computes solution (x,y) for x^2+d*y^2=p 20 CornacchiaModified(D,p) computes solution (x,y) for x^2+|D|*y^2=4p 21 maximum(L) computes the maximal number contained in L 22 expo(z,k) computes exp(z) 23 jOft(t,k) computes the j-invariant of t 24 round(r) rounds r to the nearest number out of Z 25 HilbertClassPoly(D,k) computes the Hilbert Class Polynomial 26 rootsModp(p,P) computes roots of the polynomial P modulo p 27 wUnit(D) computes the number of units in Q(sqr(D)) 28 Atkin(N,K,B) tries to prove that N is prime 31 29 32 30 "; … … 39 37 /////////////////////////////////////////////////////////////////////////////// 40 38 41 proc new (list L, number D)42 "USAGE: new (L,D);39 proc newTest(list L, number D) 40 "USAGE: newTest(L,D); 43 41 RETURN: 1, if D does not already exist in L, 44 42 -1, if D does already exist in L … … 63 61 list L=8976,-223456,556,-778,3,-55603,45,766677; 64 62 number D=-55603; 65 new (L,D);63 newTest(L,D); 66 64 } 67 65 … … 118 116 { 119 117 D=-4*a+B; 120 if((D<0)&&((D mod 4)!=2)&&((D mod 4)!=3)&&(absValue(D)<4*N)&&(new (L,D)==1))118 if((D<0)&&((D mod 4)!=2)&&((D mod 4)!=3)&&(absValue(D)<4*N)&&(newTest(L,D)==1)) 121 119 { 122 120 L[size(L)+1]=D; … … 342 340 343 341 344 proc cmod(number x, number y)342 static proc cmod(number x, number y) 345 343 "USAGE: cmod(x,y); 346 344 RETURN: x mod y … … 369 367 370 368 371 proc sqr(number w, int k)369 static proc sqr(number w, int k) 372 370 "USAGE: sqr(w,k); 373 371 RETURN: the square root of w … … 397 395 398 396 399 proc e (number z, int k)400 "USAGE: e (z,k);397 proc expo(number z, int k) 398 "USAGE: expo(z,k); 401 399 RETURN: e^z to the order k 402 400 NOTE: k describes the number of summands being calculated in the exponential power series … … 420 418 ring r = (real,30),x,dp; 421 419 number z=40.35; 422 e (z,1000);423 } 424 425 426 427 proc j ot(number t, int k)428 "USAGE: j ot(t,k);420 expo(z,1000); 421 } 422 423 424 425 proc jOft(number t, int k) 426 "USAGE: jOft(t,k); 429 427 RETURN: the j-invariant of t 430 428 ASSUME: t is a complex number with positive imaginary part … … 445 443 { 446 444 tr=tr-round(tr); 447 qr1=e (2*i*pi*tr,10*k);445 qr1=expo(2*i*pi*tr,10*k); 448 446 } 449 447 450 qi1=e (-pi*ti,10*k);448 qi1=expo(-pi*ti,10*k); 451 449 q1=qr1*qi1^2; 452 450 q2=q1^2; … … 470 468 ring r = (complex,30,i),x,dp; 471 469 number t=(-7+i*sqr(7,250))/2; 472 j ot(t,50);470 jOft(t,50); 473 471 } 474 472 … … 530 528 531 529 532 proc HilbertClassPoly nomial(number D, int k)533 "USAGE: HilbertClassPoly nomial(D,k);534 RETURN: the monic polynomial of degree h(D) in Z[X] of which j ot((D+sqr(D))/2) is a root530 proc HilbertClassPoly(number D, int k) 531 "USAGE: HilbertClassPoly(D,k); 532 RETURN: the monic polynomial of degree h(D) in Z[X] of which jOft((D+sqr(D))/2) is a root 535 533 ASSUME: D is a negative discriminant 536 534 NOTE: k is input for the procedure "jot", … … 605 603 { 606 604 tau=(-b+i*sqr(absValue(D),5*k))/(2*a); 607 j=j ot(tau,k);605 j=jOft(tau,k); 608 606 if((a==b)||(a^2==t)||(b==0)) 609 607 { … … 677 675 ring r = 0,x,dp; 678 676 number D=-23; 679 HilbertClassPoly nomial(D,50);680 } 681 682 683 684 proc RootsModp(int p, poly P)685 "USAGE: RootsModp(p,P);677 HilbertClassPoly(D,50); 678 } 679 680 681 682 proc rootsModp(int p, poly P) 683 "USAGE: rootsModp(p,P); 686 684 RETURN: list of roots of the polynomial P modulo p with p prime 687 685 ASSUME: p>=3 688 686 NOTE: this algorithm will be called recursively, and it is understood 689 687 that all the operations are done in Z/pZ (excepting sqareRoot(d,p)) 690 EXAMPLE:example RootsModp; shows an example688 EXAMPLE:example rootsModp; shows an example 691 689 " 692 690 { … … 757 755 poly B=imap(R,B); 758 756 poly C=imap(R,C); 759 list l=L+ RootsModp(p,B)+RootsModp(p,C);757 list l=L+rootsModp(p,B)+rootsModp(p,C); 760 758 return(l); 761 759 } … … 765 763 ring r = 0,x,dp; 766 764 poly f=x4+2x3-5x2+x; 767 RootsModp(7,f);765 rootsModp(7,f); 768 766 poly g=x5+112x4+655x3+551x2+1129x+831; 769 RootsModp(1223,g);770 } 771 772 773 774 proc w (number D)775 "USAGE: w (D);767 rootsModp(1223,g); 768 } 769 770 771 772 proc wUnit(number D) 773 "USAGE: wUnit(D); 776 774 RETURN: the number of roots of unity in the quadratic order of discriminant D 777 775 ASSUME: D<0 a discriminant kongruent to 0 or 1 modulo 4 … … 794 792 ring r = 0,x,dp; 795 793 number D=-3; 796 w (D);794 wUnit(D); 797 795 } 798 796 … … 843 841 number a,b,j,c; // characterize E(Z/N(i)Z) 844 842 number g,u; // g out of Z/N(i)Z, u=Jacobi(g,N(i)) 845 poly T; // T=HilbertClassPoly nomial(D,K)843 poly T; // T=HilbertClassPoly(D,K) 846 844 matrix M; // M contains the coefficients of T 847 845 … … 1013 1011 { 1014 1012 if(printlevel>=1) {"Das Minimalpolynom T von j((D+sqr(D))/2) aus Z[X] fuer D="+string(D)+" wird berechnet.";} 1015 T=HilbertClassPoly nomial(D,K);1013 T=HilbertClassPoly(D,K); 1016 1014 if(printlevel>=1) {"T="+string(T);pause();} 1017 1015 … … 1026 1024 if(printlevel>=1) {"Setze T=T mod N("+string(i)+").";"T="+string(T);pause();} 1027 1025 1028 R= RootsModp(int(N(i)),T);1026 R=rootsModp(int(N(i)),T); 1029 1027 if(deg(T)>size(R)) 1030 1028 { … … 1117 1115 { 1118 1116 k=k+1; 1119 if(k>=w (D))1120 { 1121 if(printlevel>=1) {"Da k=w (D)="+string(k)+", ist N("+string(i)+")="+string(N(i))+" nicht prim.";pause();}1117 if(k>=wUnit(D)) 1118 { 1119 if(printlevel>=1) {"Da k=wUnit(D)="+string(k)+", ist N("+string(i)+")="+string(N(i))+" nicht prim.";pause();} 1122 1120 step=14; 1123 1121 } … … 1220 1218 else 1221 1219 { 1222 if(printlevel>=1) {"N(0)=N="+string(N)+" und daher ist N nicht prim.";pause( );}1220 if(printlevel>=1) {"N(0)=N="+string(N)+" und daher ist N nicht prim.";pause(n);} 1223 1221 return(-1); 1224 1222 } … … 1237 1235 Atkin(10000079,100,2); 1238 1236 } 1237 -
Singular/LIB/crypto.lib
r1625c1 r3eadab 1 1 //GP, last modified 28.6.06 2 2 /////////////////////////////////////////////////////////////////////////////// 3 version="$Id: crypto.lib,v 1. 1 2007-01-09 10:31:49Singular Exp $";3 version="$Id: crypto.lib,v 1.2 2007-07-20 10:02:38 Singular Exp $"; 4 4 category="Teaching"; 5 5 info=" … … 2063 2063 2064 2064 */ 2065 -
Singular/LIB/modstd.lib
r1625c1 r3eadab 1 1 //GP, last modified 23.10.06 2 2 /////////////////////////////////////////////////////////////////////////////// 3 version="$Id: modstd.lib,v 1.1 3 2007-07-04 13:14:43Singular Exp $";3 version="$Id: modstd.lib,v 1.14 2007-07-20 10:02:38 Singular Exp $"; 4 4 category="Commutative Algebra"; 5 5 info=" … … 8 8 @* G. Pfister pfister@mathematik.uni-kl.de 9 9 @* H. Schoenemann hannes@mathematik.uni-kl.de 10 @* Cindy Magin, c.magin@web.de11 10 12 11 NOTE: … … 24 23 modS(I,L); liftings to Q of standard bases of I mod p for p in L 25 24 primeList(n); intvec of n primes <= 2134567879 in decreasing order 26 pStd(p,i); compute a standard basis of i using p-adic methods27 25 "; 28 26 … … 887 885 888 886 */ 887
Note: See TracChangeset
for help on using the changeset viewer.