KEVOS
ArticlesServicesCase studiesAboutContact
ArticlesServicesCase studiesAboutContact
← ArticlesComposition of Binary Quadratic FormsEngineering · Engineering MathematicsLesson 805/884← PrevNext →
ArticlePublished 7 Aug 20262 min readBy Kevin JogincompositionGauss compositionform class groupgroup law
On this page

Ask about this page

KEVOS AIComposition of Binary Quadratic Forms

KEVOS knowledge first · trusted web sources when needed

Quadratic Fields

Composition of Binary Quadratic Forms

Gauss composition as the group law on form classes, its practical computation, and reduction between compositions.

Engineering / MathematicsQuadratic Fields2 min readKV-MATH-0603

Composition is the group law on form classes, corresponding to ideal multiplication. Gauss's original formulation is intricate; the modern treatment is a short computation with the extended Euclidean algorithm.

What it computes

Composition of forms <-> multiplication of the corresponding idealsBoth forms must have the same discriminant.

Key point

The identity element is the principal form, and the inverse of a form is obtained by negating the middle coefficient. Together with composition these make the reduced forms into a group — the form class group.

The computation

Composition of two forms

  1. Compute a GCDOf the two first coefficients and the average of the middle ones, with Bezout coefficients.
  2. Solve congruencesDetermine the middle coefficient of the composite from congruence conditions.
  3. Form the productThe first coefficient is the product of the originals divided by the square of the GCD.
  4. ReduceApply reduction immediately.

Caution

Reduce after every composition without exception. Coefficients grow multiplicatively otherwise, and a chain of compositions without intermediate reduction produces enormous forms within a few steps.

Squaring

Composing a form with itself admits a simplified formula, worth implementing separately because exponentiation by repeated squaring is dominated by squarings.

Cost

This is the same argument as for integer squaring. Class group algorithms perform many exponentiations, so a dedicated squaring routine yields a direct proportional saving.

NUCOMP

Shanks's NUCOMP algorithm interleaves reduction with composition, keeping intermediate values small throughout rather than reducing afterwards. It is substantially faster for large discriminants and is the standard method in serious implementations.

Composition strategies
MethodIntermediate sizeSpeed
Compose then reduceGrows to the product of the coefficientsAdequate for small discriminants
NUCOMPBounded near the square root of the discriminantSubstantially faster for large discriminants

Uses

Composition is the group operation underlying class group structure computation, element orders in the class group, and Shanks's class group factoring method, where an ambiguous form reveals a factorisation.

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.

Related pages

  • Ideal Multiplication and Division
  • Reduction of Positive Definite Binary Forms
  • Imaginary Quadratic Class Numbers by Counting Reduced Forms

Continue learning

Reduction of Positive Definite Binary FormsArticle · Engineering MathematicsNEXT LESSON →Imaginary Quadratic Class Numbers by Counting Reduced FormsArticle · Engineering MathematicsBinary Quadratic Forms and the Ideal CorrespondenceArticle · Engineering MathematicsClass Numbers from Analytic Class Number FormulasArticle · Engineering Mathematics
KEVOS · Engineering, manufacturing and project improvement
ArticlesServicesCase studiesAboutContact
© 2026 KEVOS®