Descriptors

Two-Body

List of all two-body descriptors supported by Ta-dah!

D2_LJ

class D2_LJ : public D2_Base

Standard Lennard - Jones descriptor.

\[ V_i = \sum_{j \neq i} 4 \epsilon \Bigg(\Big(\frac{\sigma}{r_{ij}}\Big)^{12} - \Big(\frac{\sigma}{r_{ij}}\Big)^6\Bigg) f_c(r_{ij}) \]

or equivalently:

\[ V_i = \sum_{j \neq i} \frac{C_{12}}{r_{ij}^{12}} - \frac{C_6}{r_{ij}^6} f_c(r_{ij}) \]

Note that machined learned coefficients \(C_6\) and \(C_{12}\) corresponds to \(\sigma\) and \(\epsilon\) through the following relation:

\[ \sigma = \Big(\frac{C_{12}}{C_6}\Big)^{1/6} \]
\[ \epsilon = \frac{1}{4} \frac{C_6^2}{C_{12}} w(Z) \]
where \(w(Z)\) is a species depended weight factor (default is an atomic number).

The machine learned \(\sigma\) and \(\epsilon\) only make sense (say to compare with the literature ones) when BIAS false and NORM false and system in monatomic. It is ok thought to set them to true it’s just that numerical values will be different.

Required Config Key: INIT2B

Public Functions

virtual void calc_aed(const double, const double rij_sq, const double fc_ij, StDescriptors::aed_rtype aed)

Calculate AED.

Calculate Atomic Energy Descriptor for the atom local environment.

virtual void calc_dXijdri(const double rij, const double rij_sq, const double fc_ij, const double fcp_ij, StDescriptors::fd_type &fd_ij)

Calculate FD.

Calculate Force Descriptor for the atom local environment.

virtual void calc_all(const double rij, const double rij_sq, const double fc_ij, const double fcp_ij, StDescriptors::aed_rtype aed, StDescriptors::fd_type &fd_ij)

Calculate AED + FD.

virtual size_t size()

Return dimension of the descriptor.

virtual std::string label()

Return label of this descriptor.

D2_BP

class D2_BP : public D2_Base

Behler-Parrinello two-body descriptor.

\[ V_i^{\eta,r_s} = \sum_{j \neq i} \exp{\Big(-\eta(r_{ij}-r_s)^2\Big)}f_c(r_{ij}) \]

CGRID2B parameters control position \( r_s \) of the gaussian basis function.

SGRID2B parameters control width \( \eta \) of the gaussian basis function.

This is essentially a \( G^1_i \) descriptor from the below paper with an exception that it can use any cutoff function defined in Ta-dah!:

Behler, J., Parrinello, M. (2007). Generalized neural-network representation of high-dimensional potential-energy surfaces. Physical Review Letters, 98(14), 146401. https://doi.org/10.1103/PhysRevLett.98.146401

Required Config keys: INIT2B CGRID2B SGRID2B

Public Functions

virtual void calc_aed(const double rij, const double, const double fc_ij, StDescriptors::aed_rtype aed)

Calculate AED.

Calculate Atomic Energy Descriptor for the atom local environment.

virtual void calc_dXijdri(const double rij, const double, const double fc_ij, const double fcp_ij, StDescriptors::fd_type &fd_ij)

Calculate FD.

Calculate Force Descriptor for the atom local environment.

virtual void calc_all(const double rij, const double, const double fc_ij, const double fcp_ij, StDescriptors::aed_rtype aed, StDescriptors::fd_type &fd_ij)

Calculate AED + FD.

virtual size_t size()

Return dimension of the descriptor.

virtual std::string label()

Return label of this descriptor.

D2_Blip

class D2_Blip : public D2_Base

Blip two-body descriptor.

\[ V_i^{\eta,r_s} =\sum_{j \neq i} B(\eta(r_{ij}-r_s))f_c(r_{ij}) \]

where \( f_c \) is a cutoff function and \( B \) is a blip basis function centered at \(r_s\) of width \(4/\eta\).

CGRID2B parameters control position \( r_s \) of blip centres.

