class_docstr: Class for the Kendall pre-shape space bundle.
class_docstr_tok: ["Class","for","the","Kendall","pre-shape","space","bundle","."]
docstr: Compute the covariant derivative of the integrability tensor A.
  
  The horizontal covariant derivative :math:`\nabla_X (A_Y E)` is
  necessary to compute the covariant derivative of the curvature in a
  submersion.
  The components :math:`\nabla_X (A_Y E)` and :math:`A_Y E` are
  computed here for the Kendall shape space at base-point
  :math:`P = base\_point` for horizontal vector fields fields :math:
  `X, Y` extending the values :math:`X|_P = horizontal\_vec\_x`,
  :math:`Y|_P = horizontal\_vec\_y` and a general vector field
  :math:`E` extending :math:`E|_P = tangent\_vec\_e` in a neighborhood
  of the base-point P with covariant derivatives
  :math:`\nabla_X Y |_P = nabla_x y` and
  :math:`\nabla_X E |_P = nabla_x e`.
  
  Parameters
  ----------
  horizontal_vec_x : array-like, shape=[..., k_landmarks, m_ambient]
      Horizontal tangent vector at `base_point`.
  horizontal_vec_y : array-like, shape=[..., k_landmarks, m_ambient]
      Horizontal tangent vector at `base_point`.
  nabla_x_y : array-like, shape=[..., k_landmarks, m_ambient]
      Tangent vector at `base_point`.
  tangent_vec_e : array-like, shape=[..., k_landmarks, m_ambient]
      Tangent vector at `base_point`.
  nabla_x_e : array-like, shape=[..., k_landmarks, m_ambient]
      Tangent vector at `base_point`.
  base_point : array-like, shape=[..., k_landmarks, m_ambient]
      Point of the total space.
  
  Returns
  -------
  nabla_x_a_y_e : array-like, shape=[..., k_landmarks, m_ambient]
      Tangent vector at `base_point`, result of :math:`\nabla_X^S
      (A_Y E)`.
  a_y_e : array-like, shape=[..., k_landmarks, m_ambient]
      Tangent vector at `base_point`, result of :math:`A_Y E`.
  
  References
  ----------
  .. [Pennec] Pennec, Xavier. Computing the curvature and its gradient
  in Kendall shape spaces. Unpublished.
