Symmetry-based Clustering (SBC)
There are several tools for building atomistic systems from components, but the reverse process of identifying these components from an existing system is much harder. MatID utilizes a custom clustering algorithm, called Symmetry-based Clustering (SBC), which can cluster atoms based on local translational symmetry. Essentially this means that atoms which are built from the same underlying unit cell, will get clustered together.
Unlike clustering methods that work solely on the basis of atomic distances or chemical identities, SBC can produce meaningful clustering results even for structures like grain boundaries and defected structures, where other tools would struggle. SBC works for both finite and periodic structures, and can deal with noise and curvature in the structures. SBC currently returns clusters where the underlying unit cell is repeated either in two or three distinct directions (one-dimensional clusters, such as polymers are currently not handled).
Clustering is performed using the SBC
class. The basic syntax is relatively
simple: you have to initialize the SBC class with parameters that are suitable
for your use case (sensible defaults are provided), and then call the
get_clusters
-method. The following demonstrates this on a existing structure
file:
from matid.clustering import SBC
import ase.io
from ase.visualize import view
system = ase.io.read('system.xyz')
sbc = SBC()
clusters = sbc.get_clusters(system)
The return value is a list of the found Cluster
instances. You can perform
further analysis on these found clusters by using methods and attributes of this
class. E.g. to print out the indices of atoms belonging to the cluster and to
visualize the units cells of the found clusters, we could do the following:
for cluster in clusters:
print(cluster.indices)
view(cluster.get_cell())