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: Calculate Coulomb matrices for molecules. If extra randomized
  matrices are generated, they are treated as if they are features
  for additional conformers.
  
  Since Coulomb matrices are symmetric, only the (flattened) upper
  triangular portion is returned.
  
  Parameters
  ----------
  datapoint: rdkit.Chem.rdchem.Mol
      RDKit Mol object
  
  Returns
  -------
  np.ndarray
      The coulomb matrices of the given molecule.
      The default shape is `(num_confs, max_atoms, max_atoms)`.
      If num_confs == 1, the shape is `(max_atoms, max_atoms)`.
docstr_tok: ["Calculate","Coulomb","matrices","for","molecules",".","If","extra","randomized","matrices","are","generated",",","they","are","treated","as","if","they","are","features","for","additional","conformers",".","Since","Coulomb","matrices","are","symmetric",",","only","the","(","flattened",")","upper","triangular","portion","is","returned",".","Parameters","--","--","--","--","--","datapoint",":","rdkit.Chem.rdchem.Mol","RDKit","Mol","object","Returns","--","--","--","-","np.ndarray","The","coulomb","matrices","of","the","given","molecule",".","The","default","shape","is","`","(","num_confs",",","max_atoms",",","max_atoms",")","`",".","If","num_confs","==","1",",","the","shape","is","`","(","max_atoms",",","max_atoms",")","`","."]
code: def _featurize(self, datapoint: RDKitMol, **kwargs) -> np.ndarray:
      """
      Calculate Coulomb matrices for molecules. If extra randomized
      matrices are generated, they are treated as if they are features
      for additional conformers.
  
      Since Coulomb matrices are symmetric, only the (flattened) upper
      triangular portion is returned.
  
      Parameters
      ----------
      datapoint: rdkit.Chem.rdchem.Mol
          RDKit Mol object
  
      Returns
      -------
      np.ndarray
          The coulomb matrices of the given molecule.
          The default shape is `(num_confs, max_atoms, max_atoms)`.
          If num_confs == 1, the shape is `(max_atoms, max_atoms)`.
  
      """
      if "mol" in kwargs:
          datapoint = kwargs.get("mol")
          raise DeprecationWarning(
              'Mol is being phased out as a parameter, please pass "datapoint" instead.'
          )
  
      features = self.coulomb_matrix(datapoint)
      if self.upper_tri:
          features = np.asarray(
              [f[np.triu_indices_from(f)] for f in features]
          )
      if features.shape[0] == 1:
          # `(1, max_atoms, max_atoms)` -> `(max_atoms, max_atoms)`
          features = np.squeeze(features, axis=0)
      return features
  
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 2 for calling the CoulombMatrix obj's underlying member method code with example usage: obj._featurize(datapoint) and returns: features