class_docstr: Elastic metric defined by a family of second order Sobolev metrics.
  
  Each individual discrete surface is represented by a 2D-array of shape
  `[n_vertices, 3]`. See [HSKCB2022]_ for details.
  
  The parameters a0, a1, b1, c1, d1, a2 (detailed below) are non-negative weighting
  coefficients for the different terms in the metric.
  
  Parameters
  ----------
  space : DiscreteSurfaces
      Instantiated DiscreteSurfaces manifold.
  a0 : float
      First order parameter.
      Default: 1.
  a1 : float
      Stretching parameter.
      Default: 1.
  b1 : float
      Shearing parameter.
      Default: 1.
  c1 : float
      Bending parameter.
      Default: 1.
  d1 : float
      Additonal first order parameter.
      Default: 1.
  a2 : float
      Second order parameter.
      Default: 1.
  
  References
  ----------
  .. [HSKCB2022] "Elastic shape analysis of surfaces with second-order
      Sobolev metrics: a comprehensive numerical framework".
      arXiv:2204.04238 [cs.CV], 25 Sep 2022
class_docstr_tok: ["Elastic","metric","defined","by","a","family","of","second","order","Sobolev","metrics",".","Each","individual","discrete","surface","is","represented","by","a","2D-array","of","shape","`","[","n_vertices",",","3","]","`",".","See","[","HSKCB2022","]","_","for","details",".","The","parameters","a0",",","a1",",","b1",",","c1",",","d1",",","a2","(","detailed","below",")","are","non-negative","weighting","coefficients","for","the","different","terms","in","the","metric",".","Parameters","--","--","--","--","--","space",":","DiscreteSurfaces","Instantiated","DiscreteSurfaces","manifold",".","a0",":","float","First","order","parameter",".","Default",":","1.","a1",":","float","Stretching","parameter",".","Default",":","1.","b1",":","float","Shearing","parameter",".","Default",":","1.","c1",":","float","Bending","parameter",".","Default",":","1.","d1",":","float","Additonal","first","order","parameter",".","Default",":","1.","a2",":","float","Second","order","parameter",".","Default",":","1",".","References","--","--","--","--","--","..","[","HSKCB2022","]","``","Elastic","shape","analysis","of","surfaces","with","second-order","Sobolev","metrics",":","a","comprehensive","numerical","framework","''",".","arXiv:2204.04238","[","cs.CV","]",",","25","Sep","2022"]
docstr: Compute a1 term of order 1 within the inner-product.
  
  Denote h and k the tangent vectors a and b respectively.
  Denote q the base point, i.e. the surface.
  
  The equation of the inner-product is:
  :math:`\int_M (G_{a_0} + G_{a_1} + G_{b_1} + G_{c_1} + G_{d_1} + G_{a_2})vol_q`.
  
  This method computes :math:`G_{a_1} = a_1.g_q^{-1} <dh_m, dk_m>`,
  with notations taken from [HSKCB2022]_.
  
  Parameters
  ----------
  ginvdga : array-like, shape=[n_faces, 2, 2]
      Product of the inverse of the surface metric matrices
      with their differential at a.
  ginvdgb : array-like, shape=[n_faces, 2, 2]
      Product of the inverse of the surface metric matrices
      with their differential at b.
  areas_bp : array-like, shape=[n_faces,]
      Areas of the faces of the surface given by the base point.
  
  Returns
  -------
  _ : array-like, shape=[...]
      Term of order 0, and coefficient a1, of the inner-product.
  
  References
  ----------
  .. [HSKCB2022] "Elastic shape analysis of surfaces with second-order
      Sobolev metrics: a comprehensive numerical framework".
      arXiv:2204.04238 [cs.CV], 25 Sep 2022.
docstr_tok: ["Compute","a1","term","of","order","1","within","the","inner-product",".","Denote","h","and","k","the","tangent","vectors","a","and","b","respectively",".","Denote","q","the","base","point",",","i.e",".","the","surface",".","The","equation","of","the","inner-product","is",":",":","math",":","`","\\int_M","(","G_","{","a_0","}","+","G_","{","a_1","}","+","G_","{","b_1","}","+","G_","{","c_1","}","+","G_","{","d_1","}","+","G_","{","a_2","}",")","vol_q","`",".","This","method","computes",":","math",":","`","G_","{","a_1","}","=","a_1.g_q^","{","-1","}","<","dh_m",",","dk_m",">","`",",","with","notations","taken","from","[","HSKCB2022","]","_.","Parameters","--","--","--","--","--","ginvdga",":","array-like",",","shape=","[","n_faces",",","2",",","2","]","Product","of","the","inverse","of","the","surface","metric","matrices","with","their","differential","at","a.","ginvdgb",":","array-like",",","shape=","[","n_faces",",","2",",","2","]","Product","of","the","inverse","of","the","surface","metric","matrices","with","their","differential","at","b.","areas_bp",":","array-like",",","shape=","[","n_faces",",","]","Areas","of","the","faces","of","the","surface","given","by","the","base","point",".","Returns","--","--","--","-","_",":","array-like",",","shape=","[","...","]","Term","of","order","0",",","and","coefficient","a1",",","of","the","inner-product",".","References","--","--","--","--","--","..","[","HSKCB2022","]","``","Elastic","shape","analysis","of","surfaces","with","second-order","Sobolev","metrics",":","a","comprehensive","numerical","framework","''",".","arXiv:2204.04238","[","cs.CV","]",",","25","Sep","2022","."]
code: def _inner_product_a1(self, ginvdga, ginvdgb, areas_bp):
      r"""Compute a1 term of order 1 within the inner-product.
  
      Denote h and k the tangent vectors a and b respectively.
      Denote q the base point, i.e. the surface.
  
      The equation of the inner-product is:
      :math:`\int_M (G_{a_0} + G_{a_1} + G_{b_1} + G_{c_1} + G_{d_1} + G_{a_2})vol_q`.
  
      This method computes :math:`G_{a_1} = a_1.g_q^{-1} <dh_m, dk_m>`,
      with notations taken from [HSKCB2022]_.
  
      Parameters
      ----------
      ginvdga : array-like, shape=[n_faces, 2, 2]
          Product of the inverse of the surface metric matrices
          with their differential at a.
      ginvdgb : array-like, shape=[n_faces, 2, 2]
          Product of the inverse of the surface metric matrices
          with their differential at b.
      areas_bp : array-like, shape=[n_faces,]
          Areas of the faces of the surface given by the base point.
  
      Returns
      -------
      _ : array-like, shape=[...]
          Term of order 0, and coefficient a1, of the inner-product.
  
      References
      ----------
      .. [HSKCB2022] "Elastic shape analysis of surfaces with second-order
          Sobolev metrics: a comprehensive numerical framework".
          arXiv:2204.04238 [cs.CV], 25 Sep 2022.
      """
      return self.a1 * gs.sum(
          gs.einsum("...bii->...b", gs.matmul(ginvdga, ginvdgb))
          * areas_bp,
          axis=-1,
      )
  
imports: import math
  import geomstats.backend
  from geomstats.geometry.euclidean import Euclidean
  from geomstats.geometry.manifold import Manifold
  from geomstats.geometry.riemannian_metric import RiemannianMetric
  from geomstats.numerics.optimizers import ScipyMinimize
label_desc: Use image node_id 3 for calling the ElasticMetric obj's underlying member method code with example usage: obj._inner_product_a1(ginvdga, ginvdgb, areas_bp) and returns: unknown