---
title: "Operations with Linear Transformations"
canonical: "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/VectorSpaces/linear-transformation.html"
source: "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/VectorSpaces/linear-transformation.md"
part: "Matrices and Linear Algebra"
chapter: "Vector Spaces"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Matrices and Linear Algebra", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/index-matrices-linear-algebra.md"}
  - {"title": "Vector Spaces", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/VectorSpaces/index-vector-spaces.md"}
prev: {"title": "Bases", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/VectorSpaces/basis.md"}
next: {"title": "Polar Spaces", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/PolarSpaces/index-polar-spaces.md"}
intrinsics:
  - {"name": "*", "signature": "v * a: ModTupFldElt, ModMatFldElt -> ModTupFldElt"}
  - {"name": "a(v)", "signature": "a(v): ModMatFldElt, ModTupFldElt -> ModTupFldElt"}
  - {"name": "*", "signature": "a * b: ModMatRngElt, ModMatRngElt -> ModMatRngElt"}
  - {"name": "Domain", "signature": "Domain(a): ModMatRngElt -> ModTupRng"}
  - {"name": "Codomain", "signature": "Codomain(a): ModMatRngElt -> ModTupRng"}
  - {"name": "Image", "signature": "Image(a): ModMatRngElt -> ModTupRng, Map, Map"}
  - {"name": "Rank", "signature": "Rank(a): ModMatRngElt -> RngIntElt"}
  - {"name": "Kernel", "signature": "Kernel(a): ModMatRngElt -> ModTupFld, Map"}
  - {"name": "NullSpace", "signature": "NullSpace(a): ModMatRngElt -> ModTupFld, Map"}
  - {"name": "Cokernel", "signature": "Cokernel(a): ModMatRngElt -> ModTupFld, Map"}
examples:
  - "ex-135cf0"
---

# Operations with Linear Transformations

Throughout this section, $V$ is a subspace of $K^{(m)}$, $W$ is a subspace of $K^{(n)}$ and $a$ is a linear transformation belonging to ${\operatorname{Hom}}_{K}(V, W)$. See also the chapter on general matrices for many other functions applicable to such matrices (e.g., `EchelonForm)`.

<a id="operation-op-times-modtupfldelt-modmatfldelt"></a>
## `v * a: ModTupFldElt, ModMatFldElt -> ModTupFldElt`

<a id="literal-a-modmatfldelt-modtupfldelt"></a>
## `a(v): ModMatFldElt, ModTupFldElt -> ModTupFldElt`

Given an element $v$ belonging to the vector space $V$, and an element $a$ belonging to ${\operatorname{Hom}}_{K}(V, W)$, return the image of $v$ under the linear transformation $a$ as an element of the vector space $W$.

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

Given a matrix $a$ belonging to $K^{(m \times n)}$ and a matrix $b$ belonging to $K^{(n \times p)}$, for some integers $m$, $n$, $p$, form the product of $a$ and $b$ as an element of $K^{(m \times p)}$.

<a id="function-domain-modmatrngelt"></a>
## `Domain(a): ModMatRngElt -> ModTupRng`

The domain of the linear transformation $a$ belonging to ${\operatorname{Hom}}_{K}(V, W)$, returned as a subspace of $V$.

<a id="function-codomain-modmatrngelt"></a>
## `Codomain(a): ModMatRngElt -> ModTupRng`

The codomain of the linear transformation $a$ belonging to ${\operatorname{Hom}}_{K}(V, W)$, returned as a subspace of $W$.

<a id="function-image-modmatrngelt"></a>
## `Image(a): ModMatRngElt -> ModTupRng, Map, Map`

The image of the linear transformation $a$ belonging to ${\operatorname{Hom}}_{K}(V, W)$, returned as a subspace of $W$.

<a id="function-rank-modmatrngelt"></a>
## `Rank(a): ModMatRngElt -> RngIntElt`

The dimension of the image of the linear transformation $a$, i.e., the rank of the matrix $a$.

<a id="function-kernel-modmatrngelt"></a>
## `Kernel(a): ModMatRngElt -> ModTupFld, Map`

<a id="function-nullspace-modmatrngelt"></a>
## `NullSpace(a): ModMatRngElt -> ModTupFld, Map`

The kernel of the linear transformation $a$ belonging to ${\operatorname{Hom}}_{K}(V, W)$, returned as a subspace of $V$.

<a id="function-cokernel-modmatrngelt"></a>
## `Cokernel(a): ModMatRngElt -> ModTupFld, Map`

The cokernel of the linear transformation $a$ belonging to ${\operatorname{Hom}}_{K}(V, W)$.

<a id="example-ex-135cf0"></a>
## `Example: Operations on Linear Transformations (ex-135cf0)`

We illustrate the map operations for matrix spaces in the following example:

```magma
> Q := RationalField();
> Q2 := VectorSpace(Q, 2);
> Q3 := VectorSpace(Q, 3);
> Q4 := VectorSpace(Q, 4);
> H23 := Hom(Q2, Q3);
> H34 := Hom(Q3, Q4);
> x := Q2 ! [ -1, 2 ];
> a := H23 ! [ 1/2, 3, 0,  2/3, 4/5, -1 ];
> a;
[1/2   3   0]
[2/3 4/5  -1]
> Domain(a);
Full Vector space of degree 2 over Rational Field
> Codomain(a);
Full Vector space of degree 3 over Rational Field
> x*a;
( 5/6 -7/5   -2)
> b := H34 ! [ 2, 0, 1, -1/2,  1, 0, 3/2, 4,  4/5, 6/7, 0, -9/7];
> b;
[   2    0    1 -1/2]
[   1    0  3/2    4]
[ 4/5  6/7    0 -9/7]
> c := a*b;
> c;
[      4       0       5    47/4]
[    4/3    -6/7   28/15 436/105]
> x*c;
(     -4/3     -12/7    -19/15 -1447/420)
> Image(c);
Vector space of degree 4, dimension 2 over Rational Field
Echelonized basis:
(     1      0    5/4  47/16)
(     0      1  -7/30 -11/40)
> Kernel(c);
Vector space of degree 2, dimension 0 over Rational Field
> Rank(c);
2
> EchelonForm(c);
[     1      0    5/4  47/16]
[     0      1  -7/30 -11/40]
```
