Two languages for one group
A quadratic field is ℚ(√d) for squarefree d, with discriminant D equal to d or 4d according to a congruence. Prime decomposition is decided by a single Kronecker symbol. Ideal classes correspond exactly to equivalence classes of binary quadratic forms of discriminant D, with ideal multiplication corresponding to Gauss composition — and the form language, being purely integral, is what practical algorithms actually manipulate.
Learning objectives
- Compute the discriminant and integral basis of a quadratic field.
- Decide the decomposition of a prime by the Kronecker symbol.
- Reduce a binary quadratic form and count reduced forms.
- Explain the correspondence between form classes and ideal classes.
- Distinguish fundamental from non-fundamental discriminants.
Section 01Quadratic fields
For squarefree d ≠ 0, 1, the field K = ℚ(√d) has
| Condition | Discriminant D | Integral basis |
|---|---|---|
| d ≡ 1 (mod 4) | d | 1, (1 + √d)/2 |
| d ≡ 2 or 3 (mod 4) | 4d | 1, √d |
Discriminants arising this way are the fundamental discriminants. A general discriminant D = f2D0 corresponds to the non-maximal order of conductor f. The field is imaginary when D < 0 and real when D > 0, and that sign governs everything: unit rank 0 versus 1, finite versus infinite unit group, and a class number computation that is straightforward versus one that is entangled with the regulator.
For p not dividing D, the Kronecker symbol (D/p) decides: +1 means p splits into two primes, −1 means p is inert, and 0 means p ramifies. No polynomial factorisation is needed — which is why quadratic fields are the natural testbed for every algorithm in the subject.
Section 02Binary quadratic forms
A binary quadratic form is f(x, y) = ax2 + bxy + cy2, written (a, b, c), with discriminant D = b2 − 4ac. Two forms are equivalent when related by a unimodular change of variables.
- Normalise: replace b by its representative in (−a, a] by translating x.
- If a > c, swap: set (a, b, c) ← (c, −b, a). This is the inversion x ↦ −y, y ↦ x.
- Repeat from step 1 until |b| ≤ a ≤ c.
- If a = c or |b| = a, fix the sign convention by requiring b ≥ 0.
- Return the reduced form — unique in its equivalence class.
For D > 0 reduction does not produce a unique representative. Instead the reduced forms in a class form a cycle, traversed by the continued fraction expansion of a quadratic irrational. The length of that cycle is tied to the regulator — which is why real quadratic fields are computationally harder.
Section 03The correspondence with ideals
Forms (a, b, c) of discriminant D, up to unimodular equivalence, with Gauss composition as the group law. Entirely integral, so arithmetic is exact and fast.
Ideals of the quadratic order of discriminant D, up to principal ideals, with ideal multiplication as the group law. Generalises to higher degree.
The correspondence sends the form (a, b, c) to the ideal with ℤ-basis a and (−b + √D)/2. It is a group isomorphism: composition of forms corresponds to multiplication of ideals, reduction of forms to reduction of ideals, and the class number of forms to the class number of the order.
Some sources use proper (unimodular, determinant +1) equivalence and some allow determinant −1. For D < 0 the two differ, since the improper equivalence identifies a class with its inverse. Class number tables must be read with the convention in mind, or genus-level discrepancies will appear.
Section 04Composition
Gauss composition is the group law in the form language. The modern formulation uses the united-forms construction: given two forms with the same discriminant, solve a small system of congruences by the extended Euclidean algorithm to produce the composed form, then reduce.
Composition plus reduction gives a group operation on objects of bounded size at a cost comparable to a GCD. That is what makes baby-step giant-step, Shanks's class group method and the sub-exponential algorithms practical for quadratic fields long before comparable methods existed in higher degree.
ReferenceFrequently asked questions
Why is the discriminant sometimes 4d?
Because when d is congruent to 2 or 3 modulo 4, the element (1 + √d)/2 is not an algebraic integer, so the integral basis is 1, √d and the discriminant of that basis is 4d. The congruence condition determines which basis is correct.
What is a fundamental discriminant?
An integer congruent to 1 modulo 4 and squarefree, or four times a squarefree integer congruent to 2 or 3 modulo 4. These are exactly the discriminants of quadratic fields; other discriminants belong to non-maximal orders.
Should I use forms or ideals in an implementation?
For quadratic fields specifically, forms — the arithmetic is smaller, faster and entirely integral. For any code intended to generalise to higher degree, ideals, since the form language does not extend.
NavigateContinue in this stream
Curated next steps from this page. The site also surfaces algorithmically related reading below.
ProvenanceSources and further reading
This page is an original KEVOS explanatory article. It presents the underlying mathematics — definitions, algorithms, complexity results and selection criteria — in KEVOS editorial voice. No text is reproduced from any copyrighted source. Where numerical tables are relevant, KEVOS links to live authoritative databases rather than republishing static values.
