class_docstr: Class for invariant metrics on Matrix Lie groups.
  
  This class supports both left and right invariant metrics
  which exist on Lie groups.
  
  Parameters
  ----------
  space : LieGroup
      Group to equip with the invariant metric.
  metric_mat_at_identity : array-like, shape=[dim, dim]
      Matrix that defines the metric at identity.
      Optional, defaults to identity matrix if None.
  left : bool
      Whether to use a left or right invariant metric.
      Optional, default: True.
  
  References
  ----------
  .. [Milnor]    Milnor, John. “Curvatures of Left Invariant Metrics on Lie
                 Groups.” Advances in Mathematics 21, no. 3, 1976:
                 293–329. https://doi.org/10.1016/S0001-8708(76)80002-3.
  .. [Kolev]     Kolev, Boris. “Lie Groups and Mechanics: An Introduction.”
                 Journal of Nonlinear Mathematical Physics 11, no. 4, 2004:
                  480–98. https://doi.org/10.2991/jnmp.2004.11.4.5.
  .. [Gallier]   Gallier, Jean, and Jocelyn Quaintance. Differential Geometry
                 and Lie Groups: A Computational Perspective.
                 Geonger International Publishing, 2020.
                 https://doi.org/10.1007/978-3-030-46040-2.
class_docstr_tok: ["Class","for","invariant","metrics","on","Matrix","Lie","groups",".","This","class","supports","both","left","and","right","invariant","metrics","which","exist","on","Lie","groups",".","Parameters","--","--","--","--","--","space",":","LieGroup","Group","to","equip","with","the","invariant","metric",".","metric_mat_at_identity",":","array-like",",","shape=","[","dim",",","dim","]","Matrix","that","defines","the","metric","at","identity",".","Optional",",","defaults","to","identity","matrix","if","None",".","left",":","bool","Whether","to","use","a","left","or","right","invariant","metric",".","Optional",",","default",":","True",".","References","--","--","--","--","--","..","[","Milnor","]","Milnor",",","John",".","\u201c","Curvatures","of","Left","Invariant","Metrics","on","Lie","Groups.","\u201d","Advances","in","Mathematics","21",",","no",".","3",",","1976",":","293\u2013329",".","https",":","\/\/doi.org\/10.1016\/S0001-8708","(","76",")","80002-3",".","..","[","Kolev","]","Kolev",",","Boris",".","\u201c","Lie","Groups","and","Mechanics",":","An","Introduction.","\u201d","Journal","of","Nonlinear","Mathematical","Physics","11",",","no",".","4",",","2004",":","480\u201398",".","https",":","\/\/doi.org\/10.2991\/jnmp.2004.11.4.5",".","..","[","Gallier","]","Gallier",",","Jean",",","and","Jocelyn","Quaintance",".","Differential","Geometry","and","Lie","Groups",":","A","Computational","Perspective",".","Geonger","International","Publishing",",","2020.","https",":","\/\/doi.org\/10.1007\/978-3-030-46040-2","."]
docstr: Compute the parallel transport of a tangent vec along a geodesic.
  
  Approximate solution for the parallel transport of a tangent vector a
  along the geodesic between two points `base_point` and `end_point`
  or alternatively defined by :math:`t \mapsto exp_{(base\_point)}(
  t*direction)`. The parallel transport equation is written entirely
  in the Lie algebra and solved with an integration scheme.
  
  Parameters
  ----------
  tangent_vec : array-like, shape=[..., n, n]
      Tangent vector at base point to be transported.
  base_point : array-like, shape=[..., n, n]
      Point on the manifold.
  direction : array-like, shape=[..., n, n]
      Tangent vector at base point, along which the parallel transport
      is computed.
      Optional, default: None
  end_point : array-like, shape=[..., n, n]
      Point on the manifold. Point to transport to.
      Unused if `tangent_vec_b` is given
      Optional, default: None
  n_steps : int
      Number of integration steps to take.
      Optional, default : 10.
  step : str, {'euler', 'rk2', 'rk4'}
      Scheme to use for the approximation of the solution of the ODE
      Optional, default : rk4
  return_endpoint : bool
      Whether the end-point of the geodesic should be returned.
      Optional, default : False.
  
  Returns
  -------
  transported_tangent_vec: array-like, shape=[..., n, n]
      Transported tangent vector at `exp_(base_point)(tangent_vec_b)`.
  end_point : array-like, shape=[..., n, n]
      `exp_(base_point)(tangent_vec_b)`, only returned if
      `return_endpoint` is set to `True`.
  
  See Also
  --------
  geomstats.integrator
  
  References
  ----------
  .. [GP21]  Guigui, Nicolas, and Xavier Pennec. “A Reduced Parallel
             Transport Equation on Lie Groups with a Left-Invariant
             Metric.” 5th conference on Geometric Science of Information,
             Paris 2021. Springer. Lecture Notes in Computer Science.
             https://hal.inria.fr/hal-03154318.
