---
title: "Element Operations"
canonical: "https://docs.magma-maths.org/v2.30-1/BasicRings/FiniteFields/operation-element.html"
source: "https://docs.magma-maths.org/v2.30-1/BasicRings/FiniteFields/operation-element.md"
part: "Basic Rings"
chapter: "Finite Fields"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Basic Rings", "source": "https://docs.magma-maths.org/v2.30-1/BasicRings/index-basic-rings.md"}
  - {"title": "Finite Fields", "source": "https://docs.magma-maths.org/v2.30-1/BasicRings/FiniteFields/index-finite-fields.md"}
prev: {"title": "Structure Operations", "source": "https://docs.magma-maths.org/v2.30-1/BasicRings/FiniteFields/operation.md"}
next: {"title": "Polynomials for Finite Fields", "source": "https://docs.magma-maths.org/v2.30-1/BasicRings/FiniteFields/polynomial.md"}
intrinsics:
  - {"name": "+", "signature": "+ a: FldFinElt -> FldFinElt"}
  - {"name": "-", "signature": "- a: FldFinElt -> FldFinElt"}
  - {"name": "+", "signature": "a + b: FldFinElt, FldFinElt -> FldFinElt"}
  - {"name": "-", "signature": "a - b: FldFinElt, FldFinElt -> FldFinElt"}
  - {"name": "*", "signature": "a * b: FldFinElt, FldFinElt -> FldFinElt"}
  - {"name": "/", "signature": "a / b: FldFinElt, FldFinElt -> FldFinElt"}
  - {"name": "^", "signature": "a ^ k: FldFinElt, RngIntElt -> FldFinElt"}
  - {"name": "+:=", "signature": "a +:= b: FldFinElt, FldFinElt -> FldFinElt"}
  - {"name": "-:=", "signature": "a -:= b: FldFinElt, FldFinElt -> FldFinElt"}
  - {"name": "*:=", "signature": "a *:= b: FldFinElt, FldFinElt -> FldFinElt"}
  - {"name": "eq", "signature": "a eq b: FldFinElt, FldFinElt -> BoolElt"}
  - {"name": "ne", "signature": "a ne b: FldFinElt, FldFinElt -> BoolElt"}
  - {"name": "in", "signature": "a in F: FldFinElt, Rng -> BoolElt"}
  - {"name": "notin", "signature": "a notin F: FldFinElt, Rng -> BoolElt"}
  - {"name": "Parent", "signature": "Parent(a): FldFinElt -> FldFin"}
  - {"name": "Category", "signature": "Category(a): FldFinElt -> Cat"}
  - {"name": "IsZero", "signature": "IsZero(a): FldFinElt -> BoolElt"}
  - {"name": "IsOne", "signature": "IsOne(a): FldFinElt -> BoolElt"}
  - {"name": "IsMinusOne", "signature": "IsMinusOne(a): FldFinElt -> BoolElt"}
  - {"name": "IsNilpotent", "signature": "IsNilpotent(a): FldFinElt -> BoolElt"}
  - {"name": "IsIdempotent", "signature": "IsIdempotent(a): FldFinElt -> BoolElt"}
  - {"name": "IsUnit", "signature": "IsUnit(a): FldFinElt -> BoolElt"}
  - {"name": "IsZeroDivisor", "signature": "IsZeroDivisor(a): FldFinElt -> BoolElt"}
  - {"name": "IsRegular", "signature": "IsRegular(a): FldFin -> BoolElt"}
  - {"name": "IsIrreducible", "signature": "IsIrreducible(a): FldFinElt -> BoolElt"}
  - {"name": "IsPrime", "signature": "IsPrime(a): FldFinElt -> BoolElt"}
  - {"name": "IsPrimitive", "signature": "IsPrimitive(a): FldFinElt -> BoolElt"}
  - {"name": "IsPrimitive", "signature": "IsPrimitive(f): RngUPolElt -> BoolElt"}
  - {"name": "IsNormal", "signature": "IsNormal(a): FldFinElt -> BoolElt"}
  - {"name": "IsNormal", "signature": "IsNormal(a, E): FldFinElt -> BoolElt"}
  - {"name": "IsSquare", "signature": "IsSquare(a): FldFinElt -> BoolElt"}
  - {"name": "MinimalPolynomial", "signature": "MinimalPolynomial(a): FldFinElt -> RngUPolElt"}
  - {"name": "MinimalPolynomial", "signature": "MinimalPolynomial(a, E): FldFinElt, FldFin -> RngUPolElt"}
  - {"name": "CharacteristicPolynomial", "signature": "CharacteristicPolynomial(a): FldFinElt -> RngUPolElt"}
  - {"name": "CharacteristicPolynomial", "signature": "CharacteristicPolynomial(a, E): FldFinElt, FldFin -> RngUPolElt"}
  - {"name": "Norm", "signature": "Norm(a): FldFinElt -> FldFinElt"}
  - {"name": "Norm", "signature": "Norm(a, E): FldFinElt, FldFin -> FldFinElt"}
  - {"name": "AbsoluteNorm", "signature": "AbsoluteNorm(a): FldFinElt -> FldFinElt"}
  - {"name": "NormAbs", "signature": "NormAbs(a): FldFinElt -> FldFinElt"}
  - {"name": "Trace", "signature": "Trace(a): FldFinElt -> FldFinElt"}
  - {"name": "Trace", "signature": "Trace(a, E): FldFinElt, FldFin -> FldFinElt"}
  - {"name": "AbsoluteTrace", "signature": "AbsoluteTrace(a): FldFinElt -> FldFinElt"}
  - {"name": "TraceAbs", "signature": "TraceAbs(a): FldFinElt -> FldFinElt"}
  - {"name": "Frobenius", "signature": "Frobenius(a): FldFinElt -> FldFinElt"}
  - {"name": "Frobenius", "signature": "Frobenius(a, r): FldFinElt, RngIntElt -> FldFinElt"}
  - {"name": "Frobenius", "signature": "Frobenius(a, E): FldFinElt, FldFin -> FldFinElt"}
  - {"name": "Frobenius", "signature": "Frobenius(a, E, r): FldFinElt, FldFin, RngIntElt -> FldFinElt"}
  - {"name": "NormEquation", "signature": "NormEquation(K, y): FldFin, FldFin -> BoolElt, FldFinElt"}
  - {"name": "Hilbert90", "signature": "Hilbert90(a, q): FldFinElt, RngIntElt -> FldFinElt"}
  - {"name": "AdditiveHilbert90", "signature": "AdditiveHilbert90(a, q): FldFinElt, RngIntElt -> FldFinElt"}
  - {"name": "Order", "signature": "Order(a): FldFinElt -> RngIntElt"}
  - {"name": "FactoredOrder", "signature": "FactoredOrder(a): FldFinElt -> RngIntElt"}
  - {"name": "SquareRoot", "signature": "SquareRoot(a): FldFinElt -> FldFinElt"}
  - {"name": "Sqrt", "signature": "Sqrt(a): FldFinElt -> FldFinElt"}
  - {"name": "Root", "signature": "Root(a, n): FldFinElt, RngIntElt -> FldFinElt"}
  - {"name": "IsPower", "signature": "IsPower(a, n): FldFinElt, RngIntElt -> BoolElt, FldFinElt"}
  - {"name": "AllRoots", "signature": "AllRoots(a, n): FldFinElt, RngIntElt -> SeqEnum"}
