---
title: "Construction of Subalgebras, Ideals, and Quotient Rings"
canonical: "https://docs.magma-maths.org/v2.30-1/Algebras/MatrixAlgebras/subring-ideal-quotient.html"
source: "https://docs.magma-maths.org/v2.30-1/Algebras/MatrixAlgebras/subring-ideal-quotient.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 Matrix Algebras and their Elements", "source": "https://docs.magma-maths.org/v2.30-1/Algebras/MatrixAlgebras/creation.md"}
next: {"title": "The Construction of Extensions and their Elements", "source": "https://docs.magma-maths.org/v2.30-1/Algebras/MatrixAlgebras/extension.md"}
intrinsics:
  - {"name": "sub", "signature": "sub<R | L>: AlgMat, List -> AlgMat, Hom(Alg)"}
  - {"name": "ideal", "signature": "ideal<R | L>: AlgMat, List -> AlgMat"}
  - {"name": "lideal", "signature": "lideal<R | L>: AlgMat, List -> AlgMat"}
  - {"name": "rideal", "signature": "rideal<R | L>: AlgMat, List -> AlgMat"}
examples:
  - "ex-3c6faa"
---

# Construction of Subalgebras, Ideals, and Quotient Rings

<a id="constructor-constructor-sub-algmat-list-algmat-hom-alg"></a>
## `sub<R | L>: AlgMat, List -> AlgMat, Hom(Alg)`

Given the matrix algebra $R$, defined as a subring of $M_n(S)$, construct the subring $T$ of $R$ generated by the elements specified by the list $L$, where $L$ is a list of one or more items of the following types:

**(a)**
A sequence of $n^2$ elements of $S$ defining an element of $R$;

**(b)**
An element of $R$;

**(c)**
A set or sequence of elements of $R$;

**(d)**
A subring of $R$;

**(e)**
A set or sequence of subrings of $R$.

Each element or subalgebra specified by the list must belong to the *same* complete matrix algebra. The subalgebra $T$ will be constructed as a subalgebra of some matrix algebra which contains each of the elements and subalgebras specified in the list. The generators of $T$ consist of the elements specified by the terms of the list $L$ together with the stored generators for subalgebras specified by terms of the list. Repetitions of an element and occurrences of the identity element are removed (unless $T$ is trivial). The constructor returns the subalgebra $T$ and the inclusion homomorphism $f : T \rightarrow R$.

<a id="constructor-constructor-ideal-algmat-list-algmat"></a>
## `ideal<R | L>: AlgMat, List -> AlgMat`

Given the matrix algebra $R$, construct the two-sided ideal $I$ of $R$ generated by the elements of $R$ specified by the list $L$, where the possibilities for $L$ are the same as for the `sub`-constructor.

<a id="constructor-constructor-lideal-algmat-list-algmat"></a>
## `lideal<R | L>: AlgMat, List -> AlgMat`

Given the matrix algebra $R$, construct the left ideal $I$ of $R$ generated by the elements of $R$ specified by the list $L$, where the possibilities for $L$ are the same as for the `sub`-constructor.

<a id="constructor-constructor-rideal-algmat-list-algmat"></a>
## `rideal<R | L>: AlgMat, List -> AlgMat`

Given the matrix algebra $R$, construct the right ideal $I$ of $R$ generated by the elements of $R$ specified in the list $L$, where the possibilities for $L$ are the same as for the `sub`-constructor.

<a id="example-ex-3c6faa"></a>
## `Example: Subalgebra Generated by One Element (ex-3c6faa)`

We construct the subalgebra of the matrix algebra $A$ (defined above) that is generated by the first generator.

```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] >;
> B := sub< A | A.1 >;
> Dimension(B);
3
> B: Maximal;
Matrix Algebra of degree 3 and dimension 3 with 1 generator
over Rational Field
Generators:
[ 1/3    0    0]
[ 3/2    3    0]
[-1/2    4    3]

Basis:

[1 0 0]
[0 1 0]
[0 0 1]

[    0     0     0]
[    1  16/9     0]
[    0 88/27  16/9]

[   0    0    0]
[   0    0    0]
[   1 16/9    0]
```
