Is it no longer possible to calculate SVD in sage?

asked 2 years ago

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?

Preview: (hide)

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 ( 2 years ago )

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 ( 2 years ago )
1

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

John Palmieri gravatar imageJohn Palmieri ( 2 years ago )