code: def __init__(self, num_radial, num_spherical, cutoff=8.0):
      super(torsion_emb, self).__init__()
      assert num_radial <= 64
      self.num_radial = num_radial
      self.num_spherical = num_spherical
      self.cutoff = cutoff
  
      bessel_formulas = bessel_basis(num_spherical, num_radial)
      Y_lm = real_sph_harm(
          num_spherical, spherical_coordinates=True, zero_m_only=False
      )
      self.sph_funcs = []  # (num_spherical**2,)
      self.bessel_funcs = []  # (num_spherical * num_radial,)
  
      # convert to tensorflow functions
      x = sym.symbols("x")
      theta = sym.symbols("theta")
      phi = sym.symbols("phi")
      modules = {"sin": torch.sin, "cos": torch.cos, "sqrt": torch.sqrt}
      for l in range(len(Y_lm)):  # num_spherical
          for m in range(len(Y_lm[l])):
              if (
                  l == 0
              ):  # Y_00 is only a constant -> function returns value and not tensor
                  first_sph = sym.lambdify(
                      [theta, phi], Y_lm[l][m], modules
                  )
                  self.sph_funcs.append(
                      lambda theta, phi: torch.zeros_like(theta)
                      + first_sph(theta, phi)
                  )
              else:
                  self.sph_funcs.append(
                      sym.lambdify([theta, phi], Y_lm[l][m], modules)
                  )
          for j in range(num_radial):
              self.bessel_funcs.append(
                  sym.lambdify([x], bessel_formulas[l][j], modules)
              )
  
      self.register_buffer(
          "degreeInOrder",
          torch.arange(num_spherical) * 2 + 1,
          persistent=False,
      )
  
file_path: DIG/dig/threedgraph/method/comenet/ocp/utils.py
imports: import torch
  import sympy
  import numpy
  from scipy.optimize import brentq
  from scipy import special
label_desc: Use image node_id 1 to create a new torsion_emb object from inherited base classes: torch.nn with example: obj = torsion_emb(num_radial, num_spherical, cutoff)