---
title: "Elements"
canonical: "https://docs.magma-maths.org/v2.30-1/GlobalFields/EtaleAlgebras/elements.html"
source: "https://docs.magma-maths.org/v2.30-1/GlobalFields/EtaleAlgebras/elements.md"
part: "Global Fields"
chapter: "Étale Algebras"
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": "Étale Algebras", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/EtaleAlgebras/index-etale-algebras.md"}
prev: {"title": "Homomorphisms", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/EtaleAlgebras/homs.md"}
next: {"title": "Orders of Algebras", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/EtaleAlgebras/orders.md"}
intrinsics:
  - {"name": "Parent", "signature": "Parent(x): AlgEtQElt -> AlgEtQ"}
  - {"name": "Algebra", "signature": "Algebra(x): AlgEtQElt -> AlgEtQ"}
  - {"name": "Components", "signature": "Components(x): AlgEtQElt -> SeqEnum"}
  - {"name": "AbsoluteCoordinates", "signature": "AbsoluteCoordinates(x): AlgEtQElt -> SeqEnum"}
  - {"name": "AbsoluteCoordinates", "signature": "AbsoluteCoordinates(x, S): AlgEtQElt, AlgEtQOrd -> SeqEnum"}
  - {"name": "IsCoercible", "signature": "IsCoercible(A, x): AlgEtQ, Any -> BoolElt, AlgEtQElt"}
  - {"name": "!", "signature": "A ! x: AlgEtQ, Any -> AlgEtQElt"}
  - {"name": "One", "signature": "One(A): AlgEtQ -> AlgEtQElt"}
  - {"name": "Zero", "signature": "Zero(A): AlgEtQ -> AlgEtQElt"}
  - {"name": "IsUnit", "signature": "IsUnit(x): AlgEtQElt -> BoolElt"}
  - {"name": "IsZeroDivisor", "signature": "IsZeroDivisor(x): AlgEtQElt -> BoolElt"}
  - {"name": "Random", "signature": "Random(A, bd): AlgEtQ, RngIntElt -> AlgEtQElt"}
  - {"name": "Random", "signature": "Random(A): AlgEtQ -> AlgEtQElt"}
  - {"name": "RandomUnit", "signature": "RandomUnit(A, bd): AlgEtQ, RngIntElt -> AlgEtQElt"}
  - {"name": "eq", "signature": "x1 eq x2: AlgEtQElt, AlgEtQElt -> BoolElt"}
  - {"name": "eq", "signature": "x1 eq x2: RngIntElt, AlgEtQElt -> BoolElt"}
  - {"name": "eq", "signature": "x1 eq x2: AlgEtQElt, RngIntElt -> BoolElt"}
  - {"name": "eq", "signature": "x1 eq x2: FldRatElt, AlgEtQElt -> BoolElt"}
  - {"name": "eq", "signature": "x1 eq x2: AlgEtQElt, FldRatElt -> BoolElt"}
  - {"name": "+", "signature": "x1 + x2: AlgEtQElt, AlgEtQElt -> AlgEtQElt"}
  - {"name": "+", "signature": "x1 + x2: Any, AlgEtQElt -> AlgEtQElt"}
  - {"name": "+", "signature": "x1 + x2: AlgEtQElt, Any -> AlgEtQElt"}
  - {"name": "-", "signature": "- x: AlgEtQElt -> AlgEtQElt"}
  - {"name": "-", "signature": "x1 - x2: AlgEtQElt, AlgEtQElt -> AlgEtQElt"}
  - {"name": "-", "signature": "x1 - x2: Any, AlgEtQElt -> AlgEtQElt"}
  - {"name": "-", "signature": "x1 - x2: AlgEtQElt, Any -> AlgEtQElt"}
  - {"name": "*", "signature": "x1 * x2: AlgEtQElt, AlgEtQElt -> AlgEtQElt"}
  - {"name": "*", "signature": "x1 * x2: Any, AlgEtQElt -> AlgEtQElt"}
  - {"name": "*", "signature": "x1 * x2: AlgEtQElt, Any -> AlgEtQElt"}
  - {"name": "Inverse", "signature": "Inverse(x): AlgEtQElt -> AlgEtQElt"}
  - {"name": "^", "signature": "x ^ n: AlgEtQElt, RngIntElt -> AlgEtQElt"}
  - {"name": "/", "signature": "x1 / x2: AlgEtQElt, AlgEtQElt -> AlgEtQElt"}
  - {"name": "/", "signature": "x1 / x2: Any, AlgEtQElt -> AlgEtQElt"}
  - {"name": "/", "signature": "x1 / x2: AlgEtQElt, Any -> AlgEtQElt"}
  - {"name": "&+", "signature": "&+ seq: SeqEnum[AlgEtQElt] -> AlgEtQElt"}
  - {"name": "&*", "signature": "&* seq: SeqEnum[AlgEtQElt] -> AlgEtQElt"}
  - {"name": "DotProduct", "signature": "DotProduct(a, b): SeqEnum, SeqEnum -> Any"}
  - {"name": "MinimalPolynomial", "signature": "MinimalPolynomial(x): AlgEtQElt -> RngUPolElt"}
  - {"name": "MinimalPolynomial", "signature": "MinimalPolynomial(x, F): AlgEtQElt, Rng -> RngUPolElt"}
  - {"name": "AbsoluteMinimalPolynomial", "signature": "AbsoluteMinimalPolynomial(x): AlgEtQElt -> RngUPolElt"}
  - {"name": "IsIntegral", "signature": "IsIntegral(x): AlgEtQElt -> BoolElt"}
  - {"name": "Evaluate", "signature": "Evaluate(f, a): RngUPolElt, AlgEtQElt -> AlgEtQElt"}
  - {"name": "PrimitiveElement", "signature": "PrimitiveElement(A): AlgEtQ -> AlgEtQElt"}
  - {"name": "PowerBasis", "signature": "PowerBasis(A): AlgEtQ -> SeqEnum[AlgEtQElt]"}
  - {"name": "Basis", "signature": "Basis(A): AlgEtQ -> SeqEnum"}
  - {"name": "AbsoluteBasis", "signature": "AbsoluteBasis(A): AlgEtQ -> SeqEnum"}
  - {"name": ".", "signature": "A . i: AlgEtQ, RngIntElt -> AlgEtQElt"}
  - {"name": "AbsoluteCoordinates", "signature": "AbsoluteCoordinates(seq, basis): SeqEnum[AlgEtQElt], SeqEnum[AlgEtQElt] -> SeqEnum"}
  - {"name": "OrthogonalIdempotents", "signature": "OrthogonalIdempotents(A): AlgEtQ -> SeqEnum"}
  - {"name": "Idempotents", "signature": "Idempotents(A): AlgEtQ -> SeqEnum"}
examples:
  - "ex-1d7031"
---

# Elements

<a id="function-parent-algetqelt"></a>
## `Parent(x): AlgEtQElt -> AlgEtQ`

<a id="function-algebra-algetqelt"></a>
## `Algebra(x): AlgEtQElt -> AlgEtQ`

Returns the algebra to which the element $x$ belongs to.

<a id="function-components-algetqelt"></a>
## `Components(x): AlgEtQElt -> SeqEnum`

Given an element $x$, returns its components, which are elements of number fields.

<a id="function-absolutecoordinates-algetqelt"></a>
## `AbsoluteCoordinates(x): AlgEtQElt -> SeqEnum`

Given an element $x$, returns the coordinates relative to the absolute basis, which are elements of the prime rational field.

<a id="function-absolutecoordinates-algetqelt-algetqord"></a>
## `AbsoluteCoordinates(x, S): AlgEtQElt, AlgEtQOrd -> SeqEnum`

Given an element $x$ and an order $S$, returns the coordinates of $x$ with respect to the stored Z-basis of $S$.

<a id="function-iscoercible-algetq-any"></a>
## `IsCoercible(A, x): AlgEtQ, Any -> BoolElt, AlgEtQElt`

Return whether the element $x$ is coercible into the algebra $A$ and the result of the coercion if so.

<a id="operation-op-algetq-any"></a>
## `A ! x: AlgEtQ, Any -> AlgEtQElt`

Coerce $x$ into the algebra $A$.

<a id="function-one-algetq"></a>
## `One(A): AlgEtQ -> AlgEtQElt`

The multiplicative neutral element of the algebra $A$.

<a id="function-zero-algetq"></a>
## `Zero(A): AlgEtQ -> AlgEtQElt`

The additive neutral element of the algebra $A$.

<a id="function-isunit-algetqelt"></a>
## `IsUnit(x): AlgEtQElt -> BoolElt`

Returns whether the element $x$ is a unit in its algebra $A$.

<a id="function-iszerodivisor-algetqelt"></a>
## `IsZeroDivisor(x): AlgEtQElt -> BoolElt`

Returns whether the element $x$ is a zero-divisor in its algebra $A$.

<a id="function-random-algetq-rngintelt"></a>
## `Random(A, bd): AlgEtQ, RngIntElt -> AlgEtQElt`

Returns a random element of the algebra $A$. The coefficients are bounded by the positive integer $bd$.

<a id="function-random-algetq"></a>
## `Random(A): AlgEtQ -> AlgEtQElt`

```magma
bd: RngIntElt                    Default: 3
```

Returns a random element of the algebra $A$. The coefficients are bounded by the parameter $bd$ (default 3).

<a id="function-randomunit-algetq-rngintelt"></a>
## `RandomUnit(A, bd): AlgEtQ, RngIntElt -> AlgEtQElt`

Returns a random unit of the algebra $A$. The coefficients are bounded by the positive integer $bd$.

<a id="operation-op-eq-algetqelt-algetqelt"></a>
## `x1 eq x2: AlgEtQElt, AlgEtQElt -> BoolElt`

<a id="operation-op-eq-rngintelt-algetqelt"></a>
## `x1 eq x2: RngIntElt, AlgEtQElt -> BoolElt`

<a id="operation-op-eq-algetqelt-rngintelt"></a>
## `x1 eq x2: AlgEtQElt, RngIntElt -> BoolElt`

<a id="operation-op-eq-fldratelt-algetqelt"></a>
## `x1 eq x2: FldRatElt, AlgEtQElt -> BoolElt`

<a id="operation-op-eq-algetqelt-fldratelt"></a>
## `x1 eq x2: AlgEtQElt, FldRatElt -> BoolElt`

Returns whether the elements $x1$ and $x2$ are equal.

<a id="operation-op-plus-algetqelt-algetqelt"></a>
## `x1 + x2: AlgEtQElt, AlgEtQElt -> AlgEtQElt`

<a id="operation-op-plus-any-algetqelt"></a>
## `x1 + x2: Any, AlgEtQElt -> AlgEtQElt`

<a id="operation-op-plus-algetqelt-any"></a>
## `x1 + x2: AlgEtQElt, Any -> AlgEtQElt`

<a id="operation-operation-algetqelt-algetqelt"></a>
## `- x: AlgEtQElt -> AlgEtQElt`

<a id="operation-op-minus-algetqelt-algetqelt"></a>
## `x1 - x2: AlgEtQElt, AlgEtQElt -> AlgEtQElt`

<a id="operation-op-minus-any-algetqelt"></a>
## `x1 - x2: Any, AlgEtQElt -> AlgEtQElt`

<a id="operation-op-minus-algetqelt-any"></a>
## `x1 - x2: AlgEtQElt, Any -> AlgEtQElt`

<a id="operation-op-times-algetqelt-algetqelt"></a>
## `x1 * x2: AlgEtQElt, AlgEtQElt -> AlgEtQElt`

<a id="operation-op-times-any-algetqelt"></a>
## `x1 * x2: Any, AlgEtQElt -> AlgEtQElt`

<a id="operation-op-times-algetqelt-any"></a>
## `x1 * x2: AlgEtQElt, Any -> AlgEtQElt`

<a id="function-inverse-algetqelt"></a>
## `Inverse(x): AlgEtQElt -> AlgEtQElt`

The multiplicative inverse of the algebra element $x$.

<a id="operation-op-pow-algetqelt-rngintelt"></a>
## `x ^ n: AlgEtQElt, RngIntElt -> AlgEtQElt`

<a id="operation-op-div-algetqelt-algetqelt"></a>
## `x1 / x2: AlgEtQElt, AlgEtQElt -> AlgEtQElt`

<a id="operation-op-div-any-algetqelt"></a>
## `x1 / x2: Any, AlgEtQElt -> AlgEtQElt`

<a id="operation-op-div-algetqelt-any"></a>
## `x1 / x2: AlgEtQElt, Any -> AlgEtQElt`

<a id="operation-operation-seqenum-algetqelt-algetqelt"></a>
## `&+ seq: SeqEnum[AlgEtQElt] -> AlgEtQElt`

Given a sequence of `AlgEtQElt` returns the sum of the entries.

<a id="operation-operation-seqenum-algetqelt-algetqelt-2"></a>
## `&* seq: SeqEnum[AlgEtQElt] -> AlgEtQElt`

Given a sequence of `AlgEtQElt` returns the product of the entries.

<a id="function-dotproduct-seqenum-seqenum"></a>
## `DotProduct(a, b): SeqEnum, SeqEnum -> Any`

Given two sequences $a=[a_1,\ldots,a_n]$ and $b=[b_1,\ldots,b_n]$, returns $\sum_i a_i\cdot b_i$.

<a id="example-ex-1d7031"></a>
## `Example: Components and Idempotents of an Etale Algebra (ex-1d7031)`

```magma
> _<x>:=PolynomialRing(Integers());
> f := (x^8+16)*(x^8+81);
> A := EtaleAlgebra(f);
> // We compute the `canonical` primitive element, which is the class of the
> // variable x in A.
> a := PrimitiveElement(A); a;
<$.1, $.1>
> // The algebra A has two components:
> comps, embeddings, projections:=Components(A);
> K1, K2 := Explode(comps);
> // The unit element of each component corresponds to an orthogonal idempotent
> //                                                                       of A:
> [ embeddings[1](K1!1),embeddings[2](K2!1) ] eq OrthogonalIdempotents(A);
true
> // We conclude this example by showing the use of DotProduct and
> //                                              its timings advantages:
> N := 10^5;
> elts1 := [ a+i : i in [1..N] ];
> elts2 := [ a-i : i in [1..N] ];
> time s1 := &+[ elts1[i]*elts2[i] : i in [1..N] ];
Time: 0.450
> time s2 := DotProduct(elts1,elts2);
Time: 0.150
> s1 eq s2;
true
```

<a id="function-minimalpolynomial-algetqelt"></a>
## `MinimalPolynomial(x): AlgEtQElt -> RngUPolElt`

Returns the minimal polynomial over the common base ring of the number fields defining the algebra $A$ of the element $x$.

<a id="function-minimalpolynomial-algetqelt-rng"></a>
## `MinimalPolynomial(x, F): AlgEtQElt, Rng -> RngUPolElt`

Returns the minimal polynomial over the ring $F$ of the element $x$.

<a id="function-absoluteminimalpolynomial-algetqelt"></a>
## `AbsoluteMinimalPolynomial(x): AlgEtQElt -> RngUPolElt`

Returns the minimal polynomial over the prime field of the element $x$ or an algebra.

<a id="function-isintegral-algetqelt"></a>
## `IsIntegral(x): AlgEtQElt -> BoolElt`

Returns whether the element $x$ of an algebra is integral (over the integers).

<a id="function-evaluate-rngupolelt-algetqelt"></a>
## `Evaluate(f, a): RngUPolElt, AlgEtQElt -> AlgEtQElt`

Evaluate the polynomial $f$ at the algebra element $a$.

<a id="function-primitiveelement-algetq"></a>
## `PrimitiveElement(A): AlgEtQ -> AlgEtQElt`

Returns the primitive element of the étale algebra $A$. Note that $A$ has a primitive element only if it is the product of distinct number fields.

Given an étale algebra $A$ over ${{\Q}}$ there exists an element $a\in A$ such that $A = {{\Q}}[a]$, that is, every element can be written as a polynomial with rational coefficients in $a$. Such an element is called a *primitive element* of $A$. It is characterized by having a minimal polynomial whose degree equals the absolute dimension of $A$.

The intrinsic `PrimitiveElement` produces such an element of the étale algebra $A$ using a deterministic procedure which we now describe: Let $N$ be the number of components of $A$, each one having primitive element $a_i$. Set $b_1$ = $a_1$. For $i=2,\ldots,N$, set $b_i = a_i+j$ where $j$ is the smallest non-negative integer such that the minimal polynomial of $a_i+j$ is not in the set of minimal polynomials of the elements $b_1,\ldots,b_{i-1}$. The output is the element of $A$ whose components are $b_1,...,b_N$. In particular, if $A$ is a product of number fields with different defining polynomials, then the output is the element of $A$ whose components are the primitive elements of the components.

<a id="function-powerbasis-algetq"></a>
## `PowerBasis(A): AlgEtQ -> SeqEnum[AlgEtQElt]`

Returns the power basis of the étale algebra $A$, consisting of powers of the primitive element of $A$.

<a id="function-basis-algetq"></a>
## `Basis(A): AlgEtQ -> SeqEnum`

Returns a basis of the algebra $A$ over the common base field.

<a id="function-absolutebasis-algetq"></a>
## `AbsoluteBasis(A): AlgEtQ -> SeqEnum`

Returns a basis of the algebra $A$ over the prime field.

<a id="operation-operation-algetq-rngintelt-algetqelt"></a>
## `A . i: AlgEtQ, RngIntElt -> AlgEtQElt`

Returns the $i$-th element of the absolute basis of $A$.

<a id="function-absolutecoordinates-seqenum-algetqelt-seqenum-algetqelt"></a>
## `AbsoluteCoordinates(seq, basis): SeqEnum[AlgEtQElt], SeqEnum[AlgEtQElt] -> SeqEnum`

Given a sequence of elements and a basis over the `PrimeField` returns a sequence whose entries are the coordinates in the `PrimeField` with respect to the given basis.

<a id="function-orthogonalidempotents-algetq"></a>
## `OrthogonalIdempotents(A): AlgEtQ -> SeqEnum`

Returns the orthogonal idempotent element of the étale algebra $A$.

<a id="function-idempotents-algetq"></a>
## `Idempotents(A): AlgEtQ -> SeqEnum`

Returns the idempotent element of the étale algebra $A$.
