class_docstr: A diffeomorphism from UnitNormedRowsPLTDMatrices to OpenHemispheresProduct.
  
  A diffeomorphism between the space of lower triangular matrices with
  positive diagonal and unit normed rows and the product space of
  successively increasing factor-dimension open hemispheres.
  
  Given the way `OpenHemisphere` is implemented, i.e. the first component
  is positive, rows need to be flipped.
class_docstr_tok: ["A","diffeomorphism","from","UnitNormedRowsPLTDMatrices","to","OpenHemispheresProduct",".","A","diffeomorphism","between","the","space","of","lower","triangular","matrices","with","positive","diagonal","and","unit","normed","rows","and","the","product","space","of","successively","increasing","factor-dimension","open","hemispheres",".","Given","the","way","`","OpenHemisphere","`","is","implemented",",","i.e",".","the","first","component","is","positive",",","rows","need","to","be","flipped","."]
docstr: Transform vector into matrix.
  
  A generalization of inverse diffeomorphism and inverse tangent
  diffeomorphism, where we can choose if the first element is one
  (diffeomorphism) or zero (tangent diffeormorphism).
  
  Parameters
  ----------
  vec : array-like, shape=[..., space_dim]
  
  Returns
  -------
  mat : array-like, shape=[..., n, n]
docstr_tok: ["Transform","vector","into","matrix",".","A","generalization","of","inverse","diffeomorphism","and","inverse","tangent","diffeomorphism",",","where","we","can","choose","if","the","first","element","is","one","(","diffeomorphism",")","or","zero","(","tangent","diffeormorphism",")",".","Parameters","--","--","--","--","--","vec",":","array-like",",","shape=","[","...",",","space_dim","]","Returns","--","--","--","-","mat",":","array-like",",","shape=","[","...",",","n",",","n","]"]
code: def _from_product_to_mat(self, vec, ones=True):
      r"""Transform vector into matrix.
  
      A generalization of inverse diffeomorphism and inverse tangent
      diffeomorphism, where we can choose if the first element is one
      (diffeomorphism) or zero (tangent diffeormorphism).
  
      Parameters
      ----------
      vec : array-like, shape=[..., space_dim]
  
      Returns
      -------
      mat : array-like, shape=[..., n, n]
      """
      n = self.n
      flipped_vec = gs.flip(vec, axis=-1)
      batch_shape = vec.shape[:-1]
  
      gen_first = gs.ones if ones else gs.zeros
  
      first = gen_first(batch_shape + (1,))
  
      flipped_vec_ = gs.concatenate([flipped_vec, first], axis=-1)
  
      indices = sorted(
          zip(*gs.tril_indices(n)), key=lambda x: x[0], reverse=True
      )
  
      for n_batch in reversed(batch_shape):
          indices = [
              (k,) + indices_
              for k in range(n_batch)
              for indices_ in indices
          ]
  
      return gs.array_from_sparse(
          indices, gs.flatten(flipped_vec_), batch_shape + (n, n)
      )
  
imports: import geomstats.backend
  from geomstats.geometry.base import DiffeomorphicManifold, VectorSpaceOpenSet
  from geomstats.geometry.diffeo import Diffeo
  from geomstats.geometry.invariant_metric import _InvariantMetricMatrix
  from geomstats.geometry.lie_group import MatrixLieGroup
  from geomstats.geometry.lower_triangular_matrices import LowerTriangularMatrices
  from geomstats.geometry.matrices import Matrices
  from geomstats.geometry.open_hemisphere import OpenHemisphere, OpenHemispheresProduct
  from geomstats.geometry.pullback_metric import PullbackDiffeoMetric
  from geomstats.geometry.riemannian_metric import RiemannianMetric
label_desc: Use image node_id 3 for calling the UnitNormedRowsPLTDiffeo obj's underlying member method code with example usage: obj._from_product_to_mat(vec, ones) and returns: gs