10.12.2012 Views

Prime Numbers

Prime Numbers

Prime Numbers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

360 Chapter 7 ELLIPTIC CURVE ARITHMETIC<br />

arising in the theory of invariants and modular forms [Cohen 2000], [Atkin and<br />

Morain 1993b]. (It is interesting that ∆(q) has the alternative and beautiful<br />

representation q <br />

n≥1 (1 − qn ) 24 , but we shall not use this in what follows.<br />

The first given expression for ∆(q) is more amenable to calculation since the<br />

exponents grow quadratically.)<br />

Algorithm 7.5.8 (Class number and Hilbert class polynomial).<br />

Given a (negative) fundamental discriminant D, this algorithm returns any desired<br />

combination of the class number h(D), the Hilbert class polynomial T ∈ Z[X]<br />

(whose degree is h(D)), and the set of reduced forms (a, b, c) of discriminant D<br />

(whose cardinality is h(D)).<br />

1. [Initialize]<br />

T =1;<br />

b = D mod 2;<br />

r = ⌊ |D|/3⌋;<br />

h =0; //Zeroclasscount.<br />

red = {}; // Empty set of primitive reduced forms.<br />

2. [Outer loop on b]<br />

while(b ≤ r) {<br />

m =(b 2 − D)/4;<br />

for(1 ≤ a and a 2 ≤ m) {<br />

if(m mod a = 0) continue; // Continue ‘for’ loop to force a|m.<br />

c = m/a;<br />

if(b >a) continue; // Continue ‘for’ loop.<br />

3. [Optional polynomial setup]<br />

τ =(−b + i |D|)/(2a); // Note precision (see text following).<br />

f =∆(e 4πiτ )/∆(e 2πiτ ); // Note precision.<br />

j = (256f +1) 3 /f; // Note precision.<br />

4. [Begin divisors test]<br />

if(b == a or c == a or b == 0) {<br />

T = T ∗ (X − j);<br />

h = h +1; // Class count.<br />

red = red ∪ (a, b, c); // New form.<br />

} else {<br />

T = T ∗ (X 2 − 2Re(j)X + |j| 2 );<br />

h = h +2; // Class count.<br />

red = red ∪ (a, ±b, c); // Two new forms.<br />

}<br />

}<br />

}<br />

5. [Return values of interest]<br />

return (combination of) h, round(Re(T (x))),red;<br />

This algorithm is straightforward in every respect except on the issue of<br />

floating-point precision. Note that the function ∆ must be evaluated for

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!