class_docstr: Class for Sub-Riemannian metrics.
  
  This implementation assumes a bracket-generating distribution of constant dimension.
  
  Only one of the arguments 'cometric_matrix' and 'frame' can be different from
  None. If the frame is supplied, it is assumed orthonormal.
  
  Parameters
  ----------
  space : Manifold object
  cometric_matrix : callable
      Optional, default: 'None'
  
      The cometric matrix as a function of a point.
  
      You should pass :
          base_point : array-like, shape=[..., dim]
      It returns:
          _ : array-like, shape=[..., dim, dim]
  
  frame : callable
      Optional, default: 'None'
  
      Matrix representing the frame spanning the distribution,
      as a function of a point.
  
      You should pass:
          point : array-like, shape=[..., dim]
      It returns
          _ : array-like, shape=[..., dim, dist_dim]
              Frame field matrix. Each column is a vector field of the frame
              spanning the distribution.
class_docstr_tok: ["Class","for","Sub-Riemannian","metrics",".","This","implementation","assumes","a","bracket-generating","distribution","of","constant","dimension",".","Only","one","of","the","arguments","'cometric_matrix","'","and","'frame","'","can","be","different","from","None",".","If","the","frame","is","supplied",",","it","is","assumed","orthonormal",".","Parameters","--","--","--","--","--","space",":","Manifold","object","cometric_matrix",":","callable","Optional",",","default",":","'None'","The","cometric","matrix","as","a","function","of","a","point",".","You","should","pass",":","base_point",":","array-like",",","shape=","[","...",",","dim","]","It","returns",":","_",":","array-like",",","shape=","[","...",",","dim",",","dim","]","frame",":","callable","Optional",",","default",":","'None'","Matrix","representing","the","frame","spanning","the","distribution",",","as","a","function","of","a","point",".","You","should","pass",":","point",":","array-like",",","shape=","[","...",",","dim","]","It","returns","_",":","array-like",",","shape=","[","...",",","dim",",","dist_dim","]","Frame","field","matrix",".","Each","column","is","a","vector","field","of","the","frame","spanning","the","distribution","."]
docstr: Generate parameterized function for the normal geodesic curve.
  
  Normal geodesic curve defined by an initial point and an initial
  cotangent vector.
  
  Parameters
  ----------
  initial_point : array-like, shape=[..., dim]
      Point on the manifold, initial point of the geodesic.
  initial_cotangent_vec : array-like, shape=[..., dim]
      Cotangent vector at base point, the initial speed of the geodesics.
  
  Returns
  -------
  path : callable
      Time parameterized normal geodesic curve. If a batch of initial
      conditions is passed, the output array's first dimension
      represents the different initial conditions, and the second
      corresponds to time.
docstr_tok: ["Generate","parameterized","function","for","the","normal","geodesic","curve",".","Normal","geodesic","curve","defined","by","an","initial","point","and","an","initial","cotangent","vector",".","Parameters","--","--","--","--","--","initial_point",":","array-like",",","shape=","[","...",",","dim","]","Point","on","the","manifold",",","initial","point","of","the","geodesic",".","initial_cotangent_vec",":","array-like",",","shape=","[","...",",","dim","]","Cotangent","vector","at","base","point",",","the","initial","speed","of","the","geodesics",".","Returns","--","--","--","-","path",":","callable","Time","parameterized","normal","geodesic","curve",".","If","a","batch","of","initial","conditions","is","passed",",","the","output","array","'s","first","dimension","represents","the","different","initial","conditions",",","and","the","second","corresponds","to","time","."]
code: def geodesic(self, initial_point, initial_cotangent_vec, n_steps=20):
      """Generate parameterized function for the normal geodesic curve.
  
      Normal geodesic curve defined by an initial point and an initial
      cotangent vector.
  
      Parameters
      ----------
      initial_point : array-like, shape=[..., dim]
          Point on the manifold, initial point of the geodesic.
      initial_cotangent_vec : array-like, shape=[..., dim]
          Cotangent vector at base point, the initial speed of the geodesics.
  
      Returns
      -------
      path : callable
          Time parameterized normal geodesic curve. If a batch of initial
          conditions is passed, the output array's first dimension
          represents the different initial conditions, and the second
          corresponds to time.
      """
      if initial_cotangent_vec is None:
          raise ValueError(
              "Specify an initial cotangent "
              "vector to define the geodesic."
          )
  
      initial_point = gs.to_ndarray(initial_point, to_ndim=2)
      initial_cotangent_vec = gs.to_ndarray(
          initial_cotangent_vec, to_ndim=2
      )
  
      n_initial_conditions = initial_cotangent_vec.shape[0]
  
      if n_initial_conditions > 1 and len(initial_point) == 1:
          initial_point = gs.stack(
              [initial_point[0]] * n_initial_conditions
          )
  
      def path(t):
          """Generate parameterized function for geodesic curve.
  
          Parameters
          ----------
          t : array-like, shape=[n_points,]
              Times at which to compute points of the geodesics.
          """
          t = gs.array(t)
          t = gs.cast(t, initial_cotangent_vec.dtype)
          t = gs.to_ndarray(t, to_ndim=1)
  
          cotangent_vecs = gs.einsum(
              "i,...k->...ik", t, initial_cotangent_vec
          )
  
          points_at_time_t = [
              self.exp(tv, pt, n_steps=n_steps)
              for tv, pt in zip(cotangent_vecs, initial_point)
          ]
          points_at_time_t = gs.stack(points_at_time_t, axis=0)
  
          return (
              points_at_time_t[0]
              if n_initial_conditions == 1
              else points_at_time_t
          )
  
      return path
  
file_path: geomstats/geomstats/geometry/sub_riemannian_metric.py
imports: import geomstats.backend
label_desc: Use image node_id 17 for calling the SubRiemannianMetric obj's underlying member method code with example usage: obj.geodesic(initial_point, initial_cotangent_vec, n_steps) and returns: path, unknown