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.
# Set up some imports that we will need
from pymatgen import Lattice, Structure
from pymatgen.analysis.diffraction.xrd import XRDCalculator
from IPython.display import Image, display
%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_xrd_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_xrd_plot(structure)
Compare it with the experimental XRD pattern below.
display(Image(filename=('./PDF - beta CsCl.png')))