Skip to content

Latest commit

 

History

History
157 lines (127 loc) · 9.34 KB

File metadata and controls

157 lines (127 loc) · 9.34 KB

Scattering & form-factor tables

All scattering parameters live in one place — src/core/scattering/ — behind small, replaceable interfaces (types.ts), so the structure-factor calculators never hard-code a constant. This is the single home for neutron scattering lengths, X-ray form factors, and magnetic form factors; extend the records here, not the calculators.

The scattering variable throughout is s = sinθ/λ = 1/(2d) (Å⁻¹).

What exists today

Table File Form Coverage Source
Neutron b neutronData.ts Constant bound coherent length b (fm), s-independent 92 entries (91 natural elements H–Cm + D) Sears, ITC-C Vol. C §4.4.4; Ti/Mn/Zn/Au pinned to GSAS-II's Sears (1992) values
X-ray f(s) cromerMannData.ts 4-Gaussian Cromer–Mann Σ aᵢe^{−bᵢs²} + c 97 neutral atoms (H–Cf; Pu omitted, bad source fit) International Tables Vol. C pp. 500–502 (DABAX f0_InterTables); f(0)=Z verified per row
Magnetic ⟨j0⟩ magneticFormFactorData.ts A e^{−a s²} + B e^{−b s²} + C e^{−c s²} + D, normalized to 1 at s=0 97 ions (3d Sc–Cu, 4d Y–Pd, rare earths Ce–Yb, actinides U–Am, all common valences) ITC-C Vol. C §4.4.5 (Brown), via the public-domain CrysFML table in periodictable
Magnetic ⟨j2⟩ magneticFormFactorData.ts (A e^{−a s²} + … + D)·s², → 0 at s=0 95 ions (every ⟨j0⟩ ion except O¹⁺ and Pr³⁺) same

All four tables are generated files — do not hand-edit. Each *Data.ts is produced from a cited source by its generator, with the evaluation logic kept in the sibling module (neutron.ts, xray.ts, magnetic.ts):

  • Neutron — scripts/gen_neutron_b.py. Fills the full periodic table from the Sears/ITC-C table while pinning the four elements (Ti, Mn, Zn, Au) where GSAS-II uses the earlier Neutron News (1992) values, so the neutron structure factor keeps matching GSAS-II .lst output.
  • X-ray — scripts/gen_xray_ff.py. All neutral atoms from the ITC-C Cromer–Mann parametrization; every row is checked to give f(0)=Z within 0.1 e (Pu's source row misses by 5 e and is dropped).
  • Magnetic — scripts/gen_magnetic_ff.py, copying coefficients verbatim (no digit-altering float round-trips).

Only neutral-atom X-ray form factors are tabulated; the structure-factor code looks up by element symbol and does not yet use ionic X-ray species (the DABAX source carries them, so gen_xray_ff.py can be widened when needed).

Neutron scattering lengths are used for both nuclear structure factors and, via ⟨j0⟩/⟨j2⟩, the magnetic form factor of an ion — so "the neutron table for magnetic ions" is the magnetic ⟨j0⟩/⟨j2⟩ table below.

Magnetic form factor — spin-only and dipole

The current magnetic structure factor uses the spin-only approximation f(s) ≈ ⟨j0⟩(s) (structureFactor.ts).

For moments with an orbital contribution (Landé g ≠ 2) — most real magnetic refinements — the dipole approximation is required:

f(s) ≈ ⟨j0⟩(s) + (1 − 2/g)·⟨j2⟩(s)

⟨j2⟩ carries an prefactor, so it vanishes at s = 0 and the total form factor is still 1 there. The full API is in place:

  • magneticFormFactorJ2(ion, s) — ⟨j2⟩, or NaN when the ion has no ⟨j2⟩ row.
  • magneticFormFactorDipole(ion, s, g) — the full expression; falls back to spin-only ⟨j0⟩ when g = 2 or the ion has no ⟨j2⟩, so it is always safe to call.
  • magneticTable.dipole / magneticTable.hasJ2 expose the same via the table.

Both ⟨j0⟩ and ⟨j2⟩ are now populated for the full ITC-C ion set, so g ≠ 2 (orbital) refinements are unblocked at the form-factor level.

Validation

The generated coefficients are guarded by scattering.test.ts: ⟨j0⟩(0) = 1 for a spread of 3d/rare-earth/actinide ions, ⟨j2⟩(0) = 0, the dipole term reduces to ⟨j0⟩ at g = 2, and an external reference lock against periodictable's Fe²⁺ doctest (M_Q([0, 0.1, 0.2]) = [1, 0.99935, 0.99741]), which pins both the coefficients and the s = sinθ/λ convention. Building this table also corrected a bad Cr³⁺ ⟨j0⟩ row that had been in the hand-entered table (it normalized to 1 but matched no ITC-C Cr valence).

Remaining for magnetic refinement (roadmap M4)

  1. 5d transition ions (W–Ir) — not in the CrysFML table; GSAS-II sources these from Kobayashi, Nagao & Ito, Acta Cryst. A67, 473–480 (2011). Add if a 5d magnet needs them, from that reference, through the generator.
  2. End-to-end |F_mag|² cross-check — where a GSAS-II .lst/reflection list is available, confirm our magnetic |F|² is a flat multiple of GSAS-II's, the same gate used for the nuclear structure factor in neutronSfValidation.test.ts.

Do not hand-edit magneticFormFactorData.ts — a wrong 7-coefficient row silently corrupts the magnetic calculation. Extend the upstream source or the generator and regenerate, keeping the validation gates above.

Sources & citations

Full provenance for the coefficient data, for citation and reproducibility. See REFERENCES.md for the project-wide bibliography (including GSAS-II, Toby & Von Dreele 2013 — the validation reference whose .lst neutron b and atmdata magnetic conventions were cross-checked against the tables below). Web resources accessed 2026-07-08.

Neutron scattering lengths (neutron.ts)

  • Primary reference: Sears, V. F. (1992). "Neutron scattering lengths and cross sections." Neutron News 3(3), 26–37. doi:10.1080/10448639208218770
  • Convenient tabulation: NIST Center for Neutron Research, "Neutron scattering lengths and cross sections," https://www.ncnr.nist.gov/resources/n-lengths/
  • Redistribution actually imported: the Sears table (labeled ITC-C Vol. C §4.4.4) shipped in the Dans_Diffraction package (data/neutron_isotope_scattering_lengths_sears.dat), real part of the bound coherent length per natural element.
  • Cross-checked against printed values in bundled GSAS-II .lst files; Ti, Mn, Zn and Au are pinned to GSAS-II's Neutron News (1992) values, which differ slightly from the ITC edition, so the structure factor still matches GSAS-II.

X-ray form factors (xray.ts)

  • Primary reference: Cromer, D. T. & Mann, J. B. (1968). "X-ray scattering factors computed from numerical Hartree–Fock wave functions." Acta Cryst. A24, 321–324. doi:10.1107/S0567739468000550
  • Tabulated form used (4-Gaussian coefficients): International Tables for Crystallography Vol. C, pp. 500–502 / Table 6.1.1.4.
  • Redistribution actually imported: the ESRF DABAX f0_InterTables.dat table (public domain), as shipped in the xrayutilities package (materials/data/f0_InterTables.dat.xz). The 14 originally hand-entered rows match it exactly; regenerating expands to all 97 neutral atoms.

Magnetic form factors ⟨j0⟩ / ⟨j2⟩ (magneticFormFactorData.ts)

Regeneration

The magnetic table is produced by scripts/gen_magnetic_ff.py, which fetches the periodictable raw file above and copies coefficients verbatim. Re-running it reproduces magneticFormFactorData.ts byte-for-byte from the cited source.