class_docstr: Class for the 3D Heisenberg group in the vector representation.
  
  The 3D Heisenberg group represented as R^3. It is a step-2 Carnot Lie
  group. It can be equipped with a natural sub-Riemannian structure, and it
  is a fundamental example in sub-Riemannian geometry.
  
  Parameters
  ----------
  No parameters
  
  References
  ----------
  https://en.wikipedia.org/wiki/Heisenberg_group
class_docstr_tok: ["Class","for","the","3D","Heisenberg","group","in","the","vector","representation",".","The","3D","Heisenberg","group","represented","as","R^3",".","It","is","a","step-2","Carnot","Lie","group",".","It","can","be","equipped","with","a","natural","sub-Riemannian","structure",",","and","it","is","a","fundamental","example","in","sub-Riemannian","geometry",".","Parameters","--","--","--","--","--","No","parameters","References","--","--","--","--","--","https",":","\/\/en.wikipedia.org\/wiki\/Heisenberg_group"]
docstr: Compute the upper triangular matrix representation of the vector.
  
  The 3D Heisenberg group can also be represented as 3x3 upper triangular
  matrices. This function computes this representation of the vector
  `point`.
  
  Parameters
  ----------
  point : array-like, shape=[..., 3]
      Point in the vector-represention.
  
  Returns
  -------
  upper_triangular_mat : array-like, shape=[..., 3, 3]
      Upper triangular matrix.
docstr_tok: ["Compute","the","upper","triangular","matrix","representation","of","the","vector",".","The","3D","Heisenberg","group","can","also","be","represented","as","3x3","upper","triangular","matrices",".","This","function","computes","this","representation","of","the","vector","`","point","`",".","Parameters","--","--","--","--","--","point",":","array-like",",","shape=","[","...",",","3","]","Point","in","the","vector-represention",".","Returns","--","--","--","-","upper_triangular_mat",":","array-like",",","shape=","[","...",",","3",",","3","]","Upper","triangular","matrix","."]
code: def upper_triangular_matrix_from_vector(point):
      """Compute the upper triangular matrix representation of the vector.
  
      The 3D Heisenberg group can also be represented as 3x3 upper triangular
      matrices. This function computes this representation of the vector
      `point`.
  
      Parameters
      ----------
      point : array-like, shape=[..., 3]
          Point in the vector-represention.
  
      Returns
      -------
      upper_triangular_mat : array-like, shape=[..., 3, 3]
          Upper triangular matrix.
      """
      element_02 = point[..., 2] + 1 / 2 * point[..., 0] * point[..., 1]
  
      if gs.ndim(point) == 1:
          modified_point = gs.array(
              [1, point[0], element_02, 1, point[1], 1]
          )
      else:
          n_points = gs.shape(point)[0]
          modified_point = gs.stack(
              (
                  gs.ones(n_points),
                  point[..., 0],
                  element_02,
                  gs.ones(n_points),
                  point[..., 1],
                  gs.ones(n_points),
              ),
              axis=-1,
          )
  
      return gs.triu(
          SymmetricMatrices.matrix_representation(modified_point)
      )
  
file_path: geomstats/geomstats/geometry/heisenberg.py
imports: import geomstats.backend
  from geomstats.geometry.base import VectorSpace
  from geomstats.geometry.euclidean import Euclidean
  from geomstats.geometry.lie_group import LieGroup
  from geomstats.geometry.symmetric_matrices import SymmetricMatrices
label_desc: Use image node_id 9 for calling the HeisenbergVectors obj's underlying member method code with example usage: obj.upper_triangular_matrix_from_vector(point) and returns: gs