SGRID2B parameters control width \( \eta \) of blips.

Blip basis function is built out of 3rd degree polynomials in the four intervals [-2,-1], [-1,0], [0,1], [1,2] and is defined as:

\[\begin{split} \begin{equation} B(r) = \begin{cases} 1-\frac{3}{2}r^2+\frac{3}{4}|r|^3 & \text{if} \qquad 0<|r|<1\\ \frac{1}{4}(2-|r|)^3 & \text{if} \qquad 1<|r|<2\\ 0 & \text{if} \qquad |r|>2 \end{cases} \end{equation} \end{split}\]

More details about the blip basis functions can be found in the following paper:

Hernández, E., Gillan, M., Goringe, C. (1997). Basis functions for linear-scaling first-principles calculations. Physical Review B - Condensed Matter and Materials Physics, 55(20), 13485–13493. https://doi.org/10.1103/PhysRevB.55.13485

Required keys: INIT2B CGRID2B SGRID2B

Public Functions

virtual void calc_aed(const double rij, const double rij_sq, const double fc_ij, StDescriptors::aed_rtype aed)

Calculate AED.

Calculate Atomic Energy Descriptor for the atom local environment.

virtual void calc_dXijdri(const double rij, const double rij_sq, const double fc_ij, const double fcp_ij, StDescriptors::fd_type &fd_ij)

Calculate FD.

Calculate Force Descriptor for the atom local environment.

virtual void calc_all(const double rij, const double rij_sq, const double fc_ij, const double fcp_ij, StDescriptors::aed_rtype aed, StDescriptors::fd_type &fd_ij)

Calculate AED + FD.

virtual size_t size()

Return dimension of the descriptor.

virtual std::string label()

Return label of this descriptor.

D2_EAM

class D2_EAM : public D2_Base

Pair-wise part for the Embedded Atom Method descriptor.

\[ V_i = \frac{1}{2} \sum_{j \neq i} \psi(r_{ij}) \]

This descriptor will load tabulated values for the two-body potential \( \phi \) from the provided SETFL file.

This descriptor is usually used together with the many-body descriptor DM_EAM although this is not required and user can mix it with any other descriptors or use it on its own.

This descriptor will enforce cutoff distance as specified in a SETFL file. Set RCUT2B to the same value to suppress the warning message.

Required Config keys: INIT2B SETFL

Public Functions

virtual void calc_aed(double rij, const double rij_sq, const double, StDescriptors::aed_rtype aed)

Calculate AED.

Calculate Atomic Energy Descriptor for the atom local environment.

virtual void calc_dXijdri(double rij, const double rij_sq, const double, const double, StDescriptors::fd_type &fd_ij)

Calculate FD.

Calculate Force Descriptor for the atom local environment.

virtual void calc_all(double rij, const double rij_sq, const double, const double, StDescriptors::aed_rtype aed, StDescriptors::fd_type &fd_ij)

Calculate AED + FD.

virtual size_t size()

Return dimension of the descriptor.

virtual std::string label()

Return label of this descriptor.

D2_Dummy

class D2_Dummy : public D2_Base

Dummy two-body descriptor.

Use it to satisfy DescriptorsCalc requirements in case when two-body descriptor is not required.

Public Functions

virtual void calc_aed(const double, const double, const double, StDescriptors::aed_rtype aed)

Calculate AED.

Calculate Atomic Energy Descriptor for the atom local environment.

virtual void calc_dXijdri(const double, const double, const double, const double, StDescriptors::fd_type &fd_ij)

Calculate FD.

Calculate Force Descriptor for the atom local environment.

virtual void calc_all(const double, const double, const double, const double, StDescriptors::aed_rtype aed, StDescriptors::fd_type &fd_ij)

Calculate AED + FD.

virtual size_t size()

Return dimension of the descriptor.

virtual std::string label()

Return label of this descriptor.

D2_Base

class D2_Base : public D_Base

Base class for all two-body type descriptors.

All two-body descriptors must inherit this class.

Subclassed by D2_BP, D2_Blip, D2_Dummy, D2_EAM, D2_LJ, D2_MIE

