---
title: "The Construction of Extensions and their Elements"
canonical: "https://docs.magma-maths.org/v2.30-1/Algebras/MatrixAlgebras/extension.html"
source: "https://docs.magma-maths.org/v2.30-1/Algebras/MatrixAlgebras/extension.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": "Construction of Subalgebras, Ideals, and Quotient Rings", "source": "https://docs.magma-maths.org/v2.30-1/Algebras/MatrixAlgebras/subring-ideal-quotient.md"}
next: {"title": "Operations on Matrix Algebras", "source": "https://docs.magma-maths.org/v2.30-1/Algebras/MatrixAlgebras/operation.md"}
intrinsics:
  - {"name": "DirectSum", "signature": "DirectSum(R, T): AlgMat, AlgMat -> AlgMat"}
  - {"name": "TensorProduct", "signature": "TensorProduct(A, B): AlgMat, AlgMat -> AlgMat"}
  - {"name": "DirectSum", "signature": "DirectSum(a, b): AlgMatElt, AlgMatElt -> AlgMatElt"}
  - {"name": "ExteriorSquare", "signature": "ExteriorSquare(a): AlgMatElt -> AlgMatElt"}
  - {"name": "ExteriorPower", "signature": "ExteriorPower(a, r): AlgMat, RngIntElt -> AlgMatElt"}
  - {"name": "SymmetricSquare", "signature": "SymmetricSquare(a): AlgMatElt -> AlgMatElt"}
  - {"name": "SymmetricPower", "signature": "SymmetricPower(a, r): AlgMatElt, RngIntElt -> AlgMatElt"}
  - {"name": "TensorProduct", "signature": "TensorProduct(a, b): AlgMatElt, AlgMatElt -> AlgMatElt"}
examples:
  - "ex-548c90"
---

# The Construction of Extensions and their Elements

## The Construction of Direct Sums and Tensor Products

<a id="function-directsum-algmat-algmat"></a>
### `DirectSum(R, T): AlgMat, AlgMat -> AlgMat`

Given two matrix algebras $R$ and $T$, where $R$ and $T$ have the same coefficient ring $S$, return the direct sum $D$ of $R$ and $T$ (with the action given by the direct sum of the action of $R$ and the action of $T$).

<a id="function-tensorproduct-algmat-algmat"></a>
### `TensorProduct(A, B): AlgMat, AlgMat -> AlgMat`

Given two unital matrix algebras $A$ and $B$, where $A$ and $B$ have the same coefficient ring $S$, construct the tensor product of $A$ and $B$.

<a id="example-ex-548c90"></a>
### `Example: Direct Sum and Tensor Product (ex-548c90)`

We construct the direct product and tensor product of the matrix algebra $A$ (defined above) with itself.

