# ideals of a matrix ring

This post is a wiki. Anyone with karma >750 is welcome to improve it.

The command

MatrixSpace(R,n,m)


gives all the $n\times m$ matrices over R with a module structure. To construct ideals of matrix rings, I would need something like

MatrixSpace(I,n,m)


where $I$ is an ideal of $R$. But the above command would not work as $I$ is not a ring. Any suggestions what to do? Or more generally, how to construct the set of all matrices with entries from a given set?

edit retag close merge delete

Sort by » oldest newest most voted

First, note n by m matrices over a ring form a ring only if n and m are equal.

Example:

sage: MatrixSpace(ZZ, 2, 3) in Rings
False
sage: MatrixSpace(ZZ, 2) in Rings
True


Now in the case of square matrices, one way to answer your question is as follows.

sage: R.<x> = ZZ[]
sage: I = R.ideal([2, x])
sage: M = MatrixSpace(R, 2)
sage: IM_gens = [a * m for a in I.gens() for m in M.gens()]
sage: IM = M.ideal(IM_gens)


This gives us the following.

sage: R
Univariate Polynomial Ring in x over Integer Ring
sage: I
Ideal (2, x) of Univariate Polynomial Ring in x over Integer Ring
sage: M
Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in x over Integer Ring
sage: IM_gens
[
[2 0]  [0 2]  [0 0]  [0 0]  [x 0]  [0 x]  [0 0]  [0 0]
[0 0], [0 0], [2 0], [0 2], [0 0], [0 0], [x 0], [0 x]
]
sage: IM

Twosided Ideal
(
[2 0]
[0 0],

[0 2]
[0 0],

[0 0]
[2 0],

[0 0]
[0 2],

[x 0]
[0 0],

[0 x]
[0 0],

[0 0]
[x 0],

[0 0]
[0 x]
)
of Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in x over Integer Ring

more