asaplib.descriptors package

Submodules

asaplib.descriptors.atomic_descriptors module

Methods and functions to compute atomic desciptors

class asaplib.descriptors.atomic_descriptors.Atomic_Descriptor_ACSF(desc_spec)[source]

Bases: asaplib.descriptors.atomic_descriptors.Atomic_Descriptor_Base

create(frame)[source]
class asaplib.descriptors.atomic_descriptors.Atomic_Descriptor_Base(desc_spec)[source]

Bases: object

create(frame)[source]
get_acronym()[source]
is_atomic()[source]
class asaplib.descriptors.atomic_descriptors.Atomic_Descriptor_FCHL19(desc_spec)[source]

Bases: asaplib.descriptors.atomic_descriptors.Atomic_Descriptor_Base

Generate the FCHL19 representation (https://doi.org/10.1063/1.5126701). Requires the developer version of the QML package, see https://www.qmlcode.org/installation.html for installation instructions.

:param : :type : param nRs2: Number of gaussian basis functions in the two-body terms :param : :type : type nRs2: integer :param : :type : param nRs3: Number of gaussian basis functions in the three-body radial part :param : :type : type nRs3: integer :param : :type : param nFourier: Order of Fourier expansion :param : :type : type nFourier: integer :param : :type : param eta2: Precision in the gaussian basis functions in the two-body terms :param : :type : type eta2: float :param : :type : param eta3: Precision in the gaussian basis functions in the three-body radial part :param : :type : type eta3: float :param : :type : param zeta: Precision parameter of basis functions in the three-body angular part :param : :type : type zeta: float :param : :type : param two_body_decay: exponential decay for the two body function :param : :type : type two_body_decay: float :param : :type : param three_body_decay: exponential decay for the three body function :param : :type : type three_body_decay: float :param : :type : param three_body_weight: relative weight of the three body function :param : :type : type three_body_weight: float :param : :type : is_periodic: Boolean determining Whether the system is periodic. :param : :type : type Boolean:

create(frame)[source]
class asaplib.descriptors.atomic_descriptors.Atomic_Descriptor_LMBTR(desc_spec)[source]

Bases: asaplib.descriptors.atomic_descriptors.Atomic_Descriptor_Base

create(frame)[source]
class asaplib.descriptors.atomic_descriptors.Atomic_Descriptor_LMBTR_K2(desc_spec)[source]

Bases: asaplib.descriptors.atomic_descriptors.Atomic_Descriptor_LMBTR

class asaplib.descriptors.atomic_descriptors.Atomic_Descriptor_LMBTR_K3(desc_spec)[source]

Bases: asaplib.descriptors.atomic_descriptors.Atomic_Descriptor_LMBTR

class asaplib.descriptors.atomic_descriptors.Atomic_Descriptor_SOAP(desc_spec)[source]

Bases: asaplib.descriptors.atomic_descriptors.Atomic_Descriptor_Base

create(frame)[source]
class asaplib.descriptors.atomic_descriptors.Atomic_Descriptors(desc_spec_dict={})[source]

Bases: object

add(desc_spec, tag)[source]

adding the specifications of a new atomic descriptors :param desc_spec: :type desc_spec: a dictionary that specify which atomic descriptor to use

bind()[source]

binds the objects that actually compute the descriptors these objects need to have .create(frame) method to compute the descriptors of frame (a xyz object)

compute(frame)[source]

compute the global descriptor vector for a frame from atomic contributions :param frame: :type frame: ASE atom object. Coordinates of a frame.

Returns

atomic_desc_dict – and a np.array [N_desc*N_atoms]. Atomic descriptors for a frame. e.g. {‘ad1’:{‘acronym’:’soap-1’, ‘atomic_descriptors’: a np.array [N_desc*N_atoms]}}

Return type

a dictionary. each entry contains the essential info of the descriptor (acronym)

get_acronym()[source]
pack()[source]

asaplib.descriptors.atomic_to_global module

Methods and functions to compute global descriptors of a frame from its atomic desciptors

class asaplib.descriptors.atomic_to_global.Atomic_2_Global_Average(k_spec)[source]

Bases: asaplib.descriptors.atomic_to_global.Atomic_2_Global_Base

this is the vanilla situation. We just take the average soap for all atoms

create(atomic_desc, atomic_numbers=[])[source]

compute the global descriptor vector for a frame from atomic contributions :param atomic_desc: :type atomic_desc: a np.array [N_desc*N_atoms]. Atomic descriptors for a frame. :param atomic_numbers: :type atomic_numbers: np.matrix. [N_atoms]. Atomic numbers for atoms in the frame.

Returns

  • acronym (self.acronym)

  • desc (a np.array [N_desc]. Global descriptors for a frame.)

class asaplib.descriptors.atomic_to_global.Atomic_2_Global_Base(k_spec)[source]

Bases: object

create(atomic_desc, atomic_numbers=[])[source]

compute the global descriptor vector for a frame from atomic contributions :param atomic_desc: :type atomic_desc: a np.array [N_desc*N_atoms]. Atomic descriptors for a frame. :param atomic_numbers: :type atomic_numbers: np.matrix. [N_atoms]. Atomic numbers for atoms in the frame.

Returns

  • acronym (self.acronym)

  • desc (a np.array [N_desc]. Global descriptors for a frame.)

get_acronym()[source]
class asaplib.descriptors.atomic_to_global.Atomic_2_Global_Descriptors(k_spec_dict)[source]

Bases: object

add(k_spec, tag)[source]

adding the specifications of a new Atomic_2_Global_Descriptor :param k_spec: :type k_spec: a dictionary that specify which Atomic_2_Global_Descriptor descriptor to use

bind()[source]

binds the objects that actually compute the descriptors these objects need to have .create(atomic_desc) method to compute the global descriptors from atomic ones

compute(atomic_desc_dict, atomic_numbers)[source]

compute the global descriptor vector for a frame from atomic contributions :param atomic_desc_dict: and a np.array [N_desc*N_atoms]. Global descriptors for a frame.

see Atomic_Descriptors.compute() in .atomic_descriptors.py

Parameters

atomic_numbers (np.matrix. [N_atoms] Atomic numbers for atoms in the frame.) –

Returns

desc_dict – and a np.array [N_desc]. Global descriptors for a frame. e.g. {‘d1’:{ ‘acronym’: ‘XXX’, ‘descriptors’: a np.array [N_desc]}}

Return type

a dictionary. each entry contains the essential info of the descriptor, i.e. acronym

pack()[source]
class asaplib.descriptors.atomic_to_global.Atomic_2_Global_Moment_Average(k_spec)[source]

Bases: asaplib.descriptors.atomic_to_global.Atomic_2_Global_Base

get the global descriptor from atomic ones by averaging over the atomic descriptors of z th power

Parameters

zeta (take the zeta th power) –

create(atomic_desc, atomic_numbers=[])[source]

compute the global descriptor vector for a frame from atomic contributions :param atomic_desc: :type atomic_desc: a np.array [N_desc*N_atoms]. Atomic descriptors for a frame. :param atomic_numbers: :type atomic_numbers: np.matrix. [N_atoms]. Atomic numbers for atoms in the frame.

Returns

  • acronym (self.acronym)

  • desc (a np.array [N_desc]. Global descriptors for a frame.)

class asaplib.descriptors.atomic_to_global.Atomic_2_Global_Moment_Sum(k_spec)[source]

Bases: asaplib.descriptors.atomic_to_global.Atomic_2_Global_Base

get the global descriptor from atomic ones by averaging over the atomic descriptors of z th power

Parameters

zeta (take the zeta th power) –

create(atomic_desc, atomic_numbers=[])[source]

compute the global descriptor vector for a frame from atomic contributions :param atomic_desc: :type atomic_desc: a np.array [N_desc*N_atoms]. Atomic descriptors for a frame. :param atomic_numbers: :type atomic_numbers: np.matrix. [N_atoms]. Atomic numbers for atoms in the frame.

Returns

  • acronym (self.acronym)

  • desc (a np.array [N_desc]. Global descriptors for a frame.)

class asaplib.descriptors.atomic_to_global.Atomic_2_Global_Sum(k_spec)[source]

Bases: asaplib.descriptors.atomic_to_global.Atomic_2_Global_Base

We just take the sum soap for all atoms

create(atomic_desc, atomic_numbers=[])[source]

compute the global descriptor vector for a frame from atomic contributions :param atomic_desc: :type atomic_desc: a np.array [N_desc*N_atoms]. Atomic descriptors for a frame. :param atomic_numbers: :type atomic_numbers: np.matrix. [N_atoms]. Atomic numbers for atoms in the frame.

Returns

  • acronym (self.acronym)

  • desc (a np.array [N_desc]. Global descriptors for a frame.)

asaplib.descriptors.atomic_to_global.Descriptor_By_Species(atomic_desc, atomic_numbers, global_species, average_over_natom=True)[source]

first compute the average/sum descriptors for each species, then concatenate them.

Parameters
  • atomic_desc (np.matrix. [N_atoms, N_desc] Atomic descriptors for a frame.) –

  • atomic_numbers (np.matrix. [N_atoms] Atomic numbers for atoms in the frame.) –

  • global_species (a list of all atomic species in all frames) –

  • average_over_natom (normalized by number of the atoms of the same species) –

Returns

desc

Return type

np.matrix [N_desc*len(global_species)] Global descriptors for a frame.

asaplib.descriptors.global_descriptors module

Methods and functions to compute global desciptors

class asaplib.descriptors.global_descriptors.Global_Descriptor_Base(desc_spec)[source]

Bases: object

create(frame)[source]
get_acronym()[source]
is_atomic()[source]
class asaplib.descriptors.global_descriptors.Global_Descriptor_CM(desc_spec)[source]

Bases: asaplib.descriptors.global_descriptors.Global_Descriptor_Base

create(frame)[source]

compute the CM descriptor vector for a frame :param frame: :type frame: ASE atom object. Coordinates of a frame.

Returns

  • desc_dict (a dictionary. each entry contains the essential info of the descriptor, i.e. acronym) – and a np.array [N_desc]. Global descriptors for a frame. e.g. {‘d1’:{ ‘acronym’: ‘CM-*’, ‘descriptors’: a np.array [N_desc]}}

  • atomic_desc_dict ({})

class asaplib.descriptors.global_descriptors.Global_Descriptor_Morgan(desc_spec)[source]

Bases: asaplib.descriptors.global_descriptors.Global_Descriptor_Base

create(frame)[source]
class asaplib.descriptors.global_descriptors.Global_Descriptor_from_Atomic(desc_spec)[source]

Bases: asaplib.descriptors.global_descriptors.Global_Descriptor_Base

create(frame)[source]

compute the global descriptor vector for a frame from atomic contributions :param frame: :type frame: ASE atom object. Coordinates of a frame.

Returns

  • desc_dict (a dictionary. each entry contains the essential info of the descriptor, i.e. acronym) – and a np.array [N_desc]. Global descriptors for a frame. e.g. {‘d1’:{ ‘acronym’: ‘XXX’, ‘descriptors’: a np.array [N_desc]}}

  • atomic_desc_dict (a dictionary. each entry contains the essential info of the descriptor (acronym)) – and a np.array [N_desc*N_atoms]. Atomic descriptors for a frame. e.g. {‘ad1’:{‘acronym’:’soap-1’, ‘atomic_descriptors’: a np.array [N_desc*N_atoms]}}

pack()[source]
class asaplib.descriptors.global_descriptors.Global_Descriptors(desc_spec_dict={})[source]

Bases: object

add(desc_spec, tag)[source]

adding the specifications of a new atomic descriptors :param desc_spec: :type desc_spec: a dictionary that specify which atomic descriptor to use

bind()[source]

binds the objects that actually compute the descriptors these objects need to have .create(frame) method to compute the descriptors of frame (a xyz object)

compute(frame)[source]

compute the global descriptor vector and atomic descriptor matrix (if any) for a frame :param frame: :type frame: ASE atom object. Coordinates of a frame.

Returns

  • desc_dict (a dictionary. each entry contains the essential info of the descriptor, i.e. acronym) – and a np.array [N_desc]. Global descriptors for a frame. e.g. {‘d1’:{ ‘acronym’: ‘XXX’, ‘descriptors’: a np.array [N_desc]}}

  • atomic_desc_dict (a dictionary. each entry contains the essential info of the descriptor (acronym)) – and a np.array [N_desc*N_atoms]. Atomic descriptors for a frame. e.g. {‘ad1’:{‘acronym’:’soap-1’, ‘atomic_descriptors’: a np.array [N_desc*N_atoms]}}

pack()[source]

Module contents