chemtools.analysis.densitybased.NCI

class chemtools.analysis.densitybased.NCI(density, rdgradient, cube, hessian=None)[source]

Class for the Non-Covalent Interactions (NCI).

Initialize class using density, Reduced density gradient and CubeGen instance.

Parameters:
  • density (np.array) – Density evaluated on grid points of cube.
  • rdgradient (np.array) – Reduced density gradient evaluated on grid points of cube
  • cube (instance of CubeGen, default=None) – Cubic grid used for calculating and visualizing the NCI. If None, it is constructed from molecule with spacing=0.1 and threshold=2.0
  • hessian (np.array, default=None) – Hessian of density evaluated on grid points of cube. This is a 3D-array with (n, 3, 3) shape where n is the number of grid points of cube.
classmethod from_file(filename, cube=None)[source]

Initialize class using wave-function file.

Parameters:
  • filename (str) – Path to molecule’s files.
  • cube (instance of CubeGen, default=None) – Cubic grid used for calculating and visualizing the NCI. If None, it is constructed from molecule with spacing=0.1 and threshold=2.0
classmethod from_iodata(iodata, cube=None)[source]

Initialize class from IOData object from HORTON library.

Parameters:
  • iodata (IOData) – Instance of IOData.
  • cube (instance of CubeGen, default=None) – Cubic grid used for calculating and visualizing the NCI. If None, it is constructed from molecule with spacing=0.1 and threshold=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

The eigenvalues of Hessian.

plot(filename, color='b')[source]

Plot reduced density gradient.

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

Parameters:
  • filename (str) –

    Name of generated 2D plot.

    If the given filename does not have a proper extension (representing its format), the ‘png’ format is used by default (i.e. plot is saved as filename.png).

    Supported formats (which should be specified as filename extensions) include:

    • ‘svgz’ or ‘svg’ (Scalable Vector Graphics)
    • ‘tif’ or ‘tiff’ (Tagged Image File Format)
    • ‘jpg’ or ‘jpeg’ (Joint Photographic Experts Group)
    • ‘raw’ (Raw RGBA bitmap)
    • ‘png’ (Portable Network Graphics)
    • ‘ps’ (Postscript)
    • ‘eps’ (Encapsulated Postscript)
    • ‘rgba’ (Raw RGBA bitmap)
    • ‘pdf’ (Portable Document Format)
  • color (str, default='b') – Color of plot. Default is blue specified with ‘b’. For details on specifying colors, please refer to http://matplotlib.org/users/colors.html
dump_files(filename, 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:
  • filename (str) – Name of generated cube files and vmd script.
  • isosurf (float, default=0.5) – Value of reduced density gradient (RDG) iso-surface used in VMD script.
  • denscut (float, default=0.05) – 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 infity using float(‘inf’).

Note

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