Note
Go to the end to download the full example code.
Create crystal phase#
This example shows various ways to create a crystal Phase.
For alignment of the crystal axes with a Cartesian coordinate system, see the example on Crystal reference frame.
From a Crystallographic Information File (CIF) file.
E.g. one for titanium from an online repository like the Americam Mineralogist Crystal Structure Database: https://rruff.geo.arizona.edu/AMS/download.php?id=13417.cif&down=text phase_ti = Phase.from_cif(“ti.cif”) print(phase_ti)
From a space group (note that the point group is derived)
<name: . space group: Fm-3m. point group: m-3m. proper point group: 432. color: tab:blue>
From a point group (note that the space group is unknown since there are multiple options)
<name: . space group: None. point group: 432. proper point group: 432. color: tab:blue>
Non-crystalline phase
<name: . space group: None. point group: None. proper point group: None. color: tab:blue>
Hexagonal alpha-titanium with a lattice and atoms
structure_ti = Structure(
lattice=Lattice(4.5674, 4.5674, 2.8262, 90, 90, 120),
atoms=[Atom("Ti", [0, 0, 0]), Atom("Ti", [1 / 3, 2 / 3, 1 / 2])],
)
print(structure_ti)
lattice=Lattice(a=4.5674, b=4.5674, c=2.8262, alpha=90, beta=90, gamma=120)
Ti 0.000000 0.000000 0.000000 1.0000
Ti 0.333333 0.666667 0.500000 1.0000
phase_ti = Phase(space_group=191, structure=structure_ti)
print(phase_ti)
print(phase_ti.structure)
<name: . space group: P6/mmm. point group: 6/mmm. proper point group: 622. color: tab:blue>
lattice=Lattice(base=array([[ 4.5674 , 0. , 0. ],
[-2.2837 , 3.95548443, 0. ],
[ 0. , 0. , 2.8262 ]]))
Ti 0.000000 0.000000 0.000000 1.0000
Ti 0.577350 0.577350 0.500000 1.0000
Total running time of the script: (0 minutes 1.200 seconds)
Estimated memory usage: 548 MB