A positive definite quadratic form is a quadratic form
such that
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
.
For a positive definite binary quadratic form,
there exist integers
and
,
not both 0, such that
|
(3)
|
(Le Lionnais 1983).
The positive definite binary quadratic form
|
(4)
|
with integer coefficients is said to be reduced iff
and
whenever
or
.
Under the action of the special linear group
, i.e., under linear
transformations of coordinates
with integer coefficients
and determinant 1, there exists a unique reduced
binary quadratic form equivalent to any given one.
There exists a one-to-one correspondence between the set of reduced binary quadratic
forms with fundamental discriminant
and the set of classes of fractional ideals of
the unique quadratic field with number
field discriminant
.
Let
be a reduced 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 binary quadratic
form discriminant
,
which can be easily computed by systematically constructing all binary
quadratic forms of binary quadratic
form discriminant
by looping over the coefficients
and
. The third coefficient
is then determined by
,
, and
.
A real quadratic form
with a symmetric matrix
is positive definite iff every eigenvalue of
is positive. By Sylvester's
criterion, a quadratic form
with
a Hermitian matrix is
positive definite iff the determinants
of all upper-left square submatrices of
are positive. For a
matrix, these conditions
are
|
(5)
| |||
|
(6)
| |||
|
(7)
|