ipsuite.geometry package¶
Submodules¶
ipsuite.geometry.barycenter_coarse_grain module¶
ipsuite.geometry.graphs module¶
- ipsuite.geometry.graphs.atoms_to_graph(atoms: Atoms, cutoffs: dict[str, float] | None = None) Graph[source]¶
Converts ASE Atoms into a Graph based on their bond connectivity.
- Args:
atoms (ase.Atoms): Atoms instance to convert cutoffs (dict[str, float] | None): cutoffs of each atom.
Dictionary with keys for the symbols and values of the cutoff radii. If None, use the ase.data.covalent_radii. Default: None
- Returns:
G (nx.Graph): Connectivity graph
- ipsuite.geometry.graphs.edges_from_atoms(atoms: Atoms) ndarray[source]¶
Returns the graph edges of a molecular graph.
- ipsuite.geometry.graphs.identify_molecules(atoms: Atoms, cutoffs: dict[str, float] | None = None) list[ndarray][source]¶
Identifies molecules in a structure based on the connected subgraphs.
- Args:
atoms (ase.Atoms): Atoms instance to identify molecules in cutoffs (dict[str, float] | None): cutoffs of each element.
Dictionary with keys for the symbols and values of the cutoff radii. If None, use the ase.data.covalent_radii. Default: None
- Returns:
c_list (np.ndarray): Array of lists of connected atom indices
ipsuite.geometry.mapping module¶
Molecule Mapping using networkx
- class ipsuite.geometry.mapping.BarycenterMapping(frozen: bool = False, cutoffs: dict[str, float] | None = None, _components: Any | None = None)[source]¶
Bases:
objectNode that “coarse grains” each molecule in a configuration into its center of mass. Useful for operations affecting intermolecular distance, but not intramolecular distances.
Mapping nodes can be used in a more functional manner when initialized with data=None outside the project graph. In that case, one can use the mapping methods but the Node itself does not store the transformed configurations.
Attributes¶
- frozen: bool
If True, the neighbor list is only constructed for the first configuration. The indices of the molecules will be frozen for all configurations.
- cutoffs: dict[str, float] | None
cutoffs of each element. Dictionary with keys for the symbols and values of the cutoff radii. If None, use the ase.data.covalent_radii. Default: None
- cutoffs: dict[str, float] | None = None¶
- frozen: bool = False¶
ipsuite.geometry.unwrap module¶
- ipsuite.geometry.unwrap.unwrap_system(atoms: Atoms, components: list[ndarray]) list[Atom][source]¶
Molecules in a system which extend across periodic boundaries are mapped such that they are connected but dangle out of the cell. Mapping to the side where the fragment of molecule is closest to the cell center is preferred. Can be reversed by joining the returned molecules and calling the atoms.wrap() method.
Module contents¶
This module contains Nodes and utilities for molecule mapping. The Nodes provide forward_mapping and backward_mapping methods for applying and reversing the transformations. Note that they do not implement run methods and are thus intended to be used via zntrack.deps only.
- class ipsuite.geometry.BarycenterMapping(frozen: bool = False, cutoffs: dict[str, float] | None = None, _components: Any | None = None)[source]¶
Bases:
objectNode that “coarse grains” each molecule in a configuration into its center of mass. Useful for operations affecting intermolecular distance, but not intramolecular distances.
Mapping nodes can be used in a more functional manner when initialized with data=None outside the project graph. In that case, one can use the mapping methods but the Node itself does not store the transformed configurations.
Attributes¶
- frozen: bool
If True, the neighbor list is only constructed for the first configuration. The indices of the molecules will be frozen for all configurations.
- cutoffs: dict[str, float] | None
cutoffs of each element. Dictionary with keys for the symbols and values of the cutoff radii. If None, use the ase.data.covalent_radii. Default: None
- cutoffs: dict[str, float] | None = None¶
- frozen: bool = False¶