class_docstr: Class that defines operations using a hyperbolic metric.
class_docstr_tok: ["Class","that","defines","operations","using","a","hyperbolic","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 hyperboloid.
  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 hyperboloid. 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 `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","hyperboloid",".","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","hyperboloid",".","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","`","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 hyperboloid.
      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 hyperboloid. 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 `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 = self._space.embedding_space.metric.norm(direction)
      eps = gs.where(theta == 0.0, 1.0, theta)
      normalized_b = gs.einsum("...,...i->...i", 1 / eps, direction)
      pb = self._space.embedding_space.metric.inner_product(
          tangent_vec, normalized_b
      )
      p_orth = tangent_vec - gs.einsum(
          "...,...i->...i", pb, normalized_b
      )
      transported = (
          gs.einsum("...,...i->...i", gs.sinh(theta) * pb, base_point)
          + gs.einsum(
              "...,...i->...i", gs.cosh(theta) * pb, normalized_b
          )
          + p_orth
      )
      return transported
  
imports: import math
  import geomstats.algebra_utils
  import geomstats.backend
  from geomstats.geometry._hyperbolic import HyperbolicMetric, _Hyperbolic
  from geomstats.geometry.base import LevelSet
  from geomstats.geometry.minkowski import Minkowski
  from geomstats.vectorization import repeat_out
label_desc: Use image node_id 8 for calling the HyperboloidMetric obj's underlying member method code with example usage: obj.parallel_transport(tangent_vec, base_point, direction, end_point) and returns: transported