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 be Z and R.

  • desc_kwargs (dict) – Keyword arguments for the descriptor function after Z and R. This can be an empty tuple.

  • cutoff (float, None, or tuple) – Cutoff to accept or reject a structure. If None, all structures are accepted. If a tuple 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. If cutoff 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 or 3) – Cartesian coordinates of the structure.

  • kwargs – Additional keyword arguments to pass into the descriptor function.

Returns: