mbe_worker#

mbgdml.mbe.mbe_worker(r_shape, entity_ids, r_prov_specs, r_idxs, E_lower, Deriv_lower, entity_ids_lower, r_prov_specs_lower)[source]#

Worker for computing many-body contributions.

This does not take into account if many-body contributions are being 'added' or 'removed'. This just sums up all possible contributions.

Parameters:
  • r_shape (tuple, ndim: 1) – Shape of a single structure. For example, (n, 3) where n is the number of atoms.

  • entity_ids (numpy.ndarray, ndim: 1) – A uniquely identifying integer specifying what atoms belong to which entities for lower-order structures. Entities can be a related set of atoms, molecules, or functional group. For example, a water and methanol molecule could be [0, 0, 0, 1, 1, 1, 1, 1, 1].

  • r_prov_specs (numpy.ndarray, ndim: 2) – Structure provenance IDs. This specifies the r_prov_id, structure index from the r_prov_id source, and entity_ids making up the structure.

  • r_idxs (list, ndim: 1) – Structure indices of the original E and Deriv arrays for this worker.

  • E_lower (numpy.ndarray, ndim: 1) – Energies of lower-order structures.

  • Deriv_lower (numpy.ndarray, ndim: 3) – Potential energy surface derivatives (i.e., gradients or forces depending on the sign) of lower-order structures.

  • entity_ids_lower (numpy.ndarray, ndim: 1) – A uniquely identifying integer specifying what atoms belong to which entities for lower-order structures. Entities can be a related set of atoms, molecules, or functional group. For example, a water and methanol molecule could be [0, 0, 0, 1, 1, 1, 1, 1, 1].

  • r_prov_specs_lower (numpy.ndarray, ndim: 2) – Structure provenance IDs. This specifies the r_prov_id, structure index from the r_prov_id source, and entity_ids making up lower-order structures.

Returns:

  • list – Structure indices of the original E and Deriv arrays for this worker.

  • numpy.ndarray – Many-body energy contributions for the worker structure indices.

  • numpy.ndarray – Many-body derivative (i.e., gradients or forces depending on the sign) contributions for the worker structure indices.