---
title: "Finite Dimensional Affine Algebras"
canonical: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/AffineAlgebras/finite-dimension-quotient.html"
source: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/AffineAlgebras/finite-dimension-quotient.md"
part: "Commutative Algebra"
chapter: "Affine Algebras"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Commutative Algebra", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/index-commutative-algebra.md"}
  - {"title": "Affine Algebras", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/AffineAlgebras/index-affine-algebras.md"}
prev: {"title": "Maps between Affine Algebras", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/AffineAlgebras/affine-algebra-maps.md"}
next: {"title": "Affine Algebras which are Fields", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/AffineAlgebras/field.md"}
intrinsics:
  - {"name": "HasFiniteDimension", "signature": "HasFiniteDimension(Q): RngMPolRes -> BoolElt"}
  - {"name": "Dimension", "signature": "Dimension(Q): RngMPolRes -> RngIntElt"}
  - {"name": "VectorSpace", "signature": "VectorSpace(Q): RngMPolRes -> ModTupFld, Map"}
  - {"name": "MonomialBasis", "signature": "MonomialBasis(Q): RngMPolRes -> [ RngMPolResElt ]"}
  - {"name": "MatrixAlgebra", "signature": "MatrixAlgebra(Q): RngMPolRes -> AlgMat, Map"}
  - {"name": "RepresentationMatrix", "signature": "RepresentationMatrix(f): RngMPolResElt -> AlgMatElt"}
  - {"name": "IsUnit", "signature": "IsUnit(f): RngMPolResElt -> BoolElt"}
  - {"name": "IsNilpotent", "signature": "IsNilpotent(f): RngMPolResElt -> BoolElt, RngIntElt"}
  - {"name": "MinimalPolynomial", "signature": "MinimalPolynomial(f): RngMPolResElt -> RngUPol"}
examples:
  - "ex-caec0e"
---

# Finite Dimensional Affine Algebras

If an affine algebra is defined over a field and has finite dimension considered as a vector space over its coefficient field, extra special operations are available on its elements. Similar operations for affine algebras defined over general Euclidean rings will be supported in the future.

<a id="function-hasfinitedimension-rngmpolres"></a>
## `HasFiniteDimension(Q): RngMPolRes -> BoolElt`

Given an affine algebra $Q$ defined over a field, return whether $Q$ has finite dimension.

<a id="function-dimension-rngmpolres"></a>
## `Dimension(Q): RngMPolRes -> RngIntElt`

Given a finite dimensional affine algebra $Q$ defined over a field, return the dimension of $Q$.

<a id="function-vectorspace-rngmpolres"></a>
## `VectorSpace(Q): RngMPolRes -> ModTupFld, Map`

Given a finite dimensional affine algebra $Q$ defined over a field, construct the vector space $V$ isomorphic to $Q$, and return $V$ together with the isomorphism $f$ from $Q$ onto $V$.

<a id="function-monomialbasis-rngmpolres"></a>
## `MonomialBasis(Q): RngMPolRes -> [ RngMPolResElt ]`

Given a finite dimensional affine algebra $Q$ defined over a field, return the basis $B$ of monomials of $Q$. This is a sequence of monomials in $Q$ of length $d$, such that the image $f(B[i])=V.i$ where $V$ and $f$ are the return values of `VectorSpace` above.

<a id="function-matrixalgebra-rngmpolres"></a>
## `MatrixAlgebra(Q): RngMPolRes -> AlgMat, Map`

Given a finite dimensional affine algebra $Q$ defined over a field, construct the matrix algebra $A$ isomorphic to $Q$, and return $A$ together with the isomorphism $f$ from $Q$ onto $A$.

<a id="function-representationmatrix-rngmpolreselt"></a>
## `RepresentationMatrix(f): RngMPolResElt -> AlgMatElt`

Given an element $f$ of a finite dimensional affine algebra $Q$ defined over a field, return the representation matrix of $f$, which is a $d$ by $d$ matrix over the coefficient field of $Q$ (where $d$ is the dimension of $Q$) which represents $f$.

<a id="function-isunit-rngmpolreselt"></a>
## `IsUnit(f): RngMPolResElt -> BoolElt`

Given an element $f$ of a finite dimensional affine algebra $Q$ defined over a field, return whether $f$ is a unit.

<a id="function-isnilpotent-rngmpolreselt"></a>
## `IsNilpotent(f): RngMPolResElt -> BoolElt, RngIntElt`

Given an element $f$ of a finite dimensional affine algebra $Q$ defined over a field, return whether $f$ is nilpotent, and if so, return also the smallest $q$ such that $f^q = 0$.

<a id="function-minimalpolynomial-rngmpolreselt"></a>
## `MinimalPolynomial(f): RngMPolResElt -> RngUPol`

Given an element $f$ of a finite dimensional affine algebra $Q$ defined over a field, return the minimal polynomial of $f$ as a univariate polynomial over the coefficient field of $Q$.

<a id="example-ex-caec0e"></a>
## `Example: Minimal Polynomial of an Algebraic Number (ex-caec0e)`

Suppose we wish to find the minimal polynomial of $\theta = \sqrt 2 + \root 3 \of 5$ over ${\mathbb{Q}}$. To do this we can just compute the minimal polynomial of (the coset of) $x + y$ over ${\mathbb{Q}}$ in the affine algebra $Q[x, y]/(x^2 - 2, y^3 - 5)$.

```magma
> Q := RationalField();
> A<x, y> := AffineAlgebra<Q, x, y | x^2 - 2, y^3 - 5>;
> UP<z> := PolynomialRing(Q);
> MinimalPolynomial(x + y);
z^6 - 6*z^4 - 10*z^3 + 12*z^2 - 60*z + 17
```