docstr_tok: ["Compute","the","covariant","derivative","of","the","integrability","tensor","A",".","The","horizontal","covariant","derivative",":","math",":","`","\\nabla_X","(","A_Y","E",")","`","is","necessary","to","compute","the","covariant","derivative","of","the","curvature","in","a","submersion",".","The","components",":","math",":","`","\\nabla_X","(","A_Y","E",")","`","and",":","math",":","`","A_Y","E","`","are","computed","here","for","the","Kendall","shape","space","at","base-point",":","math",":","`","P","=","base\\_point","`","for","horizontal","vector","fields","fields",":","math",":","`","X",",","Y","`","extending","the","values",":","math",":","`","X|_P","=","horizontal\\_vec\\_x","`",",",":","math",":","`","Y|_P","=","horizontal\\_vec\\_y","`","and","a","general","vector","field",":","math",":","`","E","`","extending",":","math",":","`","E|_P","=","tangent\\_vec\\_e","`","in","a","neighborhood","of","the","base-point","P","with","covariant","derivatives",":","math",":","`","\\nabla_X","Y","|_P","=","nabla_x","y","`","and",":","math",":","`","\\nabla_X","E","|_P","=","nabla_x","e","`",".","Parameters","--","--","--","--","--","horizontal_vec_x",":","array-like",",","shape=","[","...",",","k_landmarks",",","m_ambient","]","Horizontal","tangent","vector","at","`","base_point","`",".","horizontal_vec_y",":","array-like",",","shape=","[","...",",","k_landmarks",",","m_ambient","]","Horizontal","tangent","vector","at","`","base_point","`",".","nabla_x_y",":","array-like",",","shape=","[","...",",","k_landmarks",",","m_ambient","]","Tangent","vector","at","`","base_point","`",".","tangent_vec_e",":","array-like",",","shape=","[","...",",","k_landmarks",",","m_ambient","]","Tangent","vector","at","`","base_point","`",".","nabla_x_e",":","array-like",",","shape=","[","...",",","k_landmarks",",","m_ambient","]","Tangent","vector","at","`","base_point","`",".","base_point",":","array-like",",","shape=","[","...",",","k_landmarks",",","m_ambient","]","Point","of","the","total","space",".","Returns","--","--","--","-","nabla_x_a_y_e",":","array-like",",","shape=","[","...",",","k_landmarks",",","m_ambient","]","Tangent","vector","at","`","base_point","`",",","result","of",":","math",":","`","\\nabla_X^S","(","A_Y","E",")","`",".","a_y_e",":","array-like",",","shape=","[","...",",","k_landmarks",",","m_ambient","]","Tangent","vector","at","`","base_point","`",",","result","of",":","math",":","`","A_Y","E","`",".","References","--","--","--","--","--","..","[","Pennec","]","Pennec",",","Xavier",".","Computing","the","curvature","and","its","gradient","in","Kendall","shape","spaces",".","Unpublished","."]
code: def integrability_tensor_derivative(
      self,
      horizontal_vec_x,
      horizontal_vec_y,
      nabla_x_y,
      tangent_vec_e,
      nabla_x_e,
      base_point,
  ):
      r"""Compute the covariant derivative of the integrability tensor A.
  
      The horizontal covariant derivative :math:`\nabla_X (A_Y E)` is
      necessary to compute the covariant derivative of the curvature in a
      submersion.
      The components :math:`\nabla_X (A_Y E)` and :math:`A_Y E` are
      computed here for the Kendall shape space at base-point
      :math:`P = base\_point` for horizontal vector fields fields :math:
      `X, Y` extending the values :math:`X|_P = horizontal\_vec\_x`,
      :math:`Y|_P = horizontal\_vec\_y` and a general vector field
      :math:`E` extending :math:`E|_P = tangent\_vec\_e` in a neighborhood
      of the base-point P with covariant derivatives
      :math:`\nabla_X Y |_P = nabla_x y` and
      :math:`\nabla_X E |_P = nabla_x e`.
  
      Parameters
      ----------
      horizontal_vec_x : array-like, shape=[..., k_landmarks, m_ambient]
          Horizontal tangent vector at `base_point`.
      horizontal_vec_y : array-like, shape=[..., k_landmarks, m_ambient]
          Horizontal tangent vector at `base_point`.
      nabla_x_y : array-like, shape=[..., k_landmarks, m_ambient]
          Tangent vector at `base_point`.
      tangent_vec_e : array-like, shape=[..., k_landmarks, m_ambient]
          Tangent vector at `base_point`.
      nabla_x_e : array-like, shape=[..., k_landmarks, m_ambient]
          Tangent vector at `base_point`.
      base_point : array-like, shape=[..., k_landmarks, m_ambient]
          Point of the total space.
  
      Returns
      -------
      nabla_x_a_y_e : array-like, shape=[..., k_landmarks, m_ambient]
          Tangent vector at `base_point`, result of :math:`\nabla_X^S
          (A_Y E)`.
      a_y_e : array-like, shape=[..., k_landmarks, m_ambient]
          Tangent vector at `base_point`, result of :math:`A_Y E`.
  
      References
      ----------
      .. [Pennec] Pennec, Xavier. Computing the curvature and its gradient
      in Kendall shape spaces. Unpublished.
      """
      if not gs.all(self.total_space.belongs(base_point)):
          raise ValueError(
              "The base_point does not belong to the pre-shape space"
          )
      if not gs.all(self.is_horizontal(horizontal_vec_x, base_point)):
          raise ValueError("Tangent vector x is not horizontal")
      if not gs.all(self.is_horizontal(horizontal_vec_y, base_point)):
          raise ValueError("Tangent vector y is not horizontal")
      if not gs.all(self.total_space.is_tangent(nabla_x_y, base_point)):
          raise ValueError("Vector nabla_x_y is not tangent")
      a_x_y = self.integrability_tensor(
          horizontal_vec_x, horizontal_vec_y, base_point
      )
      if not gs.all(self.is_horizontal(nabla_x_y - a_x_y, base_point)):
          raise ValueError(
              "Tangent vector nabla_x_y is not the gradient "
              "of a horizontal distribution"
          )
      if not gs.all(
          self.total_space.is_tangent(tangent_vec_e, base_point)
      ):
          raise ValueError("Tangent vector e is not tangent")
      if not gs.all(self.total_space.is_tangent(nabla_x_e, base_point)):
          raise ValueError("Vector nabla_x_e is not tangent")
  
      p_top = Matrices.transpose(base_point)
      p_top_p = gs.matmul(p_top, base_point)
      e_top = Matrices.transpose(tangent_vec_e)
      x_top = Matrices.transpose(horizontal_vec_x)
      y_top = Matrices.transpose(horizontal_vec_y)
  
      def sylv_p(mat_b):
          """Solves Sylvester equation for vertical component."""
          return gs.linalg.solve_sylvester(
              p_top_p, p_top_p, mat_b - Matrices.transpose(mat_b)
          )
  
      omega_ep = sylv_p(gs.matmul(p_top, tangent_vec_e))
      omega_ye = sylv_p(gs.matmul(e_top, horizontal_vec_y))
      tangent_vec_b = gs.matmul(horizontal_vec_x, omega_ye)
      tangent_vec_e_sym = tangent_vec_e - 2.0 * gs.matmul(
          base_point, omega_ep
      )
  
      a_y_e = gs.matmul(base_point, omega_ye) + gs.matmul(
          horizontal_vec_y, omega_ep
      )
  
      tmp_tangent_vec_p = (
          gs.matmul(e_top, nabla_x_y)
          - gs.matmul(y_top, nabla_x_e)
          - 2.0 * gs.matmul(p_top, tangent_vec_b)
      )
  
      tmp_tangent_vec_y = gs.matmul(p_top, nabla_x_e) + gs.matmul(
          x_top, tangent_vec_e_sym
      )
  
      scal_x_a_y_e = self.total_space.metric.inner_product(
          horizontal_vec_x, a_y_e, base_point
      )
  
      nabla_x_a_y_e = (
          gs.matmul(base_point, sylv_p(tmp_tangent_vec_p))
          + gs.matmul(horizontal_vec_y, sylv_p(tmp_tangent_vec_y))
          + gs.matmul(nabla_x_y, omega_ep)
          + tangent_vec_b
          + gs.einsum("...,...ij->...ij", scal_x_a_y_e, base_point)
      )
  
      return nabla_x_a_y_e, a_y_e
  
imports: import geomstats.backend
  from geomstats.geometry.base import LevelSet
  from geomstats.geometry.fiber_bundle import FiberBundle
  from geomstats.geometry.hypersphere import Hypersphere
  from geomstats.geometry.matrices import Matrices
  from geomstats.geometry.quotient_metric import QuotientMetric
  from geomstats.geometry.riemannian_metric import RiemannianMetric
  from geomstats.integrator import integrate
  from geomstats.vectorization import get_batch_shape, repeat_out
label_desc: Use image node_id 5 for calling the PreShapeSpaceBundle obj's underlying member method code with example usage: obj.integrability_tensor_derivative(horizontal_vec_x, horizontal_vec_y, nabla_x_y, tangent_vec_e, nabla_x_e, base_point) and returns: nabla_x_a_y_e,  a_y_e, gs