---
title: "Operations with Fields"
canonical: "https://docs.magma-maths.org/v2.30-1/LocalFields/GeneralPAdicExtensions/operations.html"
source: "https://docs.magma-maths.org/v2.30-1/LocalFields/GeneralPAdicExtensions/operations.md"
part: "Local Fields"
chapter: "General $p$-Adic Extensions"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Local Fields", "source": "https://docs.magma-maths.org/v2.30-1/LocalFields/index-local-fields.md"}
  - {"title": "General $p$-Adic Extensions", "source": "https://docs.magma-maths.org/v2.30-1/LocalFields/GeneralPAdicExtensions/index-general-padic-extensions.md"}
prev: {"title": "Constructions", "source": "https://docs.magma-maths.org/v2.30-1/LocalFields/GeneralPAdicExtensions/construction.md"}
next: {"title": "Maximal Order", "source": "https://docs.magma-maths.org/v2.30-1/LocalFields/GeneralPAdicExtensions/maximal-order.md"}
intrinsics:
  - {"name": "BaseRing", "signature": "BaseRing(L): RngLocA -> Rng"}
  - {"name": "CoefficientRing", "signature": "CoefficientRing(L): RngLocA -> Rng"}
  - {"name": "DefiningPolynomial", "signature": "DefiningPolynomial(L): RngLocA -> RngUPolElt"}
  - {"name": "Degree", "signature": "Degree(L): RngLocA -> RngIntElt"}
  - {"name": "Degree", "signature": "Degree(L, R): RngLocA, Rng -> RngIntElt"}
  - {"name": "InertiaDegree", "signature": "InertiaDegree(L): RngLocA -> RngIntElt"}
  - {"name": "RamificationDegree", "signature": "RamificationDegree(L): RngLocA -> RngIntElt"}
  - {"name": "RamificationIndex", "signature": "RamificationIndex(L): RngLocA -> RngIntElt"}
  - {"name": "Precision", "signature": "Precision(L): RngLocA -> RngIntElt"}
  - {"name": "Prime", "signature": "Prime(L): RngLocA -> RngElt"}
  - {"name": "QuotientRepresentation", "signature": "QuotientRepresentation(L): RngLocA -> RngUPolRes"}
  - {"name": "RamifiedRepresentation", "signature": "RamifiedRepresentation(L): RngLocA -> FldPad, Map"}
  - {"name": "AssignNames", "signature": "AssignNames(~L, S): RngLocA, SeqEnum[MonStgElt]"}
  - {"name": "Name", "signature": "Name(L, i): RngLocA, RngIntElt -> RngLocAElt"}
  - {"name": "Discriminant", "signature": "Discriminant(L): RngLocA -> RngElt"}
  - {"name": "ResidueClassField", "signature": "ResidueClassField(L): RngLocA -> Rng, Map"}
  - {"name": "RelativeField", "signature": "RelativeField(L, m): RngLocA, Map -> RngLocA, Map, Map"}
  - {"name": "IsRamified", "signature": "IsRamified(L): RngLocA -> BoolElt"}
  - {"name": "IsTamelyRamified", "signature": "IsTamelyRamified(L): RngLocA -> BoolElt"}
  - {"name": "IsWildlyRamified", "signature": "IsWildlyRamified(L): RngLocA -> BoolElt"}
  - {"name": "IsTotallyRamified", "signature": "IsTotallyRamified(L): RngLocA -> BoolElt"}
  - {"name": "IsUnramified", "signature": "IsUnramified(L): RngLocA -> BoolElt"}
examples:
  - "ex-ef970a"
  - "ex-a41b45"
---

# Operations with Fields

<a id="function-basering-rngloca"></a>
## `BaseRing(L): RngLocA -> Rng`

<a id="function-coefficientring-rngloca"></a>
## `CoefficientRing(L): RngLocA -> Rng`

Return the coefficient field of the local field $L$. This is the field which was extended to construct $L$.

<a id="function-definingpolynomial-rngloca"></a>
## `DefiningPolynomial(L): RngLocA -> RngUPolElt`

Return the polynomial used to define the local field $L$ as an extension of its coefficient field.

<a id="function-degree-rngloca"></a>
## `Degree(L): RngLocA -> RngIntElt`

Return the degree of the local field $L$, that is, the degree of its defining polynomial.

<a id="function-degree-rngloca-rng"></a>
## `Degree(L, R): RngLocA, Rng -> RngIntElt`

Return the degree of $L$ as an extension of $R$ where $R$ is some coefficient ring of $L$.

<a id="function-inertiadegree-rngloca"></a>
## `InertiaDegree(L): RngLocA -> RngIntElt`

<a id="function-ramificationdegree-rngloca"></a>
## `RamificationDegree(L): RngLocA -> RngIntElt`

<a id="function-ramificationindex-rngloca"></a>
## `RamificationIndex(L): RngLocA -> RngIntElt`

Return the degree of the inertial or totally ramified subfield of the local field $L$ as an extension of the coefficient field of $L$.

<a id="function-precision-rngloca"></a>
## `Precision(L): RngLocA -> RngIntElt`

Return the precision of the local field $L$. This is the maximum number of digits which can occur in an element of $L$, the difference between the valuation of an element of $L$ and the valuation of the term of highest valuation occurring in that element.

<a id="function-prime-rngloca"></a>
## `Prime(L): RngLocA -> RngElt`

