chemtools.toolbox.interactions.NCI

class chemtools.toolbox.interactions.NCI(density, rdgradient, grid, hessian=None)[source]

Non-Covalent Interactions (NCI) Class.

Initialize class using density, reduced density gradient and UniformGrid instance.

Parameters:
  • density (np.array) – Density evaluated on grid points of cube.
  • rdgradient (np.array) – Reduced density gradient evaluated on grid points of cube
  • grid (instance of UniformGrid, optional) – Cubic grid used for calculating and visualizing the NCI. If None, it is constructed from molecule with spacing=0.1 and extension=2.0.
  • hessian (np.array, optional) – Hessian of density evaluated on grid points of cube. This is a array with shape (n, 6) where n is the number of grid points of cube.
classmethod from_molecule(molecule, spin='ab', index=None, grid=None)[source]

Initialize class from Molecule object.

Parameters:
  • molecule (instance of Molecule class.) – Instance of Molecular class.
  • spin (str, optional) – The type of occupied spin orbitals; options are ‘a’, ‘b’ & ‘ab’.
  • index (int or Sequence of int, optional) – Sequence of integers representing the index of spin orbitals. If None, all occupied spin orbitals are included.
  • grid (instance of Grid, optional) – Grid used for calculating and visualizing the property values. If None, a cubic grid is constructed from molecule with spacing=0.1 & extension=2.0.
signed_density

Signed electron density.

Electron density \(\rho\left(\mathbf{r}\right)\) evaluated on a grid, signed by the second eigenvalue of the Hessian at that point, i.e. \(\text{sgn}\left(\lambda_2\right) \times \rho\left(\mathbf{r}\right)\).

eigvalues

Eigenvalues of Hessian.

generate_plot(fname, color='b', denslim=(-0.2, 0.2), rdglim=(0.0, 2.0))[source]

Plot reduced density gradient.

Reduced density gradient vs. \(\text{sgn}\left(\lambda_2\right) \times \rho\left(\mathbf{r}\right)\).

Parameters:
  • fname (str) – A string representing the path to a fname for storing the plot. If the given fname does not have a proper extension, the ‘png’ format is used by default, i.e. plot is saved as fname.png.
  • color (str, optional) – Color of plot. To customize color, see http://matplotlib.org/users/colors.html
  • denslim (tuple, optional) – The minimum and maximum of the (signed) density in the plot.
  • rdglim (tuple, optional) – The minimum and maximum of the reduced density gradient in the plot.
generate_scripts(fname, isosurf=0.5, denscut=0.05)[source]

Generate cube files and VMD script to visualize non-covalent interactions (NCI).

Generate density and reduced density gradient cube files, as well as a VMD (Visual Molecular Dynamics) script to visualize non-covalent interactions (NCI).

Parameters:
  • fname (str) – Name of generated cube files and vmd script.
  • isosurf (float, optional) – Value of reduced density gradient (RDG) iso-surface used in VMD script.
  • denscut (float, optional) – Density cutoff used in creating reduced density gradient cube file. Similar to NCIPlot program, reduced density gradient of points with density > denscut will be set to 100.0 to display reduced density gradient iso-surface subject to the constraint of low density. To visualize all reduced density gradient iso-surfaces, disregarding of the corresponding density value, set this argument equal to infinity using float(‘inf’).

Note

The generated cube files and script imitate the NCIPlot software version 1.0.

classmethod from_file(fname, spin='ab', index=None, grid=None)

Initialize class using wave-function file.

Parameters:
  • fname (str) – A string representing the path to a molecule’s fname.
  • spin (str, optional) – The type of occupied spin orbitals; options are ‘a’, ‘b’ & ‘ab’.
  • index (int or Sequence of int, optional) – Sequence of integers representing the index of spin orbitals. If None, all occupied spin orbitals are included.
  • grid (instance of Grid, optional) – Grid used for calculating and visualizing the property values. If None, a cubic grid is constructed from molecule with spacing=0.1 & extension=2.0.