---
title: "Structure Operations"
canonical: "https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFields/operation.html"
source: "https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFields/operation.md"
part: "Global Fields"
chapter: "Number Fields"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Global Fields", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/index-global-fields.md"}
  - {"title": "Number Fields", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFields/index-number-fields.md"}
prev: {"title": "Creation Functions", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFields/creation.md"}
next: {"title": "Fields with a Labelled Embedding", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFields/embedded-number-fields.md"}
intrinsics:
  - {"name": "Category", "signature": "Category(K): FldNum -> Cat"}
  - {"name": "Type", "signature": "Type(K): FldNum -> Cat"}
  - {"name": "ExtendedType", "signature": "ExtendedType(K): FldNum -> Cat"}
  - {"name": "Parent", "signature": "Parent(K): FldNum -> Pow"}
  - {"name": "AssignNames", "signature": "AssignNames(~K, s): FldNum, [ MonStgElt ]"}
  - {"name": "Name", "signature": "Name(K, i): FldNum, RngIntElt -> FldNumElt"}
  - {"name": ".", "signature": "K . i: FldNum, RngIntElt -> FldNumElt"}
  - {"name": "GroundField", "signature": "GroundField(F): FldNum -> Fld"}
  - {"name": "BaseField", "signature": "BaseField(F): FldNum -> Fld"}
  - {"name": "CoefficientField", "signature": "CoefficientField(F): FldNum -> Fld"}
  - {"name": "CoefficientRing", "signature": "CoefficientRing(F): FldNum -> Fld"}
  - {"name": "AbsoluteField", "signature": "AbsoluteField(F): FldNum -> FldNum"}
  - {"name": "SimpleExtension", "signature": "SimpleExtension(F): FldNum -> FldNum"}
  - {"name": "RelativeField", "signature": "RelativeField(F, L): FldNum, FldNum -> FldNum"}
  - {"name": "RelativeField", "signature": "RelativeField(Q, L): FldRat, FldNum -> FldNum"}
  - {"name": "Components", "signature": "Components(F): FldNum -> [FldNum]"}
  - {"name": "PrimeRing", "signature": "PrimeRing(F): FldNum -> RngRat"}
  - {"name": "PrimeField", "signature": "PrimeField(F): FldNum -> RngRat"}
  - {"name": "Centre", "signature": "Centre(F): FldNum -> FldNum"}
  - {"name": "Embed", "signature": "Embed(F, L, a): FldNum, FldNum, FldNumElt"}
  - {"name": "Embed", "signature": "Embed(F, L, a): FldNum, FldNum, [FldNumElt]"}
  - {"name": "EmbeddingMap", "signature": "EmbeddingMap(F, L): FldNum, FldNum -> Map"}
  - {"name": "MinkowskiSpace", "signature": "MinkowskiSpace(F): FldNum -> Lat, Map"}
  - {"name": "Completion", "signature": "Completion(K, P): FldNum, RngOrdIdl -> FldLoc, Map"}
  - {"name": "comp", "signature": "comp<K|P>: FldNum, RngOrdIdl -> FldLoc, Map"}
  - {"name": "Completion", "signature": "Completion(K, P): FldNum, PlcNumElt -> FldLoc, Map"}
  - {"name": "Algebra", "signature": "Algebra(K, J): FldNum, Fld -> AlgAss, Map"}
  - {"name": "Algebra", "signature": "Algebra(K, J, S): FldNum, Fld, [FldNumElt] -> AlgAss, Map"}
  - {"name": "VectorSpace", "signature": "VectorSpace(K, J): FldNum, Fld -> ModTupFld, Map"}
  - {"name": "KSpace", "signature": "KSpace(K, J): FldNum, Fld -> ModTupFld, Map"}
  - {"name": "VectorSpace", "signature": "VectorSpace(K, J, S): FldNum, Fld, [FldNumElt] -> ModTupFld, Map"}
  - {"name": "KSpace", "signature": "KSpace(K, J, S): FldNum, Fld, [FldNumElt] -> ModTupFld, Map"}
  - {"name": "Characteristic", "signature": "Characteristic(F): FldNum -> RngIntElt"}
  - {"name": "Degree", "signature": "Degree(F): FldNum -> RngIntElt"}
  - {"name": "AbsoluteDegree", "signature": "AbsoluteDegree(F): FldNum -> RngIntElt"}
  - {"name": "Discriminant", "signature": "Discriminant(F): FldNum -> RngIntElt"}
  - {"name": "Discriminant", "signature": "Discriminant(F): FldNum -> RngOrdIdl"}
  - {"name": "AbsoluteDiscriminant", "signature": "AbsoluteDiscriminant(K): FldNum -> FldRatElt"}
  - {"name": "Regulator", "signature": "Regulator(K): FldNum -> FldComElt"}
  - {"name": "RegulatorLowerBound", "signature": "RegulatorLowerBound(K): FldNum -> FldComElt"}
  - {"name": "Signature", "signature": "Signature(F): FldAlg -> RngIntElt, RngIntElt"}
  - {"name": "UnitRank", "signature": "UnitRank(K): FldNum -> RngIntElt"}
  - {"name": "DefiningPolynomial", "signature": "DefiningPolynomial(F): FldNum -> RngUPolElt"}
  - {"name": "DefiningPolynomial", "signature": "DefiningPolynomial(F): FldNum -> [RngUPolElt]"}
  - {"name": "Zeroes", "signature": "Zeroes(F, n): FldNum, RngIntElt -> [ FldComElt ]"}
  - {"name": "Basis", "signature": "Basis(F): FldNum -> [ FldNumElt ]"}
  - {"name": "Basis", "signature": "Basis(F, R): FldNum, Rng -> [ RngElt ]"}
  - {"name": "IntegralBasis", "signature": "IntegralBasis(F): FldNum -> [ FldNumElt ]"}
  - {"name": "IntegralBasis", "signature": "IntegralBasis(F, R): FldNum, Rng -> [ RngElt ]"}
  - {"name": "AbsoluteBasis", "signature": "AbsoluteBasis(K): FldNum -> [FldNumElt]"}
  - {"name": "eq", "signature": "F eq L: FldNum, FldNum -> BoolElt"}
  - {"name": "eq", "signature": "F eq L: FldRat, FldNum -> BoolElt"}
  - {"name": "eq", "signature": "F eq L: FldNum, FldRat -> BoolElt"}
  - {"name": "IsCommutative", "signature": "IsCommutative(R): Rng -> BoolElt"}
  - {"name": "IsUnitary", "signature": "IsUnitary(R): Rng -> BoolElt"}
  - {"name": "IsFinite", "signature": "IsFinite(R): Rng -> BoolElt"}
  - {"name": "IsOrdered", "signature": "IsOrdered(R): Rng -> BoolElt"}
  - {"name": "IsField", "signature": "IsField(R): Rng -> BoolElt"}
  - {"name": "IsNumberField", "signature": "IsNumberField(R): . -> BoolElt"}
  - {"name": "IsAlgebraicField", "signature": "IsAlgebraicField(R): . -> BoolElt"}
  - {"name": "IsEuclideanDomain", "signature": "IsEuclideanDomain(F): FldNum -> BoolElt"}
  - {"name": "IsSimple", "signature": "IsSimple(F): FldNum -> BoolElt"}
  - {"name": "IsPID", "signature": "IsPID(F): FldNum -> BoolElt"}
  - {"name": "IsUFD", "signature": "IsUFD(F): FldNum -> BoolElt"}
  - {"name": "IsPrincipalIdealRing", "signature": "IsPrincipalIdealRing(F): FldNum -> BoolElt"}
  - {"name": "IsDomain", "signature": "IsDomain(R): FldNum -> BoolElt"}
  - {"name": "ne", "signature": "F ne L: FldNum, FldNum -> BoolElt"}
  - {"name": "subset", "signature": "K subset L: FldNum, FldNum -> BoolElt"}
  - {"name": "subset", "signature": "K subset L: FldRat, FldNum -> BoolElt"}
  - {"name": "HasComplexConjugate", "signature": "HasComplexConjugate(K): FldNum -> BoolElt, Map"}
  - {"name": "ComplexConjugate", "signature": "ComplexConjugate(x): FldNumElt -> FldNumElt"}
  - {"name": "IsIsomorphic", "signature": "IsIsomorphic(F, L): FldNum, FldNum -> BoolElt, Map"}
  - {"name": "IsSubfield", "signature": "IsSubfield(F, L): FldNum, FldNum -> BoolElt, Map"}
  - {"name": "IsSubfield", "signature": "IsSubfield(F, L): FldRat, FldNum -> BoolElt, Map"}
  - {"name": "IsNormal", "signature": "IsNormal(F): FldNum -> BoolElt"}
  - {"name": "IsAbelian", "signature": "IsAbelian(F): FldNum -> BoolElt"}
  - {"name": "IsCyclic", "signature": "IsCyclic(F): FldNum -> BoolElt"}
  - {"name": "IsAbsoluteField", "signature": "IsAbsoluteField(K): FldNum -> BoolElt"}
examples:
  - "ex-e3e873"
  - "ex-909e79"
  - "ex-3f6dca"
  - "ex-e63cd9"
  - "ex-49b3f2"
  - "ex-0dc237"
---

<a id="operation"></a>
<a id="fldnum-str-op"></a>
# Structure Operations

In the lists below $K$ always denotes a number field.

## General Functions

Number fields form the Magma category `FldNum`. The notional power structures exist as parents of algebraic fields with no operations are allowed.

<a id="function-category-fldnum"></a>
### `Category(K): FldNum -> Cat`

<a id="function-type-fldnum"></a>
### `Type(K): FldNum -> Cat`

<a id="function-extendedtype-fldnum"></a>
### `ExtendedType(K): FldNum -> Cat`

<a id="function-parent-fldnum"></a>
### `Parent(K): FldNum -> Pow`

<a id="procedure-assignnames-fldnum-monstgelt-ref"></a>
### `AssignNames(~K, s): FldNum, [ MonStgElt ]`

Procedure to change the names of the generating elements in the number field $K$ to the contents of the sequence of strings $s$. The $i$-th sequence element will be the name used for the generator of the $(i-1)$-st subfield down from $K$ as determined by the creation of $K$, the first element being used as the name for the generator of $K$. In the case where $K$ is defined by more than one polynomial as an absolute extension, the $i$th sequence element will be the name used for the root of the $i$th polynomial used in the creation of $K$. This procedure only changes the names used in printing the elements of $K$. It does *not* assign to any identifiers the value of a generator in $K$; to do this, use an assignment statement, or use angle brackets when creating the field. Note that since this is a procedure that modifies $K$, it is necessary to have a reference `~K` to $K$ in the call to this function.

<a id="function-name-fldnum-rngintelt"></a>
### `Name(K, i): FldNum, RngIntElt -> FldNumElt`

<a id="operation-operation-fldnum-rngintelt-fldnumelt"></a>
### `K . i: FldNum, RngIntElt -> FldNumElt`

Given a number field $K$, return the element which has the $i$-th name attached to it, that is, the generator of the $(i - 1)$-st subfield down from $K$ as determined by the creation of $K$. Here $i$ must be in the range $1\leq i\leq m$, where $m$ is the number of polynomials used in creating $K$. If $K$ was created using multiple polynomials as an absolute extension, `K.i` will be a root of the $i$th polynomial used in creating $K$.

## Related Structures

Each number field has other structures related to it in various ways.

<a id="function-groundfield-fldnum"></a>
### `GroundField(F): FldNum -> Fld`

<a id="function-basefield-fldnum"></a>
### `BaseField(F): FldNum -> Fld`

<a id="function-fldnum-coefficientfield"></a>
### `CoefficientField(F): FldNum -> Fld`

<a id="function-coefficientring-fldnum"></a>
### `CoefficientRing(F): FldNum -> Fld`

Given a number field $F$, return the number field over which $F$ was defined. For an absolute number field $F$, the function returns the rational field ${\mathbb{Q}}$.

<a id="function-fldnum-absolutefield"></a>
### `AbsoluteField(F): FldNum -> FldNum`

Given a number field $F$, this returns an isomorphic number field $L$ defined as an absolute extension (i.e. over ${\mathbb{Q}}$). (For algorithm, see [[Tra76](https://docs.magma-maths.org/v2.30-1/references.md#cite-trager-factorization)])

<a id="function-fldnum-simpleextension"></a>
### `SimpleExtension(F): FldNum -> FldNum`

Given a number field $F$ or an order $O$, this returns an isomorphic field $L$ defined as an absolute simple extension. (For algorithm, see [[Tra76](https://docs.magma-maths.org/v2.30-1/references.md#cite-trager-factorization)])

<a id="function-relativefield-fldnum-fldnum"></a>
### `RelativeField(F, L): FldNum, FldNum -> FldNum`

<a id="function-relativefield-fldrat-fldnum"></a>
### `RelativeField(Q, L): FldRat, FldNum -> FldNum`

Given number fields $L$ and $F$ such that Magma knows that $F$ is a subfield of $L$, return an isomorphic number field $M$ defined as an extension over $F$.

<a id="function-components-fldnum"></a>
### `Components(F): FldNum -> [FldNum]`

Given a number field $F$ return the sequence of number fields each defined by a defining polynomial of $F$.

<a id="example-ex-e3e873"></a>
### `Example: Compositum of Two Number Fields (ex-e3e873)`

It is often desirable to build up a number field by adjoining several algebraic numbers to ${\mathbb{Q}}$. The following function returns a number field that is the composite field of two given number fields $K$ and $L$, provided that $K\cap L={\mathbb{Q}}$; if $K$ and $L$ have a common subfield larger than ${\mathbb{Q}}$ the function returns a field with the property that it contains a subfield isomorphic to $K$ as well as a subfield isomorphic to $L$.

```magma
> R<x> := PolynomialRing(Integers());
> Composite := function( K, L )
>     T<y> := PolynomialRing( K );
>     f := T!DefiningPolynomial( L );
>     ff := Factorization(f);
>     LKM := NumberField(ff[1][1]);
>     return AbsoluteField(LKM);
> end function;
```

To create, for example, the field ${\mathbb{Q}}(\sqrt{2}, \sqrt{3}, \sqrt{5})$, the above function should be applied twice:

```magma
> K := NumberField(x^2-3);
> L := NumberField(x^2-2);
> M := NumberField(x^2-5);
> KL := Composite(K, L);
> S<s> := PolynomialRing(BaseField(KL));
> KLM<w> := Composite(KL, M);
> KLM;
Number Field with defining polynomial s^8 - 40*s^6 + 352*s^4 - 960*s^2 + 576
over the Rational Field
```

Note, that the same field may be constructed with just one call to [`NumberField`](https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFields/creation.md#function-fldnum-numberfield) followed by [`AbsoluteField`](https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFields/operation.md#function-fldnum-absolutefield):

```magma
> KLM2 := AbsoluteField(NumberField([x^2-3, x^2-2, x^2-5]));
> KLM2;
Number Field with defining polynomial s^8 - 40*s^6 + 352*s^4 - 960*s^2 + 576
over the Rational Field
```

or by

```magma
> AbsoluteField(ext<Rationals() | [x^2-3, x^2-2, x^2-5]>);
Number Field with defining polynomial s^8 - 40*s^6 + 352*s^4 - 960*s^2 + 576
over the Rational Field
```

In general, however, the resulting polynomials of $KLM$ and $KLM2$ will differ. To see the difference between `SimpleExtension` and `AbsoluteField`, we will create `KLM2` again:

```magma
> KLM3 := NumberField([x^2-3, x^2-2, x^2-5]: Abs);
> AbsoluteField(KLM3);
Number Field with defining polynomials [ x^2 - 3, x^2 - 2,
    x^2 - 5] over the Rational Field
> SimpleExtension(KLM3);
Number Field with defining polynomial s^8 - 40*s^6 + 352*s^4 - 960*s^2 + 576
over the Rational Field
```

<a id="function-primering-fldnum"></a>
### `PrimeRing(F): FldNum -> RngRat`

<a id="function-primefield-fldnum"></a>
### `PrimeField(F): FldNum -> RngRat`

<a id="function-centre-fldnum"></a>
### `Centre(F): FldNum -> FldNum`

<a id="procedure-embed-fldnum-fldnum-fldnumelt"></a>
### `Embed(F, L, a): FldNum, FldNum, FldNumElt`

```magma
Overwrite: BoolElt                    Default: false
```

Install the embedding of a simple number field $F$ in $L$ where the image of the primitive element of $F$ is the element $a$ of $L$. This embedding will be used in coercing from $F$ into $L$.

If the addition of this embedding causes an inconsistency with currently known embeddings then the embedding will not be added unless `Overwrite` is set to `true`.

<a id="procedure-embed-fldnum-fldnum-fldnumelt-2"></a>
### `Embed(F, L, a): FldNum, FldNum, [FldNumElt]`

```magma
Overwrite: BoolElt                    Default: false
```

Install the embedding of the non-simple number field $F$ in $L$ where the image of the generating elements of $F$ are in the sequence $a$ of elements of $L$. This embedding will be used in coercing from $F$ into $L$.

If the addition of this embedding causes an inconsistency with currently known embeddings then the embedding will not be added unless `Overwrite` is set to `true`.

<a id="function-embeddingmap-fldnum-fldnum"></a>
### `EmbeddingMap(F, L): FldNum, FldNum -> Map`

Returns the embedding map of the number field $F$ in $L$ if an embedding is known.

<a id="example-ex-909e79"></a>
### `Example: Embedding One Number Field in Another (ex-909e79)`

Magma does not recognize two independently created number fields as equal since more than one embedding of a field in a larger field may be possible. To coerce between them, it is convenient to be able to embed them in each other.

```magma
> k := NumberField(x^2-2);
> l := NumberField(x^2-2);
> l!k.1;
>> l!k.1;
    ^
Runtime error in '!': Arguments are not compatible
LHS: FldNum
RHS: FldNumElt
> l eq k;
false
> Embed(k, l, l.1);
> l!k.1;
l.1
> Embed(l, k, k.1);
> k!l.1;
k.1
```

`Embed` is useful in specifying the embedding of a field in a larger field.

```magma
> l<a> := NumberField(x^3-2);
> L<b> := NumberField(x^6+108);
> Root(L!2, 3);
1/18*b^4
> Embed(l, L, $1);
> L!l.1;
1/18*b^4
```

Another embedding would be

```magma
> Roots(PolynomialRing(L)!DefiningPolynomial(l));
[
    <1/36*(-b^4 - 18*b), 1>,
    <1/36*(-b^4 + 18*b), 1>,
    <1/18*b^4, 1>
]
> Embed(l, L, $1[1][1] : Overwrite := true);
> L!l.1;
1/36*(-b^4 - 18*b)
```

<a id="function-minkowskispace-fldnum"></a>
### `MinkowskiSpace(F): FldNum -> Lat, Map`

```magma
Precision: RngIntElt                    Default: 167
```

The Minkowski vector space $V$ of the absolute number field $F$ as a real vector space, with inner product given by the $T_2$-norm ([`Length`](https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFieldsAndOrders/operation-element.md#function-rngord-length)) on $F$, and by the embedding $F \rightarrow V$.

<a id="function-fldnum-completion1"></a>
### `Completion(K, P): FldNum, RngOrdIdl -> FldLoc, Map`

<a id="constructor-constructor-comp-fldnum-rngordidl-fldloc-map"></a>
### `comp<K|P>: FldNum, RngOrdIdl -> FldLoc, Map`

```magma
Precision: RngIntElt                    Default: 20
```

For an absolute extension $K$ of ${\mathbb{Q}}$, compute the completion at a prime ideal $P$ which must be either a prime ideal of the maximal order or unramified. The result will be a local field or ring with default precision `Precision`.

The returned map is the canonical injection into the completion. It allows pointwise inverse operations.

<a id="function-completion-fldnum-plcnumelt"></a>
### `Completion(K, P): FldNum, PlcNumElt -> FldLoc, Map`

```magma
Precision: RngIntElt                    Default: 20
```

For an absolute extension $K$ over ${\mathbb{Q}}$ and a (finite) place $P$, compute the completion at $P$. The precision and the map are as described for [`Completion`](https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFields/operation.md#function-fldnum-completion1).

## Representing Fields as Vector Spaces

It is possible to express a number field as a vector space of any subfield using the intrinsics below. Such a construction also allows one to find properties of elements over these subfields.

<a id="function-algebra-fldnum-fld"></a>
### `Algebra(K, J): FldNum, Fld -> AlgAss, Map`

<a id="function-algebra-fldnum-fld-fldnumelt"></a>
### `Algebra(K, J, S): FldNum, Fld, [FldNumElt] -> AlgAss, Map`

Returns the associative structure constant algebra which is isomorphic to the number field $K$ as an algebra over $J$. Also returns the isomorphism from $K$ to the algebra mapping $w^i$ to the $i + 1$st unit vector of the algebra where $w$ is a primitive element of $K$.

If a sequence $S$ is given it is taken to be a basis of $K$ over $J$ and the isomorphism will map the $i$th element of $S$ to the $i$th unit vector of the algebra.

<a id="function-vectorspace-fldnum-fld"></a>
### `VectorSpace(K, J): FldNum, Fld -> ModTupFld, Map`

<a id="function-kspace-fldnum-fld"></a>
### `KSpace(K, J): FldNum, Fld -> ModTupFld, Map`

<a id="function-vectorspace-fldnum-fld-fldnumelt"></a>
### `VectorSpace(K, J, S): FldNum, Fld, [FldNumElt] -> ModTupFld, Map`

<a id="function-kspace-fldnum-fld-fldnumelt"></a>
### `KSpace(K, J, S): FldNum, Fld, [FldNumElt] -> ModTupFld, Map`

The vector space isomorphic to the number field $K$ as a vector space over $J$ and the isomorphism from $K$ to the vector space. The isomorphism maps $w^i$ to the $i + 1$st unit vector of the vector space where $w$ is a primitive element of $K$.

If $S$ is given, the isomorphism will map the $i$th element of $S$ to the $i$th unit vector of the vector space.

<a id="example-ex-3f6dca"></a>
### `Example: Minimal Polynomial over a Subfield (ex-3f6dca)`

We use the `Algebra` of a relative number field to obtain the minimal polynomial of an element over a subfield which is not in its coefficient field tower.

```magma
> K := NumberField([x^2 - 2, x^2 - 3, x^2 - 7]);
> J := AbsoluteField(NumberField([x^2 - 2, x^2 - 7]));
> A, m := Algebra(K, J);
> A;
Associative Algebra of dimension 2 with base ring J
> m;
Mapping from: RngOrd: K to AlgAss: A
> m(K.1);
(1/10*(J.1^3 - 13*J.1)                      0)
> m(K.1^2);
(2 0)
> m(K.2);
(1/470*(83*J.1^3 + 125*J.1^2 - 1419*J.1 - 1735) 1/940*(-24*J.1^3 - 5*J.1^2 +
    382*J.1 + 295))
> m(K.2^2);
(3 0)
> m(K.3);
(1/10*(-J.1^3 + 23*J.1)                       0)
> m(K.3^2);
(7 0)
> A.1 @@ m;
1
> A.2 @@ m;
(($.1 - 1)*$.1 - $.1 - 1)*K.1 + ($.1 + 1)*$.1 + $.1 + 1
>
> r := 5*K.1 - 8*K.2 + K.3;
> m(r);
(1/235*(-238*J.1^3 - 500*J.1^2 + 4689*J.1 + 6940) 1/235*(48*J.1^3 + 10*J.1^2 -
    764*J.1 - 590))
> MinimalPolynomial($1);
$.1^2 + 1/5*(-4*J.1^3 + 42*J.1)*$.1 + 5*J.1^2 - 180
> Evaluate($1, r);
0
> K:Maximal;

  K
  |
  |
  $1
  |
  |
  $2
  |
  |
  Q

K  : $.1^2 - 2
$1 : $.1^2 - 3
$2 : x^2 - 7
> Parent($3);
Univariate Polynomial Ring over J
> J;
Number Field with defining polynomial $.1^4 - 18*$.1^2 + 25 over the Rational
Field
```

## Invariants

Some information describing a number field can be retrieved.

<a id="function-characteristic-fldnum"></a>
### `Characteristic(F): FldNum -> RngIntElt`

<a id="function-fldnum-degree"></a>
### `Degree(F): FldNum -> RngIntElt`

Given a number field $F$, return the degree $[F:G]$ of $F$ over its ground field $G$.

<a id="function-absolutedegree-fldnum"></a>
### `AbsoluteDegree(F): FldNum -> RngIntElt`

Given a number field $F$, return the absolute degree of $F$ over ${\mathbb{Q}}$.

<a id="function-fldnum-discriminant"></a>
### `Discriminant(F): FldNum -> RngIntElt`

<a id="function-discriminant-fldnum"></a>
### `Discriminant(F): FldNum -> RngOrdIdl`

Given an extension $F$ of ${\mathbb{Q}}$, return the discriminant of $F$. This discriminant is defined to be the discriminant of the defining polynomial, **not** as the discriminant of the maximal order.

The discriminant in a relative extension $F$ is the ideal in the base ring generated by the discriminant of the defining polynomial.

<a id="function-absolutediscriminant-fldnum"></a>
### `AbsoluteDiscriminant(K): FldNum -> FldRatElt`

Given a number field $K$, return the absolute value of the discriminant of $K$ regarded as an extension of ${\mathbb{Q}}$.

<a id="function-regulator-fldnum"></a>
### `Regulator(K): FldNum -> FldComElt`

Given a number field $K$, return the regulator of $K$ as a real number. Note that this will trigger the computation of the maximal order and its unit group if they are not known yet. This only works in an absolute extension.

<a id="function-regulatorlowerbound-fldnum"></a>
### `RegulatorLowerBound(K): FldNum -> FldComElt`

Given a number field $K$, return a lower bound on the regulator of $O$ or $K$. This only works in an absolute extension.

<a id="function-signature-fldalg"></a>
### `Signature(F): FldAlg -> RngIntElt, RngIntElt`

Given an absolute number field $F$, returns two integers, one being the number of real embeddings, the other the number of pairs of complex embeddings of $F$.

<a id="function-unitrank-fldnum"></a>
### `UnitRank(K): FldNum -> RngIntElt`

The unit rank of the number field $K$ (one less than the number of real embeddings plus number of pairs of complex embeddings).

<a id="function-definingpolynomial-fldnum"></a>
### `DefiningPolynomial(F): FldNum -> RngUPolElt`

<a id="function-definingpolynomial-fldnum-2"></a>
### `DefiningPolynomial(F): FldNum -> [RngUPolElt]`

Given a number field $F$, the polynomial defining $F$ as an extension of its ground field $G$ is returned.

For non simple extensions, this will return a list of polynomials.

<a id="function-zeroes-fldnum-rngintelt"></a>
### `Zeroes(F, n): FldNum, RngIntElt -> [ FldComElt ]`

Given an absolute number field $F$, and an integer $n$, return the zeroes of the defining polynomial of $F$ with a precision of exactly $n$ decimal digits. The function returns a sequence of length the degree of $F$; all of the real zeroes appear before the complex zeroes.

<a id="example-ex-e63cd9"></a>
### `Example: Zeros and Defining Polynomial (ex-e63cd9)`

The information provided by `Zeros` and `DefiningPolynomial` is illustrated below.

```magma
> L := NumberField(x^6+108);
> DefiningPolynomial(L);
x^6 + 108
> Zeros(L, 30);
[ 1.889881574842309747150815910899999999994 +
1.0911236359717214035600726141999999999977*i,
1.889881574842309747150815910899999999994 -
1.0911236359717214035600726141999999999977*i,  0.E-29 +
2.1822472719434428071201452283999999999955*i,  0.E-29 -
2.1822472719434428071201452283999999999955*i,
-1.889881574842309747150815910899999999994 +
1.0911236359717214035600726141999999999977*i,
-1.889881574842309747150815910899999999994 -
1.0911236359717214035600726141999999999977*i ]
> l := NumberField(x^3 - 2);
> DefiningPolynomial(l);
x^3 - 2
> Zeros(l, 30);
[ 1.259921049894873164767210607299999999994,
-0.629960524947436582383605303639109999999 +
1.0911236359717214035600726141999999999977*i,
-0.629960524947436582383605303639109999999 -
1.0911236359717214035600726141999999999977*i ]
```

## Basis Representation

The basis of a number field can be expressed using elements from any compatible ring.

<a id="function-basis-fldnum"></a>
### `Basis(F): FldNum -> [ FldNumElt ]`

<a id="function-basis-fldnum-rng"></a>
### `Basis(F, R): FldNum, Rng -> [ RngElt ]`

Return the current basis for the number field $F$ over its ground ring as a sequence of elements of $F$ or as a sequence of elements of $R$.

<a id="function-integralbasis-fldnum"></a>
### `IntegralBasis(F): FldNum -> [ FldNumElt ]`

<a id="function-integralbasis-fldnum-rng"></a>
### `IntegralBasis(F, R): FldNum, Rng -> [ RngElt ]`

An integral basis for the algebraic number field $F$ is returned as a sequence of elements of $F$ or $R$ if given. This is the same as the basis for the maximal order. Note that the maximal order will be determined (and stored) if necessary.

<a id="example-ex-49b3f2"></a>
### `Example: Basis over Different Rings (ex-49b3f2)`

The following illustrates how a basis can look different when expressed in a different ring.

```magma
> f := x^5 + 5*x^4 - 75*x^3 + 250*x^2 + 65625;
> N := NumberField(f);
> N;
Number Field with defining polynomial x^5 + 5*x^4 - 75*x^3 + 250*x^2 + 65625
over the Rational Field
> Basis(N);
[
    1,
    N.1,
    N.1^2,
    N.1^3,
    N.1^4
]
> IntegralBasis(N);
[
    1,
    1/5*N.1,
    1/25*N.1^2,
    1/125*N.1^3,
    1/625*N.1^4
]
> IntegralBasis(N, MaximalOrder(N));
[
    [1, 0, 0, 0, 0],
    [0, 1, 0, 0, 0],
    [0, 0, 1, 0, 0],
    [0, 0, 0, 1, 0],
    [0, 0, 0, 0, 1]
]
```

<a id="function-fldnum-absolutebasis"></a>
### `AbsoluteBasis(K): FldNum -> [FldNumElt]`

Returns an absolute basis for the number field $K$, i.e. a basis for $K$ as a ${\mathbb{Q}}$ vector space. The basis will consist of the products of the basis elements of the intermediate fields. The expansion is done depth-first.

<a id="example-ex-0dc237"></a>
### `Example: Basis and Integral Basis (ex-0dc237)`

We continue our example of a field of degree 4. The functions `Basis` and `IntegralBasis` both return a sequence of elements, that can be accessed using the operators for enumerated sequences. Note that if, as in our example, $O$ is the maximal order of $K$, both functions produce the same output:

```magma
> R<x> := PolynomialRing(Integers());
> f := x^4 - 420*x^2 + 40000;
> K<y> := NumberField(f);
> O := MaximalOrder(K);
> I := IntegralBasis(K);
> B := Basis(O);
> I, B;
[
    1,
    1/2*y,
    1/40*(y^2 + 10*y),
    1/800*(y^3 + 180*y + 400)
]
[
    O.1,
    O.2,
    O.3,
    O.4
]
> Basis(O, K);
[
    1,
    1/2*y,
    1/40*(y^2 + 10*y),
    1/800*(y^3 + 180*y + 400)
]
```

## Ring Predicates

Number fields can be tested for having several properties that may hold for general rings.

<a id="operation-op-eq-fldnum-fldnum"></a>
### `F eq L: FldNum, FldNum -> BoolElt`

<a id="operation-op-eq-fldrat-fldnum"></a>
### `F eq L: FldRat, FldNum -> BoolElt`

<a id="operation-op-eq-fldnum-fldrat"></a>
### `F eq L: FldNum, FldRat -> BoolElt`

Returns `true` if and only if the number fields $F$ and $L$ are indentical. No two number fields which have been created independently of each other will be considered equal since it is possible that they can be embedded into a larger field in more than one way.

<a id="function-iscommutative-rng"></a>
### `IsCommutative(R): Rng -> BoolElt`

<a id="function-isunitary-rng"></a>
### `IsUnitary(R): Rng -> BoolElt`

<a id="function-isfinite-rng"></a>
### `IsFinite(R): Rng -> BoolElt`

<a id="function-isordered-rng"></a>
### `IsOrdered(R): Rng -> BoolElt`

<a id="function-isfield-rng"></a>
### `IsField(R): Rng -> BoolElt`

<a id="function-isnumberfield"></a>
### `IsNumberField(R): . -> BoolElt`

<a id="function-isalgebraicfield"></a>
### `IsAlgebraicField(R): . -> BoolElt`

<a id="function-iseuclideandomain-fldnum"></a>
### `IsEuclideanDomain(F): FldNum -> BoolElt`

This is not a check for euclidean number fields. This function will always return `true`, as all number fields are euclidean domains.

<a id="function-issimple-fldnum"></a>
### `IsSimple(F): FldNum -> BoolElt`

Checks if the number field $F$ is defined as a simple extension over the base ring.

<a id="function-ispid-fldnum"></a>
### `IsPID(F): FldNum -> BoolElt`

<a id="function-isufd-fldnum"></a>
### `IsUFD(F): FldNum -> BoolElt`

<a id="function-isprincipalidealring-fldnum"></a>
### `IsPrincipalIdealRing(F): FldNum -> BoolElt`

Always `true` for number fields.

<a id="function-isdomain-fldnum"></a>
### `IsDomain(R): FldNum -> BoolElt`

<a id="operation-op-ne-fldnum-fldnum"></a>
### `F ne L: FldNum, FldNum -> BoolElt`

<a id="operation-op-subset-fldnum-fldnum"></a>
### `K subset L: FldNum, FldNum -> BoolElt`

<a id="operation-op-subset-fldrat-fldnum"></a>
### `K subset L: FldRat, FldNum -> BoolElt`

<a id="function-fldnum-hascomplexconjugate"></a>
### `HasComplexConjugate(K): FldNum -> BoolElt, Map`

This function returns `true` if there is an automorphism in the number field $K$ that acts like complex conjugation.

<a id="function-complexconjugate-fldnumelt"></a>
### `ComplexConjugate(x): FldNumElt -> FldNumElt`

For an element $x$ of a number field $K$ where [`HasComplexConjugate`](https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFields/operation.md#function-fldnum-hascomplexconjugate) returns `true` (in particular this includes totally real fields, cyclotomic and quadratic fields, and CM-extensions), the conjugate of $x$ is returned.

## Field Predicates

Here all the predicates that are specific to number fields are listed.

<a id="function-isisomorphic-fldnum-fldnum"></a>
### `IsIsomorphic(F, L): FldNum, FldNum -> BoolElt, Map`

Given two number fields $F$ and $L$, this returns `true` as well as an isomorphism $F\rightarrow L$, if $F$ and $L$ are isomorphic, and it returns `false` otherwise.

<a id="function-issubfield-fldnum-fldnum"></a>
### `IsSubfield(F, L): FldNum, FldNum -> BoolElt, Map`

<a id="function-issubfield-fldrat-fldnum"></a>
### `IsSubfield(F, L): FldRat, FldNum -> BoolElt, Map`

Given two number fields $F$ and $L$, this returns `true` as well as an embedding $F\hookrightarrow L$, if $F$ is a subfield of $L$, and it returns `false` otherwise.

<a id="function-isnormal-fldnum"></a>
### `IsNormal(F): FldNum -> BoolElt`

Returns `true` if and only if the number field $F$ is a normal extension. At present this may only be applied if $F$ is an absolute extension or simple relative extension. In the relative case the result is obtained via Galois group computation.

<a id="function-isabelian-fldnum"></a>
### `IsAbelian(F): FldNum -> BoolElt`

Returns `true` if and only if the number field $F$ is a normal extension with abelian Galois group. At present this may only be applied if $F$ is an absolute extension or simple relative extension. In the relative case the result is obtained via Galois Group computation.

<a id="function-iscyclic-fldnum"></a>
### `IsCyclic(F): FldNum -> BoolElt`

Returns `true` if and only if the number field $F$ is a normal extension with cyclic Galois group. At present this may only be applied if $F$ is an absolute extension or simple relative extension. In the relative case the result is obtained via Galois and automorphism group.

<a id="function-isabsolutefield-fldnum"></a>
### `IsAbsoluteField(K): FldNum -> BoolElt`

Returns `true` iff the number field $K$ is a constructed as an absolute extension of ${\mathbb{Q}}$.
