(self)
return vals
Compute the singular values of a Matrix

        Examples
        ========

        >>> from sympy import Matrix, Symbol
        >>> x = Symbol('x', real=True)
        >>> A = Matrix([[0, 1, 0], [0, x, 0], [-1, 0, 0]])
        >>> A.singular_values()
        [sqrt(x**2 + 1), 1, 0]

        See Also
        ========

        condition_number
Compute the singular values of a Matrix
Compute the singular values of a Matrix
def singular_values(self):
        """Compute the singular values of a Matrix

        Examples
        ========

        >>> from sympy import Matrix, Symbol
        >>> x = Symbol('x', real=True)
        >>> A = Matrix([[0, 1, 0], [0, x, 0], [-1, 0, 0]])
        >>> A.singular_values()
        [sqrt(x**2 + 1), 1, 0]

        See Also
        ========

        condition_number
        """
        self = self.as_mutable()
        # Compute eigenvalues of A.H A
        valmultpairs = (self.H*self).eigenvals()

        # Expands result from eigenvals into a simple list
        vals = []
        for k, v in valmultpairs.items():
            vals += [sqrt(k)]*v  # dangerous! same k in several spots!
        # sort them in descending order
        vals.sort(reverse=True, key=default_sort_key)

        return vals
def singular_values ( self ) : self = self . as_mutable ( ) # Compute eigenvalues of A.H A valmultpairs = ( self . H * self ) . eigenvals ( ) # Expands result from eigenvals into a simple list vals = [ ] for k , v in valmultpairs . items ( ) : vals += [ sqrt ( k ) ] * v # dangerous! same k in several spots! # sort them in descending order vals . sort ( reverse = True , key = default_sort_key ) return vals