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 the hamiltonian energy associated to the cometric.
  
  The Hamiltonian at state :math:`(q, p)` is defined by
  
  .. math::
          H(q, p) = \frac{1}{2} <p, p>_q
  
  where :math:`<\cdot, \cdot>_q` is the cometric at :math:`q`.
  
  Parameters
  ----------
  state : array-like, shape=[[..., dim], [..., dim]]
      The first array in 'state' contains positions, the second contains
      covectors (momentums).
  
  Returns
  -------
  energy :  float
      Hamiltonian energy at `state`.
docstr_tok: ["Compute","the","hamiltonian","energy","associated","to","the","cometric",".","The","Hamiltonian","at","state",":","math",":","`","(","q",",","p",")","`","is","defined","by","..","math",":",":","H","(","q",",","p",")","=","\\frac","{","1","}","{","2","}","<","p",",","p",">","_q","where",":","math",":","`","<","\\cdot",",","\\cdot",">","_q","`","is","the","cometric","at",":","math",":","`","q","`",".","Parameters","--","--","--","--","--","state",":","array-like",",","shape=","[","[","...",",","dim","]",",","[","...",",","dim","]","]","The","first","array","in","'state","'","contains","positions",",","the","second","contains","covectors","(","momentums",")",".","Returns","--","--","--","-","energy",":","float","Hamiltonian","energy","at","`","state","`","."]
code: def hamiltonian(self, state):
      r"""Compute the hamiltonian energy associated to the cometric.
  
      The Hamiltonian at state :math:`(q, p)` is defined by
  
      .. math::
              H(q, p) = \frac{1}{2} <p, p>_q
  
      where :math:`<\cdot, \cdot>_q` is the cometric at :math:`q`.
  
      Parameters
      ----------
      state : array-like, shape=[[..., dim], [..., dim]]
          The first array in 'state' contains positions, the second contains
          covectors (momentums).
  
      Returns
      -------
      energy :  float
          Hamiltonian energy at `state`.
      """
      return self._get_method("hamiltonian")(state)
  
file_path: geomstats/geomstats/geometry/sub_riemannian_metric.py
imports: import geomstats.backend
label_desc: Use image node_id 9 for calling the SubRiemannianMetric obj's underlying member method code with example usage: obj.hamiltonian(state) and returns: self