We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32d441a commit f0859bfCopy full SHA for f0859bf
src/sage/matrix/matrix2.pyx
@@ -16494,7 +16494,12 @@ cdef class Matrix(Matrix1):
16494
if p == 2:
16495
from sage.rings.complex_double import CDF
16496
16497
- A = self.change_ring(CDF)
+ # Sparse matrices don't expose the ``SVD`` method.
16498
+ if self.is_sparse():
16499
+ A = self.dense_matrix().change_ring(CDF)
16500
+ else:
16501
+ A = self.change_ring(CDF)
16502
+
16503
A = A.conjugate().transpose() * A
16504
S = A.SVD()[1]
16505
return max(S.list()).real().sqrt()
0 commit comments