chemtools.conceptual.general.GeneralGlobalTool

class chemtools.conceptual.general.GeneralGlobalTool(expr, n0, n_energies, n_symbol=None, n0_symbol=None, guess=None, opts=None)[source]

Class of global conceptual DFT reactivity descriptors based on the user-specified energy model.

The energy model is approximated as a symbolic function of the number of electrons, and the unknown parameters are obtained by interpolating to the given values of energy; i.e. the number of parameters in the model should equal the number of given energy values and the corresponding number of electrons.

The \(n^{\text{th}}\)-order derivative of the symbolic energy model with respect to the number of electrons at fixed external potential is calculated symbolically.

Initialize class.

Parameters:
  • expr (sp.Exp) – The energy expression representing the dependence of energy on the number of electrons.
  • n0 (float) – Reference number of electrons, i.e. \(N_0\).
  • n_energies (dict) – The energy values of expr at different electron-numbers. The dict has int (electron-number) keys, float (energy) values.
  • n_symbol (sp.Symbol, default=sp.symbols('N')) – The symbol in expr that represents the number of electrons.
  • n0_symbol (sp.Symbol, optional) – The symbol in expr that represents the electron-number at which to evaluate expr. If not specified, assume that it is already expressed numerically in expr.
  • guess (dict, optional) – Guesses at the values of the parameters of expr. The dict has sp.Symbol keys, float values.
  • opts (dict, optional) – Optional keyword arguments to pass to the scipy.optimize.root() solver that is used to solve for the parameters in the model.
params

Parameter dictionary of energy model.

n_symbol

Symbol used to denote the number of electrons.

expression

Energy expression as a function of number of electrons, \(E(N)\).

energy(n_elec)[source]

Return the energy model \(E(N)\) evaluated for the specified number of electrons.

Parameters:n_elec (float) – Number of electrons, \(N_{\text{elec}}\).
energy_derivative(n_elec, order=1)[source]

Return the \(n^{\text{th}}\)-order derivative of energy w.r.t. the number of electrons.

This returns the \(n^{\text{th}}\)-order derivative of energy model \(E(N)\) w.r.t. to the number of electrons, at fixed chemical potential, evaluated for the specified number of electrons.

\[\left. \left(\frac{\partial^n E}{\partial N^n} \right)_{v(\mathbf{r})}\right|_{N = N_{\text{elec}}}\]
Parameters:
  • n_elec (float) – Number of electrons, \(N_{\text{elec}}\).
  • order (int, default=1) – The order of derivative denoted by \(n\) in the formula.

Note

For \(N_{\text{elec}} = N_0\) the first, second and higher order derivatives are equal to the BaseGlobalTool.chemical_potential, BaseGlobalTool.chemical_hardness and BaseGlobalTool.hyper_hardness, respectively.

chemical_hardness

Chemical hardness of the \(N_0\)-electron system.

This chemical hardness is defined as the second derivative of the energy model w.r.t. the number of electrons, at fixed external potential, evaluated at \(N_0\).

\[\eta = \left. \left(\frac{\partial^2 E}{\partial N^2} \right)_{v(\mathbf{r})} \right|_{N = N_0}\]
chemical_potential

Chemical potential of the \(N_0\)-electron system.

The chemical potential is defined as the first derivative of the energy model w.r.t. the number of electrons, at fixed external potential, evaluated at \(N_0\),

\[\mu = \left. \left(\frac{\partial E}{\partial N} \right)_{v(\mathbf{r})} \right|_{N = N_0}\]
convert_mu_to_n(mu, guess=None)

Return the number of electrons \(N\) matching the given chemical potential \(\mu\).

Chemical potential is a function of the number of electrons, \(\mu(N)\), as it is the first derivative of energy model \(E(N)\) with respect to the number of electrons at fixed external potential,

\[\mu(N) = \left(\frac{\partial E(N)}{\partial N}\right)_{v(\mathbf{r})}\]

Here we solve for \(N\) which results in the specified \(\mu\) according to the equation above, i.e. \(N(\mu) = \mu^{-1}(N)\), using scipy.optimize.newton.

Parameters:
  • mu (float) – Chemical potential, \(\mu\).
  • guess (float, default=None) – Initial guess used for solving for \(N\). If None, the reference number of electrons \(N_0\) is used as an initial guess.
ea

The same as electron_affinity.

electrofugality

Electrofugalityof the \(N_0\)-electron system.