```magma
> Q := RationalField();
> A := MatrixAlgebra< Q, 3 | [ 1/3,0,0, 3/2,3,0, -1/2,4,3],
>        [ 3,0,0, 1/2,-5,0, 8,-1/2,4] >;
> AplusA := DirectSum(A, A);
> AplusA: Maximal;
Matrix Algebra of degree 6 with 4 generators over
    Rational Field
Generators:
[ 1/3    0    0    0    0    0]
[ 3/2    3    0    0    0    0]
[-1/2    4    3    0    0    0]
[   0    0    0    0    0    0]
[   0    0    0    0    0    0]
[   0    0    0    0    0    0]

[   3    0    0    0    0    0]
[ 1/2   -5    0    0    0    0]
[   8 -1/2    4    0    0    0]
[   0    0    0    0    0    0]
[   0    0    0    0    0    0]
[   0    0    0    0    0    0]

[   0    0    0    0    0    0]
[   0    0    0    0    0    0]
[   0    0    0    0    0    0]
[   0    0    0  1/3    0    0]
[   0    0    0  3/2    3    0]
[   0    0    0 -1/2    4    3]

[   0    0    0    0    0    0]
[   0    0    0    0    0    0]
[   0    0    0    0    0    0]
[   0    0    0    3    0    0]
[   0    0    0  1/2   -5    0]
[   0    0    0    8 -1/2    4]
> AtimesA := TensorProduct(A, A);
> AtimesA: Maximal;
Matrix Algebra of degree 9 with 4 generators over
    Rational Field
Generators:
[ 1/3    0    0    0    0    0    0    0    0]
[   0  1/3    0    0    0    0    0    0    0]
[   0    0  1/3    0    0    0    0    0    0]
[ 3/2    0    0    3    0    0    0    0    0]
[   0  3/2    0    0    3    0    0    0    0]
[   0    0  3/2    0    0    3    0    0    0]
[-1/2    0    0    4    0    0    3    0    0]
[   0 -1/2    0    0    4    0    0    3    0]
[   0    0 -1/2    0    0    4    0    0    3]

[   3    0    0    0    0    0    0    0    0]
[   0    3    0    0    0    0    0    0    0]
[   0    0    3    0    0    0    0    0    0]
[ 1/2    0    0   -5    0    0    0    0    0]
[   0  1/2    0    0   -5    0    0    0    0]
[   0    0  1/2    0    0   -5    0    0    0]
[   8    0    0 -1/2    0    0    4    0    0]
[   0    8    0    0 -1/2    0    0    4    0]
[   0    0    8    0    0 -1/2    0    0    4]

[ 1/3    0    0    0    0    0    0    0    0]
[ 3/2    3    0    0    0    0    0    0    0]
[-1/2    4    3    0    0    0    0    0    0]
[   0    0    0  1/3    0    0    0    0    0]
[   0    0    0  3/2    3    0    0    0    0]
[   0    0    0 -1/2    4    3    0    0    0]
[   0    0    0    0    0    0  1/3    0    0]
[   0    0    0    0    0    0  3/2    3    0]
[   0    0    0    0    0    0 -1/2    4    3]

[   3    0    0    0    0    0    0    0    0]
[ 1/2   -5    0    0    0    0    0    0    0]
[   8 -1/2    4    0    0    0    0    0    0]
[   0    0    0    3    0    0    0    0    0]
[   0    0    0  1/2   -5    0    0    0    0]
[   0    0    0    8 -1/2    4    0    0    0]
[   0    0    0    0    0    0    3    0    0]
[   0    0    0    0    0    0  1/2   -5    0]
[   0    0    0    0    0    0    8 -1/2    4]
```

## Construction of Direct Sums and Tensor Products of Elements

<a id="function-directsum-algmatelt-algmatelt"></a>
### `DirectSum(a, b): AlgMatElt, AlgMatElt -> AlgMatElt`

Given an element $a$ of the matrix algebra $Q$ and an element $b$ of the matrix algebra $R$, form the direct sum of matrices $a$ and $b$. The square is returned as an element of the matrix algebra $T$, which must be the direct sum of the parent of $a$ and the parent of $b$.

<a id="function-exteriorsquare-algmatelt"></a>
### `ExteriorSquare(a): AlgMatElt -> AlgMatElt`

Given an element $a$ of the matrix algebra $M_n(S)$, form the exterior square of $a$ as an element of $M_m(S)$, where $m = n(n-1)/2$.

<a id="function-exteriorpower-algmat-rngintelt"></a>
### `ExteriorPower(a, r): AlgMat, RngIntElt -> AlgMatElt`

Given an element $a$ of the matrix algebra $M_n(S)$, form the $r$th exterior power of $a$ as an element of $M_m(S)$, where $m = n\choose r$.

<a id="function-symmetricsquare-algmatelt"></a>
### `SymmetricSquare(a): AlgMatElt -> AlgMatElt`

Given an element $a$ of the matrix algebra $M_n(S)$, form the symmetric square of $a$ as an element of $M_m(S)$, where $m = n(n+1)/2$.

<a id="function-symmetricpower-algmatelt-rngintelt"></a>
### `SymmetricPower(a, r): AlgMatElt, RngIntElt -> AlgMatElt`

Given an element $a$ of the matrix algebra $M_n(S)$, form the $r$th symmetric power of $a$ as an element of $M_m(S)$, for the appropriate $m$.

<a id="function-tensorproduct-algmatelt-algmatelt"></a>
### `TensorProduct(a, b): AlgMatElt, AlgMatElt -> AlgMatElt`

Given an element $a$ belonging to a subalgebra of $M_{n_1}(S)$ and an element $b$ belonging to a subalgebra of $M_{n_2}(S)$, construct the tensor product of $a$ and $b$ as an element of the matrix algebra $M_n(S)$, where $n = n_1 * n_2$.
