Criteria#
- class mbgdml.descriptors.Criteria(desc, desc_kwargs, cutoff, bound='upper')[source]#
Descriptor criteria for accepting a structure based on a descriptor and cutoff.
- Parameters:
desc (
callable) – Computes the descriptor. First two arguments must beZandR.desc_kwargs (
dict) – Keyword arguments for the descriptor function afterZandR. This can be an empty tuple.cutoff (
float,None, ortuple) – Cutoff to accept or reject a structure. IfNone, all structures are accepted. If atupleis provided, structures that are within these cutoffs will be accepted.bound (
str, default:'upper') – What bound does the cutoff represent?'upper'means any descriptor that is equal to or larger than the cutoff will be rejected.'lower'means anything equal to or smaller than the cutoff. Ifcutoffis a tuple, we ignore this.
- accept(Z, R, **kwargs)[source]#
Determine if we accept the structure.
- Parameters:
Z (
numpy.ndarray) – Atomic numbers of the structure.R (
numpy.ndarray, ndim:2or3) – Cartesian coordinates of the structure.kwargs – Additional keyword arguments to pass into the descriptor function.
- Returns:
boolornumpy.ndarray– If the descriptor is less than the cutoff.floatornumpy.ndarray– The value of the descriptor.