pengwann.interactions.AtomicInteractionContainer#
- class pengwann.interactions.AtomicInteractionContainer(sub_interactions)#
Data structure for storing multiple AtomicInteraction objects.
This class exists simply to faciliate convenient indexing and filtering over a sequence of AtomicInteraction objects. AtomicInteractionContainer objects can be indexed in the same manner as numpy arrays e.g.
interaction_container[i, j]will return all interactions between atoms i and j.- Attributes:
- sub_interactionssequence of
AtomicInteraction The sequence of AtomicInteraction objects to be stored.
- sub_interactionssequence of
Methods
filter_by_species(symbols)Return a subset of AtomicInteraction objects filtered by atomic species.
with_integrals(energies, mu[, ...])Return an updated container with integrated descriptors for all interactions.
See also
Examples
To obtain the AtomicInteraction between atoms 0 and 1:
>>> atomic_interaction_01 = interaction_container[0, 1]
To iterate over all AtomicInteraction objects:
>>> for atomic_interaction in interaction_container: >>> # Do something for each interaction.
To iterate over all the interactions between atom 0 and any other atom:
>>> for atomic_interaction in interaction_container[0]: >>> # Do something for each interaction.
To iterate over all interactions including certain atomic species/elemental symbols:
>>> symbols = ("Fe", "O") >>> for atomic_interaction in interaction_container.filter_by_species(symbols): >>> # Do something for each Fe-O interaction.