Class number of a negative discriminant (source code)

= Class number of a negative discriminant
{title2=$h(D)$}

For a negative <discriminant of a binary quadratic form> $D\equiv0$ or $1\pmod4$, the <class number of a negative discriminant> $h(D)$ counts <proper equivalence> classes of <primitive binary quadratic forms> that are positive definite and have discriminant $D$.

Uniqueness of the <reduced positive definite binary quadratic form> in each class makes this the number of reduced primitive forms. <Enumeration of reduced binary quadratic forms> proves finiteness and gives an explicit procedure. For example, $h(-4)=1$, represented by $[1,0,1]$, while $h(-39)=4$, with the four forms listed under <reduced positive definite binary quadratic forms of discriminant minus thirty-nine>.

Imprimitive forms do not enter $h(D)$. At $D=-32$, the reduced form $[2,0,4]$ has content two, so the three reduced forms listed under <reduced forms of discriminant minus thirty-two> contribute only two primitive classes. If $D$ is a <fundamental discriminant>, this form class number agrees with the <class number> of the <imaginary quadratic field> of discriminant $D$. For nonfundamental $D$, the associated <order in a number field> need not be the full <ring of integers>, so that distinction must be retained.