# chemtools.toolbox.interactions.ELF¶

class chemtools.toolbox.interactions.ELF(dens, grad, ked, grid=None, trans='rational', trans_k=2, trans_a=1, denscut=0.0005)[source]

Electron Localization Function (ELF) introduced by Becke and Edgecombe.

The ELF ratio is defined as:

$\zeta_\text{ELF}(\mathbf{r}) = \frac{\tau_\text{PD}(\mathbf{r}) - \tau_\text{W}(\mathbf{r})}{\tau_\text{TF}(\mathbf{r})}$

where $$\tau_\text{PD}(\mathbf{r})$$, $$\tau_\text{W}(\mathbf{r})$$ and $$\tau_\text{TF}(\mathbf{r})$$ are positive-definite (Lagrangian), Weizsacker and Thomas-Fermi kinetic energy densities defined in chemtools.toolbox.kinetic.KED.

The ELF is computed by transforming the ratio:

$\text{ELF}(\mathbf{r}) = f\left(\zeta_\text{ELF}(\mathbf{r})\right)$

where the transformation $$f$$ can be:

$\begin{split}\text{rational : } \, f(\zeta, k, a) &= \frac{1}{1 + a \, \zeta^k} \\ \text{hyperbolic: } \, f(\zeta, k, a) &= \tfrac{1}{2} \left(1 + \tanh\left(a \left(\zeta^{-k} - \zeta^{k}\right)\right)\right)\end{split}$

Traditionally, the ‘rational’ transformation with $$k=2$$ and $$a=1$$ is used.

Initialize class from arrays.

Parameters: dens (np.ndarray) – Electron density of grid points, $$\rho(\mathbf{r})$$. grad (np.ndarray) – Gradient of electron density of grid points, $$\nabla \rho(\mathbf{r})$$. ked (np.ndarray) – Positive-definite or Lagrangian kinetic energy density of grid points; $$\tau_\text{PD} (\mathbf{r})$$ or $$G(\mathbf{r})$$. grid (instance of Grid, optional) – Grid used for computation of ELF. Only if this a CubeGrid one can generate the scripts. trans (str, optional) – Type of transformation applied to ELF ratio; options are ‘rational’ or ‘hyperbolic’. trans_k (float, optional) – Parameter $$k$$ of transformation. trans_a (float, optional) – Parameter $$a$$ of transformation. denscut (float, optional) – Value of density cut. ELF value of points with density < denscut is set to zero.
classmethod from_molecule(molecule, spin='ab', index=None, grid=None, trans='rational', trans_k=2, trans_a=1, denscut=0.0005)[source]

Initialize class from molecule.

Parameters: molecule (instance of Molecule class.) – Instance of Molecular class. spin (str, optional) – Type of occupied spin orbitals; options are ‘a’, ‘b’ & ‘ab’. index (int or sequence of int, optional) – Sequence of spin orbital indices to use. If None, all occupied spin orbitals are used. grid (instance of Grid, optional) – Grid used for computation of ELF. Only if this a CubeGrid one can generate the scripts. If None, a cubic grid is constructed from molecule with spacing=0.1 & extension=2.0. trans (str, optional) – Type of transformation applied to ELF ratio; options are ‘rational’ or ‘hyperbolic’. trans_k (float, optional) – Parameter $$k$$ of transformation. trans_a (float, optional) – Parameter $$a$$ of transformation. denscut (float, optional) – Value of density cut. ELF value of points with density < denscut is set to zero.
classmethod from_file(fname, spin='ab', index=None, grid=None, trans='rational', trans_k=2, trans_a=1, denscut=0.0005)[source]

Initialize class from wave-function file.

Parameters: fname (str) – Path to a molecule’s file. spin (str, optional) – Type of occupied spin orbitals; options are ‘a’, ‘b’ & ‘ab’. index (int or sequence of int, optional) – Sequence of spin orbital indices to use. If None, all occupied spin orbitals are used. grid (instance of Grid, optional) – Grid used for computation of ELF. Only if this a CubeGrid one can generate the scripts. If None, a cubic grid is constructed from molecule with spacing=0.1 & extension=2.0. trans (str, optional) – Type of transformation applied to ELF ratio; options are ‘rational’ or ‘hyperbolic’. trans_k (float, optional) – Parameter $$k$$ of transformation. trans_a (float, optional) – Parameter $$a$$ of transformation. denscut (float, optional) – Value of density cut. ELF value of points with density < denscut is set to zero.
ratio

The ELF ratio evaluated on grid points.

value

The $$\text{ELF}(\mathbf{r})$$ evaluated on grid points.

generate_scripts(fname, isosurf=0.8)[source]

Generate VMD scripts & cube file to visualize ELF iso-surface.

Parameters: fname (str) – File name used for the generated files. The VMD script and cube file will be named fname.vmd and fname-elf.cube, respectively. isosurf (float, optional) – Value of ELF iso-surface used in VMD script.