KEVOS
ArticlesServicesCase studiesAboutContact
ArticlesServicesCase studiesAboutContact
← ArticlesQuadratic Fields and Binary Quadratic FormsEngineering · Engineering MathematicsLesson 1/5← PrevNext →
GuidePublished 6 Aug 2026Updated 13 Aug 202610 min readBy Kevin JoginComputational Number TheoryQuadratic FieldsQuadratic FieldBinary Quadratic Form
On this page

Ask about this page

KEVOS AIQuadratic Fields and Binary Quadratic Forms

KEVOS knowledge first · trusted web sources when needed

Skip to the main content

Mathematics•Quadratic Fields

Quadratic Fields and Binary Quadratic Forms

The degree-2 case where everything is explicit — and the classical language of forms that runs parallel to the language of ideals.

  • Engineering
  • Mathematics
  • Part 1 of 5
  • 10 min read
  • KV-MATH-0031
Executive summary

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

Discriminant and integral basis
ConditionDiscriminant DIntegral basis
d ≡ 1 (mod 4)d1, (1 + √d)/2
d ≡ 2 or 3 (mod 4)4d1, √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.

Prime decomposition in one symbol

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.

AlgorithmReduction of a positive definite form (D &lt; 0)in: a positive definite form of discriminant D  →  out: the reduced form
  1. Normalise: replace b by its representative in (−a, a] by translating x.
  2. If a > c, swap: set (a, b, c) ← (c, −b, a). This is the inversion x ↦ −y, y ↦ x.
  3. Repeat from step 1 until |b| ≤ a ≤ c.
  4. If a = c or |b| = a, fix the sign convention by requiring b ≥ 0.
  5. Return the reduced form — unique in its equivalence class.
Each swap strictly decreases a, so the process terminates quickly. A reduced form satisfies a ≤ √(|D|/3), which bounds the search space for class number computation.
Indefinite forms behave differently

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

FormsClassical language

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.

IdealsModern language

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.

Two conventions for the class group of forms

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.

O(log D)cost of one composition
a ≤ √(|D|/3)size bound after reduction
Exact integersno floating point required
Why this matters for algorithms

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.

  • Quadratic FieldsClass Numbers of Imaginary Quadratic Fields
  • Quadratic FieldsReal Quadratic Fields and the Infrastructure Method
  • Number Fields IOrders and Ideals in Number Fields
  • Foundational AlgorithmsLegendre, Jacobi and Kronecker Symbols

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.

Handbook application: from concept to controlled practice

Purpose. This expanded section turns the original page into a practical handbook. It preserves the supplied material and adds a repeatable way to apply, check and review Quadratic Fields and Binary Quadratic Forms. It does not replace a contract, legislation, a controlled standard, competent engineering judgement or specialist advice.

The operating aim is to turn a compact mathematical statement into a usable chain of definitions, claims, examples and checks. Read the original explanation first, then use the workflow and checks below to convert knowledge into evidence.

Treat Quadratic Fields and Binary Quadratic Forms as a network of definitions and implications, not as a list of formulas. The working vocabulary on this page—quadratic, fields, binary, forms, section—should be made explicit before any proof or computation begins. Record the ambient set or structure, the permitted operations and the equality or equivalence relation in use. A compact theorem often changes meaning when the base field, finiteness condition, commutativity assumption or direction of an action changes.

For a proof, write the hypotheses as a checklist and mark the line at which each one is used. For a computation, state the representation of the input, the arithmetic model, the termination condition and the output invariant. For a classification problem, distinguish existence from uniqueness and distinguish an object from its representation. These separations prevent a correct local calculation from being mistaken for the general result.

A useful worked example should be small enough to inspect completely but rich enough to exercise the main mechanism. Compute the result in two ways where practical: symbolically and by substitution, structurally and numerically, or directly and through a normal form. Then include one near-miss example in which a hypothesis fails. The contrast explains why the theorem is shaped as it is and gives the reader a diagnostic pattern for later problems.

Verification is part of the mathematics. Check domains and codomains, substitute proposed solutions, test identity and zero cases, compare dimensions or cardinalities, and confirm that maps respect the required operations. In numerical work, report precision, conditioning and a residual rather than digits alone. In algorithmic work, separate mathematical correctness from implementation complexity and resource limits.

Step-by-step operating method

  1. Fix the setting. State the objects, ambient structure, notation and assumptions before manipulating symbols.
  2. Separate claims. Distinguish definitions, hypotheses, conclusions, equivalent conditions and consequences.
  3. Choose a method. Select proof, construction, calculation or algorithm according to the question actually asked.
  4. Work a small case. Use the smallest non-trivial example to expose the mechanism and test edge behaviour.
  5. Verify independently. Substitute back, check invariants, test boundary cases or use an alternative derivation.

