PyMatGen Sites & Species¶
This page provides a concise list of available properties and methods, grouped by topic.
Refer to Pymatgen's API docs for detailed descriptions.
Make sure you understand the difference between object classifications:
Element: The fundamental chemical component (e.g., Na or Cl).
Species: A singular chemical entity, encompassing an
Cluster. Essentially, a species can be an individual element or a set of associated elements. Additionally, it may contain extra information about the element(s), such as charge and bonding.
Specieswith xyz coordinates in free space (without a lattice). It includes orientation information if multiple atoms are present in the
Specieswith xyz coordinates relative to an associated lattice. This also includes orientation details if multiple atoms are part of the
(basic single crystals)
Structure object represents the unit cell for NaCl, it contains two
PeriodicSites: one for
Na and one for
Cl, both of type
Optionally, you can replace the
Element types with
Since these are single-atom
Species, there's no need to worry about orientation (i.e., rotating the atom has no effect).
(advanced molecular crystals and beyond)
If you have a crystal structure with ethanol intercalated between graphite, your
Structure object has several ways to define its
- each atom is its own
PeriodicSite, represented by an
- there are two
PeriodicSitetypes: (i) a
Moleculetype for all ethanol molecules and (ii) an
Elementtype for all carbons part of the graphite.
- ... and more! Choose what makes sense for your application. NOTE: Options 1 and 2 should cover the majority of cases.
To access the
PeriodicSite objects from a
# OPTION 1
sites = structure.sites
# OPTION 2
for site in structure:
#... do something
lattice(matches between all sites in
(under dev sections)¶