This notebook shows how to plot an XRD plot for the two polymorphs of CsCl ($Pm\overline{3}m$ and $Fm\overline{3}m$). You can also use matgenie.py's diffraction command to plot an XRD pattern from a structure file.
# Uncomment the subsequent lines in this cell to install dependencies for Google Colab.
# !pip install pymatgen==2022.2.27
# Set up some imports that we will need
from IPython.display import Image, display
from pymatgen.analysis.diffraction.xrd import XRDCalculator
from pymatgen.core import Lattice, Structure
%matplotlib inline
Let's start with the typical $\alpha$ form of CsCl.
# Create CsCl structure
a = 4.209 # Angstrom
latt = Lattice.cubic(a)
structure = Structure(latt, ["Cs", "Cl"], [[0, 0, 0], [0.5, 0.5, 0.5]])
c = XRDCalculator()
c.show_plot(structure)
Compare it with the experimental XRD pattern below.
display(Image(filename=("./PDF - alpha CsCl.png")))
Let's now look at the $\beta$ (high-temperature) form of CsCl.
# Create CsCl structure
a = 6.923 # Angstrom
latt = Lattice.cubic(a)
structure = Structure(
latt,
["Cs", "Cs", "Cs", "Cs", "Cl", "Cl", "Cl", "Cl"],
[
[0, 0, 0],
[0.5, 0.5, 0],
[0, 0.5, 0.5],
[0.5, 0, 0.5],
[0.5, 0.5, 0.5],
[0, 0, 0.5],
[0, 0.5, 0],
[0.5, 0, 0],
],
)
c.show_plot(structure)
Compare it with the experimental XRD pattern below.
display(Image(filename=("./PDF - beta CsCl.png")))