class_docstr: Orthogonal orbital parameterization using matrix exponential.
  The orthogonal orbital is represented by:
  
      P = matrix_exp(Q) @ C
  
  where C is an orthogonal coefficient tensor, and Q is the parameters defining
  the rotation of the orthogonal tensor.
  
  Examples
  --------
  >>> from deepchem.models.dft import MatExpOrbParams
  >>> params = torch.randn(3, 3)
  >>> coeffs = torch.randn(4, 3)
  >>> with_penalty = 0.1
  >>> orb, penalty = MatExpOrbParams.params2orb(params, coeffs, with_penalty)
  >>> params2, coeffs2 = MatExpOrbParams.orb2params(orb)
docstr: Get the free parameters from the orthogonal orbitals. Returns ``params``
  and ``coeffs`` described in ``params2orb``.
  
  Parameters
  ----------
  orb: torch.Tensor
      The orthogonal orbitals.
  
  Returns
  -------
  params: torch.Tensor
      The free parameters to be optimized.
  coeffs: torch.Tensor
      The coefficients to get the orthogonal orbitals.
docstr_tok: ["Get","the","free","parameters","from","the","orthogonal","orbitals",".","Returns","``","params","``","and","``","coeffs","``","described","in","``","params2orb","``",".","Parameters","--","--","--","--","--","orb",":","torch.Tensor","The","orthogonal","orbitals",".","Returns","--","--","--","-","params",":","torch.Tensor","The","free","parameters","to","be","optimized",".","coeffs",":","torch.Tensor","The","coefficients","to","get","the","orthogonal","orbitals","."]
code: def orb2params(orb: torch.Tensor) -> List[torch.Tensor]:
      """
      Get the free parameters from the orthogonal orbitals. Returns ``params``
      and ``coeffs`` described in ``params2orb``.
  
      Parameters
      ----------
      orb: torch.Tensor
          The orthogonal orbitals.
  
      Returns
      -------
      params: torch.Tensor
          The free parameters to be optimized.
      coeffs: torch.Tensor
          The coefficients to get the orthogonal orbitals.
  
      """
      # orb: (*, nao, norb)
      nao = orb.shape[-2]
      norb = orb.shape[-1]
      nparams = norb * (nao - norb) + norb * (norb - 1) // 2
  
      # the orbital becomes the coefficients while params is all zeros (no rotation)
      coeffs = orb
      params = torch.zeros(
          (*orb.shape[:-2], nparams), dtype=orb.dtype, device=orb.device
      )
      return [params, coeffs]
  
file_path: deepchem/deepchem/models/dft/hamilton/orbparams.py
imports: from typing import List
  import torch
label_desc: Use image node_id 2 for calling the MatExpOrbParams obj's underlying member method code with example usage: obj.orb2params(orb) and returns: list