---
title: "Elements of $M_n$ as Homomorphisms"
canonical: "https://docs.magma-maths.org/v2.30-1/Algebras/MatrixAlgebras/homomorphism-element.html"
source: "https://docs.magma-maths.org/v2.30-1/Algebras/MatrixAlgebras/homomorphism-element.md"
part: "Algebras"
chapter: "Matrix Algebras"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Algebras", "source": "https://docs.magma-maths.org/v2.30-1/Algebras/index-algebras.md"}
  - {"title": "Matrix Algebras", "source": "https://docs.magma-maths.org/v2.30-1/Algebras/MatrixAlgebras/index-matrix-algebras.md"}
prev: {"title": "Elementary Operations on Elements", "source": "https://docs.magma-maths.org/v2.30-1/Algebras/MatrixAlgebras/element.md"}
next: {"title": "Elementary Operations on Subalgebras and Ideals", "source": "https://docs.magma-maths.org/v2.30-1/Algebras/MatrixAlgebras/subalgebra-ideal.md"}
intrinsics:
  - {"name": "Image", "signature": "Image(a): AlgMatElt -> ModTup"}
  - {"name": "RowSpace", "signature": "RowSpace(a): AlgMatElt -> ModTup"}
  - {"name": "Kernel", "signature": "Kernel(a): AlgMatElt -> ModTup"}
  - {"name": "NullSpace", "signature": "NullSpace(a): AlgMatElt -> ModTup"}
  - {"name": "RowNullSpace", "signature": "RowNullSpace(a): AlgMatElt -> ModTup"}
  - {"name": "NullspaceOfTranspose", "signature": "NullspaceOfTranspose(a): AlgMatVElt -> ModTupRng"}
  - {"name": "Restrict", "signature": "Restrict(a, V): AlgMatElt, ModTupRng -> AlgMatElt"}
  - {"name": "Restrict", "signature": "Restrict(a, V): AlgMatElt, ModTupFld -> AlgMatElt"}
---

<a id="elements-of-m-n-as-homomorphisms"></a>
# Elements of $M_n$ as Homomorphisms

The matrix algebra $M_n(S)$ may also be viewed as the module ${\operatorname{Hom}}(S^{(n)}, S^{(n)})$. At present this will not happen automatically so that in order to treat elements of $M_n(S)$ as homomorphisms, it is necessary to explicitly coerce the matrix into ${\operatorname{Hom}}(S^{(n)}, S^{(n)})$. However, two fundamental homomorphism-type operators are provided for elements of $M_n(S)$.

<a id="function-image-algmatelt"></a>
## `Image(a): AlgMatElt -> ModTup`

<a id="function-rowspace-algmatelt"></a>
## `RowSpace(a): AlgMatElt -> ModTup`

Given an element of $M_n(S)$, return the image of the module $S^{(n)}$ under the homomorphism represented by the matrix $a$ (as an element of $S^{(n)}$).

<a id="function-kernel-algmatelt"></a>
## `Kernel(a): AlgMatElt -> ModTup`

<a id="function-nullspace-algmatelt"></a>
## `NullSpace(a): AlgMatElt -> ModTup`

```magma
Al: MonStgElt                    Default: "Default"
```

Given an element of $M_n(S)$, return the kernel of the homomorphism represented by the matrix $a$ (as an element of $S^{(n)}$).

<a id="function-rownullspace-algmatelt"></a>
## `RowNullSpace(a): AlgMatElt -> ModTup`

<a id="function-nullspaceoftranspose-algmatvelt"></a>
## `NullspaceOfTranspose(a): AlgMatVElt -> ModTupRng`

Given an element of $M_n(S)$, return the row nullspace of the homomorphism represented by the matrix $a$ (as an element of $S^{(n)}$). This is equal to the kernel of the transpose of $a$.

<a id="function-restrict-algmatelt-modtuprng"></a>
## `Restrict(a, V): AlgMatElt, ModTupRng -> AlgMatElt`

<a id="function-restrict-algmatelt-modtupfld"></a>
## `Restrict(a, V): AlgMatElt, ModTupFld -> AlgMatElt`

If $V \simeq S^{(m)}$ is a free submodule of $S^{(n)}$ stable by an element $a$ of $M_n(S)$, returns the restriction of the homomorphism $a$ to the stable submodule $V$, as an element of $M_m(S)$.
