**This is an interactive demo of the static structure factor.** Click on the diffraction pattern (top right) or the plot of the radially averaged structure factor (bottom right) to examine the density waves contributing to a specific peak.

Some additional background is given below. For more demonstrations, see:

www.softmatterdemos.org

## Background

The static structure factor is an extremely useful tool for analyzing the global structure of many-body systems. Roughly speaking, it measures the presence of periodic density fluctuations in the system as a function of the length and direction of the wave vector. In particular, if we have a system of *N* particles at particle positions, then the structure factor is given by:
Here, the angular brackets denote an ensemble average. For a crystal, the structure factor shows sharp peaks (known as Bragg peaks) at specific wave vectors. To fully understand what the structure factor is measuring, it can be helpful to visualize how different interparticle distances contribute to these peaks. In this demo, you can explore this for several different crystal structures (switch via the menu button on the top left). The diffraction pattern in the top left corresponds to the structure factor *S*(**q**).
When you click on this pattern, the density wave *w*(**r**) corresponding to the chosen wave vector **q** will be plotted on top of the configuration:
with **r**_{ref}
the position of the highlighted reference particle (which you can switch by clicking on another particle). Green indicates a high value. Negative values are shown as transparent (but can be highlighted as red by clicking one of the buttons on the left). Hence, if you select one of the peaks in the diffraction pattern, the particles whose centers are located in a green region are the ones whose distance to the reference particle contributes positively to this peak.

Note that you can also combine multiple wave vectors, by holding Shift when clicking on the diffraction pattern. Additionally, you can hold Control to add multiple wave vectors at once, taking the crystal symmetry into account. The small button on the top left of the diffraction pattern locally optimizes the choice of wave vectors, moving them to the nearest peak.

The radially averaged structure factor (bottom right) is simply the average over all wave vectors **q** with the same magnitude. Clicking on the plot will again show a wave pattern indicating the contribution of pair distances to the selected peak.