Classification

MatID can be used to automatically classify structures into different structural classes. The currently supported classes are:

  • Class3D: Generic class for all three-dimensional structures, e.g. bulk crystals, liquids, solid-liquid interfaces.

  • Class2D: Generic class for all two-dimensional structures, e.g. surfaces, 2D materials.

    • Surface: Specific class for surface structures.

    • Material2D: Specific class for 2D materials.

  • Class1D: Generic class for all one-dimensional structures, e.g. polymers, nanotubes.

  • Class0D: Generic class for all zero-dimensional structures, e.g. atoms, molecules, clusters.

    • Atom: Specific class for single atoms.

The classification system is hierarchical: e.g. a Surface is a subclass of a Class2D. If a two-dimensional structure cannot be assigned with certainty into a more specific subclass, the most specific applicable parent class is used.

The classification is based on the structural properties of the system, i.e. atomic positions, unit cell, periodic boundary conditions and atomic numbers. The classification, like the whole MatID package supports the ASE library for handling atomic structures. With ASE you can read structures from multiple files, or define the structure yourself with the Atoms class or the different structure creation tools. Once the structure has been specified as an ASE.Atoms object, you can input it into classification.

The following code shows an example of reading a structure from an extended XYZ file and classifying it.

from matid import Classifier
import ase.io

# Read an extended XYZ file containin an atomic geometry. Extended XYZ files
# will also include the unit cell and periodic boundary conditions.
system = ase.io.read("structure.xyz")

# Define the classifier
classifier = Classifier()

# Perform classification
classification = classifier.classify(system)

# Investigate result
print(classification)

An alternative way is to define the Atoms object yourself

from matid import Classifier
from ase import Atoms

# Define the structure as an ASE Atoms object
system = Atoms(
    positions=[
        [5., 5.,       5.2981545],
        [5., 5.763239, 4.7018455],
        [5., 4.236761, 4.7018455],
    ],
    symbols=["O", "H", "H"],
    cell=[10, 10, 10],
    pbc=[True, True, True],
)

# Define the classifier
classifier = Classifier()

# Perform classification
classification = classifier.classify(system)

# Investigate result
print(classification)

The Classifier class provides multiple parameters that can be used to tune the classification to fit different scenarios. The default settings are quite conservative: they are good for a wide range of systems, but can result in slow classification for bigger systems. The speed can be improved by providing custom settings if more is known about the dataset.