---
title: "General Structure Invariants"
canonical: "https://docs.magma-maths.org/v2.30-1/GlobalFields/AlgebraicFunctionFields/structure-invar.html"
source: "https://docs.magma-maths.org/v2.30-1/GlobalFields/AlgebraicFunctionFields/structure-invar.md"
part: "Global Fields"
chapter: "Algebraic Function 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": "Algebraic Function Fields", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/AlgebraicFunctionFields/index-algebraic-function-fields.md"}
prev: {"title": "Related Structures", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/AlgebraicFunctionFields/structure-related.md"}
next: {"title": "Galois Groups", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/AlgebraicFunctionFields/galois.md"}
intrinsics:
  - {"name": "Characteristic", "signature": "Characteristic(F): FldFun -> RngIntElt"}
  - {"name": "Characteristic", "signature": "Characteristic(O): RngFunOrd -> RngIntElt"}
  - {"name": "IsPerfect", "signature": "IsPerfect(F): Fld -> BoolElt"}
  - {"name": "Degree", "signature": "Degree(F): FldFunG -> RngIntElt"}
  - {"name": "Degree", "signature": "Degree(F, G): FldFun, FldFun -> RngIntElt"}
  - {"name": "Degree", "signature": "Degree(O): RngFunOrd -> RngIntElt"}
  - {"name": "AbsoluteDegree", "signature": "AbsoluteDegree(F): FldFunG -> RngIntElt"}
  - {"name": "AbsoluteDegree", "signature": "AbsoluteDegree(O): RngFunOrd -> RngIntElt"}
  - {"name": "DefiningPolynomial", "signature": "DefiningPolynomial(F): FldFun -> RngUPolElt"}
  - {"name": "DefiningPolynomial", "signature": "DefiningPolynomial(O): RngFunOrd -> RngUPolElt"}
  - {"name": "DefiningPolynomials", "signature": "DefiningPolynomials(F): FldFun -> [RngUPolElt]"}
  - {"name": "DefiningPolynomials", "signature": "DefiningPolynomials(O): RngFunOrd -> [RngUPolElt]"}
  - {"name": "Basis", "signature": "Basis(F): FldFunG -> SeqEnum[FldFunElt]"}
  - {"name": "Basis", "signature": "Basis(O): RngFunOrd -> SeqEnum[FldFunElt]"}
  - {"name": "Basis", "signature": "Basis(O, R): RngFunOrd, Rng -> SeqEnum[RngElt]"}
  - {"name": "TransformationMatrix", "signature": "TransformationMatrix(O1, O2): RngFunOrd, RngFunOrd -> AlgMatElt, RngElt"}
  - {"name": "CoefficientIdeals", "signature": "CoefficientIdeals(O): RngFunOrd -> [RngFunOrdIdl]"}
  - {"name": "BasisMatrix", "signature": "BasisMatrix(O): RngFunOrd -> AlgMatElt"}
  - {"name": "PrimitiveElement", "signature": "PrimitiveElement(O): RngFunOrd -> RngFunOrdElt"}
  - {"name": "Discriminant", "signature": "Discriminant(O): RngFunOrd -> ."}
  - {"name": "AbsoluteDiscriminant", "signature": "AbsoluteDiscriminant(O): RngFunOrd -> ."}
  - {"name": "DimensionOfExactConstantField", "signature": "DimensionOfExactConstantField(F): FldFunG -> RngIntElt"}
  - {"name": "DegreeOfExactConstantField", "signature": "DegreeOfExactConstantField(F): FldFunG -> RngIntElt"}
  - {"name": "Genus", "signature": "Genus(F): FldFunG -> RngIntElt"}
  - {"name": "GapNumbers", "signature": "GapNumbers(F): FldFunG -> SeqEnum[RngIntElt]"}
  - {"name": "GapNumbers", "signature": "GapNumbers(F, P): FldFunG, PlcFunElt -> SeqEnum[RngIntElt]"}
  - {"name": "GapNumbers", "signature": "GapNumbers(P): PlcFunElt -> SeqEnum[RngIntElt]"}
  - {"name": "SeparatingElement", "signature": "SeparatingElement(F): FldFunG -> FldFunGElt"}
  - {"name": "RamificationDivisor", "signature": "RamificationDivisor(F): FldFunG -> DivFunElt"}
  - {"name": "WeierstrassPlaces", "signature": "WeierstrassPlaces(F): FldFunG -> [PlcFunElt]"}
  - {"name": "WronskianOrders", "signature": "WronskianOrders(F): FldFunG -> [RngIntElt]"}
  - {"name": "Different", "signature": "Different(O): RngFunOrd -> RngFunOrdIdl"}
  - {"name": "Index", "signature": "Index(O, S): RngFunOrd, RngFunOrd -> Any"}
examples:
  - "ex-a8d7ef"
  - "ex-ec93f9"
---

# General Structure Invariants

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

<a id="function-characteristic-rngfunord"></a>
## `Characteristic(O): RngFunOrd -> RngIntElt`

The characteristic of the function field $F/k$ or one of its orders $O$.

<a id="function-isperfect-fld"></a>
## `IsPerfect(F): Fld -> BoolElt`

Applies to any field in Magma. Returns whether $F$ is perfect.

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

<a id="function-degree-fldfun-fldfun"></a>
## `Degree(F, G): FldFun, FldFun -> RngIntElt`

<a id="function-degree-rngfunord"></a>
## `Degree(O): RngFunOrd -> RngIntElt`

The degree $[F:G]$ of the field extension $F/G$ where $G$ is the base field of $F$ unless specified. For an order $O$, this function returns the rank of $O$ as a module over its coefficient ring. Note that this rank is equal to the degree $[F:G]$ where $F$ and $G$ are the field of fractions of $O$ and the coefficient ring of $O$ respectively.

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

<a id="function-absolutedegree-rngfunord"></a>
## `AbsoluteDegree(O): RngFunOrd -> RngIntElt`

The degree of the function field $F$ or the order $O$ as a finite extension of $k(x)$ or $k[x]$ or as an infinite extension of $k$.

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

<a id="function-definingpolynomial-rngfunord"></a>
## `DefiningPolynomial(O): RngFunOrd -> RngUPolElt`

The defining polynomial of the function field $F$ over its coefficient ring. For an order $O$ belonging to a function field $F$, this function returns the defining polynomial of $O$, which may be different from that of $F/k(x, \alpha_1, \ldots, \alpha_r)$.

<a id="function-definingpolynomials-fldfun"></a>
## `DefiningPolynomials(F): FldFun -> [RngUPolElt]`

<a id="function-definingpolynomials-rngfunord"></a>
## `DefiningPolynomials(O): RngFunOrd -> [RngUPolElt]`

Return the defining polynomials of the function field $F$ or the order $O$ as a sequence of polynomials over the coefficient ring.

<a id="function-basis-fldfung"></a>
## `Basis(F): FldFunG -> SeqEnum[FldFunElt]`

<a id="function-basis-rngfunord"></a>
## `Basis(O): RngFunOrd -> SeqEnum[FldFunElt]`

<a id="function-basis-rngfunord-rng"></a>
## `Basis(O, R): RngFunOrd, Rng -> SeqEnum[RngElt]`

The basis $1, \alpha, \dots, \alpha^{n-1}$ of the function field $F[\alpha]$ over the coefficient field.

Given an order $O$ belonging to a function field $F$, this function returns the basis of $O$ in the form of function field elements.

Given an additional ring $R$, return the basis of $O$ as elements of $R$.

<a id="function-transformationmatrix-rngfunord-rngfunord"></a>
## `TransformationMatrix(O1, O2): RngFunOrd, RngFunOrd -> AlgMatElt, RngElt`

Return the matrix $M$ and a denominator $d$ which transforms elements of the order $O1$ into elements of the order $O2$.

<a id="function-coefficientideals-rngfunord"></a>
## `CoefficientIdeals(O): RngFunOrd -> [RngFunOrdIdl]`

The coefficient ideals of the order $O$ of a relative extension. These are the ideals $\{A_i\}$ of the coefficient ring of $O$ such that for every element $e$ of $O$, $e = \sum_i a_i*b_i$ where $\{b_i\}$ is the basis returned for $O$ and each $a_i \in A_i$.

<a id="function-basismatrix-rngfunord"></a>
## `BasisMatrix(O): RngFunOrd -> AlgMatElt`

Given an order $O$ in a function field $F$ of degree $n$, this returns an $n\times n$ matrix whose $i$-th row contains the coefficients for the $i$-th basis element of $O$ with respect to the power basis of $F$. Thus, if $b_i$ is the $i$-th basis element of $O$,

$$
b_i=\sum_{j=1}^{n}M_{ij}\alpha^{j-1}
$$

where $M$ is the matrix and $\alpha$ is the generator of $F$.

<a id="function-primitiveelement-rngfunord"></a>
## `PrimitiveElement(O): RngFunOrd -> RngFunOrdElt`

A root of the defining polynomial of the order $O$.

<a id="function-discriminant-rngfunord"></a>
## `Discriminant(O): RngFunOrd -> .`

The discriminant of the order $O$, up to a unit in its coefficient ring.

<a id="function-absolutediscriminant-rngfunord"></a>
## `AbsoluteDiscriminant(O): RngFunOrd -> .`

The discriminant of the order $O$ of an algebraic function field $F$ over the bottom coefficient ring of $O$, (the subring of the rational function field $F$ extends).

<a id="function-dimensionofexactconstantfield-fldfung"></a>
## `DimensionOfExactConstantField(F): FldFunG -> RngIntElt`

<a id="function-degreeofexactconstantfield-fldfung"></a>
## `DegreeOfExactConstantField(F): FldFunG -> RngIntElt`

The dimension of the exact constant field of the function field $F/k$ over $k$. The exact constant field is the algebraic closure of $k$ in $F$.

<a id="function-genus-fldfung"></a>
## `Genus(F): FldFunG -> RngIntElt`

```magma
Al     : MonStgElt                    Default: 
IsExact: BoolElt                      Default: false
```

The genus of the function field $F/k$. If $F$ is an extension of a rational function field over ${\mathbb{Q}}$ or ${\mathbb{F}}_q$ by a single monic integral polynomial and the parameter `Al` is set to `"Montes"` then the Montes algorithm [[Sta18](https://docs.magma-maths.org/v2.30-1/references.md#cite-2015arxiv150601904s)] will be used to compute the genus.

The index $[k_0:{\rm ConstantField}(F)]$, where $k_0$ is the full constant field, is also returned. If it is known beforehand that $k_0$ is the constant field $F$ is defined over then set the parameter `IsExact := true`.

<a id="example-ex-a8d7ef"></a>
## `Example: Invariants of a Relative Function Field (ex-a8d7ef)`

```magma
> PF<x> := PolynomialRing(GF(31, 3));
> P<y> := PolynomialRing(PF);
> FF1<b> := ext<FieldOfFractions(PF) | y^2 - x^3 + 1>;
> P<y> := PolynomialRing(FF1);
> FF2<d> := ext<FF1 | y^3 - b*x*y - 1>;
> Characteristic(FF2);
31
> EFF2I := EquationOrderInfinite(FF2);
> MFF2I := MaximalOrderInfinite(FF2);
> Degree(MFF2I) eq 3;
true
> AbsoluteDegree(EFF2I);
6
> Genus(FF2);
9
> DefiningPolynomial(EFF2I);
$.1^3 + [ 0, 30/x^3 ]*$.1 + [ 30/x^9, 0 ]
> Basis(MFF2I);
[ 1, 1/x*d, 1/x^2*d^2 ]
> Discriminant(EFF2I);
Ideal of Maximal Equation Order of FF1 over Valuation ring of Univariate
rational function field over GF(31^3)
Variables: x with generator 1/x
Generator:
(4*x^3 + 27)/x^15*b + 4/x^18
> AbsoluteOrder(EFF2I);
Order of Algebraic function field defined over Univariate rational function
field over GF(31^3) by
y^6 + 29*y^3 + (30*x^5 + x^2)*y^2 + 1 over Valuation ring of Univariate rational
function field over GF(31^3) with generator 1/x
> AbsoluteDiscriminant(EFF2I);
(2*x^9 + 25*x^6 + 6*x^3 + 29)/x^33
> Discriminant($2);
(30*x^24 + 6*x^21 + 16*x^18 + 20*x^15 + 16*x^12 + 7*x^9 + 27*x^6 + 3*x^3 +
    30)/x^48
```

<a id="example-ex-ec93f9"></a>
## `Example: Invariants of a Non-Simple Field (ex-ec93f9)`

Invariants are slightly different for non–simple fields.

```magma
> P<x> := PolynomialRing(Rationals());
> P<y> := PolynomialRing(P);
> F<a, b> := FunctionField([3*y^3 - x^2, x*y^2 + 1]);
> DefiningPolynomials(F);
[
    3*y^3 - x^2,
    x*y^2 + 1
]
> DefiningPolynomials(EquationOrderFinite(F));
[
    y^3 - 1/3*x^2,
    y^2 + x
]
> DefiningPolynomials(EquationOrderInfinite(F));
[
    $.1^3 - 1/3/$.1^4,
    $.1^2 + 1/$.1
]
> Basis(F);
[
    1,
    a,
    a^2,
    $.1*b,
    $.1*a*b,
    $.1*a^2*b
]
> TransformationMatrix(EquationOrderFinite(F), MaximalOrderFinite(F));
[1 0 0 0 0 0]
[0 1 0 0 0 0]
[0 0 x 0 0 0]
[0 0 0 1 0 0]
[0 0 0 0 x 0]
[0 0 0 0 0 x]
1
> TransformationMatrix(MaximalOrderFinite(F), EquationOrderFinite(F));
[x 0 0 0 0 0]
[0 x 0 0 0 0]
[0 0 1 0 0 0]
[0 0 0 x 0 0]
[0 0 0 0 1 0]
[0 0 0 0 0 1]
x
```

<a id="function-gapnumbers-fldfung"></a>
## `GapNumbers(F): FldFunG -> SeqEnum[RngIntElt]`

```magma
SeparatingElement: FldFunGElt                    Default: 
```

The sequence of global gap numbers of the function field $F/k$ (in characteristic zero this is always $[1, \dots, g]$). A separating element used internally for the computation can be specified, it defaults to `SeparatingElement(F)`. See the description of [`GapNumbers`](https://docs.magma-maths.org/v2.30-1/GlobalFields/AlgebraicFunctionFields/divisors.md#function-divfunelt-gapnumbers).

<a id="function-gapnumbers-fldfung-plcfunelt"></a>
## `GapNumbers(F, P): FldFunG, PlcFunElt -> SeqEnum[RngIntElt]`

<a id="function-gapnumbers-plcfunelt"></a>
## `GapNumbers(P): PlcFunElt -> SeqEnum[RngIntElt]`

The sequence of gap numbers of the function field $F/k$ at $P$ where $P$ must be a place of degree one. See the description of [`GapNumbers`](https://docs.magma-maths.org/v2.30-1/GlobalFields/AlgebraicFunctionFields/divisors.md#function-divfunelt-gapnumbers).

<a id="function-separatingelement-fldfung"></a>
## `SeparatingElement(F): FldFunG -> FldFunGElt`

Returns a separating element of the function field $F/k$.

<a id="function-ramificationdivisor-fldfung"></a>
## `RamificationDivisor(F): FldFunG -> DivFunElt`

```magma
SeparatingElement: FldFunGElt                    Default: 
```

The ramification divisor of the function field $F/k$. The semantics of calling `RamificationDivisor()` with $F$ or the zero divisor of $F$ are identical. For further details see the description of [`RamificationDivisor`](https://docs.magma-maths.org/v2.30-1/GlobalFields/AlgebraicFunctionFields/divisors.md#function-divfunelt-ramificationdivisor).

<a id="function-weierstrassplaces-fldfung"></a>
## `WeierstrassPlaces(F): FldFunG -> [PlcFunElt]`

```magma
SeparatingElement: FldFunGElt                    Default: 
```

The Weierstrass places of the function field $F/k$. The semantics of calling `WeierstrassPlaces` with $F$ or the zero divisor of $F$ are identical. See the description of [`WeierstrassPlaces`](https://docs.magma-maths.org/v2.30-1/GlobalFields/AlgebraicFunctionFields/divisors.md#function-divfunelt-weierstrassplaces).

<a id="function-wronskianorders-fldfung"></a>
## `WronskianOrders(F): FldFunG -> [RngIntElt]`

```magma
SeparatingElement: FldFunGElt                    Default: 
```

The Wronskian orders of the function field $F/k$. The semantics of calling `WronskianOrders` with $F$ or the zero divisor of $F$ are identical. See the description of [`WronskianOrders`](https://docs.magma-maths.org/v2.30-1/GlobalFields/AlgebraicFunctionFields/divisors.md#function-divfunelt-wronskianorders).

<a id="function-different-rngfunord"></a>
## `Different(O): RngFunOrd -> RngFunOrdIdl`

The different of the maximal order $O$.

<a id="function-index-rngfunord-rngfunord"></a>
## `Index(O, S): RngFunOrd, RngFunOrd -> Any`

The index of $S$ in $O$ where $S$ is a suborder of $O$ and $O$ and $S$ have the same equation order.
