quemb.molbe.autofrag.graphgen¶
- quemb.molbe.autofrag.graphgen(mol, n_BE=2, frozen_core=True, remove_nonunique_frags=True, frag_prefix='f', connectivity='euclidean', iao_valence_basis=None, cutoff=20.0)¶
Generate fragments via adjacency graph.
Generalizes the BEn fragmentation scheme to arbitrary fragment sizes using a graph theoretic heuristic. In brief: atoms are assigned to nodes in an adjacency graph and edges are weighted by some distance metric. For a given fragment center site, Dijkstra’s algorithm is used to find the shortest path from that center to its neighbors. The number of nodes visited on that shortest path determines the degree of separation of the corresponding neighbor. I.e., all atoms whose shortest paths from the center site visit at most 1 node must be direct neighbors to the center site, which gives BE2-type fragments; all atoms whose shortest paths visit at most 2 nodes must then be second-order neighbors, hence BE3; and so on.
Currently does not support periodic calculations.
- Parameters:
mol (
Mole
) – The molecule object.n_BE (
int
) – The order of nearest neighbors (with respect to the center atom) included in a fragment. Supports alln_BE
, withn_BE
in[1, 2, 3, 4, 5, 6, 7, 8, 9]
having been tested.frozen_core (
bool
) – Whether to exclude core AO indices from the fragmentation process. True by default.remove_nonunique_frags (
bool
) – Whether to remove fragments which are strict subsets of another fragment in the system. True by default.frag_prefix (
str
) – Prefix to be appended to the fragment datanames. Useful for managing fragment scratch directories.connectivity (
str
) – Keyword string specifying the distance metric to be used for edge weights in the fragment adjacency graph. Currently supports “euclidean” (which uses the square of the distance between atoms in real space to determine connectivity within a fragment.)cutoff (
float
) – Atoms with an edge weight beyond cutoff will be excluded from the shortest_path calculation. This is crucial when handling very large systems, where computing the shortest paths from all to all becomes non-trivial. Defaults to 20.0.
- Returns:
FragmentMap mapping various fragment components to AO indices, data names, and other info.
- Return type: