Skip to content

Migrating from spglib ​

The dedicated adapter returns the dictionary shape spglib users already pass to their analysis code, so switching analysis tools needs one import change.

Taskspglibxtalforge
Datasetspglib.get_symmetry_dataset(cell)xtalforge.get_symmetry_dataset(structure)
Space-group numberdataset["number"]dataset["number"]
International symboldataset["international"]dataset["international"]
Hall symboldataset["hall"]dataset["hall"]
Rotationsdataset["rotations"]dataset["rotations"]
Translationsdataset["translations"]dataset["translations"]
Wyckoff lettersdataset["wyckoffs"]dataset["wyckoffs"]
Equivalent atomsdataset["equivalent_atoms"]dataset["equivalent_atoms"]
Standardized celldataset["std_lattice"]dataset["std_lattice"]
Primitive celldataset["primitive_lattice"]dataset["primitive_lattice"]
python
import xtalforge

structure = xtalforge.Structure(open("POSCAR").read(), "poscar")
dataset = xtalforge.get_symmetry_dataset(structure, symprec=1e-5)
print(dataset["number"], dataset["international"])

The adapter uses the native detector; the returned arrays are plain Python lists, so existing spglib consumers can keep their code unchanged.