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: Construct a function which iterates another function n_steps times.
  
  Parameters
  ----------
  func : callable
      A function which calculates the next step of a
      sequence to be calculated.
  n_steps : int
      The number of times to iterate func.
  
  Returns
  -------
  flow : callable
      Given a state, 'flow' returns a sequence with n_steps
      iterations of func.
docstr_tok: ["Construct","a","function","which","iterates","another","function","n_steps","times",".","Parameters","--","--","--","--","--","func",":","callable","A","function","which","calculates","the","next","step","of","a","sequence","to","be","calculated",".","n_steps",":","int","The","number","of","times","to","iterate","func",".","Returns","--","--","--","-","flow",":","callable","Given","a","state",",","'flow","'","returns","a","sequence","with","n_steps","iterations","of","func","."]
code: def iterate(func, n_steps):
      r"""Construct a function which iterates another function n_steps times.
  
      Parameters
      ----------
      func : callable
          A function which calculates the next step of a
          sequence to be calculated.
      n_steps : int
          The number of times to iterate func.
  
      Returns
      -------
      flow : callable
          Given a state, 'flow' returns a sequence with n_steps
          iterations of func.
      """
  
      def flow(x):
          r"""Compute flow starting at x."""
          xs = [x]
          for i in range(n_steps):
              xs.append(func(xs[i]))
          return gs.array(xs)
  
      return flow
  
file_path: geomstats/geomstats/geometry/sub_riemannian_metric.py
imports: import geomstats.backend
label_desc: Use image node_id 14 for calling the SubRiemannianMetric obj's underlying member method code with example usage: obj.iterate(func, n_steps) and returns: flow, gs