code: def parallel_transport(
      self,
      tangent_vec,
      base_point,
      direction=None,
      end_point=None,
      n_steps=10,
      step="rk4",
      return_endpoint=False,
  ):
      r"""Compute the parallel transport of a tangent vec along a geodesic.
  
      Approximate solution for the parallel transport of a tangent vector a
      along the geodesic between two points `base_point` and `end_point`
      or alternatively defined by :math:`t \mapsto exp_{(base\_point)}(
      t*direction)`. The parallel transport equation is written entirely
      in the Lie algebra and solved with an integration scheme.
  
      Parameters
      ----------
      tangent_vec : array-like, shape=[..., n, n]
          Tangent vector at base point to be transported.
      base_point : array-like, shape=[..., n, n]
          Point on the manifold.
      direction : array-like, shape=[..., n, n]
          Tangent vector at base point, along which the parallel transport
          is computed.
          Optional, default: None
      end_point : array-like, shape=[..., n, n]
          Point on the manifold. Point to transport to.
          Unused if `tangent_vec_b` is given
          Optional, default: None
      n_steps : int
          Number of integration steps to take.
          Optional, default : 10.
      step : str, {'euler', 'rk2', 'rk4'}
          Scheme to use for the approximation of the solution of the ODE
          Optional, default : rk4
      return_endpoint : bool
          Whether the end-point of the geodesic should be returned.
          Optional, default : False.
  
      Returns
      -------
      transported_tangent_vec: array-like, shape=[..., n, n]
          Transported tangent vector at `exp_(base_point)(tangent_vec_b)`.
      end_point : array-like, shape=[..., n, n]
          `exp_(base_point)(tangent_vec_b)`, only returned if
          `return_endpoint` is set to `True`.
  
      See Also
      --------
      geomstats.integrator
  
      References
      ----------
      .. [GP21]  Guigui, Nicolas, and Xavier Pennec. “A Reduced Parallel
                 Transport Equation on Lie Groups with a Left-Invariant
                 Metric.” 5th conference on Geometric Science of Information,
                 Paris 2021. Springer. Lecture Notes in Computer Science.
                 https://hal.inria.fr/hal-03154318.
      """
      if direction is None:
          if end_point is not None:
              tangent_vec_b_ = 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."
              )
      else:
          tangent_vec_b_ = direction
  
      translation_map = self._space.tangent_translation_map(
          base_point, left=self.left, inverse=True
      )
      left_angular_vel_a = self._space.to_tangent(
          translation_map(tangent_vec)
      )
      left_angular_vel_b = self._space.to_tangent(
          translation_map(tangent_vec_b_)
      )
  
      def acceleration(state, time):
          """Compute the right-hand-side of the parallel transport eq."""
          omega, zeta = state[1:]
          gam_dot, omega_dot = self.geodesic_equation(state[:2], time)
          zeta_dot = -self.connection_at_identity(omega, zeta)
          return gs.stack([gam_dot, omega_dot, zeta_dot])
  
      (
          base_point,
          left_angular_vel_a,
          left_angular_vel_b,
      ) = gs.broadcast_arrays(
          base_point, left_angular_vel_a, left_angular_vel_b
      )
      initial_state = gs.stack(
          [base_point, left_angular_vel_b, left_angular_vel_a]
      )
  
      flow = integrate(
          acceleration, initial_state, n_steps=n_steps, step=step
      )
      gamma, _, zeta_t = flow[-1]
      transported = self._space.tangent_translation_map(
          gamma, left=self.left, inverse=False
      )(zeta_t)
      return (transported, gamma) if return_endpoint else transported
  
imports: import geomstats.backend
  from geomstats.geometry.matrices import Matrices
  from geomstats.geometry.riemannian_metric import RiemannianMetric
  from geomstats.integrator import integrate
  from geomstats.numerics.geodesic import ExpODESolver, LogShootingSolver
  from geomstats.numerics.ivp import GSIVPIntegrator
  from geomstats.vectorization import repeat_out
label_desc: Use image node_id 20 for calling the _InvariantMetricMatrix obj's underlying member method code with example usage: obj.parallel_transport(tangent_vec, base_point, direction, end_point, n_steps, step, return_endpoint) and returns: unknown, gs