chemtools.conceptual.base.BaseGlobalTool¶
-
class
chemtools.conceptual.base.
BaseGlobalTool
(n0, n_max)[source]¶ Base class of global conceptual DFT reactivity descriptors.
Initialize class.
Parameters: - n0 (float) – Reference number of electrons, i.e. \(N_0\).
- n_max (float) – Maximum number of electrons that system can accept, i.e. \(N_{\text{max}}\).
-
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)\]
-
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
.
-
electron_affinity
¶ Electron affinity (EA) of the \(N_0\)-electron system.
\[EA = E\left(N_0\right) - E\left(N_0 + 1\right)\]
-
ea
¶ The same as
electron_affinity
.
-
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)\]
-
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)\]
-
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)\]
-
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}\]
-
mu
¶ The same as
chemical_potential
.
-
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}\]
-
eta
¶ The same as
chemical_hardness
.
-
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}\]
-
hyper_hardness
(order=2)[source]¶ 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)[source]¶ 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.
-
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
andBaseGlobalTool.hyper_hardness
, respectively.
-
grand_potential
(n_elec)[source]¶ 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)[source]¶ 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)[source]¶ 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)[source]¶ 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.
-
convert_mu_to_n
(mu, guess=None)[source]¶ 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.