← LibraryReduction of Positive Definite Binary FormsEngineering · MathematicsLesson 305/385← PrevNext →
ArticlePublished 7 Aug 20262 min readBy Kevin Joginform reductionpositive definitereduced formGauss reduction

Quadratic Fields

Reduction of Positive Definite Binary Forms

Reducing a positive definite binary quadratic form to the unique reduced form in its class, and the resulting class number algorithm.

Engineering / MathematicsQuadratic Fields2 min readKV-MATH-0602

Every positive definite binary form is equivalent to exactly one reduced form. Uniqueness makes reduction a canonical form computation, and it turns class number computation into enumeration.

The reduction conditions

|b| <= a <= c, and b >= 0 if |b| = a or a = cThe final clause breaks the remaining ties, giving uniqueness.

The algorithm

Gauss reduction of a positive definite form

  1. Normalise the middle coefficientTranslate so that the middle coefficient lies in the interval determined by the first.
  2. Swap if neededIf the first coefficient exceeds the last, swap them and negate the middle one.
  3. RepeatContinue until both conditions hold.
  4. Break tiesApply the final sign convention.

Class number by enumeration

Reduced forms of a given discriminant satisfy explicit bounds on their coefficients. Enumerating all triples within those bounds and keeping the reduced ones counts the classes exactly.

a <= sqrt(|D| / 3), |b| <= a, b congruent to D modulo 2The middle coefficient determines the last.

Counting class number by enumeration

  1. Bound the first coefficientBy the square root of a third of the absolute discriminant.
  2. Loop over the middle coefficientWithin the reduction bounds and the correct parity.
  3. Solve for the lastFrom the discriminant relation; discard non-integer results.
  4. Test reduction and countKeep only reduced forms, applying the tie-break convention.

Relation to lattice reduction

A positive definite binary form is a rank two lattice, and reduction is exactly finding its shortest basis. This is the two-dimensional case of LLL, where the shortest vector can be found exactly rather than approximately — see short vector search.

Source. Henri Cohen, A Course in Computational Algebraic Number Theory, Springer GTM 138 — 5.2. Structural reference unverified: the source file was not available during authoring; chapter and section numbers are taken from the published edition and have not been checked against a physical copy.

Continue learning

Binary Quadratic Forms and the Ideal CorrespondenceArticle · MathematicsNEXT LESSON →Composition of Binary Quadratic FormsArticle · MathematicsPrime Decomposition in Quadratic FieldsArticle · MathematicsImaginary Quadratic Class Numbers by Counting Reduced FormsArticle · Mathematics