gen_r_entity_combs#

mbgdml.mbe.gen_r_entity_combs(r_prov_spec, entity_ids_lower)[source]#

Generate entity_id combinations of a specific size for a single structure.

r_prov_spec[2:] provides entity_ids of a reference structure. For example, consider r_prov_spec = [0, 0, 34, 5, 2]. This tells us that the structure contains three entities, and the entity_ids of each are 34, 5, and 2 in the structure provenance.

gen_r_entity_combs generates all combinations (without replacement) based on the number of entities in entity_ids_lower. If entity_ids_lower is [0, 0, 0, 1, 1, 1] (i.e., number of lower-order entities is 2), then gen_r_entity_combs produces all 3 choose 2 combinations.

Parameters:
  • r_prov_spec (numpy.ndarray, ndim: 1) – Structure provenance specifications of a single structure.

  • 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].

Yields:

tuple – Entity combinations of a single structure.