Next: About this document ...
Up: Lecture 24: Quadratic Forms
Previous: Class Numbers
There are much more sophisticated ways to compute
than
simply listing the reduced binary quadratic forms of discriminant
,
which is an
algorithm. For example, there is an algorithm
that can compute
for
having
digits in a reasonable
amount of time. These more sophisticated algorithms use the fact
that the set of primitive positive definite binary quadratic forms
of given discriminant is a finite abelian group.
Definition 3.1
Let

and

be two
quadratic forms of the same discriminant

. Set

,

and let

and

be such that
(obtained by two applications of Euclid's algorithm), and let

. Define the composite of the equivalence
classes of the two forms

and

to be
the equivalence class of the form
This mysterious-looking group law is induced by ``multiplication
of ideals'' in the ``ring of integers'' of the quadratic imaginary
number field
.
The following PARI program computes this group operation:
{composition(f1, f2)=
local(a1,b1,c1,a2,b2,c2,D,s,n,bz0,bz1,u,v,w);
a1=f1[1]; b1=f1[2]; c1=f1[3];
a2=f2[1]; b2=f2[2]; c2=f2[3];
D = b1^2 - 4*a1*c1;
if(b2^2 - 4*a2*c2 != D, error("Forms must have the same discriminant."));
s = (b1+b2)/2;
n = (b1-b2)/2;
bz0 = bezout(a1,a2);
bz1 = bezout(bz0[3],s);
u = bz1[1]*bz0[1];
v = bz1[1]*bz0[2];
w = bz1[2];
d = bz1[3];
d0 = gcd(gcd(gcd(d,c1),c2),n);
a3 = d0*a1*a2/d^2;
b3 = b2+2*a2*(v*(s-b2)-w*c2)/d;
c3 = (b3^2-D)/(4*a3);
f3 = reduce([a3,b3,c3]);
return(f3);
}
Let's try the group out in the case when
.
? reducedforms(-23)
[1, 1, 6] ----> [1, 1, 6]
[2, 1, 3] ----> [2, 1, 3]
[3, 1, 2] ----> [2, -1, 3]
[6, 1, 1] ----> [1, 1, 6]
%56 = [[1, 1, 6], [2, -1, 3], [2, 1, 3]]
Thus the group has elements
,
, and
.
Since
,
the group must be cyclic of order
. Let's find the identity element.
? composition([1,1,6],[2,-1,3])
%58 = [2, -1, 3]
Thus the identity element must be
.
The element
is a generator for the group:
? composition([2,-1,3],[2,-1,3])
%59 = [2, 1, 3]
? composition([2,-1,3],[2,1,3])
%60 = [1, 1, 6]
Next: About this document ...
Up: Lecture 24: Quadratic Forms
Previous: Class Numbers
William A Stein
2001-11-07