This got broken in Sage 8.5. (still works in 8.4)
On Wed, Oct 9, 2019 at 6:09 AM David Joyner <wdjoy...@gmail.com> wrote: > > > On Wed, Oct 9, 2019 at 1:33 AM Robert Samal <robert.sa...@gmail.com> > wrote: > >> Sorry, F=GF(3), I made my original example shorter and didn't read it >> properly. >> >> So the full problematic code is >> >> B=matrix(GF(3), 2,2,[1,0,1,0], sparse=True) >> v=vector(GF(3), [1,1]) >> B.solve_right(v) >> >> > Yes. I can confirm it works with "sparse=True" removed *or* if GF(3) is > replaced by ZZ. > So there's an easy workaround but maybe the docs or the code has a bug? > Thanks for reporting. > > Thanks, >> >> Robert >> >> >> On Tuesday, October 8, 2019 at 5:17:59 PM UTC-7, Robert Samal wrote: >>> >>> I am trying to solve a rather large linear systems of equations of >>> GF(3). As the matrices are sparse, I thought that adding "sparse=True" to >>> the constructor of the matrix could be of help. However, I ran to a strange >>> error message. >>> >>> B=matrix(GF(3), 2,2,[1,0,1,0], sparse=True) >>> v=vector(F, [1,1]) >>> B.solve_right(v) >>> >>> The above code yields the following >>> >>> TypeError: Cannot convert sage.matrix.matrix_modn_sparse.Matrix_modn_sparse >>> to sage.matrix.matrix_integer_sparse.Matrix_integer_sparse >>> >>> >>> I am hesitant to paste the whole error message here, but it ends with >>> reference to file >>> SageMath/local/lib/python2.7/site-packages/sage/matrix/matrix_modn_sparse.pyx >>> in >>> sage.matrix.matrix_modn_sparse.Matrix_modn_sparse._solve_matrix_linbox >>> (build/cythonized/sage/matrix/matrix_modn_sparse.cpp:11633). >>> >>> I am using Sage 8.9, but the same issue was on 8.7 as well. >>> >>> Few other observations: >>> -- works as expected for dense matrices -- or for sparse ones over integers >>> -- the same issue occurs whether y is a vector or a matrix >>> -- It behaves the same for systems with no solution. >>> >>> Is there some hidden limitation of sparse matrices over finite fields? >>> I.e., is it a bug or feature? :-) >>> I tried to RTFM, but couldn't find this discussed. The page for sparse >>> matrices over >>> finite fields does not exactly promise the solve method, but it does not >>> mention it >>> would not work either. Is it possible to achieve what I want by other means >>> (in Sage). >>> >>> Thanks. >>> >>> >>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "sage-support" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to sage-support+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/sage-support/6ac68e19-7c5a-4be1-ba10-1bac22cddc62%40googlegroups.com >> <https://groups.google.com/d/msgid/sage-support/6ac68e19-7c5a-4be1-ba10-1bac22cddc62%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-support+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-support/CAEQuuAWQYKhtkVme8wHkJTj38QkmfnSJf3_Lhtqj9PxJmq8HcQ%40mail.gmail.com > <https://groups.google.com/d/msgid/sage-support/CAEQuuAWQYKhtkVme8wHkJTj38QkmfnSJf3_Lhtqj9PxJmq8HcQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/CAAWYfq0g7uzjcPfs69Q8yW54_GrEjGG3gxXar46XWReXrqVfAQ%40mail.gmail.com.