\[\nu_{\text{electrofugality}} = \text{sgn}\left(N_{\text{max}} - N_0 + 1\right) \times \left(E(N_0 - 1) - E(N_{\text{max}})\right)\]
electron_affinity

Electron affinity (EA) of the \(N_0\)-electron system.

\[EA = E\left(N_0\right) - E\left(N_0 + 1\right)\]
electronegativity

Mulliken electronegativity defined as negative chemical_potential.

\[\chi_{\text{Mulliken}} = - \mu\]
electrophilicity

Electrophilicity of the \(N_0\)-electron system.

\[\omega_{\text{electrophilicity}} = \text{sgn}\left(N_{\text{max}} - N_0\right) \times \left(E(N_0) - E(N_{\text{max}})\right)\]
eta

The same as chemical_hardness.

grand_potential(n_elec)

Return the grand potential model evaluated for the specified number of electrons.

\[\begin{split}\Omega [\mu(N_{\text{elec}}); v(\mathbf{r})] &= E(N_{\text{elec}}) - \mu(N_{\text{elec}}) \times N_{\text{elec}} \\ &= E(N_{\text{elec}}) - \left.\left(\frac{\partial E(N)}{\partial N} \right)_{v(\mathbf{r})}\right|_{N = N_{\text{elec}}} \times N_{\text{elec}}\end{split}\]
Parameters:n_elec (float) – Number of electrons, \(N_{\text{elec}}\).
grand_potential_derivative(n_elec, order=1)

Evaluate the \(n^{\text{th}}\)-order derivative of grand potential at the given n_elec.

This returns the \(n^{\text{th}}\)-order derivative of grand potential model w.r.t. to the chemical potential, at fixed external potential, evaluated for the specified number of electrons \(N_{\text{elec}}\).

That is,

\[\left. \left(\frac{\partial^n \Omega}{\partial \mu^n} \right)_{v(\mathbf{r})} \right|_{N = N_{\text{elec}}} = \left. \left(\frac{\partial^{n-1}}{\partial \mu^{n-1}} \frac{\partial \Omega}{\partial \mu} \right)_{v(\mathbf{r})} \right|_{N = N_{\text{elec}}} = - \left. \left(\frac{\partial^{n-1} N}{\partial \mu^{n-1}} \right)_{v(\mathbf{r})} \right|_{N = N_{\text{elec}}} \quad n = 1, 2, \dots\]

These derivatives can be computed using the derivative of energy model w.r.t. number of electrons, at fixed external potential, evaluated at \(N_{\text{elec}}\). More specifically,

\[\begin{split}\left. \left(\frac{\partial \Omega}{\partial \mu} \right)_{v(\mathbf{r})} \right|_{N = N_{\text{elec}}} &= - N_{\text{elec}} \\ \left. \left(\frac{\partial^2 \Omega}{\partial \mu^2} \right)_{v(\mathbf{r})} \right|_{N = N_{\text{elec}}} &= -\frac{1}{\eta^{(1)}}\end{split}\]

where \(\eta^{(n)}\) denotes the \((n+1)^{\text{th}}\)-order derivative of energy w.r.t. number of electrons evaluated at \(N_{\text{elec}}\), i.e.

\[\eta^{(n)} = \left. \left(\frac{\partial^{n+1} E}{\partial N^{n+1}} \right)_{v(\mathbf{r})} \right|_{N = N_{\text{elec}}} \qquad n = 1, 2, \dots\]

To compute higher-order derivatives, Faa di Bruno formula which generalizes the chain rule to higher derivatives can be used. i.e. for \(n \geq 2\),

\[\left. \left(\frac{\partial^n \Omega}{\partial \mu^n} \right)_{v(\mathbf{r})} \right|_{N = N_{\text{elec}}} = \frac{-\displaystyle\sum_{k=1}^{n-2} \left.\left(\frac{\partial^k \Omega}{\partial \mu^k} \right)_{v(\mathbf{r})} \right|_{N = N_{\text{elec}}} \cdot B_{n-1,k} \left(\eta^{(1)}, \eta^{(2)}, \dots, \eta^{(n-k)} \right)} {B_{n-1,n-1} \left(\eta^{(1)}\right)}\]

where \(B_{n-1,k} \left(x_1, x_2, \dots, x_{n-k}\right)\) denotes the Bell polynomials.

