Learning Objectives
Section 3.5 (Bloch's theorem) told us where diffraction peaks can appear: only at reciprocal-lattice points . That is the geometry. But every real crystal contains more than one atom per unit cell — and the waves scattered by those atoms interfere. Some of the geometrically-allowed peaks come out bright, some come out dim, and some come out perfectly dark. The single number that controls all of that is the structure factor . By the end of this section you will be able to:
- Write the structure-factor sum and explain every piece — the form factor , the fractional coordinates , and why the exponent has a factor of .
- Read a structure factor as a sum of vectors in the complex plane — one arrow per atom — and recognise destructive interference as the arrows cancelling head-to-tail.
- Derive by hand the famous selection rules: simple cubic allows everything, BCC kills odd, and FCC allows only all-even or all-odd .
- Connect to the intensity an X-ray or neutron detector records, and understand why a powder diffractogram of FCC copper has the iconic sequence.
- Compute structure factors in a few lines of NumPy and locate where VASP uses exactly the same sum (in PAW projectors and in the charge density's Fourier components on the FFT grid).
One-line preview: the reciprocal lattice tells you where the spots can sit; the structure factor tells you how brightly each one shines. Together they are the diffraction pattern.
From Where to How Bright
Bragg's condition, , is a statement about angles. Equivalently, a peak occurs whenever the scattering wavevector coincides with a reciprocal-lattice vector . So far so good — but Bragg never asked how strong that peak is. It just says "it is allowed at this angle."
Imagine you doubled the crystal's unit cell by sliding a copy of every atom by half a lattice vector. Bragg's geometry would not notice — the lattice still has the same spacing. Yet, for a symmetrically-placed atom, half of the spots that Bragg allows would suddenly disappear. Real crystals do this all the time: BCC iron, FCC copper, the two-atom basis of diamond, the Na/Cl basis of rock salt. The geometry is fixed by the lattice, but the brightness is fixed by where the atoms sit inside the cell.
The 30-second mental model
Think of every atom as a tiny radio antenna, broadcasting an outgoing spherical wave whose strength is its form factor and whose phase depends on where the atom sits. At a chosen reflection , the detector sees the sum of all those waves. Sometimes they add up; sometimes they cancel. The structure factor is just that sum, written as a single complex number.
Laue, Bragg, and the Ewald Sphere
Before we count the brightness of peaks, let's nail down where they sit — geometrically, with no algebra hiding behind the curtain. There are three statements of the diffraction condition, all saying the same thing. Once you see them as one picture, the rest of the chapter clicks into place.
1. Elastic scattering — the magnitude rule
An X-ray (or electron, or neutron) photon comes in with wavevector of magnitude . It scatters elastically — energy in equals energy out — so the outgoing wavevector has the same magnitude as the incoming one: . That single sentence is what makes the geometry sit on a sphere.
2. The Laue condition — direction is locked to G
The crystal can only re-route the photon by exchanging momentum with the lattice. The lattice can only absorb momenta that are reciprocal vectors (Section 3.2 told us why: any other momentum-kick would average to zero across the periodic potential). So the change in wavevector, , must be a reciprocal-lattice vector:
This is the Laue condition. It is the diffraction rule a physicist would write down — short, vector, reciprocal-space.
3. Bragg's law — angle and plane spacing
A crystallographer would prefer to talk about planes of atoms with spacing reflecting an X-ray like a mirror. Path length adds up constructively when the extra round-trip distance equals an integer number of wavelengths, giving the Bragg law:
Here is the angle between the incoming beam and the (hkℓ) plane. The two formulations look nothing alike — one is in reciprocal space with vectors, the other is in real space with a triangle and a sine. We will now show they are literally the same equation.
From Laue to Bragg — three lines
Start from the Laue condition . Square both sides and use elastic scattering :
Divide by and read the dot product as a cosine of the angle between and :
Now is perpendicular to the (hkℓ) plane, so the angle between the beam and the plane is . That gives , and substituting and yields
Bragg's law falls out of the Laue condition with nothing more than "the magnitudes are equal." The n on the right of is absorbed into the choice of : a reflection from the nth-order plane stack is the same thing as a reflection from on the (hkℓ) plane stack. One picture, two languages.
Why the d-spacing formula is d = 2π/|G|
A reciprocal-lattice vector is normal to the family of (hkℓ) planes (we will prove this in a moment in §3.2 if you have not seen it yet). The plane closest to the origin sits at a perpendicular distance from the origin. The plane equation, in the form , says that any on the plane projects to the same length along . The next plane along is at , and so on, so the phase pickup from one plane to the next is . For all planes to scatter in phase, this phase must be a multiple of , giving , i.e. . This is the bridge between crystallography (planes) and physics (reciprocal vectors).
The Ewald sphere — the geometry, finally drawn
The two boxed equations share an answer; how do you actually find which (hkℓ) lights up for a given crystal orientation and wavelength? Ewald's 1913 trick was to draw the picture on the same diagram as the reciprocal lattice. The recipe is four steps:
- Draw the reciprocal lattice as a forest of points, with the origin O at the (000) point.
- Pick the incident wavevector and place its tip at O. Call its tail L (the "lab" point).
- Draw a sphere of radius centred at L. This is the Ewald sphere.
- Every reciprocal-lattice point that lies on the surface of this sphere is a Bragg peak. The outgoing beam goes from L to that point, automatically with the right magnitude (it is a sphere radius!) and with .
The widget below is exactly that recipe in 2D (so the "sphere" is a circle and the lattice is a grid). Slide the wavelength to grow or shrink the circle, slide the crystal angle to roll it around the origin, and watch the Bragg peaks switch on whenever a grid point hits the curve. The orange L moves on a circle of radius around the white O, and the highlighted reflection's panel lists , and the Bragg angle — verifying in real time.
The Ewald construction — drag the wavelength and the beam direction
3 G on the sphereReciprocal lattice = grey grid of points G = (h, k). Incident beam k_in points from L (orange) into the origin O. The cyan circle (the 2-D Ewald sphere) has centre L and radius |k_in|. Any reciprocal-lattice point that sits on the circle is a Bragg peak: a scattered beam k_out = k_in + G comes out from L through that point. Move the sliders and watch peaks light up.
- ━ kin (incident beam) and the Ewald circle, radius |kin|
- ━ kout for the highlighted G — same length as kin
- - - G = kout − kin (the Laue vector)
- ● Bragg-allowed point (on the circle) · ● not currently in diffracting condition
- Crank |kin| up — the circle bulges outward and reaches more (h, k).
- Sweep the angle slider — the circle rolls around O and the reflections that switch on are exactly the ones a rotating crystal would record.
- Note that O = (0, 0) always sits on the circle (the forward beam, undeviated, kout = kin).
What the slider taught you
A fixed wavelength on a fixed crystal generally puts only a handful of G-points exactly on the Ewald sphere — that is why a single-crystal X-ray photo shows isolated spots, not all the allowed (hkℓ) at once. To collect them all, experiments either (a) rotate the crystal so the sphere sweeps through reciprocal space (rotating-crystal method), (b) use a continuous band of wavelengths so the sphere's radius spans a range and many points are caught (Laue method), or (c) grind the crystal into a powder so reciprocal vectors of fixed length appear in every direction — Debye–Scherrer rings (powder method).
Connecting back to ENCUT and KPOINTS
The same sphere appears inside VASP, just dressed differently. The plane-wave basis (Section 3.5 and §4.9) keeps every with — that is a sphere in reciprocal space, centred at , of radius . It is not an Ewald sphere (no diffraction is happening), but it is the same geometric construction: pick a centre in reciprocal space, draw a ball around it, keep the lattice points inside (or on) it. Once you have the Ewald picture, you have the mental machinery for every sphere-in-reciprocal-space construction in the rest of the book.
A Two-Atom Thought Experiment
Forget 3D for a moment. Picture a 1D chain of unit cells of length . Each cell contains two identical atoms — one at the origin and one at fractional position . The reciprocal lattice has the familiar points . What is the scattered amplitude at ?
The wave reaching the detector from the corner atom has phase 0 (we set the origin there). The wave from the second atom is delayed by . With both atoms having amplitude , the total amplitude is
Two arrows of length , one at angle 0 and one at angle . When the two arrows point the same way, they double up: . When they point exactly opposite — i.e. when , or equivalently — they cancel exactly: . Pick (the BCC analogue): every odd reflection vanishes. We just discovered systematic absences with two atoms and one slider.
Hold this picture
For the rest of the section, every structure-factor calculation is this same picture, repeated for more atoms and three spatial axes. The complex number is just a compact bookkeeping device for adding up arrows.
The Structure Factor — Definition and Anatomy
Generalising the 1D toy: write each atom's fractional position as and the reciprocal-lattice vector as . Using the duality from Section 3.2, the dot product collapses beautifully:
With that in hand, the structure factor is
Five symbols, but every one of them earns its place. Let's read the equation aloud once:
| Symbol | What it is | Why it is here |
|---|---|---|
| F(hkℓ) | Complex amplitude of the (hkℓ) reflection. | What we want — the brightness and phase of one diffraction spot. |
| Σⱼ | Sum over every atom in the unit cell. | Every atom is a wave source; the detector sees the sum of those waves. |
| fⱼ | Atomic form factor of atom j. | Tells us how strong an antenna atom j is — bigger atoms scatter more. |
| (xⱼ, yⱼ, zⱼ) | Fractional coordinates of atom j. | Where the antenna sits inside the cell. Drives the phase via 2π(h·x+k·y+ℓ·z). |
| exp[2πi(...)] | Phase factor. | Encodes the path-length difference between this atom and the origin. |
| (h, k, ℓ) | Miller indices = which reciprocal-lattice point. | Selects which spot on the diffractogram we are evaluating. |
Two conventions, one sum
Some books absorb the into the reciprocal-lattice vector and write . Others (mostly crystallographers) factor it out and write with fractional coordinates. Both are the same number. Use the second form when you have a list of fractional positions in a POSCAR — the shows up exactly once.
Atomic Form Factor — Why Heavy Atoms Glow Brighter
The number is itself a function of the scattering vector . It is the Fourier transform of atom 's electron density :
At the integral just counts electrons: , the atomic number. So carbon has at low angle, lead has ; with X-rays, lead overwhelms carbon by a factor of in intensity. As grows the electron cloud is no longer well-resolved and falls off — that is why diffraction patterns fade at large .
Three flavours of f, one formula
For X-rays, is the electron-density Fourier transform above. For neutrons it is replaced by a near-constant nuclear scattering length (nuclei are tiny — point-like compared to a wavelength). For electrons it is the Fourier transform of the electrostatic potential. The structure-factor sum looks identical in all three; only the meaning of changes.
For most of this section we treat the form factors as constants — the cancellations we want to expose are geometric and depend only on the atomic positions. We will revisit the angle dependence when we compute powder patterns numerically in Chapter 6.
Interactive — Drag Atoms, Watch the Pattern
The visualiser below puts a 2D structure factor in front of you. The unit cell on the left has two atoms; you can drag them anywhere within the cell and tweak each form factor. The right panel is the resulting diffraction pattern: a 7×7 grid of reciprocal-lattice points , with the radius of each yellow spot proportional to . Click any spot to see its phase decomposition — two arrows in the complex plane (sky for atom 1, amber for atom 2) summed head-to-tail to produce the green total.
Each atom contributes a complex number of length fj and angle 2π(h·xj + k·yj). The structure factor F(h,k) is their head-to-tail sum. When the two arrows point opposite ways and have equal length, they cancel — that spot goes dark. That is a systematic absence.
Three experiments to run before moving on:
- Hit the Simple preset (only one atom). Every spot is the same size — pure lattice, no interference.
- Hit BCC-like (atoms at and ). Watch the spots with odd vanish. Click one — the two arrows point opposite ways and cancel exactly. That is the systematic-absences rule made visible.
- Switch to Heavy + light. Now the two arrows have unequal lengths, so they can never quite cancel — the "forbidden" spots come back, dimly. This is exactly what happens for ordered binary alloys like Cu3Au or rock salt.
Pedagogical anchor: if you can predict the pattern before you drag, you understand structure factors. The rest of this section is just turning that visual intuition into a 3D formula and a few lines of code.
Worked Example 1 — Simple Cubic
One atom per cell at . The sum has exactly one term:
Every reciprocal-lattice point is allowed and every spot has the same intensity (modulo the angle-dependence of ). The simple-cubic powder pattern is a clean ladder of peaks at .
Worked Example 2 — BCC and the First Forbidden Peak
BCC has a two-atom basis on the conventional cube: corner at and body-centre at .
The structure factor is
The key observation: equals for even and for odd . So
| h + k + ℓ | F(hkℓ) | Allowed? |
|---|---|---|
| even | f · (1 + 1) = 2f | ✓ allowed (intensity ∝ 4f²) |
| odd | f · (1 − 1) = 0 | ✗ forbidden (perfect cancellation) |
That single line — half of the spots Bragg permits actually disappear — is the defining experimental signature of BCC. The very first peak in the iron powder pattern is , not ; is killed because is odd. Without structure factors you would predict a peak that experiments never see.
Re-derive on the interactive
Open the BCC-like preset above. Click : the two arrows are antiparallel — exact cancellation. Click : the arrows are aligned — full amplitude. The 2D version of the same rule.
Worked Example 3 — FCC's All-Same-Parity Rule
FCC has four atoms per conventional cube at . The sum factorises:
Three sub-cases cover everything:
- All three of have the same parity (all even or all odd) ⇒ each pairwise sum , , is even ⇒ every exponential is ⇒ (intensity ).
- Mixed parity (one odd among two evens, or one even among two odds) ⇒ exactly two pairwise sums are odd ⇒ . Forbidden.
The famous powder fingerprint of FCC copper is therefore — hit any university X-ray lab and you will see exactly this sequence on aluminum foil and copper coins.
A subtle catch
The four-atom basis above lives on the conventional cubic cell. If you instead work with the primitive rhombohedral FCC cell, there is only one atom per cell ⇒ for every primitive . No spots are forbidden! The reason the conventional indexing has absences is that the conventional cell is four times larger — it contains fictitious reciprocal-lattice points that do not actually correspond to primitive reciprocal vectors. They "turn off" through the structure factor. The two pictures are completely consistent.
Worked Example 4 — NaCl, Where Cancellations Are Almost Perfect
Rock salt is FCC with a two-element basis: Na at and Cl at , plus the FCC face-centre translations applied to both. Carrying out the sum:
The right bracket is the FCC factor (4 if all-same-parity, 0 otherwise). The left bracket is for even and for odd . Three regimes appear:
| Reflection class | F | What it tells you |
|---|---|---|
| All-even, e.g. (200), (400) | 4 (f_Na + f_Cl) | Strong: both species add. Driven by the average density. |
| All-odd, e.g. (111), (311) | 4 (f_Na − f_Cl) | Weak but non-zero: difference of form factors. The signature of an ordered binary basis. |
| Mixed parity, e.g. (100), (110) | 0 | Forbidden by the FCC face-centre rule — the basis cannot rescue them. |
The weak odd reflections of NaCl famously vanish to first approximation when , which is why early diffraction data on KCl (whose form factors are nearly equal) looked like simple cubic instead of FCC — a beautiful historical puzzle that the structure factor solved.
From |F|² to a Real Diffraction Pattern
What a detector counts at the spot is, in the kinematical approximation,
The structure factor gives the chemistry. The other factors are pure geometry/statistics: the Lorentz factor, the polarisation factor, the multiplicity (how many symmetry-equivalent share the same -spacing in a powder), and the Debye-Waller factor that damps peaks at high angle because thermal vibration smears the atomic positions.
For the rest of this book, when we say "intensity" for a single-crystal calculation we will mean alone. The geometric corrections are handled by the powder-pattern simulator and never change the absent/present pattern — only the relative magnitudes of the present ones.
Computing Structure Factors in Python
Every formula in this section fits in twelve lines of NumPy. Below the code panel is the running execution trace — click any line on the right to see exactly what its variables hold. The example computes the first six FCC reflections and prints the allowed/forbidden verdict for each.
Notice how short the function is. The whole concept — atoms scatter, their waves interfere, take the squared modulus — collapses into four real lines (the loop body plus the return). Every diffraction pattern you will ever fit is built from this primitive.
Structure Factors Inside VASP
VASP does not ship a button labelled "structure factor," but the same sum is hidden inside three of its most heavily-used routines:
- PAW projector setup. The non-local part of every pseudopotential is applied in reciprocal space via — exactly the structure-factor sum, with PAW projector functions in place of atomic form factors. Every SCF iteration recomputes it.
- Charge density on the FFT grid. The pseudo charge density stored in CHGCAR is the inverse FFT of its plane-wave coefficients . Those coefficients are nothing but generalised structure factors evaluated at every reciprocal-lattice vector inside the FFT box.
- Optical and X-ray spectra. When you set , VASP needs matrix elements . Their ionic contribution reduces, again, to a structure-factor sum.
Pulling structure factors out of a finished VASP calculation
For a relaxed POSCAR you can compute (and plot) X-ray powder patterns in a few lines using :
1from pymatgen.core import Structure
2from pymatgen.analysis.diffraction.xrd import XRDCalculator
3
4# Read VASP-relaxed structure straight from the CONTCAR
5struct = Structure.from_file("CONTCAR")
6
7xrd = XRDCalculator(wavelength="CuKa") # 1.54184 Å
8pattern = xrd.get_pattern(struct, two_theta_range=(10, 90))
9
10for hkl, intensity, two_theta in zip(
11 pattern.hkls, pattern.y, pattern.x):
12 miller = hkl[0]["hkl"]
13 print(f"({miller[0]},{miller[1]},{miller[2]}) "
14 f"2θ = {two_theta:5.2f}° I = {intensity:6.2f}")Under the hood, calls the same sum we wrote above, with proper angle-dependent X-ray form factors from the International Tables and a Lorentz-polarisation weighting. Run it once on your favourite VASP-relaxed structure and you will see for FCC, for BCC, every time.
Sanity-check workflow
When a VASP relaxation surprises you — symmetry-broken positions, unexpected lattice parameters — a quick simulated powder pattern tells you whether the predicted structure is actually the polymorph you intended. We will use exactly this loop in Chapter 6 to validate Mn-doped CdSe supercells before spending hours on band-structure runs.
Common Pitfalls
| Pitfall | Symptom | Fix |
|---|---|---|
| Cartesian coordinates inside the phase | F oscillates with cell size and looks lattice-parameter-dependent. | Always use FRACTIONAL positions. The 2π factor presupposes them. |
| Conventional vs primitive basis confusion | FCC powder pattern from primitive cell shows peaks at every (hkℓ) — no absences. | Pick one cell consistently. Conventional + 4 atoms gives the textbook absences; primitive + 1 atom does not. |
| Forgetting the form-factor angle dependence | Predicted high-angle peak intensities are 5–10× too strong vs experiment. | Use tabulated f(sinθ/λ) (Cromer-Mann coefficients) or pymatgen, not f = Z. |
| Treating |F|² as the only intensity factor | Powder peak intensities disagree with experiment even for simple metals. | Multiply by Lorentz, polarisation, multiplicity, and Debye-Waller. They are geometry, not chemistry. |
| Dropping a 2π or its sign | Selection rules invert (e.g. you predict FCC where the data is BCC). | Verify with one known reflection (the (111) of any FCC element) before trusting your code. |
Summary
- Reciprocal lattice + structure factor = diffraction pattern. The lattice fixes the spot positions; the structure factor fixes the intensities.
- The structure factor is a sum of complex arrows in the plane, one per atom. They can add (bright spot) or cancel (forbidden spot). Geometry-driven cancellations are systematic absences, the topic of the next section.
- Three benchmark rules to keep in your head: simple cubic allows everything, BCC demands even, FCC demands all the same parity.
- The detector responds to , multiplied by Lorentz, polarisation, multiplicity, and Debye-Waller weights. The latter four are geometry; only carries the chemistry.
- Twelve lines of NumPy reproduce every textbook selection rule. Pymatgen wraps the same primitive into a one-call XRD simulator that works directly on a VASP .
Coming next: Section 3.7 — Systematic Absences — where we turn the "F = 0" rules above into a complete catalogue of selection rules, and use the absences in a real diffractogram to fingerprint the space group of an unknown crystal.