Skip to content
LumenaryAcademy
Structure 70 min

X-ray diffraction

How waves scattered by a crystal reveal where its atoms are, from Bragg's law and structure factors to powder patterns, phase identification and electron and neutron diffraction.

Code tested · 6AI-draftedAwaiting review by a materials scientist

Your guides: Chloe · The Materials Scientist, Margaret · The Tester, Gideon · The Failure Analyst

MotivationH

Seeing atoms with waves

Crystal structures described iron as body-centred cubic with a lattice parameter of 0.28665 nm, and copper as face-centred cubic with 0.36149 nm. How does anyone know? Atoms are about 0.1 to 0.3 nm across. Visible light has wavelengths of 400 to 700 nm, thousands of times longer, and no lens can make it resolve detail that much finer than its wavelength. To see atoms you need a wave whose wavelength is about the size of the atoms.

X-rays are such a wave. In 1912 Max von Laue suggested that a crystal, with its atoms in a regular three-dimensional array, should act on X-rays as a ruled grating acts on light; Walter Friedrich and Paul Knipping shone X-rays through a copper sulfate crystal and found a pattern of sharp spots. Within a year William Henry Bragg and his son William Lawrence Bragg had turned the spots into a method: from the angles at which a crystal reflects X-rays you can work out the spacing of its planes of atoms, and from the strengths of the reflections, where the atoms sit. More than a century later, X-ray diffraction remains the first measurement made on almost every new solid, in industry and in research.

IntuitionH

Waves, interference and a crystal as a grating

When two waves of the same wavelength meet, they add. If their crests coincide, they are in phase and reinforce each other; if the crests of one meet the troughs of the other, they are out of phase and cancel. What decides which happens is the path difference: if one wave has travelled a whole number of wavelengths further than the other, they arrive in phase.

Each atom in an X-ray beam scatters a little of the wave in every direction, because the X-rays shake its electrons, which re-radiate. In almost every direction the wavelets from billions of atoms arrive with random phases and cancel. Only in special directions do they all arrive in phase and add up to a strong beam. Those directions are the diffraction peaks, and they depend only on the geometry of the lattice and the wavelength.

Analogy, not a formal construction

Hold a CD or DVD under a lamp and you see rainbow colours. The disc's tracks are a regular grating about a micrometre apart, close to the wavelength of visible light, and each colour is reinforced at a different angle. A crystal does the same for X-rays, with "tracks" a fraction of a nanometre apart, stacked in three dimensions. The analogy stops there: the disc reflects from one surface, while X-rays penetrate thousands of planes deep.

θθdP₁P₂ABincident X-raysdiffracted X-raysextra path AP₂ + P₂B = 2d sin θ
Bragg's picture of diffraction. X-rays arrive at angle θ to a set of parallel atomic planes a distance d apart, and leave at the same angle. The wave scattered by the lower plane travels an extra distance AP₂ + P₂B = 2d sin θ. When this equals a whole number of wavelengths, waves from all the planes add in phase.
DefinitionsH

Bragg's law

Theorem— Bragg's law

Radiation of wavelength λ\lambda falling on a family of lattice planes of spacing dd at a glancing angle θ\theta is reflected strongly when

nλ=2dsin⁡θn\lambda = 2d\sin\theta

for a whole number nn, the order of the reflection. The diffracted beam makes the same angle θ\theta with the planes, so it is deviated by 2θ2\theta from the incident beam.

Proof

Consider two parallel rays striking neighbouring planes at the points P1P_1 and P2P_2, with P2P_2 directly below P1P_1, as in the figure. Draw perpendiculars from P1P_1 to the lower ray's incoming and outgoing paths, meeting them at AA and BB. Up to the wavefront through P1P_1 and AA, and after the wavefront through P1P_1 and BB, the two rays travel equal distances. The extra distance is AP2+P2BAP_2 + P_2B. In the right-angled triangle P1AP2P_1 A P_2, the angle at P2P_2 between the plane normal and the ray is 90°−θ90° - \theta, so the angle at P1P_1 is θ\theta and AP2=dsin⁡θAP_2 = d\sin\theta; likewise P2B=dsin⁡θP_2B = d\sin\theta. The waves arrive in phase when 2dsin⁡θ=nλ2d\sin\theta = n\lambda. Every further plane adds the same path difference again, so waves from all the planes are then in phase.

∎