Public Functions

virtual void calc_aed(const double rij, const double rij_sq, const double fc_ij, StDescriptors::aed_rtype aed) = 0

Calculate AED.

Calculate Atomic Energy Descriptor for the atom local environment.

virtual void calc_dXijdri(const double rij, const double rij_sq, const double fc_ij, const double fcp_ij, StDescriptors::fd_type &fd_ij) = 0

Calculate FD.

Calculate Force Descriptor for the atom local environment.

virtual void calc_fd_approx(const double rij, const double fcijp, const double fcijn, StDescriptors::aed_rtype aedp, StDescriptors::aed_rtype aedn, StDescriptors::fd_type &fd_ij, const double h)

Calculate approximation to FD.

Calculate Force Descriptor for the atom local environment using central difference approximation.

h -> something small e.g. 1e-8 fcijp -> cutoff(rij+h,…) fcijn -> cutoff(rij-h,…) aedp -> calc_aed(rij+h,…) aedn -> calc_aed(rij-h,…) fd_ij - descriptor derivative

virtual void calc_all(const double rij, const double rij_sq, const double fc_ij, const double fcp_ij, StDescriptors::aed_rtype aed, StDescriptors::fd_type &fd_ij) = 0

Calculate AED + FD.

virtual std::string label() = 0

Return label of this descriptor.

Three-Body

As is stands Ta-dah! does not support three-body type descriptors. They are simply slow to compute and there exist a number of angularly dependend many-body descriptors. However if there is enough interest in three-body descriptors they can be fairly easily added to the library. Just drop us an email…

Many-Body

List of all many-body type descriptors supported by Ta-dah! Note that some many-body type descriptors can calculate non-spherical charge distributionis hence they overcome Embedded Atom Method limitations.

DM_EAD

class DM_EAD : public DM_Base

Embedded Atom Descriptor

\[ V_i^{L,\eta,r_s} = \sum_{l_x,l_y,l_z}^{l_x+l_y+l_z=L} \frac{L!}{l_x!l_y!l_z!} \Big( \rho_i^{\eta,r_s,l_x,l_y,l_z} \Big)^2 \]

where density \( \rho \) is calculated using Gaussian Type Orbitals:

\[ \rho_i^{\eta,r_s,l_x,l_y,l_z} = \sum_{j \neq i} x_{ij}^{l_x}y_{ij}^{l_y}z_{ij}^{l_z} \exp{\Big(-\eta(r_{ij}-r_s)^2\Big)}f_c(r_{ij}) \]

CGRIDMB parameters control position \( r_s \) of the gaussian basis function.

SGRIDMB parameters control width \( \eta \) of the gaussian basis function.

AGRIDMB parameter specify maximum value for the angular momentum \(L_{max}\).

e.g. \(L_{max}=2\) will calculate descriptors with \( L=0,1,2 \) (s,p,d orbitals).

More information about this descriptor:

Zhang, Y., Hu, C.,Jiang, B. (2019). Embedded atom neural network potentials: efficient and accurate machine learning with a physically inspired representation. Journal of Physical Chemistry Letters, 10(17), 4962–4967. https://doi.org/10.1021/acs.jpclett.9b02037

Required Config keys: INITMB CGRIDMB SGRIDMB AGRIDMB

Public Functions

virtual void calc_aed(StDescriptors::rho_rtype rho, StDescriptors::aed_rtype aed)

Calculate AED.

Calculate Atomic Energy Descriptor for the atom local environment.

virtual int calc_dXijdri_dXjidri(const double rij, const double rij_sq, const Eigen::Vector3d &vec_ij, const double fc_ij, const double fcp_ij, StDescriptors::rho_rtype rhoi, StDescriptors::rho_rtype rhoj, StDescriptors::fd_type &fd_ij, const double wi, const double wj)

Calculate FD.

Calculate Force Descriptor between to atoms.

This method works for half NN lists and linear models.

\[ \mathbf{fd}_{ij} \mathrel{+}= \frac{\partial \mathbf{X}_{ij}}{\partial \mathbf{r}_i} + \frac{\partial \mathbf{X}_{ji}}{\partial \mathbf{r}_i} \]

