pyxtal_ff.descriptors.ACSF¶
-
class
pyxtal_ff.descriptors.ACSF.ACSF(symmetry_parameters, Rc=6.5, derivative=True, stress=False, cutoff='cosine', atom_weighted=False)[source]¶ Bases:
objectA class for calculating Behler-Parrinello symmetry functions.
The forms of the functions are consistent with the functions presented in:
Behler, J. (2011). The Journal of Chemical Physics, 134(7), 074106.Parameters: - symmetry_parameters (dict) – The user-defined parameters for the symmetry functions calculations. i.e. {‘G2’: {‘eta’: [0.1, 0.2,], ‘Rs’: [0.0, 0.1]}}
- Rc (float) – The symmetry functions will be calculated within this radius.
- derivative (bool) – If True, calculate the derivatives.
- stress (bool) – If True, calculate the virial stress contribution.
-
calculate(crystal, system=None, ids=None)[source]¶ The symmetry functions are obtained through this calculate method.
Parameters: - crystal (object) – ASE Structure object.
- system (list) – A list of the crystal structures system. All elements in the list have to be integer. For example, the system of crystal structure is NaCl system. Then, system should be pass as [11, 17]
- ids (list) – A list of the centered atoms to be computed if None, all atoms will be considered
Returns: all_G – The user-defined symmetry functions that represent the crystal.
Currently, there are 3 types of symmetry functions implemented. Here are the order of the descriptors are printed out based on their symmetry parameters:
- G2: [“element”, “Rs”, “eta”]
- G4: [“pair_elements”, “eta”, “lambda”, “zeta”]
- G5: [“pair_elements”, “eta”, “lambda”, “zeta”]
Return type: dict
-
pyxtal_ff.descriptors.ACSF.calculate_G2(Dij, IDs, atomic_numbers, type_set, Rc, parameters, Gtype)[source]¶ Calculate G2 symmetry function for a center atom i.
G2 function describes the radial feature of atoms in a crystal structure given a cutoff radius.
Parameters: - Dij (float array [m]) – The array of distances for a given atom.
- IDs (int array [m]) – The indices of neighbors centering about atom i.
- atomic_numbers (int array [N]) – The elemental indices for atoms within the unitcell. e.g. [11, 11, 11, 11, 17, 17, 17, 17]
- Rc (float) – The cutoff radius.
- parameters (dict) –
- Rs: float array (n1)
- The shift from the center of the G2 symmetry function.
- etas: float array (n2)
- eta parameters of G2 symmetry function.
- cutoff: str
- The cutoff function.
Returns: G2 – G2 symmetry value.
Return type: 1D float array [d = n1*n2*l]
-
pyxtal_ff.descriptors.ACSF.calculate_G2Prime(Rij, Ri, i, IDs, atomic_numbers, type_set, Rc, parameters, Gtype)[source]¶ Calculate the derivative of G2 symmetry function for atom i.
Parameters: - Rij (float array [m, 3]) – The vector distances of atom i to neighbors js.
- i (int) – The i-th atom center.
- IDs (int array [m]) – The indices of neighbors centering about atom i.
- atomic_numbers (int array [N]) – The elemental indices for atoms within the unitcell. e.g. [11, 11, 11, 11, 17, 17, 17, 17]
- Rc (float) – The cutoff radius.
- parameters (dict) –
- Rs: float array (n1)
- The shift from the center of the G2 symmetry function.
- etas: float array (n2)
- eta parameters of G2 symmetry function.
- cutoff: str
- The cutoff function.
Returns: G2Prime – The derivative of G2 symmetry value at i-th atom. m is the index of the atom that force is acting on.
Return type: 1D float array [m, (n1*n2*l), 3]
-
pyxtal_ff.descriptors.ACSF.calculate_G4(Rij, IDs, jks, atomic_numbers, type_set, Rc, parameters, Gtype)[source]¶ Calculate G4 symmetry function for a given atom i.
G4 function also describes the angular feature of atoms in a crystal structure given a cutoff radius.
Parameters: - Rij (array [j, 3]) – The vector distances of atom i to neighbors js.
- IDs (int array [m]) – The indices of neighbors centering about atom i.
- jks (int array [m*(m-1)/2, 2]) – The list of [j,k] pairs
- atomic_numbers (int array [N]) – The elemental indices for atoms within the unitcell. e.g. [11, 11, 11, 11, 17, 17, 17, 17]
- Rc (float) – The cutoff radius.
- parameters (dict) – Rs: float array (n1) etas: float array (n2) lamBdas: float array (n3) zetas: float array (n4) cutoff: str
Returns: G4 – G4 symmetry value with d members.
Return type: array [d = n1*n2*n3*n4*l]
-
pyxtal_ff.descriptors.ACSF.calculate_G4Prime(Rij, Ri, i, IDs, jks, atomic_numbers, type_set, Rc, parameters, Gtype)[source]¶ Calculate G4 symmetry function for a given atom i.
G4 function also describes the angular feature of atoms in a crystal structure given a cutoff radius.
Parameters: - Rij (array [j, 3]) – The vector distances of atom i to neighbors js.
- i (int) – The i-th atom center.
- IDs (int array [j]) – The indices of neighbors centering about atom i.
- jks (int array [j*k, 2]) – The list of [j,k] pairs
- atomic_numbers (int array [j]) – The elemental indices for atoms within the unitcell. e.g. [11, 11, 11, 11, 17, 17, 17, 17]
- Rc (float) – The cutoff radius.
- parameters (dict) – zetas: float array (n1) lamBdas: float array (n2) etas: float array (n3) cutoff: str
- Returns – The derivative of G4 symmetry value at i-th atom. m is the index of the atom that force is acting on.
-
pyxtal_ff.descriptors.ACSF.calculate_G5(Rij, IDs, jks, atomic_numbers, type_set, Rc, parameters, Gtype)[source]¶ Calculate G5 symmetry function for a given atom i.
G5 function also describes the angular feature of atoms in a crystal structure given a cutoff radius.
Parameters: - Rij (array [j, 3]) – The vector distances of atom i to neighbors js.
- IDs (int array [m]) – The indices of neighbors centering about atom i.
- jks (int array [m*(m-1)/2, 2]) – The list of [j,k] pairs
- atomic_numbers (int array [N]) – The elemental indices for atoms within the unitcell. e.g. [11, 11, 11, 11, 17, 17, 17, 17]
- Rc (float) – The cutoff radius.
- parameters (dict) – Rs: float array (n1) etas: float array (n2) lamBdas: float array (n3) zetas: float array (n4) cutoff: str
Returns: G5 – G5 symmetry value with d members.
Return type: array [d = n1*n2*n3*n4*l]
-
pyxtal_ff.descriptors.ACSF.calculate_G5Prime(Rij, Ri, i, IDs, jks, atomic_numbers, type_set, Rc, parameters, Gtype)[source]¶ Calculate G5 symmetry function for a given atom i.
G5 function also describes the angular feature of atoms in a crystal structure given a cutoff radius.
Parameters: - Rij (array [j, 3]) – The vector distances of atom i to neighbors js.
- i (int) – The i-th atom center.
- IDs (int array [j]) – The indices of neighbors centering about atom i.
- jks (int array [j*k, 2]) – The list of [j,k] pairs
- atomic_numbers (int array [j]) – The elemental indices for atoms within the unitcell. e.g. [11, 11, 11, 11, 17, 17, 17, 17]
- Rc (float) – The cutoff radius.
- parameters (dict) – zetas: float array (n1) lamBdas: float array (n2) etas: float array (n3) cutoff: str
Returns: G5Prime – The derivative of G5 symmetry value at i-th atom. m is the index of the atom that force is acting on.
Return type: array [m, d, 3]
-
pyxtal_ff.descriptors.ACSF.dRij_dRm_norm(Rij, ijm_list)[source]¶ Calculate the derivative of Rij norm w. r. t. atom m. This term affects only on i and j.
Parameters: - Rij (array [j, 3] or [j*k, 3]) – The vector distances of atom i to atom j.
- ijm_list (array [j, 3] or [j*k, 3]) – Id list of center atom i, neighbors atom j, and atom m.
Returns: dRij_m – The derivative of pair atoms w.r.t. atom m in x, y, z directions.
Return type: array [j, 3] or [j*k, 3]
-
pyxtal_ff.descriptors.ACSF.dRij_dRm_vector(ijm_list)[source]¶ Calculate the derivative of Rij vector w. r. t. atom m.
Parameters: ijm_list (array [i*j, 3]) – List of indices of center atom i, neighbors atom j, and atom m. Returns: The derivative of the position vector R_{ij} with respect to atom index m in x, y, z directions. Return type: list of float
-
pyxtal_ff.descriptors.ACSF.dRijk_dRm(Rij, Rik, Rjk, ijk_list, m)[source]¶ Calculate the derivative of R_{ab} norm with respect to atom m.
Parameters: - Rij (array [j*k, 3]) – The vector distances of atom i to neighbors js.
- Rik (array [j*k, 3]) – The vector distances of atom i to neighbors ks.
- Rjk (array [j*k, 3]) – The vector distances of atom j to atom k, where j != k.
- ijk_list (array) – The combinations of atom i, neighbor j, and neighbor k indices.
- m (array) – the list of atoms
Returns: dR{ab}_dRm – The derivative of R_{ab} norm with respect to atom m.
Return type: array [j*k, 3, m]
-
pyxtal_ff.descriptors.ACSF.dcosijk_dRm(Rij, Rik, ijk_list, m_list, dRij_dRm, dRik_dRm)[source]¶ Calculate the derivative of cosine_ijk function w. r. t. atom m. m must belong to one of the ijks. Otherwise, the derivative is zero. If the input Rij and Rik are (j*k)*3 dimensions, the output will be (j*k)*3*3. The extra dimension comes from looping over {i, j, k}.
Parameters: - Rij (array [j*k, 3]) – The vector distances of atom i to neighbors js.
- Rik (array [j*k, 3]) – The vector distances of atom i to neighbors ks, where j != k.
Returns: - Derivative of cosine dot product w.r.t. the radius of an atom m,
- The atom m has to be in the an array with 3 indices (i, j, and k.)