It is conventional to absorb the order into the indices: the nn-th order reflection from (hkl)(hkl) planes is treated as the first-order reflection from the planes (nh nk nl)(nh\,nk\,nl), with spacing d/nd/n. So the "(200) reflection" of a cubic crystal is the second order of (100), and Bragg's law is used as λ=2dhklsin⁡θ\lambda = 2d_{hkl}\sin\theta with dhkl=a/h2+k2+l2d_{hkl} = a/\sqrt{h^2 + k^2 + l^2} for a cubic crystal. Since sin⁡θ≤1\sin\theta \le 1, only planes with d>λ/2d > \lambda/2 can reflect at all.

The program computes the wavelengths of the three common probes (X-rays from a copper anode, electrons in a transmission electron microscope, and neutrons from a research reactor, using de Broglie's relation λ=h/p\lambda = h/p for the particles) and the angles at which each reflects from copper.

python
import numpy as np

h, c, e = 6.62607015e-34, 2.99792458e8, 1.602176634e-19     # SI
m_e, m_n = 9.1093837e-31, 1.67492750e-27                     # electron and neutron masses, kg

# Three probes and their wavelengths (nm)
lam_xray = 0.15406                                           # copper K-alpha-1 X-rays
V = 200e3                                                    # electrons accelerated through 200 kV
p_e = np.sqrt(2 * m_e * e * V * (1 + e * V / (2 * m_e * c**2)))   # relativistic momentum
lam_e = h / p_e * 1e9
E_n = 0.0253 * e                                             # a thermal neutron, 25.3 meV
lam_n = h / np.sqrt(2 * m_n * E_n) * 1e9
E_xray = h * c / (lam_xray * 1e-9) / e / 1e3
print(f"X-rays, Cu K-alpha-1:     lambda = {lam_xray:.5f} nm  (photon energy {E_xray:.2f} keV)")
print(f"electrons at 200 kV:      lambda = {lam_e:.5f} nm")
print(f"thermal neutrons, 25 meV: lambda = {lam_n:.5f} nm")

# Bragg's law for copper (FCC, a = 0.36149 nm): lambda = 2 d sin(theta)
a = 0.36149
print("\nplane   d/nm     2theta X-rays   2theta electrons   2theta neutrons")
for hkl in [(1, 1, 1), (2, 0, 0), (2, 2, 0), (3, 1, 1), (2, 2, 2), (4, 0, 0), (3, 3, 1), (4, 2, 0)]:
    d = a / np.sqrt(sum(i * i for i in hkl))
    cols = []
    for lam in (lam_xray, lam_e, lam_n):
        s = lam / (2 * d)
        cols.append(f"{2 * np.degrees(np.arcsin(s)):8.2f}" if s <= 1 else "   none ")
    print(f"({''.join(map(str, hkl))})  {d:.4f}      {cols[0]}         {cols[1]}         {cols[2]}")
print(f"\nX-rays of {lam_xray} nm can only reflect from planes with d > lambda/2 = {lam_xray / 2:.4f} nm")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Copper K-alpha X-rays (8.05 keV photons, 0.154 nm) and thermal neutrons (0.180 nm) both have wavelengths comparable to atomic spacings, so they diffract at large, easily measured angles. Electrons at 200 kV have a wavelength of only 0.0025 nm, sixty times shorter, and diffract at angles of about a degree; that is why electron diffraction patterns in a microscope look like flat grids of spots. Neutrons, with their longer wavelength, run out of reflections sooner: copper's (331) and (420) planes are too close together for them.

ComputationC

Why the peaks are sharp, and what their width tells you

Bragg's law says where the waves from successive planes are exactly in phase. But what happens slightly off the Bragg angle? With two planes, nothing dramatic: the waves are nearly in phase and still add well. With a thousand planes, each successive plane adds a small extra phase error, and by the five-hundredth plane the error has reached half a wavelength, so the second half of the crystal cancels the first. The more planes, the narrower the range of angles over which they all agree. The program adds up the waves from NN planes, with their phases, around copper's (111) reflection.

python
import numpy as np

lam = 0.15406                    # nm, Cu K-alpha-1
d = 0.36149 / np.sqrt(3)         # copper (111) spacing, nm
theta_B = np.arcsin(lam / (2 * d))

def intensity(two_theta_deg, N):
    """Waves scattered by N equally spaced planes, added with their phases; 1 = all in step."""
    theta = np.radians(two_theta_deg) / 2
    phase = 2 * np.pi * 2 * d * np.sin(theta) / lam          # phase step between planes
    n = np.arange(N)[:, None]
    amplitude = np.exp(1j * n * phase).sum(axis=0)
    return np.abs(amplitude) ** 2 / N**2

two_theta = np.linspace(38.0, 49.0, 22001)
print(f"Bragg angle for Cu (111): 2theta = {2 * np.degrees(theta_B):.3f} degrees\n")
print("  N planes   thickness L/nm   peak FWHM/deg   K = FWHM * L cos(theta) / lambda")
for N in [5, 10, 20, 50, 200]:
    I = intensity(two_theta, N)
    above = two_theta[I >= 0.5 * I.max()]
    fwhm = above.max() - above.min()
    L = N * d
    K = np.radians(fwhm) * L * np.cos(theta_B) / lam
    print(f"  {N:6}      {L:9.2f}         {fwhm:8.3f}          {K:.3f}")

# Two small pictures, one character per 0.2 degrees of 2theta from 36 to 51 degrees
grid = np.arange(36.0, 51.0, 0.2)
for N in [5, 20]:
    print(f"\nN = {N}:")
    I = intensity(grid, N)
    for level in [0.75, 0.5, 0.25, 0.05]:
        print("  " + "".join("#" if v >= level else " " for v in I))
    print("  " + "-" * len(grid))
print("  36" + " " * (len(grid) - 4) + "51  (2theta, degrees)")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The width of the peak is inversely proportional to the thickness LL of the diffracting crystal: the product (width in radians) × Lcos⁡θ/λL\cos\theta/\lambda settles at about 0.89. This is the Scherrer equation, β≈Kλ/(Lcos⁡θ)\beta \approx K\lambda/(L\cos\theta), with KK close to 0.9, published by Paul Scherrer in 1918. A crystal 200 planes (42 nm) thick gives a peak 0.2° wide; one only 10 nm thick gives 0.8°.

ExplanationH

The reciprocal lattice, in outline

Bragg's law treats one family of planes at a time. Crystallographers organise all of them at once with the reciprocal lattice.

Definition— reciprocal lattice

For a lattice with vectors a1,a2,a3\mathbf a_1, \mathbf a_2, \mathbf a_3, the reciprocal lattice vectors are

b1=2πa2×a3a1⋅(a2×a3),b2=2πa3×a1a1⋅(a2×a3),b3=2πa1×a2a1⋅(a2×a3),\mathbf b_1 = 2\pi\frac{\mathbf a_2 \times \mathbf a_3}{\mathbf a_1\cdot(\mathbf a_2\times\mathbf a_3)}, \quad \mathbf b_2 = 2\pi\frac{\mathbf a_3 \times \mathbf a_1}{\mathbf a_1\cdot(\mathbf a_2\times\mathbf a_3)}, \quad \mathbf b_3 = 2\pi\frac{\mathbf a_1 \times \mathbf a_2}{\mathbf a_1\cdot(\mathbf a_2\times\mathbf a_3)},

chosen so that ai⋅bj=2π\mathbf a_i \cdot \mathbf b_j = 2\pi if i=ji = j and 0 otherwise. The points Ghkl=hb1+kb2+lb3\mathbf G_{hkl} = h\mathbf b_1 + k\mathbf b_2 + l\mathbf b_3 form the reciprocal lattice.

Each reciprocal lattice point stands for one family of planes: Ghkl\mathbf G_{hkl} is perpendicular to the (hkl)(hkl) planes and its length is ∣Ghkl∣=2π/dhkl|\mathbf G_{hkl}| = 2\pi/d_{hkl}. Writing the incident and diffracted waves as wave vectors k\mathbf k and k′\mathbf k', of equal length 2π/λ2\pi/\lambda, diffraction occurs when

k′−k=Ghkl,\mathbf k' - \mathbf k = \mathbf G_{hkl},

the Laue condition. Taking lengths, ∣k′−k∣=2∣k∣sin⁡θ|\mathbf k' - \mathbf k| = 2|\mathbf k|\sin\theta, and this equation becomes 2sin⁡θ⋅2π/λ=2π/d2\sin\theta \cdot 2\pi/\lambda = 2\pi/d, which is Bragg's law again. Paul Ewald's construction makes the condition visual: draw a sphere of radius 2π/λ2\pi/\lambda through the origin of the reciprocal lattice; every reciprocal lattice point that touches the sphere gives a diffracted beam. Rotating the crystal rotates its reciprocal lattice through the sphere, and spots flash on and off.

ExplanationH

Structure factors and systematic absences

Bragg's law gives the positions of the peaks from the lattice alone. Their intensities depend on what is inside the unit cell: the basis. Each atom jj in the cell, at fractional coordinates (xj,yj,zj)(x_j, y_j, z_j), scatters with an amplitude fjf_j, the atomic scattering factor, roughly proportional to its number of electrons at small angles and falling at larger angles. Its wave arrives with a phase that depends on where it sits in the cell.

Definition— structure factor

The structure factor of the reflection (hkl)(hkl) is

Fhkl=∑jfj e2πi(hxj+kyj+lzj),F_{hkl} = \sum_{j} f_j\, e^{2\pi i (h x_j + k y_j + l z_j)},

summed over the atoms in one unit cell. The intensity of the reflection is proportional to ∣Fhkl∣2|F_{hkl}|^2.

For some reflections the waves from the atoms in the cell cancel exactly, and Fhkl=0F_{hkl} = 0 however strong the planes look. These systematic absences reveal the centring of the lattice.

Theorem— Absences in BCC and FCC

For a BCC cell of one element, with atoms at (0,0,0)(0,0,0) and (12,12,12)(\tfrac12,\tfrac12,\tfrac12), Fhkl=2fF_{hkl} = 2f when h+k+lh + k + l is even and 00 when it is odd. For an FCC cell, with atoms at (0,0,0)(0,0,0), (12,12,0)(\tfrac12,\tfrac12,0), (12,0,12)(\tfrac12,0,\tfrac12) and (0,12,12)(0,\tfrac12,\tfrac12), Fhkl=4fF_{hkl} = 4f when h,k,lh, k, l are all even or all odd, and 00 when they are mixed.

Proof

BCC: F=f(1+eπi(h+k+l))=f(1+(−1)h+k+l)F = f\left(1 + e^{\pi i (h + k + l)}\right) = f\left(1 + (-1)^{h+k+l}\right), which is 2f2f or 00. FCC: F=f(1+(−1)h+k+(−1)h+l+(−1)k+l)F = f\left(1 + (-1)^{h+k} + (-1)^{h+l} + (-1)^{k+l}\right). If h,k,lh, k, l have the same parity, every pairwise sum is even and F=4fF = 4f. If they are mixed, exactly one of the three pairs has the same parity, so exactly one of the three signs is +1+1 and two are −1-1, giving F=f(1+1−1−1)=0F = f(1 + 1 - 1 - 1) = 0.

∎

The program evaluates the sum directly for simple cubic, BCC, FCC and diamond, for every h2+k2+l2h^2 + k^2 + l^2 up to 16, and for two salts with the rock-salt structure.

python
import numpy as np
from itertools import product

def structure_factor(atoms, hkl):
    """F(hkl) = sum over the atoms in the cell of f_j exp(2 pi i (h x + k y + l z))."""
    return sum(f * np.exp(2j * np.pi * np.dot(hkl, xyz)) for f, xyz in atoms)

fcc_sites = [(0, 0, 0), (0.5, 0.5, 0), (0.5, 0, 0.5), (0, 0.5, 0.5)]
cells = {
    "SC": [(1, (0, 0, 0))],
    "BCC": [(1, (0, 0, 0)), (1, (0.5, 0.5, 0.5))],
    "FCC": [(1, s) for s in fcc_sites],
    "diamond": [(1, s) for s in fcc_sites] + [(1, (x + 0.25, y + 0.25, z + 0.25)) for x, y, z in fcc_sites],
}
# one representative (hkl) for each value of h^2 + k^2 + l^2 up to 16
reps = {}
for hkl in product(range(5), repeat=3):
    if hkl[0] >= hkl[1] >= hkl[2] and 0 < sum(i * i for i in hkl) <= 16:
        reps.setdefault(sum(i * i for i in hkl), hkl)
print(" N=h2+k2+l2  hkl     |F|/f:   SC   BCC   FCC  diamond")
for N in sorted(reps):
    hkl = reps[N]
    row = [abs(structure_factor(cells[s], hkl)) for s in cells]
    print(f"   {N:3}      ({''.join(map(str, hkl))})        " + "  ".join(f"{v:4.1f}" for v in row))
print("(N = 7 and N = 15 cannot be written as a sum of three squares, so no plane has them)")

# Rock salt: Na+ (10 electrons) on the FCC sites, Cl- (18 electrons) shifted by (1/2, 0, 0).
# Approximating f by the number of electrons (the forward-scattering limit):
def rock_salt(f_cation, f_anion):
    return [(f_cation, s) for s in fcc_sites] + [(f_anion, (x + 0.5, y, z)) for x, y, z in fcc_sites]
print("\n         |F(111)|  |F(200)|  ratio of intensities I(111)/I(200), ignoring other factors")
for name, fc, fa in [("NaCl", 10, 18), ("KCl", 18, 18)]:
    F111, F200 = abs(structure_factor(rock_salt(fc, fa), (1, 1, 1))), abs(structure_factor(rock_salt(fc, fa), (2, 0, 0)))
    print(f"  {name}   {F111:7.1f}  {F200:8.1f}    {F111**2 / F200**2:.3f}")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

So a BCC metal shows reflections with h2+k2+l2=2,4,6,8,10,12,14,16,…h^2 + k^2 + l^2 = 2, 4, 6, 8, 10, 12, 14, 16, \ldots, an FCC metal 3,4,8,11,12,16,…3, 4, 8, 11, 12, 16, \ldots, and diamond-structure silicon loses the FCC reflections with all indices even and h+k+lh + k + l not divisible by 4, such as (200) and (222). The rock-salt lines show the basis at work: in NaCl the odd reflections such as (111) depend on the difference fCl−fNaf_{\text{Cl}} - f_{\text{Na}} and are weak, and in KCl, where K⁺ and Cl⁻ both have 18 electrons, they almost vanish, so that KCl's X-ray pattern looks like that of a simple cubic crystal with half the lattice parameter.

A beautiful consequence: the allowed reflections of an FCC lattice (all odd or all even indices) themselves form a body-centred cubic arrangement in reciprocal space, and those of BCC form a face-centred one. The reciprocal of FCC is BCC, and vice versa.

ComputationC

A powder pattern, and identifying a phase

Most diffraction in materials science is done on powders or polycrystalline solids: millions of small crystals in every orientation. For every family of planes, some crystals are always oriented to satisfy Bragg's law, so each reflection becomes a cone of diffracted rays, recorded as a peak at its 2θ2\theta by a detector swinging round the sample. The intensity of each peak is, approximately,

Ihkl∝mhkl ∣Fhkl∣2 1+cos⁡22θsin⁡2θcos⁡θ,I_{hkl} \propto m_{hkl}\,|F_{hkl}|^2\,\frac{1 + \cos^2 2\theta}{\sin^2\theta\cos\theta},

where the multiplicity mhklm_{hkl} counts the symmetry-equivalent planes that reflect at the same angle (eight for {111}\{111\} in a cubic crystal, six for {100}\{100\}), and the last factor, the Lorentz-polarisation factor, accounts for the geometry of the measurement and the polarisation of the scattered X-rays. The program simulates the patterns of copper and α-iron with copper K-alpha radiation, then identifies an unknown metal from a list of peak positions.

python
import numpy as np
from itertools import product

lam = 0.15406                                     # nm, Cu K-alpha-1
bases = {"BCC": [(0, 0, 0), (0.5, 0.5, 0.5)],
         "FCC": [(0, 0, 0), (0.5, 0.5, 0), (0.5, 0, 0.5), (0, 0.5, 0.5)]}

def powder_pattern(structure, a, two_theta_max=120):
    """Peaks (2theta, relative intensity, hkl) of a cubic element. Intensity = multiplicity
    x |F|^2 x Lorentz-polarisation factor, with a constant atomic scattering factor."""
    peaks = {}
    for hkl in product(range(-6, 7), repeat=3):
        N = sum(i * i for i in hkl)
        if N == 0:
            continue
        F = sum(np.exp(2j * np.pi * np.dot(hkl, xyz)) for xyz in bases[structure])
        s = lam * np.sqrt(N) / (2 * a)               # sin(theta) from Bragg's law
        if abs(F) < 1e-6 or s > 1:
            continue
        theta = np.arcsin(s)
        if 2 * np.degrees(theta) > two_theta_max:
            continue
        lp = (1 + np.cos(2 * theta) ** 2) / (np.sin(theta) ** 2 * np.cos(theta))
        key = round(2 * np.degrees(theta), 4)        # all (hkl) with the same N share one peak
        label = "".join(map(str, sorted(map(abs, hkl), reverse=True)))
        peak = peaks.setdefault(key, [0.0, label])
        peak[0] += abs(F) ** 2 * lp                   # summing over all (hkl) counts the multiplicity
    top = max(p[0] for p in peaks.values())
    return [(tt, 100 * p[0] / top, p[1]) for tt, p in sorted(peaks.items())]

for name, structure, a in [("copper", "FCC", 0.36149), ("alpha-iron", "BCC", 0.28665)]:
    print(f"{name} ({structure}, a = {a} nm), Cu K-alpha-1:")
    for tt, I, hkl in powder_pattern(structure, a):
        print(f"   2theta = {tt:7.2f}   ({hkl})   I = {I:5.1f}")

# Identifying an unknown cubic metal from seven peak positions (simulated data, degrees)
measured = np.array([40.26, 58.25, 73.19, 87.00, 100.63, 114.93, 131.17])
s2 = np.sin(np.radians(measured / 2)) ** 2           # proportional to h^2 + k^2 + l^2
print("\nunknown: sin^2(theta) / sin^2(theta_1) =", np.round(s2 / s2[0], 3))
allowed = {"SC": [1, 2, 3, 4, 5, 6, 8], "BCC": [2, 4, 6, 8, 10, 12, 14], "FCC": [3, 4, 8, 11, 12, 16, 19]}
for name, N in allowed.items():
    N = np.array(N)
    mismatch = np.max(np.abs(s2 / s2[0] - N / N[0]))
    a_est = lam / 2 * np.sqrt(N / s2)                 # Bragg's law with d = a / sqrt(N)
    print(f"  as {name:3}: worst ratio mismatch {mismatch:.3f}; a = {a_est.mean():.4f} +- {a_est.std():.4f} nm")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.
1112002203112224001102002112203104060801001202θ (degrees), Cu K-alphacopper (FCC)α-iron (BCC)
Simulated powder patterns of copper (FCC, top) and α-iron (BCC, bottom) with copper K-alpha radiation, drawn from the program's output. The FCC pattern shows its characteristic close pair (111) and (200); the BCC pattern has more evenly spaced peaks. Intensities assume a constant atomic scattering factor, so the high-angle peaks are drawn stronger than a real measurement shows.

The two patterns are easy to tell apart. FCC gives a close pair of peaks, (111) and (200), whose sin⁡2θ\sin^2\theta values are in the ratio 3 : 4; BCC gives (110) and (200) in the ratio 2 : 4. That is the basis of indexing: since sin⁡2θ=(λ2/4a2)(h2+k2+l2)\sin^2\theta = (\lambda^2/4a^2)(h^2 + k^2 + l^2) for a cubic crystal, the ratios of sin⁡2θ\sin^2\theta values must match the allowed sequence of h2+k2+l2h^2 + k^2 + l^2.

For the unknown, the ratios are 1 : 2 : 3 : 4 : 5 : 6 : 7, which matches BCC (2, 4, 6, …, 14) and nothing else, giving a=0.3165a = 0.3165 nm. Among BCC metals, that is tungsten. With only six peaks, simple cubic (1, 2, 3, 4, 5, 6) would have fitted just as well; the seventh peak decides it, because 7 cannot be a sum of three squares, while 14 can.

Molybdenum, also BCC with a=0.3147a = 0.3147 nm, would put its peaks only 0.25° to 0.5° higher, and a sample surface a fraction of a millimetre out of position shifts peaks by tenths of a degree too. So careful work mixes in an internal standard with a certified lattice parameter, such as NIST's silicon powder, and identification also uses relative intensities and chemistry, not peak positions alone.

Real phase identification works the same way, but against a database. The analyst measures a pattern, the software extracts the peak positions and intensities, and a search–match program compares them with hundreds of thousands of reference patterns: the commercial Powder Diffraction File of the International Centre for Diffraction Data, or patterns computed from open structures in the Crystallography Open Database. Mixtures are routine: a corrosion product, a cement clinker or a battery cathode after cycling may contain five phases, and the relative peak intensities give their proportions. Hugo Rietveld's 1969 method refines a whole structural model (lattice parameters, atomic positions, phase fractions, crystallite sizes) until the computed pattern matches every point of the measured one; Rietveld refinement is now the standard way to get quantitative answers from a powder.

ExplanationH

Electron and neutron diffraction

X-rays scatter from electrons, so heavy atoms dominate and hydrogen is nearly invisible. Two other probes complement them.

Electrons are charged and interact with matter far more strongly than X-rays, by several orders of magnitude. A transmission electron microscope can record a diffraction pattern from a region tens of nanometres across, one grain or one precipitate, and switch at once to an image of the same region (Microscopy). Low-energy electron diffraction (LEED) probes only the top few atomic layers and is the standard tool of surface science. Since the late 2010s, three-dimensional electron diffraction (3D ED, also called microED) has solved the structures of crystals far too small for X-rays, including pharmaceuticals and zeolites. The price of the strong interaction is that electrons scatter several times inside the sample, which makes intensities harder to interpret.

Neutrons are uncharged and scatter from nuclei, with strengths that vary irregularly from element to element and even between isotopes. Hydrogen (better, deuterium) and lithium, nearly invisible to X-rays, are clearly seen, which matters for hydrogen-storage materials and battery cathodes. Oxygen next to a heavy metal is far easier to locate. And because the neutron has a magnetic moment, it diffracts from ordered magnetic moments: in 1949 Clifford Shull and colleagues used it to show directly the antiparallel spins of antiferromagnetic manganese oxide (Magnetic materials). Neutrons penetrate centimetres of metal, so engineers use them to measure residual stresses deep inside welds and turbine discs, from the tiny shifts of dd that stress causes. The drawback is that neutron sources are large national facilities and their beams are weak, so samples must be big.

ProbeScatters fromTypical wavelengthStrengthsLimits
X-rayselectrons0.05–0.2 nmlaboratory instruments everywhere; precise; quantitativelight atoms weak; neighbours in the periodic table hard to tell apart
Electronselectrostatic potential0.002–0.004 nm (TEM)nanometre regions; combined with imaging; surfaces (LEED)multiple scattering; vacuum; beam damage
Neutronsnuclei and magnetic moments0.05–0.5 nmlight atoms, isotopes, magnetism, deep penetrationlarge facilities; weak beams; big samples
History & global context

The Braggs and a century of crystallography

Wilhelm Röntgen discovered X-rays in 1895, but for seventeen years nobody knew whether they were waves or particles. The 1912 experiment of Friedrich, Knipping and von Laue settled it (waves) and proved at the same stroke that crystals are regular arrays of atoms. In 1913 the Braggs, father and son, built an X-ray spectrometer, measured reflection angles, and solved the first crystal structures: sodium chloride, which showed that the salt contains no NaCl molecules, only an array of ions, and diamond, with its tetrahedral network. Lawrence Bragg was 25 when the two shared the 1915 Nobel Prize in Physics, and he is still the youngest laureate in physics.

Crystallography then spread into every science, with many of its greatest results coming from women and from laboratories all over the world. Kathleen Lonsdale showed in 1929 that the benzene ring is flat. Dorothy Crowfoot Hodgkin solved the structures of penicillin, vitamin B12 and insulin, and received the 1964 Nobel Prize in Chemistry. Rosalind Franklin and Raymond Gosling's diffraction images of DNA were decisive evidence for the double helix. In India, G. N. Ramachandran worked out the triple helix of collagen and gave biochemistry the Ramachandran plot. In 1982 Dan Shechtman, working at what is now NIST, recorded an electron diffraction pattern with tenfold symmetry from a rapidly cooled aluminium–manganese alloy: a symmetry no periodic crystal can have. These quasicrystals, ordered but not periodic, were doubted for years and earned him the 2011 Nobel Prize in Chemistry; they forced the International Union of Crystallography to redefine a crystal as any solid with an essentially sharp diffraction pattern.

ExplanationH

The professional view

A laboratory powder diffractometer measures a pattern in minutes to hours and is found in every materials, geology, pharmaceutical, cement and battery laboratory. For harder problems, crystallographers travel to synchrotrons, whose X-ray beams are billions of times brighter: among them the ESRF in France, the Advanced Photon Source in the United States, SPring-8 in Japan, Diamond in the United Kingdom, PETRA III in Germany, Sirius in Brazil and the Shanghai Synchrotron Radiation Facility, with new fourth-generation sources such as MAX IV in Sweden and HEPS in China. There, a pattern takes milliseconds, so a battery can be watched while it charges or a weld while it solidifies. X-ray free-electron lasers (LCLS, European XFEL, SACLA, SwissFEL, PAL-XFEL) produce femtosecond pulses that capture structures before the sample is destroyed. Neutron work happens at reactors and spallation sources such as the ILL in France, ISIS in the United Kingdom, the SNS in the United States, J-PARC in Japan and CSNS in China, with the European Spallation Source being completed in Sweden.

Analysis is done in software: open-source packages such as GSAS-II and FullProf, commercial ones from instrument makers, and for quick reference patterns, libraries such as pymatgen. For example (not run here; it needs pymatgen):

python
# Not run here: needs pymatgen (pip install pymatgen)
from pymatgen.core import Lattice, Structure
from pymatgen.analysis.diffraction.xrd import XRDCalculator

cu = Structure.from_spacegroup("Fm-3m", Lattice.cubic(3.6149), ["Cu"], [[0, 0, 0]])
pattern = XRDCalculator(wavelength="CuKa").get_pattern(cu, two_theta_range=(30, 120))
for two_theta, intensity, hkls in zip(pattern.x, pattern.y, pattern.hkls):
    print(f"{two_theta:7.2f}  {intensity:6.1f}  {hkls[0]['hkl']}")

Unlike our simulation, such software uses tabulated atomic scattering factors that fall off with angle, and thermal vibration factors, so its high-angle peaks are much weaker than ours, as real ones are.

Common misconceptionsH

Common misconceptions

Misconception

"Bragg reflection is a reflection from a mirror-like surface of atoms." The planes are mathematical; the scattering is from every atom, and the reflection is built up from thousands of planes deep inside the crystal. Unlike a mirror, a crystal reflects only at the exact Bragg angles.

Misconception

"If a reflection is missing, the planes must not exist." The (100) planes of a BCC crystal certainly exist, but halfway between them lies an identical plane of body-centre atoms, scattering exactly out of phase. Absences come from cancellation, and they are the most direct evidence of the lattice centring.

Misconception

"Diffraction tells you the positions of the atoms directly." It tells you the magnitudes ∣Fhkl∣|F_{hkl}| but not their phases, and both are needed to reconstruct the electron density. This phase problem is solved indirectly: by trial models, by statistical "direct methods" (for which Herbert Hauptman and Jerome Karle shared the 1985 Nobel Prize in Chemistry), or by adding heavy atoms or using anomalous scattering.

Misconception

"Broad peaks mean a bad measurement." They may, but they may also be the most interesting result in the pattern: nanometre-sized crystallites, strain from defects, or stacking faults. Every instrument also has its own small width, measured with a well-crystallised standard and subtracted before conclusions are drawn.

Exercises

Exercises

1. X-ray diffraction

Warm-upHuman

Why can a crystal diffract X-rays into sharp beams, while it cannot do the same for visible light?

Choose one

2. X-ray diffraction

CoreHuman

Aluminium is FCC with a=0.40495a = 0.40495 nm. At what angle 2θ2\theta does its (111) reflection appear with copper K-alpha-1 radiation (λ=0.15406\lambda = 0.15406 nm)? Give 2θ2\theta in degrees, rounded to the nearest whole degree.

3. X-ray diffraction

CoreHuman

Which of these reflections appear in the diffraction pattern of an FCC metal such as copper? Select all that apply.

Choose all that apply

4. X-ray diffraction

CoreHuman

A powder of gold nanoparticles gives a (111) peak at 2θ=38.18°2\theta = 38.18° with copper K-alpha-1 radiation (λ\lambda = 0.15406 nm). After the instrument's own broadening is removed, the peak's full width at half maximum is 0.50°0.50°. Using the Scherrer equation L=Kλ/(βcos⁡θ)L = K\lambda/(\beta\cos\theta) with K=0.9K = 0.9, estimate the crystallite size LL in nanometres, to the nearest whole number.

5. X-ray diffraction

CoreHuman

You need to find exactly where the lithium ions sit in a lithium iron phosphate battery cathode, in a sample of several grams. Which probe is best suited?

Choose one

6. X-ray diffraction

CoreComputational

Write structure_factor(atoms, hkl) that returns the structure factor Fhkl=∑jfj e2πi(hxj+kyj+lzj)F_{hkl} = \sum_j f_j\, e^{2\pi i(hx_j + ky_j + lz_j)} as a Python complex. atoms is a list of (f, (x, y, z)) with fractional coordinates, and hkl a tuple of three integers. Use the cmath module.

The tests check BCC and FCC absences, diamond's (111) and (222), and caesium chloride, where Cs⁺ (54 electrons) and Cl⁻ (18) make (100) weak but present.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

7. X-ray diffraction

StretchComputational

Write identify_cubic(two_theta, wavelength) that takes the first seven peak positions 2θ2\theta (in degrees, ascending) of an element with a cubic structure, and the wavelength in nm, and returns (structure, a): structure is one of "SC", "BCC", "FCC", "diamond", and a is the lattice parameter in nm.

Method: for each structure, list its allowed values of N=h2+k2+l2N = h^2 + k^2 + l^2 in increasing order; compare the measured ratios sin⁡2θi/sin⁡2θ1\sin^2\theta_i/\sin^2\theta_1 with Ni/N1N_i/N_1; choose the structure whose ratios match best, and estimate aa from Bragg's law, a=(λ/2)Ni/sin⁡2θia = (\lambda/2)\sqrt{N_i/\sin^2\theta_i}, averaged over the peaks. The tests use aluminium, tungsten, silicon, polonium, and iron with small measurement errors.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Further reading and resources