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 beZ
andR
.desc_kwargs (
dict
) – Keyword arguments for the descriptor function afterZ
andR
. This can be an empty tuple.cutoff (
float
,None
, ortuple
) – Cutoff to accept or reject a structure. IfNone
, all structures are accepted. If atuple
is 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. Ifcutoff
is 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:2
or3
) – Cartesian coordinates of the structure.kwargs – Additional keyword arguments to pass into the descriptor function.
- Returns:
bool
ornumpy.ndarray
– If the descriptor is less than the cutoff.float
ornumpy.ndarray
– The value of the descriptor.