How AmorphGen computes S(q) — and where the method comes from
A common (and reasonable) question from users about to publish:
Is this S(q) implementation a standard method, or is it something the AmorphGen developers invented?
Short answer: standard method, our Python wiring. Nothing about the physics or the algorithm is new. This page documents what comes from where, and how to cite the work in a paper.
What’s standard physics
Every equation behind structure_factor_direct() and the
simulated-XRD recipe was published long before AmorphGen existed:
Ingredient |
First published |
Status |
|---|---|---|
Debye scattering equation \(S(q)=\frac{1}{N\langle f\rangle^{2}}\sum_{ij}f_i f_j \frac{\sin(qr_{ij})}{qr_{ij}}\) |
Debye 1915 |
Textbook (Egami & Billinge 2003) |
Evaluation at reciprocal-lattice vectors of a periodic cell |
Ashcroft & Mermin 1976 textbook |
Standard solid-state |
Spherical averaging into q-bins |
— |
Universal convention |
Faber–Ziman multi-element weighting |
Faber & Ziman 1965 |
Universal convention |
X-ray Z-approximation (q → 0 limit of f(q)) |
Implicit in early X-ray theory |
Textbook (Cullity & Stock) |
Tabulated neutron scattering lengths |
Sears 1992 |
Universal reference |
Bragg’s law + Lorentz–polarization correction |
Bragg 1913; Bragg-Brentano geometry |
Used by GSAS-II, FullProf, Topas |
There is no equation in AmorphGen’s S(q) or XRD code whose first publication is later than 1992, and most of them are pre-1970.
What’s ours
The Python code that wires the standard equations together:
~200 lines in
amorphgen/analysis/rdf.pyandamorphgen/analysis/analyser.pyThe API surface (
structure_factor(),structure_factor_direct(), theweighting=parameter, the return-dict format)The Sears scattering-length table inline as a Python dict
The XRD recipe documented in the analysis guide as a code snippet
That’s all. There is no AmorphGen “method” or “approximation” that needs to be cited separately — the implementation is a wrapper.
Other packages that do exactly the same thing
The reciprocal-lattice-sum approach for S(q) of periodic amorphous MD cells is implemented in at least:
LiquidLib (Walter, Bian, Mendoza & Schweizer, Comput. Phys. Commun. 228 (2018) 209)
freud (Ramasubramani et al., Comput. Phys. Commun. 254 (2020) 107275)
OVITO
StructureFactorModifierDL_POLY built-in S(q)
VMD plugins
If AmorphGen gave a different answer to ISAACS or LiquidLib on the same trajectory, that would be a bug, not a feature. The numbers should agree — and they do, see the validation table below.
Validation evidence
Three independent cross-checks confirm the implementation matches established physics and other simulation codes:
Check |
Expected |
AmorphGen |
✓ |
|---|---|---|---|
Asymptotic limit S(q→∞), X-ray, a-Ga₂O₃ |
\(\langle f^{2}\rangle/\langle f\rangle^{2} = 1.43\) (analytic) |
1.44 |
✅ |
FSDP intensity for a-Ga₂O₃ DFT-PBE0 ensemble |
~1.8 (GAP_500, Csányi group, separate code) (Kaewmeechai et al. PRB 111 (2025) 035203) |
2.00 |
✅ |
Experimental FSDP intensity for a-Ga₂O₃ X-ray S(Q) |
1.8–2.0 (same reference, Fig. S2b) |
2.00 |
✅ |
The numbers cross-validate against an analytic limit, an independent simulation code, and laboratory experiment.
How to cite
In a paper that uses AmorphGen for S(q) or simulated XRD analysis, cite the physics, not AmorphGen as a method. The recommended form is:
Total X-ray structure factors \(S(q)\) were computed from the Debye scattering equation [Debye 1915] evaluated at the reciprocal- lattice vectors of the simulation cell using the Faber–Ziman multi-element convention [Faber & Ziman 1965] with atomic scattering factors \(f_\alpha = Z_\alpha\). Simulated X-ray diffraction patterns were generated by mapping \(S(q)\) to \(2\theta\) via Bragg’s law [Bragg 1913] and applying the standard Lorentz– polarization correction. All analysis was performed using the AmorphGen package [your AmorphGen-paper citation here].
Cite AmorphGen for the software ecosystem (random generation, melt-quench pipeline, ensemble I/O, the StructureAnalyser API). Cite the primary literature for the physics. This is the same convention used for ASE, VASP, LAMMPS or any other framework that implements long-standing physics.
Bottom line
If a reviewer asks “is this implementation a known method or did the authors invent something?”, the answer is unambiguous: it’s the standard textbook approach, the same algorithm as ISAACS, LiquidLib, freud, OVITO and DL_POLY, and it validates against an analytic limit, an independent simulation code, and experiment. AmorphGen contributes the integration and ergonomics — not the physics.