examples:
  - "ex-ead4e7"
---

# Element Operations

See also Section [Generic Element Functions](https://docs.magma-maths.org/v2.30-1/BasicRings/IntroductionToRings/element.md#rngintro-elt-funcs).

## Arithmetic Operators

<a id="operation-operation-fldfinelt-fldfinelt"></a>
### `+ a: FldFinElt -> FldFinElt`

<a id="operation-operation-fldfinelt-fldfinelt-2"></a>
### `- a: FldFinElt -> FldFinElt`

<a id="operation-op-plus-fldfinelt-fldfinelt"></a>
### `a + b: FldFinElt, FldFinElt -> FldFinElt`

<a id="operation-op-minus-fldfinelt-fldfinelt"></a>
### `a - b: FldFinElt, FldFinElt -> FldFinElt`

<a id="operation-op-times-fldfinelt-fldfinelt"></a>
### `a * b: FldFinElt, FldFinElt -> FldFinElt`

<a id="operation-op-div-fldfinelt-fldfinelt"></a>
### `a / b: FldFinElt, FldFinElt -> FldFinElt`

<a id="operation-op-pow-fldfinelt-rngintelt"></a>
### `a ^ k: FldFinElt, RngIntElt -> FldFinElt`

<a id="operation-operation-fldfinelt-fldfinelt-fldfinelt"></a>
### `a +:= b: FldFinElt, FldFinElt -> FldFinElt`

<a id="operation-operation-fldfinelt-fldfinelt-fldfinelt-2"></a>
### `a -:= b: FldFinElt, FldFinElt -> FldFinElt`

<a id="operation-operation-fldfinelt-fldfinelt-fldfinelt-3"></a>
### `a *:= b: FldFinElt, FldFinElt -> FldFinElt`

## Equality and Membership

<a id="operation-op-eq-fldfinelt-fldfinelt"></a>
### `a eq b: FldFinElt, FldFinElt -> BoolElt`

<a id="operation-op-ne-fldfinelt-fldfinelt"></a>
### `a ne b: FldFinElt, FldFinElt -> BoolElt`

<a id="operation-op-in-fldfinelt-rng"></a>
### `a in F: FldFinElt, Rng -> BoolElt`

<a id="operation-op-notin-fldfinelt-rng"></a>
### `a notin F: FldFinElt, Rng -> BoolElt`

## Parent and Category

<a id="function-parent-fldfinelt"></a>
### `Parent(a): FldFinElt -> FldFin`

<a id="function-category-fldfinelt"></a>
### `Category(a): FldFinElt -> Cat`

## Predicates on Ring Elements

<a id="function-iszero-fldfinelt"></a>
### `IsZero(a): FldFinElt -> BoolElt`

<a id="function-isone-fldfinelt"></a>
### `IsOne(a): FldFinElt -> BoolElt`

<a id="function-isminusone-fldfinelt"></a>
### `IsMinusOne(a): FldFinElt -> BoolElt`

<a id="function-isnilpotent-fldfinelt"></a>
### `IsNilpotent(a): FldFinElt -> BoolElt`

<a id="function-isidempotent-fldfinelt"></a>
### `IsIdempotent(a): FldFinElt -> BoolElt`

<a id="function-isunit-fldfinelt"></a>
### `IsUnit(a): FldFinElt -> BoolElt`

<a id="function-iszerodivisor-fldfinelt"></a>
### `IsZeroDivisor(a): FldFinElt -> BoolElt`

<a id="function-isregular-fldfin"></a>
### `IsRegular(a): FldFin -> BoolElt`

<a id="function-isirreducible-fldfinelt"></a>
### `IsIrreducible(a): FldFinElt -> BoolElt`

<a id="function-isprime-fldfinelt"></a>
### `IsPrime(a): FldFinElt -> BoolElt`

<a id="function-isprimitive-fldfinelt"></a>
### `IsPrimitive(a): FldFinElt -> BoolElt`

Returns `true` if and only if the element $a$ of $F$ is a primitive element for $F$ (i.e., if and only if the multiplicative order of $a$ is $\#F-1$).

<a id="function-isprimitive-rngupolelt"></a>
### `IsPrimitive(f): RngUPolElt -> BoolElt`

Given a univariate polynomial $f\in F[x]$, over a finite field $F$, such that the degree of $f$ is greater than or equal to 1, this function returns `true` if and only if $f$ defines a primitive extension $G=F[x]/f$ of $F$ (that is, $x$ is primitive in $G$).

<a id="function-isnormal-fldfinelt"></a>
### `IsNormal(a): FldFinElt -> BoolElt`

Returns `true` if and only if the element $a$ of $F$ generates a normal basis for the field over the ground field, that is, if and only if $a, a^q, \ldots, a^{q^{n-1}}$ form a basis for $F$ over the ground field $G={\bf F}_{q}$.

<a id="function-isnormal-fldfinelt-2"></a>
### `IsNormal(a, E): FldFinElt -> BoolElt`

Returns `true` if and only if the element $a$ of the finite field $F$ with $q^n$ elements generates a normal basis for $F$ over its subfield $E$, that is, if and only if $a, a^q, \ldots, a^{q^{n-1}}$ form a basis for $F$ over $E$ for $q=\#E$.

<a id="function-issquare-fldfinelt"></a>
### `IsSquare(a): FldFinElt -> BoolElt`

Given a finite field element $a\in F$, this function returns either `true` and an element $b\in F$ such that $b^2=a$, or it returns `false` in the case that such an element does not exist.

## Minimal and Characteristic Polynomial

<a id="function-minimalpolynomial-fldfinelt"></a>
### `MinimalPolynomial(a): FldFinElt -> RngUPolElt`

The minimal polynomial of the element $a$ of the field $F$, relative to the ground field of $F$. This is the unique minimal-degree monic polynomial with coefficients in the ground field, having $a$ as a root.

<a id="function-minimalpolynomial-fldfinelt-fldfin"></a>
### `MinimalPolynomial(a, E): FldFinElt, FldFin -> RngUPolElt`

The minimal polynomial of the element $a$ of the field $F$, relative to the subfield $E$ of $F$. This is the unique minimal-degree monic polynomial with coefficients in $E$, having $a$ as a root.

<a id="function-characteristicpolynomial-fldfinelt"></a>
### `CharacteristicPolynomial(a): FldFinElt -> RngUPolElt`

Given an element $a$ of a finite field $F$, return the characteristic polynomial of $a$ with respect to the ground field of $F$. (This polynomial is the characteristic polynomial of the companion matrix of $a$ written as a polynomial over the ground field, and is a power of the minimal polynomial.)

<a id="function-characteristicpolynomial-fldfinelt-fldfin"></a>
### `CharacteristicPolynomial(a, E): FldFinElt, FldFin -> RngUPolElt`

Given an element $a$ of a finite field $F$, return the characteristic polynomial of $a$ with respect to the subfield $E$ of $F$. (This polynomial is the characteristic polynomial of the companion matrix of $a$ written as a polynomial over $E$, and is a power of the minimal polynomial over $E$.)

## Norm, Trace, and Frobenius

<a id="function-norm-fldfinelt"></a>
### `Norm(a): FldFinElt -> FldFinElt`

The norm of the element $a$ from the field $F$ to the ground field of $F$.

<a id="function-norm-fldfinelt-fldfin"></a>
### `Norm(a, E): FldFinElt, FldFin -> FldFinElt`

The relative norm of the element $a$ from the field $F$, with respect to the subfield $E$ of $F$. The result is an element of $E$.

<a id="function-absolutenorm-fldfinelt"></a>
### `AbsoluteNorm(a): FldFinElt -> FldFinElt`

<a id="function-normabs-fldfinelt"></a>
### `NormAbs(a): FldFinElt -> FldFinElt`

The absolute norm of the element $a$, that is, the norm to the prime subfield of the parent field $F$ of $a$.

<a id="function-trace-fldfinelt"></a>
### `Trace(a): FldFinElt -> FldFinElt`

The trace of the element $a$ from the field $F$ to the ground field of $F$.

<a id="function-trace-fldfinelt-fldfin"></a>
### `Trace(a, E): FldFinElt, FldFin -> FldFinElt`

The relative trace of the element $a$ from field $F$, with respect to the subfield $E$ of $F$. The result is an element of $E$.

<a id="function-absolutetrace-fldfinelt"></a>
### `AbsoluteTrace(a): FldFinElt -> FldFinElt`

<a id="function-traceabs-fldfinelt"></a>
### `TraceAbs(a): FldFinElt -> FldFinElt`

The trace of the element $a$, that is, the trace to the prime subfield of the parent field $F$ of $a$.

<a id="function-frobenius-fldfinelt"></a>
### `Frobenius(a): FldFinElt -> FldFinElt`

The Frobenius image of $a$ w.r.t. the ground field of $K$; i.e., $a^{\#G}$, where $G$ is the ground field of the parent of $a$.

<a id="function-frobenius-fldfinelt-rngintelt"></a>
### `Frobenius(a, r): FldFinElt, RngIntElt -> FldFinElt`

The $r$-th Frobenius image of $a$ w.r.t. the ground field of $K$; i.e., $a^{(\#G)^r}$, where $G$ is the ground field of the parent of $a$.

<a id="function-frobenius-fldfinelt-fldfin"></a>
### `Frobenius(a, E): FldFinElt, FldFin -> FldFinElt`

The Frobenius image of x w.r.t. $E$; i.e., $x^{\#E}$.

<a id="function-frobenius-fldfinelt-fldfin-rngintelt"></a>
### `Frobenius(a, E, r): FldFinElt, FldFin, RngIntElt -> FldFinElt`

The Frobenius image of x w.r.t. $E$; i.e., $x^{(\#E)^r}$.

<a id="function-normequation-fldfin-fldfin"></a>
### `NormEquation(K, y): FldFin, FldFin -> BoolElt, FldFinElt`

Given a finite field $K$ and an element $y$ of a subfield $S$ of $K$, return whether an element $x\in K$ exists such that Norm$(x, S) = y$, and, if so, such an element $x$ (in $K$).

<a id="function-hilbert90-fldfinelt-rngintelt"></a>
### `Hilbert90(a, q): FldFinElt, RngIntElt -> FldFinElt`

Given an element $a$ of some finite field $k$ and a power $q$ of the characteristic of $k$, return a solution of the Hilbert 90 equation $x^qx^{-1}=a$. Note that the solution may be in a finite-degree extension of $k$.

<a id="function-additivehilbert90-fldfinelt-rngintelt"></a>
### `AdditiveHilbert90(a, q): FldFinElt, RngIntElt -> FldFinElt`

Given an element $a$ of some finite field $k$ and a power $q$ of the characteristic of $k$, return a solution of the additive Hilbert 90 equation $x^q - x=a$. Note that the solution may be in a finite-degree extension of $k$.

## Order and Roots

<a id="function-order-fldfinelt"></a>
### `Order(a): FldFinElt -> RngIntElt`

The multiplicative order of the non-zero element $a$ of the field $F$.

<a id="function-factoredorder-fldfinelt"></a>
### `FactoredOrder(a): FldFinElt -> RngIntElt`

The multiplicative order of the non-zero element $a$ of the field $F$ as a factorization sequence.

<a id="function-squareroot-fldfinelt"></a>
### `SquareRoot(a): FldFinElt -> FldFinElt`

<a id="function-sqrt-fldfinelt"></a>
### `Sqrt(a): FldFinElt -> FldFinElt`

The square root of the non-zero element $a$ from the field $F$, i.e., an element $y$ of $F$ such that $y^2 = a$. An error results if $a$ is not a square.

<a id="function-root-fldfinelt-rngintelt"></a>
### `Root(a, n): FldFinElt, RngIntElt -> FldFinElt`

The $n$-th root of the non-zero element $a$ from the field $F$, i.e., an element $y$ of $F$ such that $y^n = a$. An error results if no such root exists.

<a id="function-ispower-fldfinelt-rngintelt"></a>
### `IsPower(a, n): FldFinElt, RngIntElt -> BoolElt, FldFinElt`

Given a finite field element $a\in F$, and an integer $n>0$, this function returns either `true` and an element $b\in F$ such that $b^n=a$, or it returns `false` in the case that such an element does not exist.

<a id="function-allroots-fldfinelt-rngintelt"></a>
### `AllRoots(a, n): FldFinElt, RngIntElt -> SeqEnum`

Given a finite field element $a\in F$, and an integer $n>0$, return a sequence containing all of the $n$-th roots of $a$ which lie in the same field $F$.

<a id="example-ex-ead4e7"></a>
### `Example: Roots and Traces of Elements (ex-ead4e7)`

Given the fields $F$ and $F49$ defined above, we can use the following functions:

```magma
> F7 := FiniteField(7);
> F49<w> := ext< F7 | 2 >;
> F<z> := ext< F49 | 2 >;
> Root(z^73, 7);
z^1039
> Trace(z^73);
1
> Trace(z^73, F49);
w^44
> Norm(z^73);
3
> Norm(z^73, F49);
w^37
> Norm(w^37);
3
> MinimalPolynomial(z^73);
x^2 + w^20*x + w^43
> MinimalPolynomial(z^73, F7);
x^4 + 4*x^2 + 4*x + 3
```

We now demonstrate the `NormEquation` function.

```magma
> Norm(z);
3
> NormEquation(F, F7!3);
true z
> Norm(z^30, F49);
w^30
> Parent(z) eq F;
true
> NormEquation(F, w^30);
true z^30
```
