# Introduction

This chapter gives an overview of number fields in Magma. Full documentation is spread across the following chapters:

Cyclotomic fields, Chapter [Cyclotomic Fields](../CyclotomicFields/index-cyclotomic-fields.md#chapfldcyc)

Quadratic fields, Chapter [Quadratic Fields](../QuadraticFields/index-quadratic-fields.md#chapfldquad)

Orders in number fields, including ideal theory, Chapter [Number Fields and Orders](../NumberFieldsAndOrders/index-number-fields-and-orders.md#rngord-main)

Galois Theory, Chapter [Galois Groups and Automorphisms](../GaloisGroupsAndAutomorphisms/index-galois-groups-and-automorphisms.md#rngordgal-main)

Class Field Theory, Chapter [Class Field Theory](../ClassFieldTheory/index-class-field-theory.md#fldab-main)

The algorithms, functions and syntax for number fields and orders are often parallel to those for extensions of function fields of one variable.

Number fields in Magma are finite extensions of the rational field ${\mathbb{Q}}$, or another number field. Extensions directly over ${\mathbb{Q}}$ are referred to as *absolute fields*, extensions of number fields are called *relative fields*.

The `RationalField()` is *not* a number field in Magma. A trivial extension is created by `RationalsAsNumberField()`.

A number field is constructed as $K = k[t]/(f(t))$ where $f$ is an irreducible polynomial in $k[t]$. The generator `K.1` is a root of $f$. A field may also be constructed as a multivariate quotient $K = k[s_1,\ldots,s_n]/(f_1(s_1), \ldots, f_n(s_n))$ for univariate $f_i$ in $k[t]$. The generators `K.i` are roots of $f_i$. This construction is a shortcut for creating a tower of single extensions.

Number fields in Magma are abstract: they do not come with a distinguished embedding into an algebraically closed field. Embeddings between fields can be defined by the user, and may also be chosen (once and for all) by functions such as `IsIsomorphic` and `IsSubfield`. Crucially, it is possible to create multiple copies of the field defined by a given polynomial. Therefore every extension defined by the user creates a *new* object in Magma (unless the user requests otherwise).

The embeddings of a field into the real and complex numbers are given by the `Conjugates` of an element, or by `InfinitePlaces` of a field (and `Evaluate` to evaluate the embedding corresponding to a place). See [Places and Divisors](divisors.md#fldnum-plcnum).

The basis of `K<w>` $= k[t]/(f(t))$ over its base field $k$ is always the power basis $1, w, w^2, \dots, w^{n-1}$ (where the generator `w = K.1` is a root of $f$). The basis of an order in an absolute field is usually in hermite form with respect to the field basis, however there are exceptions such as the `LLL` of an order. The field of fractions of an order always has the same basis as the order.

An arbitrary number field can be converted to an absolute extension of ${\mathbb{Q}}$ using `AbsoluteField`, i.e. this finds a primitive element over ${\mathbb{Q}}$. Similarly, a number field defined by multiple polynomials can be converted to a field defined by a single polynomial using [`SimpleExtension`](operation.md#function-fldnum-simpleextension).

Notes about relative fields:

- Invariants such as [`Degree`](operation.md#function-fldnum-degree), [`Discriminant`](operation.md#function-fldnum-discriminant), [`Norm`](operation-element.md#function-fldnum-norm), [`Trace`](operation-element.md#function-fldnum-trace) are always relative to the base field. They have variants of the form `Degree(K, k)` and `AbsoluteDegree`.

- Some operations and invariants are implemented only for absolute fields, for instance `ClassGroup`, `UnitGroup` and so on.

- Conversions (eg between relative/absolute fields) may be time consuming. However the results are stored, so are only computed once. Applying the resulting maps to elements should be fast.

*Warnings:*

- `Discriminant(F)` for a field $F$ returns `Discriminant(DefiningPolynomial(F))`, *not* `Discriminant(MaximalOrder(F))`.

- Some functions defined for fields are shortcuts, referring to the maximal order. For example, `UnitGroup(F)` returns the (finitely generated) unit group of `MaximalOrder(F)`, *not* the multiplicative group of $F$.
