Descriptors API
calculate_descriptors
generate_force_descriptor
laaf
Locally averaged atomic fingerprints (LAAF) — G2, G3, G4, G5, SOAP, MBSF.
- class AtomicAI.descriptors.laaf.AverageFingerprintCalculator(cutoff_descriptor=5.0, cutoff_average=4.0, traj_data='traj_data', selected_snapshots=':', number_of_eta=100, element_conversion=None, descriptor_type='custom', descriptor=None, descriptor_parameters=None)[source]
Bases:
objectMain class for calculation of LAAF
- AtomicAI.descriptors.laaf.calculate_average_fingerprint(cutoff_descriptor=5, cutoff_average=4, traj_data='traj_data', selected_snapshots=':', output_file='average_fingerprint.csv', append=False, target_element=0, number_of_data=None, number_of_eta=100, start_step=0, final_step=None, element_conversion=None, seed=None, lattice_parameters=None, local_descriptor_type=None, descriptor=None, use_buffer=False, descriptor_parameters=None, target_neighbor_element=None)[source]
Calculate averaged fingerprints for randomly selected center atoms. Center atomic sites are selected by target_element, neighbor atomic sites are selected by target_neighbor_element. REMARK: Descriptor order is different between original and acsf g2: original is 0-0/0-1 while acsf g2 is 0-1/0-0
- Parameters:
target_neighbor_element (
int)descriptor_parameters – specific parameters for descriptors. For advanced use!
selected_snapshots (
str) – str compliant with ase.io.read functiondescriptor – instance of descriptor # TODO: List all available descriptors
local_descriptor_type – name of descriptor # TODO: Can it be inferred from “descriptor”?
append (
bool) – If True, will append at the end of the csv file. Else overwriting it.lattice_parameters – For normal xyz files
cutoff_descriptor (
float)cutoff_average (
float)input_file
traj_data (
str)output_file (
str)target_element (
int)number_of_data (
int)number_of_eta (
int)start_step (
int) – 0 = first selected snapshotfinal_step (
int)element_conversion (
dict)use_buffer (
bool) – store calculated fingerprint vectors for later random choiceseed (
int)
- Returns:
- AtomicAI.descriptors.laaf.calculate_eta(r0=0.45, cutoff_descriptor=5.0, number_of_eta=100)[source]
Calculate the decay function [goes from R0 to cutoff]
- Return type:
- Returns:
list of eta
- AtomicAI.descriptors.laaf.calculate_fingerprint_vector(x_ij, y_ij, z_ij, atomic_type_list, lattice_a, lattice_b, lattice_c, eta_all_list, atom_type, cutoff_descriptor)
Calculate the fingerprint vector for a single atom i. Original implementation of Botu descriptor.
acsf
Atom-Centered Symmetry Functions only G2 function[1]
Notice that the order of pair in descriptors follows the order of defined species
- [1] Jörg Behler, “Atom-centered symmetry functions for constructing high-dimensional
neural network potentials”, The Journal of Chemical Physics, 134, 074106 (2011), https://doi.org/10.1063/1.3553717
- class AtomicAI.descriptors.acsf.ACSF(cutoff_descriptor, params_g2=None, params_g3=None, params_g4=None, params_g5=None, species=None, periodic=True)[source]
Bases:
object- create(system, positions=None)[source]
Return the ACSF output for the given systems and given positions.
- Parameters:
system (
ase.Atomsor list ofase.Atoms) – One or many atomic structures.positions (list) – Positions where to calculate ACSF. Can be provided as cartesian positions or atomic indices. If no positions are defined, the output will be created for all atoms in the system. When calculating for multiple systems, provide the positions as a list for each system.
- Returns:
np.ndarray
- class AtomicAI.descriptors.acsf.ACSF_Force(rcut=6.0, params_v2b=None, params_v3b=None, species=None, periodic=True)[source]
Bases:
object- create(system, positions=None)[source]
Return the ACSF output for the given systems and given positions.
- Parameters:
system (
ase.Atomsor list ofase.Atoms) – One or many atomic structures.positions (list) – Positions where to calculate ACSF. Can be provided as cartesian positions or atomic indices. If no positions are defined, the output will be created for all atoms in the system. When calculating for multiple systems, provide the positions as a list for each system.
- Returns:
np.ndarray
- AtomicAI.descriptors.acsf.get_g2(xij, yij, zij, atomic_type_list, lattice_a, lattice_b, lattice_c, params_2b_list, cutoff_descriptor, n_species)
Calculate the fingerprint vector for a single atom i
- AtomicAI.descriptors.acsf.get_g3(xij, yij, zij, atomic_type_list, lattice_a, lattice_b, lattice_c, params_g3_list, cutoff_descriptor, n_species)
Calculate the fingerprint vector for a single atom i
- AtomicAI.descriptors.acsf.get_g4(xij, yij, zij, atomic_type_list, m_x, m_y, m_z, params_g4_list, cutoff_descriptor, n_species)
Calculate the fingerprint vector for a single atom i
- AtomicAI.descriptors.acsf.get_g5(xij, yij, zij, atomic_type_list, m_x, m_y, m_z, params_g5_list, cutoff_descriptor, n_species)
Calculate the fingerprint vector of G5 for a single atom i
- AtomicAI.descriptors.acsf.get_v2b(xij, yij, zij, atomic_type_list, m_x, m_y, m_z, params_2b_list, cutoff_descriptor, n_species)
Calculate the fingerprint vector for a single atom i
- Parameters:
xij (
float64)yij (
float64)zij (
float64)atomic_type_list (
int64)m_x (
float64)m_y (
float64)m_z (
float64)params_2b_list (
float64)cutoff_descriptor (
float)
- Returns:
- AtomicAI.descriptors.acsf.get_v3b(xij, yij, zij, atomic_type_list, m_x, m_y, m_z, params_v3b_list, cutoff_descriptor, n_species)
Calculate the fingerprint vector for a single atom i
- Parameters:
xij (
float64)yij (
float64)zij (
float64)atomic_type_list (
int64)m_x (
float64)m_y (
float64)m_z (
float64)params_v3b_list (
float64)cutoff_descriptor (
float)
- Returns:
mbsf
Modified Behler-Parrinello symmetry functions (MBSF) [1], is a modified version of Behler-Parrinello atom-centered symmetry functions (ACSF)[2]. Support two-body and three-body fingerprints
Notice that the order of pair in descriptors follows the order of defined species
[1] Smith J S, Isayev O and Roitberg A E 2017 Chem. sci. 8 3192 [2] Jörg Behler, “Atom-centered symmetry functions for constructing high-dimensional
neural network potentials”, The Journal of Chemical Physics, 134, 074106 (2011), https://doi.org/10.1063/1.3553717
- class AtomicAI.descriptors.mbsf.MBSF(cutoff_descriptor, params_gr=None, params_ga=None, species=None, periodic=True)[source]
Bases:
object- create(system, positions=None)[source]
Return the ACSF output for the given systems and given positions.
- Parameters:
system (
ase.Atomsor list ofase.Atoms) – One or many atomic structures.positions (list) – Positions where to calculate ACSF. Can be provided as cartesian positions or atomic indices. If no positions are defined, the output will be created for all atoms in the system. When calculating for multiple systems, provide the positions as a list for each system.
- Returns:
np.ndarray
- AtomicAI.descriptors.mbsf.get_ga_nblst(xij, yij, zij, atomic_type_list, m_x, m_y, m_z, params_ga_list, cutoff_descriptor, n_species, nb_index, nb_index_shift, nb_r2_lst)
Calculate the fingerprint vector for a single atom i
- Parameters:
xij (
float64)yij (
float64)zij (
float64)atomic_type_list (
int64)lattice_a
lattice_b
lattice_c
eta_all_list
atom_type
cutoff_descriptor (
float)
- Returns:
- AtomicAI.descriptors.mbsf.get_gr(xij, yij, zij, atomic_type_list, lattice_a, lattice_b, lattice_c, params_2b_list, cutoff_descriptor, n_species)
Calculate the fingerprint vector for a single atom i
- Parameters:
xij (
float64)yij (
float64)zij (
float64)atomic_type_list (
int64)lattice_a (
float64)lattice_b (
float64)lattice_c (
float64)eta_all_list
atom_type
cutoff_descriptor (
float)
- Returns:
- AtomicAI.descriptors.mbsf.get_gr_nblst(xij, yij, zij, atomic_type_list, m_x, m_y, m_z, params_gr_list, cutoff_descriptor, n_species, nb_index, nb_index_shift, nb_r2_lst)
Calculate the fingerprint vector for a single atom i
- Parameters:
xij (
float64)yij (
float64)zij (
float64)atomic_type_list (
int64)lattice_a
lattice_b
lattice_c
eta_all_list
atom_type
cutoff_descriptor (
float)
- Returns:
- AtomicAI.descriptors.mbsf.get_grga(xij, yij, zij, atomic_type_list, m_x, m_y, m_z, params_g4_list, cutoff_descriptor, n_species)
Calculate the fingerprint vector for a single atom i
- Parameters:
xij (
float64)yij (
float64)zij (
float64)atomic_type_list (
int64)lattice_a
lattice_b
lattice_c
eta_all_list
atom_type
cutoff_descriptor (
float)
- Returns:
- AtomicAI.descriptors.mbsf.get_neighbour_lst(xij, yij, zij, m_x, m_y, m_z, radius_cutoff)