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.Sat, 06 Dec 2014 17:10:44 -0600Echelon form of matrix with coefficients in Zphttp://ask.sagemath.org/question/25142/echelon-form-of-matrix-with-coefficients-in-zp/I was wondering if there was a way to find the echelon form of a matrix with coefficients in Zp with sage? I tried
<pre><code>Matrix(Zp(5), 3, 3, [1..9]).echelon_form()</code></pre>
but this gives a NotImplementedError as echelon_form is not implemented over generic non-exact rings at present. I would also very much like the transformation matrix used to get to echelon form if possible.Fri, 05 Dec 2014 10:10:06 -0600http://ask.sagemath.org/question/25142/echelon-form-of-matrix-with-coefficients-in-zp/Answer by vdelecroix for <p>I was wondering if there was a way to find the echelon form of a matrix with coefficients in Zp with sage? I tried</p>
<pre><code>Matrix(Zp(5), 3, 3, [1..9]).echelon_form()</code></pre>
<p>but this gives a NotImplementedError as echelon_form is not implemented over generic non-exact rings at present. I would also very much like the transformation matrix used to get to echelon form if possible.</p>
http://ask.sagemath.org/question/25142/echelon-form-of-matrix-with-coefficients-in-zp/?answer=25144#post-id-25144Hello,
NotImplementedError exactly tells you the current state of Sage library on that function... one workaround is to go over QQ (or possibly ZZ) make the echelon form and go back to Zp
sage: m = Matrix(Zp(5), 3, 3, [1..9])
sage: m.change_ring(QQ).echelon_form().change_ring(Zp(5))
[ 1 + O(5^20) 0 4 + 4*5 + 4*5^2 + ... + O(5^20)]
[ 0 1 + O(5^20) 2 + O(5^20) ]
[ 0 0 0 ]
(note that I slightly edited the output)
VincentFri, 05 Dec 2014 13:04:07 -0600http://ask.sagemath.org/question/25142/echelon-form-of-matrix-with-coefficients-in-zp/?answer=25144#post-id-25144Answer by algebraicallyclosed for <p>I was wondering if there was a way to find the echelon form of a matrix with coefficients in Zp with sage? I tried</p>
<pre><code>Matrix(Zp(5), 3, 3, [1..9]).echelon_form()</code></pre>
<p>but this gives a NotImplementedError as echelon_form is not implemented over generic non-exact rings at present. I would also very much like the transformation matrix used to get to echelon form if possible.</p>
http://ask.sagemath.org/question/25142/echelon-form-of-matrix-with-coefficients-in-zp/?answer=25151#post-id-25151 F = GF(5)
Matrix(F, 3, 3, [1..9]).echelon_form()
︡
gives the output
[1 0 4]
[0 1 2]
[0 0 0]
Sat, 06 Dec 2014 15:28:28 -0600http://ask.sagemath.org/question/25142/echelon-form-of-matrix-with-coefficients-in-zp/?answer=25151#post-id-25151Comment by algebraicallyclosed for <pre><code>F = GF(5)
Matrix(F, 3, 3, [1..9]).echelon_form()
︡
</code></pre>
<p>gives the output</p>
<pre><code>[1 0 4]
[0 1 2]
[0 0 0]
</code></pre>
http://ask.sagemath.org/question/25142/echelon-form-of-matrix-with-coefficients-in-zp/?comment=25155#post-id-25155Oh,sorry, I thought that it was the field Zp,Sat, 06 Dec 2014 17:10:44 -0600http://ask.sagemath.org/question/25142/echelon-form-of-matrix-with-coefficients-in-zp/?comment=25155#post-id-25155Comment by vdelecroix for <pre><code>F = GF(5)
Matrix(F, 3, 3, [1..9]).echelon_form()
︡
</code></pre>
<p>gives the output</p>
<pre><code>[1 0 4]
[0 1 2]
[0 0 0]
</code></pre>
http://ask.sagemath.org/question/25142/echelon-form-of-matrix-with-coefficients-in-zp/?comment=25153#post-id-25153What is the link with the original question? Did you notice that Zp is the ring of p-adic integers and note the finite ring with p elements?Sat, 06 Dec 2014 16:08:00 -0600http://ask.sagemath.org/question/25142/echelon-form-of-matrix-with-coefficients-in-zp/?comment=25153#post-id-25153