ipsuite.geometry package

Submodules

ipsuite.geometry.barycenter_coarse_grain module

ipsuite.geometry.barycenter_coarse_grain.barycenter_backmapping(cg_atoms, molecules)[source]
ipsuite.geometry.barycenter_coarse_grain.coarse_grain_to_barycenter(molecules)[source]

ipsuite.geometry.graphs module

ipsuite.geometry.graphs.atoms_to_graph(atoms: Atoms) Graph[source]

Converts ASE Atoms into a Graph based on their bond connectivity.

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) list[ndarray][source]

Identifies molecules in a structure based on the connected subgraphs.

ipsuite.geometry.graphs.split_molecule(a0, a1, atoms)[source]

ipsuite.geometry.mapping module

Molecule Mapping using networkx

class ipsuite.geometry.mapping.BarycenterMapping(frozen: bool = False, _components: Any | None = None)[source]

Bases: object

Node 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.

backward_mapping(cg_atoms: Atoms, molecules: list[Atoms]) list[Atoms][source]
forward_mapping(atoms: Atoms) tuple[Atoms, list[Atoms]][source]
frozen: bool = False

ipsuite.geometry.unwrap module

ipsuite.geometry.unwrap.closest_atom_to_center(atoms)[source]
ipsuite.geometry.unwrap.displace_neighbors(mol, edges)[source]
ipsuite.geometry.unwrap.sort_atomic_edges(edges, idx)[source]
ipsuite.geometry.unwrap.unwrap(atoms, edges, idx)[source]
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, _components: Any | None = None)[source]

Bases: object

Node 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.

backward_mapping(cg_atoms: Atoms, molecules: list[Atoms]) list[Atoms][source]
forward_mapping(atoms: Atoms) tuple[Atoms, list[Atoms]][source]
frozen: bool = False