virtual int calc_dXijdri(const double rij, const double rij_sq, const Eigen::Vector3d &vec_ij, const double fc_ij, const double fcp_ij, StDescriptors::rho_rtype rhoi, StDescriptors::fd_type &fd_ij)

Calculate FD.

Calculate Force Descriptor between to atoms.

This method works for full NN lists and all models.

\[ \mathbf{fd}_{ij} \mathrel{+}= \frac{\partial \mathbf{X}_{ij}}{\partial \mathbf{r}_i} \]

virtual size_t size()

Return dimension of the descriptor.

virtual std::string label()

Return label of this descriptor.

virtual void init_rhoi(StDescriptors::rho_rtype rhoi)

Resize arrays for a density and F’.

virtual void calc_rho(const double rij, const double rij_sq, const double fc_ij, const Eigen::Vector3d &vec_ij, StDescriptors::rho_rtype rho)

Calculate density.

virtual size_t rhoi_size()

Return size of the density array.

virtual size_t rhoip_size()

Return size of the derivative of the embedding energy array.

DM_EAM

class DM_EAM : public DM_Base

many-body part for the Embedded Atom Method descriptor.

\[ V_i = F\Bigg(\sum_{j \neq i} \rho(r_{ij}) \Bigg) \]

This descriptor will load tabulated values for the density \( \rho \) and embedded energy \( F \) from the provided SETFL file.

This descriptor is usually used together with the two-body descriptor D2_EAM although this is not required and user can mix it with any other descriptors or use it on its own.

This descriptor will enforce cutoff distance as specified in a SETFL file. Set RCUTMB to the same value to suppress the warning message.

Required Config keys: INITMB SETFL

Public Functions

virtual void calc_aed(StDescriptors::rho_rtype rho, StDescriptors::aed_rtype aed)

Calculate AED.

Calculate Atomic Energy Descriptor for the atom local environment.

virtual int calc_dXijdri_dXjidri(const double rij, const double rij_sq, const Eigen::Vector3d &vec_ij, const double fc_ij, const double fcp_ij, StDescriptors::rho_rtype rhoi, StDescriptors::rho_rtype rhoj, StDescriptors::fd_type &fd_ij, const double wi, const double wj)

Calculate FD.

Calculate Force Descriptor between to atoms.

This method works for half NN lists and linear models.

\[ \mathbf{fd}_{ij} \mathrel{+}= \frac{\partial \mathbf{X}_{ij}}{\partial \mathbf{r}_i} + \frac{\partial \mathbf{X}_{ji}}{\partial \mathbf{r}_i} \]

virtual int calc_dXijdri(const double rij, const double rij_sq, const Eigen::Vector3d &vec_ij, const double fc_ij, const double fcp_ij, StDescriptors::rho_rtype rhoi, StDescriptors::fd_type &fd_ij)

Calculate FD.

Calculate Force Descriptor between to atoms.

This method works for full NN lists and all models.

\[ \mathbf{fd}_{ij} \mathrel{+}= \frac{\partial \mathbf{X}_{ij}}{\partial \mathbf{r}_i} \]

virtual size_t size()

Return dimension of the descriptor.

virtual std::string label()

Return label of this descriptor.

virtual void init_rhoi(StDescriptors::rho_rtype rhoi)

Resize arrays for a density and F’.

virtual void calc_rho(const double rij, const double rij_sq, const double fc_ij, const Eigen::Vector3d &vec_ij, StDescriptors::rho_rtype rho)

Calculate density.

virtual size_t rhoi_size()

Return size of the density array.

virtual size_t rhoip_size()

Return size of the derivative of the embedding energy array.

DM_Dummy

class DM_Dummy : public DM_Base

Dummy many-body descriptor.

Use it to satisfy DescriptorsCalc requirements in case when many-body descriptor is not required.

Public Functions

virtual void calc_aed(StDescriptors::rho_rtype rho, StDescriptors::aed_rtype aed)

Calculate AED.

