Atomic clusters¶
The main information on the nodes and linkers in chic
is exposed by
the AtomicCluster
class:
- class chic.atomic_cluster.AtomicCluster[source]¶
Represents a cluster of atoms in a structure.
- property graph¶
Getter for _graph attribute.
- property bead_ids¶
Getter for bead_ids attribute. These are the unique IDs assigned to the beads for the cluster.
- property beads_frac_coords¶
Getter for beads_frac_coords attribute. These are the fractional coordinates of the beads.
- property beads_images¶
Getter for beads_images attribute. These are the images of the beads.
- property atom_to_bead_index¶
Getter for atom_to_bead_index attribute. This is a dictionary mapping the atom indices to the beads indices.
- property internal_bead_bonds¶
Getter for internal_bead_bonds attribute. This is a list of tuples representing the bonds between beads in the cluster.
- property coordination_number: int¶
coordination number of the cluster, i.e. the number of external edges.
- Type:
return
- get_indices_by_species(species: str) List[int] [source]¶
Get the indices of the sites in the cluster with a given species.
- get_cart_coords_by_species(species: str) ndarray [source]¶
Get the cartesian coordinates of the sites in the cluster with a given species.
- assign_beads(bead_ids: List[int], beads_frac_coords: ndarray, beads_images: ndarray, atom_to_bead_index: Dict[int, List[int]], internal_bead_bonds: List[Tuple[int, int]])[source]¶
Assign beads to the cluster.
- Parameters:
bead_ids – list of bead IDs.
beads_frac_coords – fractional coordinates of the beads.
beads_images – images of the beads.
atom_to_bead_index – dictionary mapping the atom indices to the beads indices.
internal_bead_bonds – list of tuples representing the bonds between beads in the cluster.
- get_centroid(skip_elements: List[str] | None = None) ndarray [source]¶
Compute the centroid of the cluster.
- Parameters:
skip_elements – the elements to skip when computing the centroid.
- find_rings(including: List[str] | None = None, strong_rings: bool = False, connective_including: bool = False)[source]¶
Find all rings in the cluster.
- Parameters:
including – list of elements to include in the rings. If None, all rings will be returned irrespective of the elements included.
connective_including – whether or not the connecting elements specified in “including” must also be the elements that connect to other building units.
strong_rings – whether to make sure the rings cannot be decomposed into smaller rings.
- to_molecule() Molecule [source]¶
Convert the AtomicCluster to a pymatgen Molecule object.
Note, this has a lot of shared functionality, but loses the site indexing that I want to keep uniform across all representations.
- get_image_by_site_index(site_index: int) ndarray [source]¶
Exctract the periodic image for a given site index.
- classmethod with_updated_coordinates_and_images(instance, new_cart_coords: ndarray, new_images: ndarray)[source]¶
Create a copy of an existing AtomicCluster instance with updated cartesian coordinates and images. Also set edges_external to None.
- Parameters:
instance – An instance of AtomicCluster to be copied.
new_cart_coords – Updated cartesian coordinates.
new_images – Updated images.
- Returns:
New AtomicCluster instance with updated attributes.