npl.descriptors package
Submodules
npl.descriptors.global_feature_classifier module
- class npl.descriptors.global_feature_classifier.AdsorptionFeatureVector(symbols)[source]
Bases:
SimpleFeatureClassifier
- class npl.descriptors.global_feature_classifier.AtomicCoordinationTypes(symbols)[source]
Bases:
SimpleFeatureClassifier
- class npl.descriptors.global_feature_classifier.CoordinationFeatureClassifier(symbols)[source]
Bases:
SimpleFeatureClassifierFeature classifier that counts how often each coordination number appears if vacancies (atoms of element ‘X’) are present in an otherwise PURE particle.
Form of the feature vector: [n_aa_bonds, n_a(cn=0), n_a(cn=1), … n_a(cn=12)]
- class npl.descriptors.global_feature_classifier.DipoleMomentCalculator(symbols)[source]
Bases:
SimpleFeatureClassifier
- class npl.descriptors.global_feature_classifier.ExtendedTopologicalFeaturesClassifier(symbols)[source]
Bases:
GlobalFeatureClassifierExtension of the Topological Feature Classifier Class. Computes the topological feature vector for more than 2 metals in the nanoparticle
- get_feature_labels()[source]
Generate a list of feature labels for the extended topological feature vector.
The feature labels include: - Bond counts for all possible pairs of elements. - Sublayer indices for each element. - Coordination numbers for each element from 0 to 12.
- Returns:
list: A list of feature labels.
- class npl.descriptors.global_feature_classifier.GeneralizedCoordinationNumber(particle)[source]
Bases:
SimpleFeatureClassifierClass that only works for Monometallic Nanopaticles
- class npl.descriptors.global_feature_classifier.GlobalFeatureClassifier[source]
Bases:
objectBase class for classifiers that produce a feature vector directly from a particle without the need for precomputing local environments.
Valid implementations have to implement the compute_feature_vector(particle) method.
- class npl.descriptors.global_feature_classifier.LayererTopologicalDescriptors(symbols, particle)[source]
Bases:
SimpleFeatureClassifier
- class npl.descriptors.global_feature_classifier.SimpleFeatureClassifier(symbols)[source]
Bases:
GlobalFeatureClassifierBase class for classifiers which provides handling of two elements and calculation of bond counts.
Entries for different elements in feature vectors have to be ordered consistently. This class uses an alphabetical ordering of TWO elements. The returned feature vector consists of [n_aa_bonds/n_atoms, n_ab_bonds/n_atoms, n_bb_bonds/n_atoms, n_a_atoms*0.1].
- Args:
symbols (list): A list of symbols representing the elements.
- Attributes:
symbol_a (str): The first symbol in the ordered list of symbols. symbol_b (str): The second symbol in the ordered list of symbols. feature_key (str): The key used to store the feature vector in the particle object.
- class npl.descriptors.global_feature_classifier.TopologicalFeatureClassifier(symbols)[source]
Bases:
SimpleFeatureClassifierClassifier for a generalization of the topological descriptors by Kozlov et al. (2015).
Implemented for TWO elements, which are sorted alphabetically.The returned feature vector will have the form [n_aa_bonds/n_atoms, n_ab_bonds/n_atoms, n_bb_bonds/n_atoms, n_a_atoms*0.1, n_a(cn=0), n_a(cn=1), …, n_a(cn=12].
- class npl.descriptors.global_feature_classifier.testTopologicalFeatureClassifier(symbols)[source]
Bases:
SimpleFeatureClassifierClassifier for a generalization of the topological descriptors by Kozlov et al. (2015). Implemented for TWO elements, which are sorted alphabetically.The returned feature vector will have the form [n_aa_bonds/n_atoms, n_ab_bonds/n_atoms, n_bb_bonds/n_atoms, n_a_atoms*0.1, n_a(cn=0), n_a(cn=1), …, n_a(cn=12].
npl.descriptors.local_environment_calculator module
- class npl.descriptors.local_environment_calculator.LocalEnvironmentCalculator[source]
Bases:
objectBase class for local environment calculators.
Intended use: Implementations should implement predict_local_environment() which calculates and returns the local environment of a single atom.
- class npl.descriptors.local_environment_calculator.NeighborCountingEnvironmentCalculator(symbols)[source]
Bases:
LocalEnvironmentCalculatorCalculate a local environment of the form [n_a, n_b], where n_a denotes the number of surrounding a atoms.
Currently restricted to two elements which are ordered alphabetically. Requires a valid neighbor list.
- class npl.descriptors.local_environment_calculator.SOAPCalculator(l_max)[source]
Bases:
LocalEnvironmentCalculatorExperimental class. Compute the spherical harmonics power spectrum for each atom and element.
Based on the code provided by Dr. Johannes Margraf. See https://arxiv.org/abs/1901.10971v1 Ceriotti et al. for details, used convention etc.
npl.descriptors.local_environment_feature_classifier module
- class npl.descriptors.local_environment_feature_classifier.CoordinationNumberClassifier(local_environment_calculator)[source]
- class npl.descriptors.local_environment_feature_classifier.KMeansClassifier(n_cluster, local_environment_calculator, feature_key)[source]
- class npl.descriptors.local_environment_feature_classifier.LocalEnvironmentFeatureClassifier(local_environment_calculator)[source]
Bases:
objectLocalEnvironmentFeatureClassifier is a class that classifies features of local environments around atoms in a particle.
- Attributes:
local_environment_calculator: An instance responsible for computing local environments. feature_key: A key to identify the feature being computed.
- Methods:
- __init__(local_environment_calculator):
Initializes the classifier with a local environment calculator.
- compute_atom_features(particle, recompute_local_environments=False):
Computes features for each atom in the particle. Optionally recomputes local environments.
compute_feature_vector(particle, recompute_atom_features=True, recompute_local_environments=False):
Computes the feature vector for the particle. Optionally recomputes atom features and local environments.
- compute_atom_feature(particle, atom_index, recompute_local_environment=False):
Computes the feature for a specific atom in the particle.
- get_feature_key():
Returns the feature key.
- set_feature_key(feature_key):
Sets the feature key.
- compute_n_features(particle):
Abstract method to compute the number of features for the particle. Must be implemented by subclasses.
- predict_atom_feature(particle, lattice_index, recompute_local_environment=False):
Abstract method to predict the feature of a specific atom. Must be implemented by subclasses.