class_docstr: Calculate Coulomb matrices for molecules.
  
  Coulomb matrices provide a representation of the electronic structure of
  a molecule. For a molecule with `N` atoms, the Coulomb matrix is a
  `N X N` matrix where each element gives the strength of the
  electrostatic interaction between two atoms. The method is described
  in more detail in [1]_.
  
  Examples
  --------
  >>> import deepchem as dc
  >>> featurizers = dc.feat.CoulombMatrix(max_atoms=23)
  >>> input_file = 'deepchem/feat/tests/data/water.sdf' # really backed by water.sdf.csv
  >>> tasks = ["atomization_energy"]
  >>> loader = dc.data.SDFLoader(tasks, featurizer=featurizers)
  >>> dataset = loader.create_dataset(input_file)
  
  References
  ----------
  .. [1] Montavon, Grégoire, et al. "Learning invariant representations of
      molecules for atomization energy prediction." Advances in neural information
      processing systems. 2012.
  
  Note
  ----
  This class requires RDKit to be installed.
docstr: Generate Coulomb matrices for each conformer of the given molecule.
  
  Parameters
  ----------
  mol: rdkit.Chem.rdchem.Mol
      RDKit Mol object
  
  Returns
  -------
  np.ndarray
      The coulomb matrices of the given molecule
docstr_tok: ["Generate","Coulomb","matrices","for","each","conformer","of","the","given","molecule",".","Parameters","--","--","--","--","--","mol",":","rdkit.Chem.rdchem.Mol","RDKit","Mol","object","Returns","--","--","--","-","np.ndarray","The","coulomb","matrices","of","the","given","molecule"]
code: def coulomb_matrix(self, mol: RDKitMol) -> np.ndarray:
      """
      Generate Coulomb matrices for each conformer of the given molecule.
  
      Parameters
      ----------
      mol: rdkit.Chem.rdchem.Mol
          RDKit Mol object
  
      Returns
      -------
      np.ndarray
          The coulomb matrices of the given molecule
  
      """
      try:
          from rdkit import Chem
          from rdkit.Chem import AllChem
      except ModuleNotFoundError:
          raise ImportError(
              "This class requires RDKit to be installed."
          )
  
      # Check whether num_confs >=1 or not
      num_confs = len(mol.GetConformers())
      if num_confs == 0:
          mol = Chem.AddHs(mol)
          AllChem.EmbedMolecule(mol, AllChem.ETKDG())
  
      if self.remove_hydrogens:
          mol = Chem.RemoveHs(mol)
      n_atoms = mol.GetNumAtoms()
      z = [atom.GetAtomicNum() for atom in mol.GetAtoms()]
      rval = []
      for conf in mol.GetConformers():
          d = self.get_interatomic_distances(conf)
          m = np.outer(z, z) / d
          m[range(n_atoms), range(n_atoms)] = 0.5 * np.array(z) ** 2.4
          if self.randomize:
              for random_m in self.randomize_coulomb_matrix(m):
                  random_m = pad_array(random_m, self.max_atoms)
                  rval.append(random_m)
          else:
              m = pad_array(m, self.max_atoms)
              rval.append(m)
      return np.asarray(rval)
  
file_path: deepchem/deepchem/feat/molecule_featurizers/coulomb_matrices.py
imports: import numpy
  from typing import Any, List, Optional
  from deepchem.utils.typing import RDKitMol
  from deepchem.utils.data_utils import pad_array
  from deepchem.feat.base_classes import MolecularFeaturizer
label_desc: Use image node_id 3 for calling the CoulombMatrix obj's underlying member method code with example usage: obj.coulomb_matrix(mol) and returns: np