Symmetry Analysis
The SymmetryAnalyzer
class in MatID contains several symmetry routines for
analyzing 3D structures. The basic features are based on the excellent spglib
library, but with an extended feature set that makes MatID unique. The following
subsections showcase some of its most interesting features and you can learn
more in the API reference.
Conventional Cell
For each space group there is a conventional cell that has been standardized by
in Volume A of International Tables for Crystallography
(ITA). This conventional cell can be retrieved by using
the
get_conventional_system()
method, for example:
from matid import SymmetryAnalyzer
from ase.spacegroup import crystal
from ase.visualize import view
# Create an initial system with ASE
a = 5.64
nacl = crystal(
['Na', 'Cl'],
[(0, 0, 0), (0.5, 0.5, 0.5)],
spacegroup=225,
cellpar=[a, a, a, 90, 90, 90]
) * [3, 2, 1]
view(nacl)
# Let's retrieve the conventional cell as ASE Atoms
analyzer = SymmetryAnalyzer(nacl)
conventional_cell = analyzer.get_conventional_system()
view(conventional_cell)
You could also use spglib
to retrieve the conventional cell, but MatID adds an
additional step of normalization to make the structure even more standardized.
Although the shape and symmetries of the cell are already well-defined for a
conventional cell reported by spglib
, the exact location of atoms in the cell
can vary. The same structure can have multiple representations, which all look
different. If you are only interested in the symmetry properties of the system,
this may not be relevant. But if instead you wish to generate a more unique
structure for the conventional cell for visualization or identification
purposes, then additional processing is required.
Below is an example of the same rock salt structure (space group 225) in two different configurations, and the result of spglib conventional cell and the MatID conventional cell.
The only difference in the two original structures is the way the Wyckoff positions have been filled: structure A has has Na in Wyckoff position "a" and Cl in Wyckoff position "b" while in the second one these positions are reversed. The conventional cell reported by MatID makes an additional step of searching for the most unique representation based on chirality-preserving Euclidean Normalizers. These are reported e.g. by the Bilbao Crystal database. Each normalizer is essentially a transform that can be applied to the structure to gain a new form of the conventional cell without modifying the underlying material. MatID iterates over these different representations and selects one based on the population of different Wyckoff sites which differs among these representations.
It should be noted that certain Wyckoff sites in certain space groups are
parametrized. MatID does not perform any selection between these parameters, so
in these cases the exact visual representation will still differ. By calling
get_has_free_wyckoff_parameters()
you can query whether the structure contains parametrized wyckoff positions.
Wyckoff sets
You can use
get_wyckoff_sets_conventional()
to query a detailed breakdown of the occupied Wyckoff sets in a material. The
following example shows an example of how you could query the Wyckoff sets in a
fairly complicated clathrate material:
from matid import SymmetryAnalyzer
from ase.io import read
# Load clathrate structure from file
clathrate = read('clathrate.xyz')
# Print the wyckoff sets
symm = SymmetryAnalyzer(clathrate)
wyckoff_sets_conv = symm.get_wyckoff_sets_conventional()
for i_group, group in enumerate(wyckoff_sets_conv):
print("Set {}".format(i_group))
print(" Letter: {}".format(group.wyckoff_letter))
print(" Element: {}".format(group.element))
print(" Indices: {}".format(group.indices))
print(" Multiplicity: {}".format(group.multiplicity))
print(" Repr.: {}".format(group.representative))
print(" x: {}".format(group.x))
print(" y: {}".format(group.y))
print(" z: {}".format(group.z))
The output of this script is:
Set 0
Letter: c
Element: Si
Indices: [40, 41, 42, 43, 44, 45]
Multiplicity: 6
Repr.: ['1/4', '0', '1/2']
x: None
y: None
z: None
Set 1
Letter: i
Element: Si
Indices: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
Multiplicity: 16
Repr.: ['x', 'x', 'x']
x: 0.6837
y: None
z: None
Set 2
Letter: k
Element: Si
Indices: [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39]
Multiplicity: 24
Repr.: ['0', 'y', 'z']
x: None
y: 0.6922999999999999
z: 0.8827999999999999
Material ID
You can use
get_material_id()
to
report a 28-digit character sequence for a given structure. This is essentially
a hash-digest which is seeded using information about the space group,
dimensionality and the Wyckoff sites occupied in the conventional cell. Due to
the way MatID generates the conventional cell, this identifier is fairly unique
and can be used in many cases to identify structures 3D and 2D materials with
"enough" symmetry.
The material id can act as a convenient handle for finding materials with very specific structure. As a simple example one could imagine trying to find skutterudite. The filters required for this would include:
- Space group number
- Wyckoff position occupation (assuming a normalized one is available)
Often this information is not directly reported and if it is, it can be a daunting task for the user to formulate the queries precisely. This is where the material id can offer a shortcut: you can use MatID to retrieve it for a structure and use it in queries, provided that a database has it stored. For example, if you have an atomic structure, you could use the following script to retrieve the material id for it:
from matid import SymmetryAnalyzer
from ase.spacegroup import crystal
from ase.visualize import view
# Create an initial system with ASE
a = 9.04
skutterudite = crystal(
('Co', 'Sb'),
basis=[(0.25, 0.25, 0.25), (0.0, 0.335, 0.158)],
spacegroup=204,
cellpar=[a, a, a, 90, 90, 90]
)
view(skutterudite)
# Let's retrieve the material id
analyzer = SymmetryAnalyzer(skutterudite)
material_id = analyzer.get_material_id()
print(material_id)
This material id can then be used e.g. in the NOMAD platform to query for structures
containing skutterudite (material id = zI9HC39lOUK_w2Clv8XUHb43tYVV
).
The material id is not guaranteed to be unique, but can be highly useful in practice. In some sense it has a similar value proposal to SMILES for molecules. There are some of the cases in which it will fail:
- Parametrized Wyckoff sites
- If isotropic scaling of cell should affect the material identification
- If variable angles for the conventional cell are a problem