Lab 6.12 · 30 min

Lab: structure factor by hand

X-ray and neutron experiments do not measure g(r); they measure the structure factor S(k), how strongly density waves of wavevector k are present. We compute S(k) by hand for four atoms, then for the LJ liquid in two ways: directly from positions and as a Fourier transform of g(r). The numbers show which k values a box allows, what cutting g(r) at L/2 does, and how S(k → 0) is tied to the compressibility.

The setup

A density wave e^(ik·r) has wavelength 2π/k. S(k) measures how strongly the particles line up with it:

S(k) = (1/N) |Σⱼ e^(i k·rⱼ)|² = (1/N) [ (Σ cos k·rⱼ)² + (Σ sin k·rⱼ)² ] periodic box of side L: only k = (2π/L)(nₓ, n_y, n_z) are allowed from g(r) (3D): S(k) = 1 + 4πρ ∫ r² (g(r) − 1) sin(kr)/(kr) dr

System: the 3D LJ liquid of Labs 6.9–6.11 (500 atoms, ρ = 0.8, T = 1.0, L = 8.55), 50 frames.

Step 1

S(k) of four atoms by hand

Why: The definition is just two sums of cosines and sines. On four atoms in a 1D box of length 4, we can see exactly when the waves add up and when they cancel.

lattice x = 0, 1, 2, 3 (L = 4, k = 2πn/4) n = 1 k = 1.571 Σcos = 0, Σsin = 0 S = 0 n = 2 k = 3.142 0, 0 S = 0 n = 3 k = 4.712 0, 0 S = 0 n = 4 k = 6.283 Σcos = 4, Σsin = 0 S = 16/4 = 4 = N disordered x = 0, 1.1, 1.9, 3.2 n = 1 Σcos = 0.165, Σsin = 0.193 S = 0.0161 n = 2 Σcos = 0.191, Σsin = −1.206 S = 0.3726 n = 3 Σcos = −0.246, Σsin = 0.151 S = 0.0208 n = 4 Σcos = 2.927, Σsin = 0.951 S = 2.368

What the numbers say: On the lattice every wave cancels exactly, except the one whose wavelength equals the spacing (k = 2π/1): there all four atoms are in phase and S = N, a Bragg peak that grows with the number of atoms. Shift the atoms a little and the cancellation is no longer perfect: the peak drops to 2.37 and is shared with the other k values. A liquid is the extreme case: no Bragg peaks, only a broad maximum near k ≈ 2π/(neighbour distance).

Step 2

The LJ liquid, directly from positions

Why: For a 3D box, every allowed k vector gives one value of S; vectors of the same length are averaged. The smallest k is set by the box: the longest wave that fits is L.

smallest k = 2π/L = 2π/8.550 = 0.735 next: 0.735 × √2 = 1.039, × √3 = 1.273, × 2 = 1.470
k0.7351.0392.04.06.06.6258.010.0
S(k)0.0540.0500.0620.1281.2262.4240.9500.702
main peak at k = 6.625 -> 2π/k = 0.948 (about the nearest-neighbour distance, ≈ 1.1)

What the numbers say: S(k) has a sharp main peak near k = 6.6, the signature of the shell of neighbours, damped oscillations around 1 at large k, and very small values (≈ 0.05) at small k: long density waves are strongly suppressed because the liquid is hard to compress. The box decides what we can see: nothing exists below k = 0.735, and the first few k values have only 3–6 vectors each, so they are noisy. To see structure on longer length scales (clusters, nano-segregation in ionic liquids, the "pre-peak") the box must be several times larger than that length.

Step 3

S(k) from g(r): truncation and the window

Why: S(k) can also be computed from g(r), which most analyses already have. The transform needs g(r) to infinity, but we only know it up to L/2. Cutting the integral there causes errors; a window function that smoothly brings the integrand to zero (here the Lorch window, sin(πr/R)/(πr/R)) is the usual fix.

