A quadratic form is said to be positive definite if
for
. A real quadratic
form in
variables is positive definite iff
its canonical form is
(1)
|
(2)
|
of two real variables is positive definite if it is
for any
,
therefore if
and the binary
quadratic form discriminant
. A binary
quadratic form is positive definite if there exist nonzero
and
such that
(3)
|
(Le Lionnais 1983).
The positive definite quadratic form
(4)
|
is said to be reduced if ,
, and
if
or
. Under the action of the general
linear group
, i.e., under the set of linear transformations of coordinates
with integer coefficients and determinant
, there exists a unique reduced positive definite binary
quadratic form equivalent to any given one.
There exists a one-to-one correspondence between the set of reduced quadratic forms with fundamental
discriminant and the set of classes of fractional
ideals of the unique quadratic field with
discriminant
. Let
be a reduced positive definite binary quadratic
form with fundamental discriminant
,
and consider the map
which maps the form
to the ideal class containing the ideal
.
Then this map is one-to-one and onto. Thus, the class
number of the imaginary quadratic field
is equal to the number of reduced binary quadratic forms of discriminant
, which can be easily computed by systematically constructing
all binary quadratic forms of discriminant
by looping over the coefficients
and
. The third coefficient
is then determined by
,
, and
.
A quadratic form is positive definite iff every
eigenvalue of
is positive. A quadratic
form
with
a Hermitian matrix is
positive definite if all the principal minors in the top-left corner of
are positive, in other words
(5)
| |||
(6)
| |||
(7)
|