class_docstr: Class that defines the canonical metric for Stiefel manifolds.
docstr: Compute the retraction of a tangent vector.
  
  This computation is based on the QR-decomposition.
  
  e.g. :math:`P_x(V) = qf(X + V)`.
  
  Parameters
  ----------
  tangent_vec : array-like, shape=[..., n, p]
      Tangent vector at a base point.
  base_point : array-like, shape=[..., n, p]
      Point in the Stiefel manifold.
  
  Returns
  -------
  exp : array-like, shape=[..., n, p]
      Point in the Stiefel manifold equal to the retraction
      of tangent_vec at the base point.
code: def retraction(tangent_vec, base_point):
      """Compute the retraction of a tangent vector.
  
      This computation is based on the QR-decomposition.
  
      e.g. :math:`P_x(V) = qf(X + V)`.
  
      Parameters
      ----------
      tangent_vec : array-like, shape=[..., n, p]
          Tangent vector at a base point.
      base_point : array-like, shape=[..., n, p]
          Point in the Stiefel manifold.
  
      Returns
      -------
      exp : array-like, shape=[..., n, p]
          Point in the Stiefel manifold equal to the retraction
          of tangent_vec at the base point.
      """
      matrix_q, matrix_r = gs.linalg.qr(base_point + tangent_vec)
  
      diagonal = gs.diagonal(matrix_r, axis1=-2, axis2=-1)
      sign = gs.sign(gs.sign(diagonal) + 0.5)
      diag = algebra_utils.from_vector_to_diagonal_matrix(sign)
      result = Matrices.mul(matrix_q, diag)
  
      return result
  
imports: import warnings
  import geomstats.backend
  import geomstats.errors
  from geomstats import algebra_utils
  from geomstats.geometry.base import LevelSet
  from geomstats.geometry.hermitian_matrices import powermh
  from geomstats.geometry.matrices import Matrices
  from geomstats.geometry.riemannian_metric import RiemannianMetric
  from geomstats.vectorization import repeat_out
label_desc: Use image node_id 5 for calling the StiefelCanonicalMetric obj's underlying member method code with example usage: obj.retraction(tangent_vec, base_point) and returns: result