[sage-support] Re: solving a linear system of GF(3) -- strange TypeError

2019-10-08 Thread Robert Samal
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)

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.


Re: [sage-support] solving a linear system of GF(3) -- strange TypeError

2019-10-08 Thread David Joyner
On Tue, Oct 8, 2019, 8:18 PM 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
>

What is F (in the line defining v)?


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/e8912161-212e-4e6f-aa69-a7461b2f6c09%40googlegroups.com
> 
> .
>

-- 
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/CAEQuuAXABMowo8zgScxcOrRpZK-7PDasoJjeEVyT_WQkFaxXxg%40mail.gmail.com.


[sage-support] solving a linear system of GF(3) -- strange TypeError

2019-10-08 Thread Robert Samal
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/e8912161-212e-4e6f-aa69-a7461b2f6c09%40googlegroups.com.