Is it no longer possible to calculate SVD in sage?

asked 2023-02-08 18:32:57 +0100

more_weight gravatar image

I recently noticed that the property .SVD() is no longer available for matrices defined over the RDF ring.

Is it no longer possible to calculate singular value decomposition in sage?

edit retag flag offensive close merge delete

Comments

For me, m = matrix(RDF,4,range(1,17)); m.SVD() works in the latest Sage. Can you provide more details? What version of Sage, what is not working for you, etc.?

John Palmieri gravatar imageJohn Palmieri ( 2023-02-08 22:28:01 +0100 )edit

Thanks for the reply. Yes, your mwe works.

I think my issue is that my matrix was originally defined as a "sparse" matrix over RDF and therefore I guess does not have the SVD method. Running A=matrix(RDF, A.nrows(), A.ncols(), A._list()) fixes the issue. Thanks!

more_weight gravatar imagemore_weight ( 2023-02-09 00:22:00 +0100 )edit

That makes sense. I think you could also do A.dense_matrix().SVD().

John Palmieri gravatar imageJohn Palmieri ( 2023-02-09 00:38:51 +0100 )edit