Calculate Atomic Energy Descriptor for the atom local environment.

virtual int calc_dXijdri_dXjidri(const double rij, const double rij_sq, const Eigen::Vector3d &vec_ij, const double fc_ij, const double fcp_ij, StDescriptors::rho_rtype rhoi, StDescriptors::rho_rtype rhoj, StDescriptors::fd_type &fd_ij, const double wi, const double wj)

Calculate FD.

Calculate Force Descriptor between to atoms.

This method works for half NN lists and linear models.

\[ \mathbf{fd}_{ij} \mathrel{+}= \frac{\partial \mathbf{X}_{ij}}{\partial \mathbf{r}_i} + \frac{\partial \mathbf{X}_{ji}}{\partial \mathbf{r}_i} \]

virtual int calc_dXijdri(const double rij, const double rij_sq, const Eigen::Vector3d &vec_ij, const double fc_ij, const double fcp_ij, StDescriptors::rho_rtype rhoi, StDescriptors::fd_type &fd_ij)

Calculate FD.

Calculate Force Descriptor between to atoms.

This method works for full NN lists and all models.

\[ \mathbf{fd}_{ij} \mathrel{+}= \frac{\partial \mathbf{X}_{ij}}{\partial \mathbf{r}_i} \]

virtual size_t size()

Return dimension of the descriptor.

virtual std::string label()

Return label of this descriptor.

virtual void init_rhoi(StDescriptors::rho_rtype rhoi)

Resize arrays for a density and F’.

virtual void calc_rho(const double rij, const double rij_sq, const double fc_ij, const Eigen::Vector3d &vec_ij, StDescriptors::rho_rtype rho)

Calculate density.

virtual size_t rhoi_size()

Return size of the density array.

virtual size_t rhoip_size()

Return size of the derivative of the embedding energy array.

DM_Base

class DM_Base : public D_Base

Base class for all many-body type descriptors.

All many-body descriptors must inherit this class.

Subclassed by DM_Blip, DM_Dummy, DM_EAD, DM_EAM, DM_mEAD< F >

Public Functions

virtual void calc_aed(StDescriptors::rho_rtype rho, StDescriptors::aed_rtype aed) = 0

Calculate AED.

Calculate Atomic Energy Descriptor for the atom local environment.

virtual int calc_dXijdri_dXjidri(const double rij, const double rij_sq, const Eigen::Vector3d &vec_ij, const double fc_ij, const double fcp_ij, StDescriptors::rho_rtype rhoi, StDescriptors::rho_rtype rhoj, StDescriptors::fd_type &fd_ij, const double wi, const double wj) = 0

Calculate FD.

Calculate Force Descriptor between to atoms.

This method works for half NN lists and linear models.

\[ \mathbf{fd}_{ij} \mathrel{+}= \frac{\partial \mathbf{X}_{ij}}{\partial \mathbf{r}_i} + \frac{\partial \mathbf{X}_{ji}}{\partial \mathbf{r}_i} \]

virtual int calc_dXijdri(const double rij, const double rij_sq, const Eigen::Vector3d &vec_ij, const double fc_ij, const double fcp_ij, StDescriptors::rho_rtype rhoi, StDescriptors::fd_type &fd_ij) = 0

Calculate FD.

Calculate Force Descriptor between to atoms.

This method works for full NN lists and all models.

\[ \mathbf{fd}_{ij} \mathrel{+}= \frac{\partial \mathbf{X}_{ij}}{\partial \mathbf{r}_i} \]

virtual void init_rhoi(StDescriptors::rho_rtype rhoi) = 0

Resize arrays for a density and F’.

virtual void calc_rho(const double rij, const double rij_sq, const double fc_ij, const Eigen::Vector3d &vec_ij, StDescriptors::rho_rtype rho) = 0

Calculate density.

virtual size_t rhoi_size() = 0

Return size of the density array.

virtual size_t rhoip_size() = 0

Return size of the derivative of the embedding energy array.

virtual size_t size() = 0

Return dimension of the descriptor.

virtual std::string label() = 0

Return label of this descriptor.