Return the prime of the local field $L$. This is the same as the prime of the coefficient field of $L$.

<a id="example-ex-ef970a"></a>
## `Example: Coefficient Ring and Defining Polynomial (ex-ef970a)`

Continuing from the first example we have :

```magma
> CoefficientRing(L);
7-adic field mod 7^50
> DefiningPolynomial(L);
$.1^6 + (32 + O(7^50))*$.1^5 + (390 + O(7^50))*$.1^4 + (2284 + O(7^50))*$.1^3 +
    (6588 + O(7^50))*$.1^2 + (8744 + O(7^50))*$.1 + 5452 + O(7^50)
> Precision(L);
150
> Prime(L);
7
> Degree(L); RamificationDegree(L); InertiaDegree(L);
6
3
2
```

<a id="function-quotientrepresentation-rngloca"></a>
## `QuotientRepresentation(L): RngLocA -> RngUPolRes`

Return the polynomial quotient ring which is isomorphic to the local field $L$ and is used to represent $L$.

<a id="function-ramifiedrepresentation-rngloca"></a>
## `RamifiedRepresentation(L): RngLocA -> FldPad, Map`

Return the local field isomorphic to the local field $L$ constructed as an unramified then a ramified extension and the map from $L$ into the isomorphic field.

<a id="example-ex-a41b45"></a>
## `Example: Two-Step Representation of a Local Field (ex-a41b45)`

We create a $1$ step local field and compute its representation as a $2$ step local field.

```magma
> P<x> := PolynomialRing(Integers());
> L<a> := LocalField(pAdicField(7, 50), x^6 - 49*x^2 + 686);
> L;
Extension of 7-adic field mod 7^50 by x^6 + O(7^50)*x^5 + O(7^50)*x^4 +
    O(7^50)*x^3 - (7^2 + O(7^52))*x^2 + O(7^50)*x + 2*7^3 + O(7^53)
> QuotientRepresentation(L);
Univariate Quotient Polynomial Algebra in $.1 over 7-adic field mod 7^50
with modulus $.1^6 + O(7^50)*$.1^5 + O(7^50)*$.1^4 + O(7^50)*$.1^3 - (7^2 +
    O(7^52))*$.1^2 + O(7^50)*$.1 + 2*7^3 + O(7^53)
> RR, m := RamifiedRepresentation(L);
> RR;
Totally ramified extension defined by the polynomial x^2 +
    417092732355694537113348201703437033788663*$.1^2 +
    586194602218356762336379252895075698537137*$.1 -
    130094113224633998166887533755901214096597
 over Unramified extension defined by the polynomial x^3 + 6*x + 2
 over 7-adic field mod 7^50
> m(L.1);
RR.1 + O(RR.1^92)
> RR.1 @@ m;
O(7^48)*$.1^5 + O(7^48)*$.1^4 + O(7^49)*$.1^3 + O(7^49)*$.1^2 + $.1 + O(7^50)
> CoefficientRing(RR).1 @@ m;
O(7^34)*$.1^5 - (954564700580430506024960512238*7^-1 + O(7^35))*$.1^4 +
    O(7^36)*$.1^3 + (1031213687115590174398504554631*7^-1 + O(7^35))*$.1^2 +
    O(7^37)*$.1 + 131284877366067295106350173568*7 + O(7^36)
```

<a id="procedure-assignnames-rngloca-seqenum-monstgelt-ref"></a>
## `AssignNames(~L, S): RngLocA, SeqEnum[MonStgElt]`

Assign the name in the sequence $S$ to the generator of the extension defining the local field $L$.

<a id="function-name-rngloca-rngintelt"></a>
## `Name(L, i): RngLocA, RngIntElt -> RngLocAElt`

Return the generator of the local field $L$ which has assigned to it the name in the sequence $S$ which was input to `AssignNames`. The only valid input for $i$ is $1$.

<a id="function-discriminant-rngloca"></a>
## `Discriminant(L): RngLocA -> RngElt`

Return the discriminant of the local field $L$.

<a id="function-residueclassfield-rngloca"></a>
## `ResidueClassField(L): RngLocA -> Rng, Map`

Return the residue class field of the maximal order of the local field $L$ and the map between $L$ and its residue class field.

<a id="function-relativefield-rngloca-map"></a>
## `RelativeField(L, m): RngLocA, Map -> RngLocA, Map, Map`

Return $L$ as an extension of the domain of the map $m$ which should be a map from a subfield of $L$ (having the same coefficient ring as $L$) into $L$.

## Predicates on Fields

<a id="function-isramified-rngloca"></a>
### `IsRamified(L): RngLocA -> BoolElt`

Return whether the local field $L$ has a non trivial ramified subfield, that is, the ramification degree of $L$ is greater than $1$.

<a id="function-istamelyramified-rngloca"></a>
### `IsTamelyRamified(L): RngLocA -> BoolElt`

<a id="function-iswildlyramified-rngloca"></a>
### `IsWildlyRamified(L): RngLocA -> BoolElt`

Return whether the local field $L$ is tamely or wildly ramified.

<a id="function-istotallyramified-rngloca"></a>
### `IsTotallyRamified(L): RngLocA -> BoolElt`

Return whether the local field $L$ is a totally ramified extension, that is, $L$ has a trivial inertial subfield.

<a id="function-isunramified-rngloca"></a>
### `IsUnramified(L): RngLocA -> BoolElt`

Return whether the local field $L$ is equal to its inertial subfield.