one term of the integral, r = 1.1008, g = 2.6078, k = 6.75: r² (g − 1) sin(kr)/(kr) dr = 0.005109 (sum 200 such terms)
kdirectfrom g(r)from g(r), window
0.7350.0540.0460.046
1.0390.050−0.0850.050
1.4700.0530.0520.057
2.00.0620.1200.059
4.00.1280.0750.144
6.6252.4242.2741.923
8.00.9500.9071.009
10.00.7020.7170.724
k = 0 from g(r): 0.636 (raw), 0.046 (window)

What the numbers say: At large k the transform works (10.0: 0.717 vs 0.702). At small k the raw transform goes wrong, even negative (−0.085 at k = 1.04, impossible for |Σe^(ik·r)|²), and k = 0 comes out 13 times too large (0.636), because the cut at L/2 = 4.3 leaves a step in r²(g − 1) whose transform rings. The window removes the ringing (0.050, 0.046) but smears the main peak (1.92 instead of 2.42). So: compute S(k) directly from positions when the box allows it; use the transform of g(r) for k values between the allowed ones, with a window, and know that it trades small-k accuracy against peak height.

Step 4

S(0) and the compressibility

Why: As k → 0 the structure factor measures how much the number of particles in a large region fluctuates, which is set by how compressible the liquid is: S(0) = ρk_BTκ_T = k_BT / (∂P/∂ρ). This links structure to thermodynamics and gives a check of both.

pressure at ρ = 0.78, 0.80, 0.82 (256 atoms, 2 runs each): 2.885, 3.294, 3.711 ∂P/∂ρ = (3.711 − 2.885)/0.04 = 20.64 S(0) = k_BT / (∂P/∂ρ) = 1/20.64 = 0.0485 κ_T = 1/(ρ ∂P/∂ρ) = 0.0606 (ideal gas: S(0) = 1) direct S at the smallest k: 0.0535, 0.0501, 0.0455, 0.0526 g(r) tail offset expected (Lab 6.9): S(0)/N = 0.0485/500 = 1×10⁻⁴

What the numbers say: The pressure route (0.0485) and the small-k structure factor (0.045–0.054) agree: a dense liquid has density fluctuations 20 times weaker than an ideal gas. This is also why the 1/N offset of g(r) in Lab 6.9 is tiny for a dense liquid (10⁻⁴) but large for a gas (1/N). For mixtures and ionic systems, the same idea gives partial structure factors: the charge–charge structure factor of an electrolyte must go to zero as k² at small k (perfect screening), a strong test of a simulation's electrostatics. Limitation: S(0) from a few small-k points needs good statistics and a large box; the pressure route needs runs at several densities.

Step 5

Comparing with experiment

Why: To compare a simulated S(k) with X-ray or neutron data, the units must match and the atoms must be weighted the way the experiment sees them.

reduced -> real k: k[Å⁻¹] = k* / σ[Å] argon (σ = 3.405 Å): peak k* = 6.625 -> 1.95 Å⁻¹ smallest k of the 500-atom box: 0.735/3.405 = 0.216 Å⁻¹ X-ray: each atom weighted by its form factor f(k) (≈ number of electrons, falls with k) neutron: each element weighted by its scattering length b (isotope-dependent: H and D differ in sign) mixture: S(k) = Σ_αβ wα wβ S_αβ(k) / (Σ wα)²

What the numbers say: For a one-component liquid the simulated S(k) can be compared directly once k is converted (liquid argon's main peak is indeed near 2 Å⁻¹). For molecules, mixtures and ionic liquids each pair of species gets its own partial structure factor, weighted by form factors or scattering lengths, and features such as the low-k pre-peak need boxes several nanometres wide. Tools: LAMMPS compute rdf plus a transform, or compute saed/xrd; dedicated codes such as TRAVIS compute weighted S(k) directly.

Summary

methodmerit (number)limitation (number)
direct from positionsexact at allowed k: peak 2.424only k ≥ 2π/L = 0.735; few vectors at small k
transform of g(r), rawany k; good at large k (0.717 vs 0.702)small k wrong: −0.085, S(0) = 0.636
transform with windowsmall k fixed (0.050, 0.046)main peak lowered to 1.92
S(0) from ∂P/∂ρ0.0485, matches small-k S ≈ 0.05runs at several densities
experimentk* / σ; peak 1.95 Å⁻¹ for argonweights per species; big boxes for pre-peaks