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: Randomize a Coulomb matrix as decribed in [1]_:
  
  1. Compute row norms for M in a vector row_norms.
  2. Sample a zero-mean unit-variance noise vector e with dimension
      equal to row_norms.
  3. Permute the rows and columns of M with the permutation that
      sorts row_norms + e.
  
  Parameters
  ----------
  m: np.ndarray
      Coulomb matrix.
  
  Returns
  -------
  List[np.ndarray]
      List of the random coulomb matrix
  
  References
  ----------
  .. [1] Montavon et al., New Journal of Physics, 15, (2013), 095003
docstr_tok: ["Randomize","a","Coulomb","matrix","as","decribed","in","[","1","]","_",":","1",".","Compute","row","norms","for","M","in","a","vector","row_norms",".","2",".","Sample","a","zero-mean","unit-variance","noise","vector","e","with","dimension","equal","to","row_norms",".","3",".","Permute","the","rows","and","columns","of","M","with","the","permutation","that","sorts","row_norms","+","e.","Parameters","--","--","--","--","--","m",":","np.ndarray","Coulomb","matrix",".","Returns","--","--","--","-","List","[","np.ndarray","]","List","of","the","random","coulomb","matrix","References","--","--","--","--","--","..","[","1","]","Montavon","et","al.",",","New","Journal","of","Physics",",","15",",","(","2013",")",",","095003"]
code: def randomize_coulomb_matrix(self, m: np.ndarray) -> List[np.ndarray]:
      """Randomize a Coulomb matrix as decribed in [1]_:
  
      1. Compute row norms for M in a vector row_norms.
      2. Sample a zero-mean unit-variance noise vector e with dimension
          equal to row_norms.
      3. Permute the rows and columns of M with the permutation that
          sorts row_norms + e.
  
      Parameters
      ----------
      m: np.ndarray
          Coulomb matrix.
  
      Returns
      -------
      List[np.ndarray]
          List of the random coulomb matrix
  
      References
      ----------
      .. [1] Montavon et al., New Journal of Physics, 15, (2013), 095003
  
      """
      rval = []
      row_norms = np.asarray(
          [np.linalg.norm(row) for row in m], dtype=float
      )
      rng = np.random.RandomState(self.seed)
      for i in range(self.n_samples):
          e = rng.normal(size=row_norms.size)
          p = np.argsort(row_norms + e)
          new = m[p][:, p]  # permute rows first, then columns
          rval.append(new)
      return 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 4 for calling the CoulombMatrix obj's underlying member method code with example usage: obj.randomize_coulomb_matrix(m) and returns: rval