ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 07 Oct 2015 21:08:16 -0500Liner Code over IntegerRinghttps://ask.sagemath.org/question/29424/liner-code-over-integerring/ I want to make linear code over ring that is not field. I try to do this
sage: MS = MatrixSpace(IntegerModRing(4),3,3);
sage: G = MS([[1,0,0],[0,1,0],[0,0,1]])
sage: C=LinearCode(G)
But, there is error such as below
NotImplementedError: Echelon form not implemented over 'Ring of integers modulo 4'
Of course, there is no problem if I use `IntegerModRing(n)` with prime number `n`, but it is ring that is also field. I hope I can make Linear Code over Ring. Could somebody help me? Thanks.Wed, 09 Sep 2015 05:15:07 -0500https://ask.sagemath.org/question/29424/liner-code-over-integerring/Answer by vdelecroix for <p>I want to make linear code over ring that is not field. I try to do this </p>
<pre><code>sage: MS = MatrixSpace(IntegerModRing(4),3,3);
sage: G = MS([[1,0,0],[0,1,0],[0,0,1]])
sage: C=LinearCode(G)
</code></pre>
<p>But, there is error such as below</p>
<pre><code>NotImplementedError: Echelon form not implemented over 'Ring of integers modulo 4'
</code></pre>
<p>Of course, there is no problem if I use <code>IntegerModRing(n)</code> with prime number <code>n</code>, but it is ring that is also field. I hope I can make Linear Code over Ring. Could somebody help me? Thanks.</p>
https://ask.sagemath.org/question/29424/liner-code-over-integerring/?answer=29438#post-id-29438Hello,
It does not seem to be supported. There is no support for submodules of $\mathbb{Z} / n \mathbb{Z}$
sage: F = Zmod(4)**3
sage: v0 = F((1,0,0))
sage: v1 = F((1,1,1))
sage: F.submodule([v0,v1])
Traceback (most recent call last):
...
NotImplementedError: Echelon form not implemented over 'Ring of integers modulo 4'.
There is an [old ticket (#6452)](http://trac.sagemath.org/ticket/6452) on the Sage development website that aimed to implement it. There is some code with it but sadly not in final stage. If you have some programming skill you might have a look and contribute to Sage!Sun, 13 Sep 2015 17:26:16 -0500https://ask.sagemath.org/question/29424/liner-code-over-integerring/?answer=29438#post-id-29438Comment by nur_hamid for <p>Hello,</p>
<p>It does not seem to be supported. There is no support for submodules of $\mathbb{Z} / n \mathbb{Z}$</p>
<pre><code>sage: F = Zmod(4)**3
sage: v0 = F((1,0,0))
sage: v1 = F((1,1,1))
sage: F.submodule([v0,v1])
Traceback (most recent call last):
...
NotImplementedError: Echelon form not implemented over 'Ring of integers modulo 4'.
</code></pre>
<p>There is an <a href="http://trac.sagemath.org/ticket/6452">old ticket (#6452)</a> on the Sage development website that aimed to implement it. There is some code with it but sadly not in final stage. If you have some programming skill you might have a look and contribute to Sage!</p>
https://ask.sagemath.org/question/29424/liner-code-over-integerring/?comment=29817#post-id-29817Ok. Thanks.Wed, 07 Oct 2015 21:08:16 -0500https://ask.sagemath.org/question/29424/liner-code-over-integerring/?comment=29817#post-id-29817Answer by fidbc for <p>I want to make linear code over ring that is not field. I try to do this </p>
<pre><code>sage: MS = MatrixSpace(IntegerModRing(4),3,3);
sage: G = MS([[1,0,0],[0,1,0],[0,0,1]])
sage: C=LinearCode(G)
</code></pre>
<p>But, there is error such as below</p>
<pre><code>NotImplementedError: Echelon form not implemented over 'Ring of integers modulo 4'
</code></pre>
<p>Of course, there is no problem if I use <code>IntegerModRing(n)</code> with prime number <code>n</code>, but it is ring that is also field. I hope I can make Linear Code over Ring. Could somebody help me? Thanks.</p>
https://ask.sagemath.org/question/29424/liner-code-over-integerring/?answer=29425#post-id-29425Did you mean to construct the linear code over the finite field of size 4?
sage: MS = MatrixSpace(FiniteField(4,'a'),3,3); # Can also use GF(4,'a') to construct FF on 4 elems.
sage: G = MS([[1,0,0],[0,1,0],[0,0,1]])
sage: C=LinearCode(G)
Wed, 09 Sep 2015 12:42:56 -0500https://ask.sagemath.org/question/29424/liner-code-over-integerring/?answer=29425#post-id-29425