ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 11 Dec 2016 07:28:34 -0600ideals of a matrix ringhttp://ask.sagemath.org/question/35970/ideals-of-a-matrix-ring/ 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?Fri, 09 Dec 2016 11:09:51 -0600http://ask.sagemath.org/question/35970/ideals-of-a-matrix-ring/Answer by slelievre for <p>The command </p>
<pre><code>MatrixSpace(R,n,m)
</code></pre>
<p>gives all the $n\times m$ matrices over R with a module structure. To construct ideals of matrix rings, I would need something like</p>
<pre><code>MatrixSpace(I,n,m)
</code></pre>
<p>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?</p>
http://ask.sagemath.org/question/35970/ideals-of-a-matrix-ring/?answer=35981#post-id-35981First, 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 RingSun, 11 Dec 2016 07:28:34 -0600http://ask.sagemath.org/question/35970/ideals-of-a-matrix-ring/?answer=35981#post-id-35981