code: def _singular_value_decomposition(A):
      r"""Returns a Condensed Singular Value decomposition.
  
      Explanation
      ===========
  
      A Singular Value decomposition is a decomposition in the form $A = U \Sigma V^H$
      where
  
      - $U, V$ are column orthogonal matrix.
      - $\Sigma$ is a diagonal matrix, where the main diagonal contains singular
        values of matrix A.
  
      A column orthogonal matrix satisfies
      $\mathbb{I} = U^H U$ while a full orthogonal matrix satisfies
      relation $\mathbb{I} = U U^H = U^H U$ where $\mathbb{I}$ is an identity
      matrix with matching dimensions.
  
      For matrices which are not square or are rank-deficient, it is
      sufficient to return a column orthogonal matrix because augmenting
      them may introduce redundant computations.
      In condensed Singular Value Decomposition we only return column orthogonal
      matrices because of this reason
  
      If you want to augment the results to return a full orthogonal
      decomposition, you should use the following procedures.
  
      - Augment the $U, V$ matrices with columns that are orthogonal to every
        other columns and make it square.
      - Augment the $\Sigma$ matrix with zero rows to make it have the same
        shape as the original matrix.
  
      The procedure will be illustrated in the examples section.
  
      Examples
      ========
  
      we take a full rank matrix first:
  
      >>> from sympy import Matrix
      >>> A = Matrix([[1, 2],[2,1]])
      >>> U, S, V = A.singular_value_decomposition()
      >>> U
      Matrix([
      [ sqrt(2)/2, sqrt(2)/2],
      [-sqrt(2)/2, sqrt(2)/2]])
      >>> S
      Matrix([
      [1, 0],
      [0, 3]])
      >>> V
      Matrix([
      [-sqrt(2)/2, sqrt(2)/2],
      [ sqrt(2)/2, sqrt(2)/2]])
  
      If a matrix if square and full rank both U, V
      are orthogonal in both directions
  
      >>> U * U.H
      Matrix([
      [1, 0],
      [0, 1]])
      >>> U.H * U
      Matrix([
      [1, 0],
      [0, 1]])
  
      >>> V * V.H
      Matrix([
      [1, 0],
      [0, 1]])
      >>> V.H * V
      Matrix([
      [1, 0],
      [0, 1]])
      >>> A == U * S * V.H
      True
  
      >>> C = Matrix([
      ...         [1, 0, 0, 0, 2],
      ...         [0, 0, 3, 0, 0],
      ...         [0, 0, 0, 0, 0],
      ...         [0, 2, 0, 0, 0],
      ...     ])
      >>> U, S, V = C.singular_value_decomposition()
  
      >>> V.H * V
      Matrix([
      [1, 0, 0],
      [0, 1, 0],
      [0, 0, 1]])
      >>> V * V.H
      Matrix([
      [1/5, 0, 0, 0, 2/5],
      [  0, 1, 0, 0,   0],
      [  0, 0, 1, 0,   0],
      [  0, 0, 0, 0,   0],
      [2/5, 0, 0, 0, 4/5]])
  
      If you want to augment the results to be a full orthogonal
      decomposition, you should augment $V$ with an another orthogonal
      column.
  
      You are able to append an arbitrary standard basis that are linearly
      independent to every other columns and you can run the Gram-Schmidt
      process to make them augmented as orthogonal basis.
  
      >>> V_aug = V.row_join(Matrix([[0,0,0,0,1],
      ... [0,0,0,1,0]]).H)
      >>> V_aug = V_aug.QRdecomposition()[0]
      >>> V_aug
      Matrix([
      [0,   sqrt(5)/5, 0, -2*sqrt(5)/5, 0],
      [1,           0, 0,            0, 0],
      [0,           0, 1,            0, 0],
      [0,           0, 0,            0, 1],
      [0, 2*sqrt(5)/5, 0,    sqrt(5)/5, 0]])
      >>> V_aug.H * V_aug
      Matrix([
      [1, 0, 0, 0, 0],
      [0, 1, 0, 0, 0],
      [0, 0, 1, 0, 0],
      [0, 0, 0, 1, 0],
      [0, 0, 0, 0, 1]])
      >>> V_aug * V_aug.H
      Matrix([
      [1, 0, 0, 0, 0],
      [0, 1, 0, 0, 0],
      [0, 0, 1, 0, 0],
      [0, 0, 0, 1, 0],
      [0, 0, 0, 0, 1]])
  
      Similarly we augment U
  
      >>> U_aug = U.row_join(Matrix([0,0,1,0]))
      >>> U_aug = U_aug.QRdecomposition()[0]
      >>> U_aug
      Matrix([
      [0, 1, 0, 0],
      [0, 0, 1, 0],
      [0, 0, 0, 1],
      [1, 0, 0, 0]])
  
      >>> U_aug.H * U_aug
      Matrix([
      [1, 0, 0, 0],
      [0, 1, 0, 0],
      [0, 0, 1, 0],
      [0, 0, 0, 1]])
      >>> U_aug * U_aug.H
      Matrix([
      [1, 0, 0, 0],
      [0, 1, 0, 0],
      [0, 0, 1, 0],
      [0, 0, 0, 1]])
  
      We add 2 zero columns and one row to S
  
      >>> S_aug = S.col_join(Matrix([[0,0,0]]))
      >>> S_aug = S_aug.row_join(Matrix([[0,0,0,0],
      ... [0,0,0,0]]).H)
      >>> S_aug
      Matrix([
      [2,       0, 0, 0, 0],
      [0, sqrt(5), 0, 0, 0],
      [0,       0, 3, 0, 0],
      [0,       0, 0, 0, 0]])
  
  
  
      >>> U_aug * S_aug * V_aug.H == C
      True
  
      """
  
      AH = A.H
      m, n = A.shape
      if m >= n:
          V, S = (AH * A).diagonalize()
  
          ranked = []
          for i, x in enumerate(S.diagonal()):
              if not x.is_zero:
                  ranked.append(i)
  
          V = V[:, ranked]
  
          Singular_vals = [
              sqrt(S[i, i]) for i in range(S.rows) if i in ranked
          ]
  
          S = S.diag(*Singular_vals)
          V, _ = V.QRdecomposition()
          U = A * V * S.inv()
      else:
          U, S = (A * AH).diagonalize()
  
          ranked = []
          for i, x in enumerate(S.diagonal()):
              if not x.is_zero:
                  ranked.append(i)
  
          U = U[:, ranked]
          Singular_vals = [
              sqrt(S[i, i]) for i in range(S.rows) if i in ranked
          ]
  
          S = S.diag(*Singular_vals)
          U, _ = U.QRdecomposition()
          V = AH * U * S.inv()
  
      return U, S, V
  
imports: import copy
  from sympy.core import S
  from sympy.core.function import expand_mul
  from sympy.functions.elementary.miscellaneous import Min, sqrt
  from sympy.functions.elementary.complexes import sign
  from .exceptions import NonSquareMatrixError, NonPositiveDefiniteMatrixError
  from .utilities import _get_intermediate_simp, _iszero
  from .determinant import _find_reasonable_pivot_naive
label_desc: Use image node_id 11 for calling a global function with example usage: _singular_value_decomposition(A) and returns: U,  S,  V