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: Compute sub-Riemannian sharp map.
  
  This is the sub-Riemannian sharp map, mapping a covector at base_point to a
  tangent vector in the distribution subspace at base_point. For an orthonormal
  frame (F_i)_{i=1..dist_dim}, the sharp map is given by
  
  .. math::
          \sharp(q, p) = \sum_i^{dist_dim} p(F_i(q)) * F_i(q)
  
  Parameters
  ----------
  base_point : array-like, shape=[..., dim]
      Point on the manifold.
  
  cotangent_vec : array-like, shape=[..., dim]
      Cotangent vector at `base_point`.
  
  Returns
  -------
  sr_sharp : array-like, shape=[..., dim]
      sub-Riemannian sharp of 'cotangent_vec' at 'base_point'
docstr_tok: ["Compute","sub-Riemannian","sharp","map",".","This","is","the","sub-Riemannian","sharp","map",",","mapping","a","covector","at","base_point","to","a","tangent","vector","in","the","distribution","subspace","at","base_point",".","For","an","orthonormal","frame","(","F_i",")","_","{","i=1","..","dist_dim","}",",","the","sharp","map","is","given","by","..","math",":",":","\\sharp","(","q",",","p",")","=","\\sum_i^","{","dist_dim","}","p","(","F_i","(","q",")",")","*","F_i","(","q",")","Parameters","--","--","--","--","--","base_point",":","array-like",",","shape=","[","...",",","dim","]","Point","on","the","manifold",".","cotangent_vec",":","array-like",",","shape=","[","...",",","dim","]","Cotangent","vector","at","`","base_point","`",".","Returns","--","--","--","-","sr_sharp",":","array-like",",","shape=","[","...",",","dim","]","sub-Riemannian","sharp","of","'cotangent_vec","'","at","'base_point","'"]
code: def sr_sharp(self, base_point, cotangent_vec):
      r"""Compute sub-Riemannian sharp map.
  
      This is the sub-Riemannian sharp map, mapping a covector at base_point to a
      tangent vector in the distribution subspace at base_point. For an orthonormal
      frame (F_i)_{i=1..dist_dim}, the sharp map is given by
  
      .. math::
              \sharp(q, p) = \sum_i^{dist_dim} p(F_i(q)) * F_i(q)
  
      Parameters
      ----------
      base_point : array-like, shape=[..., dim]
          Point on the manifold.
  
      cotangent_vec : array-like, shape=[..., dim]
          Cotangent vector at `base_point`.
  
      Returns
      -------
      sr_sharp : array-like, shape=[..., dim]
          sub-Riemannian sharp of 'cotangent_vec' at 'base_point'
      """
      if self.frame is None:
          raise NotImplementedError(
              "The sub-Riemannian sharp map is only"
              " implemented when a frame is passed."
          )
  
      frame = self.frame(base_point)
      coefs = gs.einsum("...i,...ij->...j", cotangent_vec, frame)
      coefs_on_frame = gs.einsum("...j,...ij->...ij", coefs, frame)
  
      return gs.einsum("...ij->...i", coefs_on_frame)
  
file_path: geomstats/geomstats/geometry/sub_riemannian_metric.py
imports: import geomstats.backend
label_desc: Use image node_id 2 for calling the SubRiemannianMetric obj's underlying member method code with example usage: obj.sr_sharp(base_point, cotangent_vec) and returns: gs