Parameters:
  • n_elec (float) – Number of electrons, \(N_{\text{elec}}\).
  • order (int, default=1) – The order of derivative denoted by \(n\) in the formula.
grand_potential_mu(mu)

Evaluate the grand potential model for the specified chemical potential \(\mu\).

To evaluate grand potential model, first the number of electrons corresponding to the specified \(\mu\) is found, i.e. \(N(\mu)=\mu^{-1}(N)\), then the grand potential in computed by,

\[\Omega [\mu(N); v(\mathbf{r})] = E(N(\mu)) - \mu \times N(\mu)\]
Parameters:mu (float) – Chemical potential \(\mu\).
grand_potential_mu_derivative(mu, order=1)

Evaluate the \(n^{\text{th}}\)-order derivative of grand potential at the given mu.

This returns the \(n^{\text{th}}\)-order derivative of grand potential model w.r.t. chemical potential, at fixed external potential, evaluated for the specified chemical potential \(\mu\).

That is,

\[\left. \left(\frac{\partial^n \Omega}{\partial \mu^n} \right)_{v(\mathbf{r})} \right|_{N = N\left(\mu\right)} = \left. \left(\frac{\partial^{n-1}}{\partial \mu^{n-1}} \frac{\partial \Omega}{\partial \mu} \right)_{v(\mathbf{r})} \right|_{N = N\left(\mu\right)} = - \left. \left(\frac{\partial^{n-1} N}{\partial \mu^{n-1}} \right)_{v(\mathbf{r})} \right|_{N = N\left(\mu\right)} \quad n = 1, 2, \dots\]

To evaluate this expression, the number of electrons corresponding to the specified \(\mu\) should is found, i.e. \(N(\mu)=\mu^{-1}(N)\).

Parameters:
  • mu (float) – Chemical potential, \(\mu\).
  • order (int, default=1) – The order of derivative denoted by \(n\) in the formula.
hyper_hardness(order=2)

Return the \(n^{\text{th}}\)-order hyper-hardness of the \(N_0\)-electron system.

The \(n^{\text{th}}\)-order hyper-hardness is defined as the \((n+1)^{\text{th}}\) -order derivative, where \(n \geq 2\), of the energy model w.r.t the number of electrons, at fixed external potential, evaluated at \(N_0\).

\[\eta^{(n)} = \left. \left(\frac{\partial^{n+1} E}{\partial N^{n+1}} \right)_{v(\mathbf{r})} \right|_{N = N_0} \quad \text{for} \quad n \geq 2\]
Parameters:order (int, default=2) – The order of hyper-hardness denoted by \(n \geq 2\) in the formula.
hyper_softness(order)

Return the \(n^{\text{th}}\)-order hyper-softness of the \(N_0\)-electron system.

The \(n^{\text{th}}\)-order hyper softness is defined as the \((n+1)^{\text{th}}\) -order derivative, where \(n \geq 2\), of the grand potential model w.r.t the number of electrons at fixed external potential evaluated at \(N_0\).

\[S^{(n)} = - \left. \left(\frac{\partial^{n+1} \Omega}{\partial \mu^{n+1}} \right)_{v(\mathbf{r})} \right|_{N = N_0} \quad \text{for} \quad n \geq 2\]
Parameters:order (int, default=2) – The order of hyper-hardness denoted by \(n \geq 2\) in the formula.
ionization_potential

Ionization potential (IP) of the \(N_0\)-electron system.

\[IP = E\left(N_0 - 1\right) - E\left(N_0\right)\]
ip

The same as ionization_potential.

mu

The same as chemical_potential.

n0

Reference number of electrons, i.e. \(N_0\).

n_max

Maximum number of electrons that the system can accept.

\[N_{\text{max}} = \underbrace {\min }_N E(N)\]
nucleofugality

Nucleofugality of the \(N_0\)-electron system.

\[\nu_{\text{nucleofugality}} = \text{sgn}\left(N_0 + 1 - N_{\text{max}}\right) \times \left(E(N_0 + 1) - E(N_{\text{max}})\right)\]
softness

Chemical softness of the \(N_0\)-electron system.

The chemical softness is defined as the second derivative of the grand potential model w.r.t the number of electrons, at fixed external potential, evaluated at \(N_0\). This is equal to the inverse chemical hardness.

\[S = - \left. \left(\frac{\partial^2 \Omega}{\partial \mu^2} \right)_{v(\mathbf{r})}\right|_{N = N_0} = \frac{1}{\eta}\]