Worked-example protocol

Illustrative method—not a source theorem. Start with a small admissible input and list the definitions it must satisfy. Carry out each transformation on a separate line, citing the property that permits it. Preserve exact values until approximation is necessary. At the end, verify the output against the original definition and one invariant such as dimension, degree, determinant, order, norm or residual. Then alter one hypothesis and observe which step ceases to be valid. This protocol creates a reusable example without inventing a theorem-specific numerical answer.

StageRecordQuality check
InputObjects, domain, notation, assumptionsEvery symbol is defined
MethodPermitted operation or cited result at each stepAll hypotheses hold
OutputExact result and representationCorrect type, domain and form
VerificationSubstitution, invariant or alternative derivationIndependent agreement
Boundary testZero, identity, degenerate or failed hypothesisScope is understood

Common failure modes and recovery actions

1. Watch for

Using a theorem without checking every hypothesis.

Recovery: Return to the governing definition or requirement and restate the decision in one sentence.

2. Watch for

Treating a suggestive example as a proof of the general case.

Recovery: Separate evidence from assumption, assign an owner and set a date for validation.

3. Watch for

Changing notation or conventions part-way through an argument.

Recovery: Run a small counterexample, boundary test, pilot or independent check before proceeding.

4. Watch for

Hiding a division-by-zero, convergence, finiteness or commutativity assumption.

Recovery: Record the consequence, decision and rationale, then update the controlled baseline.

5. Watch for

Reporting a computed result without a residual, substitution or structural check.

Recovery: Escalate when the issue affects safety, compliance, acceptance, material value or an agreed tolerance.

Review checklist

  • Can every symbol be traced to a definition or prior result?
  • Which hypothesis does each major step use?
  • Does the method cover zero, identity, degenerate and boundary cases?
  • Can the conclusion be checked by a second representation or calculation?
  • Are mandatory requirements distinguished from recommendations and illustrative values?
  • Are sources, assumptions, units, dates and versions recorded closely enough to reproduce the decision?
  • Have safety, legal, ethical, stakeholder and operational consequences been considered at the appropriate level?
  • Is there a named owner and a trigger for review, escalation, change or retirement?

Questions for deeper application

What is the most important distinction a practitioner must preserve when applying Quadratic Fields and Binary Quadratic Forms?

Answer with a fact or cited source where available. Where evidence is incomplete, record the assumption, consequence, responsible owner and next validation action.

Which assumption about quadratic would change the result most if it proved false?

Answer with a fact or cited source where available. Where evidence is incomplete, record the assumption, consequence, responsible owner and next validation action.

What evidence would allow an independent reviewer to reproduce or challenge the conclusion?

Answer with a fact or cited source where available. Where evidence is incomplete, record the assumption, consequence, responsible owner and next validation action.

Which boundary, exception or failure case has not yet been tested?

Answer with a fact or cited source where available. Where evidence is incomplete, record the assumption, consequence, responsible owner and next validation action.

What must be handed over, monitored or reviewed after the immediate work is complete?

Answer with a fact or cited source where available. Where evidence is incomplete, record the assumption, consequence, responsible owner and next validation action.

Authoritative references and use notes

The sources below were selected as institutional or primary guidance for the broader practice. They support the handbook method; they do not imply that every statement or clause in a source applies to every project. Confirm the current edition, jurisdiction, contract and application before treating any requirement as mandatory.

  • MIT OpenCourseWare — Number Theory I — Massachusetts Institute of Technology. Used for algebraic and analytic number theory. Accessed 2026-08-13.
  • MIT OpenCourseWare — Algebra I — Massachusetts Institute of Technology. Used for groups, vector spaces, linear transformations and linear groups. Accessed 2026-08-13.

On this page

  1. Executive summary
  2. Quadratic fields
  3. Binary quadratic forms
  4. The correspondence with ideals
  5. Composition
  6. FAQ
  7. Continue in this stream
  8. Sources
Page ID
KV-MATH-0031
Taxonomy
ENG-MATH — Engineering / Mathematics
Collection
COL-CANT-001
Topic stream
CANT-QUADRATIC-FIELDS
Version
1.1.0 / content 2026.08
Last reviewed
2026-08-06

Continue learning

NEXT LESSON →Class Numbers of Imaginary Quadratic FieldsGuide · Engineering MathematicsBaby-Step Giant-Step and Class Group StructureGuide · Engineering MathematicsReal Quadratic Fields and the Infrastructure MethodGuide · Engineering MathematicsThe Cohen–Lenstra HeuristicsGuide · Engineering Mathematics
KEVOS · Engineering, manufacturing and project improvement
ArticlesServicesCase studiesAboutContact
© 2026 KEVOS®