class_docstr: Class for the Hypersphere Metric.
docstr: Compute the parallel transport of a tangent vector.
  
  Closed-form solution for the parallel transport of a tangent vector
  along the geodesic between two points `base_point` and `end_point`
  or alternatively defined by :math:`t \mapsto exp_{(base\_point)}(
  t*direction)`.
  
  Parameters
  ----------
  tangent_vec : array-like, shape=[..., dim + 1]
      Tangent vector at base point to be transported.
  base_point : array-like, shape=[..., dim + 1]
      Point on the hypersphere.
  direction : array-like, shape=[..., dim + 1]
      Tangent vector at base point, along which the parallel transport
      is computed.
      Optional, default : None.
  end_point : array-like, shape=[..., dim + 1]
      Point on the hypersphere. Point to transport to. Unused if
      `tangent_vec_b` is given.
      Optional, default : None.
  
  Returns
  -------
  transported_tangent_vec: array-like, shape=[..., dim + 1]
      Transported tangent vector at
      `end_point=exp_(base_point)(tangent_vec_b)`.
docstr_tok: ["Compute","the","parallel","transport","of","a","tangent","vector",".","Closed-form","solution","for","the","parallel","transport","of","a","tangent","vector","along","the","geodesic","between","two","points","`","base_point","`","and","`","end_point","`","or","alternatively","defined","by",":","math",":","`","t","\\mapsto","exp_","{","(","base\\_point",")","}","(","t","*","direction",")","`",".","Parameters","--","--","--","--","--","tangent_vec",":","array-like",",","shape=","[","...",",","dim","+","1","]","Tangent","vector","at","base","point","to","be","transported",".","base_point",":","array-like",",","shape=","[","...",",","dim","+","1","]","Point","on","the","hypersphere",".","direction",":","array-like",",","shape=","[","...",",","dim","+","1","]","Tangent","vector","at","base","point",",","along","which","the","parallel","transport","is","computed",".","Optional",",","default",":","None",".","end_point",":","array-like",",","shape=","[","...",",","dim","+","1","]","Point","on","the","hypersphere",".","Point","to","transport","to",".","Unused","if","`","tangent_vec_b","`","is","given",".","Optional",",","default",":","None",".","Returns","--","--","--","-","transported_tangent_vec",":","array-like",",","shape=","[","...",",","dim","+","1","]","Transported","tangent","vector","at","`","end_point=exp_","(","base_point",")","(","tangent_vec_b",")","`","."]
code: def parallel_transport(
      self, tangent_vec, base_point, direction=None, end_point=None
  ):
      r"""Compute the parallel transport of a tangent vector.
  
      Closed-form solution for the parallel transport of a tangent vector
      along the geodesic between two points `base_point` and `end_point`
      or alternatively defined by :math:`t \mapsto exp_{(base\_point)}(
      t*direction)`.
  
      Parameters
      ----------
      tangent_vec : array-like, shape=[..., dim + 1]
          Tangent vector at base point to be transported.
      base_point : array-like, shape=[..., dim + 1]
          Point on the hypersphere.
      direction : array-like, shape=[..., dim + 1]
          Tangent vector at base point, along which the parallel transport
          is computed.
          Optional, default : None.
      end_point : array-like, shape=[..., dim + 1]
          Point on the hypersphere. Point to transport to. Unused if
          `tangent_vec_b` is given.
          Optional, default : None.
  
      Returns
      -------
      transported_tangent_vec: array-like, shape=[..., dim + 1]
          Transported tangent vector at
          `end_point=exp_(base_point)(tangent_vec_b)`.
      """
      if direction is None:
          if end_point is not None:
              direction = self.log(end_point, base_point)
          else:
              raise ValueError(
                  "Either an end_point or a tangent_vec_b must be given to define the"
                  " geodesic along which to transport."
              )
      theta = gs.linalg.norm(direction, axis=-1)
      eps = gs.where(theta == 0.0, 1.0, theta)
      normalized_b = gs.einsum("...,...i->...i", 1 / eps, direction)
      pb = gs.dot(tangent_vec, normalized_b)
      p_orth = tangent_vec - gs.einsum(
          "...,...i->...i", pb, normalized_b
      )
      transported = (
          -gs.einsum("...,...i->...i", gs.sin(theta) * pb, base_point)
          + gs.einsum(
              "...,...i->...i", gs.cos(theta) * pb, normalized_b
          )
          + p_orth
      )
      return transported
  
imports: import logging
  import math
  from itertools import product
  from scipy.stats import beta
  import geomstats.algebra_utils
  import geomstats.backend
  from geomstats.geometry.base import LevelSet
  from geomstats.geometry.euclidean import Euclidean
  from geomstats.geometry.riemannian_metric import RiemannianMetric
  from geomstats.vectorization import get_batch_shape, repeat_out
label_desc: Use image node_id 8 for calling the HypersphereMetric obj's underlying member method code with example usage: obj.parallel_transport(tangent_vec, base_point, direction, end_point) and returns: transported