Docs are under construction. Content may be incomplete or change.

Powder X-ray Diffraction

Page type: Concept
On this page

Powder X-ray diffraction converts structural periodicity and atomic electron density into a one-dimensional pattern of scattering angle versus intensity. Peak positions constrain lattice spacings. Systematic absences and relative intensities contain information about translational symmetry and the contents of the unit cell. Peak shapes contain information about the instrument and specimen microstructure. Those statements refer to different layers of the experiment, and a scientifically useful simulation must say which layers it includes.

Tako provides two geometry-only diffraction models. The periodic model enumerates reciprocal-lattice reflections for a three-dimensional cell, evaluates kinematic structure factors, applies a powder Lorentz–polarization factor, merges coincident reflections, and optionally scales the strongest retained peak to 100. The finite-system Debye model sums scattering over all ordered atom pairs on a requested angular grid. It requires no periodic cell and is suitable for clusters or finite structural models, but its present form-factor coverage is narrow and its angular correction differs from the periodic model.

Neither branch is an experimental pattern generator in the full sense. Tako currently omits partial occupancies, disorder models, anomalous scattering, wavelength doublets, preferred orientation, absorption, background, instrumental resolution, crystallite-size and microstrain broadening, and refinement against observations. Its output is best understood as an idealized structural scattering prediction under explicit assumptions.

The scientific foundations and terminology follow crystallographic conventions, Debye scattering theory, International Union of Crystallography resources, and the primary references listed at the end.

What a powder pattern represents

An elastic X-ray scattering experiment illuminates a specimen with incident wavevector k0\mathbf k_0 and observes scattered radiation with wavevector k1\mathbf k_1. For elastic scattering,

k0=k1=2πλ,|\mathbf k_0|=|\mathbf k_1|=\frac{2\pi}{\lambda},

where λ\lambda is the wavelength. The scattering vector is

q=k1k0,\mathbf q=\mathbf k_1-\mathbf k_0,

with magnitude

q=q=4πsinθλ.q=|\mathbf q|=\frac{4\pi\sin\theta}{\lambda}.

The measured angle between the incident and diffracted beams is 2θ2\theta. Crystallographic form-factor tables often use

s=sinθλ,s=\frac{\sin\theta}{\lambda},

whereas Tako’s Debye implementation uses the symbol ss for

sT=2sinθλ=q2π=2s.s_{\mathrm T}=\frac{2\sin\theta}{\lambda}=\frac{q}{2\pi}=2s.

This factor-of-two convention must be tracked carefully. In the periodic implementation, the reciprocal-vector norm gg is 1/d1/d, and the scattering-factor argument is (g/2)2=(sinθ/λ)2(g/2)^2=(\sin\theta/\lambda)^2. In the Debye implementation, the variable passed through the pair sum is sT=gs_{\mathrm T}=g. Both can represent the same physics while using different symbols internally.

A single crystal produces discrete spots because only particular reciprocal vectors satisfy the diffraction condition for a given orientation. A powder contains many crystallite orientations. The reciprocal-lattice spots sweep out cones, and an ideal one-dimensional powder pattern records their integrated intersections as peaks at 2θ2\theta. The resulting curve discards directional information. Different structures can therefore produce similar powder patterns, especially when peaks overlap or intensities are altered by texture, disorder, or limited resolution.

@startuml powder-scattering-geometry title Elastic scattering geometry and reciprocal variables skinparam backgroundColor White skinparam titleFontColor #24292f skinparam titleBackgroundColor White skinparam titleBorderColor White skinparam shadowing false skinparam defaultFontName "Helvetica" skinparam ArrowColor #24292f skinparam rectangle { BorderColor #24292f BackgroundColor #f6f8fa FontColor #24292f } rectangle "Incident beam\nk0, |k0| = 2pi/lambda" as I #ddf4ff rectangle "Elastic scattering\nangle between beams = 2theta" as S #fff8c5 rectangle "Diffracted beam\nk1, |k1| = 2pi/lambda" as O #ddf4ff rectangle "Scattering vector\nq = k1 - k0\n|q| = 4pi sin(theta)/lambda" as Q #dafbe1 rectangle "Crystallographic variable\ns = sin(theta)/lambda\nTako Debye variable = q/(2pi)" as V I --> S S --> O I --> Q O --> Q Q --> V @enduml

Coherent and incoherent contributions

The ideal structure-factor treatment is coherent and kinematic. Waves scattered by atoms interfere according to their relative phases. This produces sharp Bragg reflections and systematic extinctions. Real specimens also contribute incoherent scattering, fluorescence, Compton scattering, air and holder scattering, diffuse scattering from disorder, and detector background. Tako does not calculate these terms.

The kinematic approximation assumes single scattering. It is generally appropriate for powder simulations used as phase fingerprints, but extinction and multiple scattering can affect carefully measured intensities, particularly for large, highly perfect crystallites. A simulated relative intensity should not be interpreted as a detector count without an experimental forward model.

Reciprocal lattice and Bragg diffraction

Let the direct lattice be generated by basis vectors a\mathbf a, b\mathbf b, and c\mathbf c. Using the crystallographic convention without 2π2\pi, reciprocal vectors satisfy

aa=1,ab=0,\mathbf a^*\cdot\mathbf a=1, \quad \mathbf a^*\cdot\mathbf b=0,

with cyclic equivalents. A reciprocal-lattice vector is

ghkl=ha+kb+lc.\mathbf g_{hkl}=h\mathbf a^*+k\mathbf b^*+l\mathbf c^*.

The associated interplanar spacing is

dhkl=1ghkl.d_{hkl}=\frac{1}{|\mathbf g_{hkl}|}.

First-order Bragg diffraction occurs when

2dhklsinθ=λ,2d_{hkl}\sin\theta=\lambda,

or

2θhkl=2arcsin(λ2dhkl).2\theta_{hkl}=2\arcsin\left(\frac{\lambda}{2d_{hkl}}\right).

Higher-order diffraction can be represented by higher Miller indices, so the enumeration need only use the first-order equation for every reciprocal vector. A reflection is geometrically inaccessible when λ/(2d)>1\lambda/(2d)>1.

Peak positions and the metric tensor

Peak positions depend on the reciprocal metric. In a cubic cell of length aa,

1dhkl2=h2+k2+l2a2.\frac{1}{d_{hkl}^2}=\frac{h^2+k^2+l^2}{a^2}.

For lower-symmetry cells, cross terms involving reciprocal angles enter. This makes powder diffraction sensitive to cell lengths and angles even when atomic fractional coordinates are unchanged. Thermal expansion, pressure, composition, residual stress, and calibration errors can all shift peaks. A simulation using a zero-temperature optimized cell should not be expected to reproduce room-temperature experimental positions exactly.

The sensitivity grows at high angle. Differentiating Bragg’s law gives, approximately,

Δ(2θ)2tanθΔdd.\Delta(2\theta)\approx -2\tan\theta\,\frac{\Delta d}{d}.

A small relative lattice-spacing error therefore produces a larger angular shift as θ\theta increases. Agreement of one low-angle line is weak evidence of cell accuracy; a pattern-wide comparison is more informative.

Reciprocal-space enumeration in Tako

Tako converts the internal cell to an inverse-transpose reciprocal basis in Å1^{-1} without a 2π2\pi factor. It defines

gmax=2λ,g_{\max}=\frac{2}{\lambda},

the largest reciprocal norm satisfying Bragg’s law. If the requested minimum angle is positive, it also computes

gmin=2sin(θmin)λ;g_{\min}=\frac{2\sin(\theta_{\min})}{\lambda};

otherwise gmin=0g_{\min}=0.

The implementation obtains the reciprocal metric, diagonalizes it, and uses its smallest eigenvalue to build a conservative integer search bound. It then loops over every integer triplet (h,k,l)(h,k,l) in the resulting cube, excludes (0,0,0)(0,0,0), and retains vectors in the spherical norm range. This is exact within the enumerated bound, but the number of integer candidates can grow rapidly for long, skewed, or ill-conditioned cells. A singular cell errors; a metric that is not positive definite also errors.

Every retained vector receives d=1/gd=1/g and a Bragg angle. Vectors outside the requested angular range are removed. The periodic angular step is not used in this process: the output is a list of ideal reflection sticks, not a sampled continuous grid. Tako nevertheless echoes the requested step in periodic metadata. It does not represent instrumental resolution or profile sampling.

Structure factors and atomic form factors

Peak positions follow the lattice; intensities encode the contents of the cell. For a reflection hklhkl, the ideal kinematic structure factor is

Fhkl=jojfj(s)exp ⁣[2πi(hxj+kyj+lzj)]exp(Bjs2),F_{hkl}=\sum_j o_j f_j(s) \exp\!\left[2\pi i(hx_j+ky_j+lz_j)\right] \exp(-B_j s^2),

where (xj,yj,zj)(x_j,y_j,z_j) are fractional coordinates, ojo_j is occupancy, fjf_j is the atomic scattering factor, BjB_j is a displacement parameter in the convention used by the implementation, and

s=sinθλ=g2.s=\frac{\sin\theta}{\lambda}=\frac{|\mathbf g|}{2}.

The coherent reflection intensity before geometric corrections is proportional to

Fhkl2.|F_{hkl}|^2.

The complex phases are essential. Two atoms can reinforce or cancel one another. Systematic absences arise when symmetry-related contributions cancel exactly. This is why a lattice-only list of dd spacings cannot predict a diffraction fingerprint.

Form-factor model in the periodic branch

The periodic branch uses bundled coefficients compatible with the pymatgen XRD model. For each element it evaluates

f(s)=Z41.78214s2iaiexp(bis2).f(s)=Z-41.78214s^2\sum_i a_i\exp(-b_i s^2).

The factors decrease with scattering angle because a finite electron cloud does not scatter coherently like a point charge at large momentum transfer. Heavy elements usually dominate X-ray intensity, while hydrogen contributes weakly.

If coefficients for an element are absent, periodic calculation returns an error rather than silently substituting an atomic number. The model uses neutral-element coefficients and does not expose ionic scattering factors. It also omits the anomalous terms ff' and ff'',

f=f0+f+if,f=f_0+f'+if'',

which become important near absorption edges and for resonant experiments.

Occupancy and thermal motion assumptions

The public structure passed to XRD has one element per site and no diffraction occupancy field. Tako therefore assumes occupancy one for every listed atom. Split sites, vacancies represented by fractional occupancy, substitutional disorder, and occupational correlations cannot be modeled directly. Duplicating sites is not a valid general substitute because it changes composition and phase relationships.

The lower periodic library supports element-specific Debye–Waller factors, but the public Tako XRD operation does not provide them. Its factor map is empty, so every site uses B=0B=0. Simulated high-angle intensities therefore lack attenuation from thermal and static atomic displacement. Comparing such intensities with finite-temperature experiment can overemphasize high-angle peaks.

The structure representation also lacks anisotropic displacement tensors. No thermal diffuse scattering is computed. Atomic positions are exact points at the supplied coordinates.

Powder geometric correction, multiplicity, and merging

The periodic branch multiplies every reflection by

Lp(2θ)=1+cos2(2θ)sin2θcosθ.L_p(2\theta)= \frac{1+\cos^2(2\theta)}{\sin^2\theta\cos\theta}.

This is a Lorentz–polarization expression for an idealized powder geometry. It diverges formally near geometric singularities; Tako returns zero if sinθ\sin\theta or cosθ\cos\theta is smaller than its numerical threshold. Experimental instruments can use different polarization states, geometries, monochromators, detectors, and integration conventions, so an appropriate correction is experiment-specific.

After multiplying F2|F|^2 by this factor, Tako discards reflections whose intensity is at most 10810^{-8} in its arbitrary internal scale. This cutoff removes exact and near extinctions before peak merging.

Coincident reflections

Powder averaging maps all reflections with the same dd spacing onto the same angle. Tako merges peaks whose calculated 2θ2\theta values differ by no more than 10510^{-5} degrees. Their intensities are added. The merged peak retains the angle and dd spacing of the first inserted reflection rather than an intensity-weighted average; the tolerance is so small that this distinction is ordinarily negligible.

Each merged peak carries reflection families. For nonhexagonal metrics, the family key sorts h|h|, k|k|, and l|l|. For a lattice identified as hexagonal, it forms the four-index-like basal values h|h|, k|k|, and hk|-h-k|, sorts them, and combines them with l|l|. The multiplicity is accumulated from the explicitly enumerated reciprocal vectors assigned to that key.

This is a computational family grouping, not a full space-group representation analysis. It does not return symmetry operators, extinction symbols, Wyckoff positions, or conventional crystallographic reflection conditions. The representative Miller index becomes the lexicographically largest encountered member of its grouped family. A label in the viewer is therefore a convenient representative, not a complete family description.

Relative scaling

With periodic scaling enabled, Tako finds the strongest retained merged peak and assigns it intensity 100:

Iiscaled=100IiImax.I_i^{\mathrm{scaled}}=100\frac{I_i}{I_{\max}}.

Scaling preserves ratios inside that calculated pattern but removes an overall scale. It does not calibrate against incident flux, sample mass, illuminated volume, detector efficiency, or exposure. With scaling disabled, the values retain the model’s arbitrary magnitude, including multiplicity and Lorentz–polarization weighting; they are still not absolute counts.

@startuml periodic-powder-construction title Periodic powder-peak construction in Tako skinparam backgroundColor White skinparam titleFontColor #24292f skinparam titleBackgroundColor White skinparam titleBorderColor White skinparam shadowing false skinparam defaultFontName "Helvetica" skinparam ArrowColor #24292f skinparam rectangle { BorderColor #24292f BackgroundColor #f6f8fa FontColor #24292f } rectangle "Cell + fractional sites\noptional spg standardization" as A #ddf4ff rectangle "Enumerate reciprocal hkl\nwithin Bragg sphere" as B rectangle "d = 1/|g|\n2theta from Bragg law" as C #fff8c5 rectangle "Structure factor\nneutral-atom f(s), occupancy 1, B=0" as D rectangle "Multiply by powder LP\ndrop intensity <= 1e-8" as E rectangle "Merge within 1e-5 degree\naccumulate families and multiplicity" as F #dafbe1 rectangle "Optional strongest peak = 100\nreturn ideal sticks" as G A --> B B --> C C --> D D --> E E --> F F --> G @enduml

Symmetry standardization

Periodic XRD enables symmetry refinement by default. The label “refinement” can be misleading: Tako does not refine a structure against diffraction observations and does not optimize energy. It requests a standardized crystallographic cell from the spg symmetry library.

The implementation converts Cartesian positions to fractional coordinates, wraps each coordinate into [0,1)[0,1), passes the lattice, wrapped positions, and atomic-number types to the symmetry dataset constructor, and uses a fixed tolerance of 10510^{-5} in the engine’s internal length units. Since the internal cell is in bohr, the physical length tolerance is approximately 5.29×1065.29\times10^{-6} Å. This is stricter than a nominal 10510^{-5} Å tolerance and much stricter than tolerances often used to recognize slightly distorted experimental structures.

If the symmetry library succeeds, Tako substitutes its standardized lattice, fractional positions, and element types for diffraction. Standardization can rotate or transform the cell, reorder sites, and choose a different standardized representation. The XRD input retained for scattering contains only this lattice, positions, elements, and a hexagonal-metric flag.

If dataset construction fails, the symmetry helper silently falls back to the exact input lattice and coordinates while symmetry_refinement: true still records only the request, not success (Known Limitations).

Metadata discarded or unavailable

The standardized scattering structure does not retain atom identifiers, title, constraints, layer membership, charge, spin, custom masses, isotope identity, site labels, occupancies, or displacement parameters. Most of these do not belong in the ideal structure factor as currently formulated, but losing them prevents an audit of correspondence between the input model and standardized sites.

Standardization is particularly risky when the input intentionally contains a subtle symmetry-breaking distortion, ordered defect, magnetic ordering pattern, isotopic labeling, or partial occupancy encoded outside the simple element list. Atomic number is the only site type used for symmetry. Two atoms of the same element but different chemical roles are indistinguishable to this symmetry model.

Disable standardization when the exact distorted cell is the scientific object. Enable it when the goal is an idealized crystallographic fingerprint and the standardized structure has been independently inspected. In current Tako output that inspection cannot be done from the XRD result itself, so preserving a separately standardized structure is important for reproducibility.

Hexagonal recognition

After standardization or direct input, Tako identifies a hexagonal metric by comparing aa and bb, checking a basal angle with cosine magnitude 0.5, and requiring the other two axes to be orthogonal, all with relative or absolute tolerances of 10510^{-5}. This flag changes only family grouping. It does not change reciprocal-vector enumeration or structure factors.

Periodic branch: exact current model

The periodic branch executes only when the selected mode is periodic and the converted structure has both a cell and nonzero periodic boundary conditions. Any structure with a cell is serialized by the current frontend as periodic along all three axes. Partial periodicity is not preserved.

The model’s exact scientific assumptions are:

  • three-dimensional fixed-cell periodicity;
  • elastic, coherent, kinematic scattering;
  • one average or characteristic wavelength per calculation;
  • integer reciprocal-lattice reflections satisfying first-order Bragg geometry;
  • neutral atomic form factors from bundled coefficients;
  • full occupancy for every site;
  • zero Debye–Waller factor for every element;
  • no anomalous dispersion;
  • the fixed Lorentz–polarization factor above;
  • no peak profile, broadening, background, absorption, extinction, or texture;
  • merged ideal sticks with optional strongest-peak normalization.

The periodic output is deterministic for a fixed structure and settings. It does not use an electronic-structure calculator, energy, forces, charge, spin, or an optimized electron density. Selecting GFN2 or an MLIP elsewhere does not change XRD. Structural provenance still matters: a cell obtained from a calculator can change the pattern, but the diffraction operation itself does not call that calculator.

Angle range behavior

The frontend accepts any finite minimum angle. It repairs a maximum that is not greater than the minimum. The runtime repeats that repair. It does not clamp the range to 02θ1800\le2\theta\le180^\circ.

For a nonpositive periodic minimum, reciprocal enumeration starts at g=0g=0, but all physical Bragg peaks remain nonnegative. A maximum above 180 degrees does not produce unphysical reflections because the arcsine relation cannot exceed 180 degrees. Such metadata is still misleading and should be avoided.

The effective step is at least 0.001 degree, but periodic enumeration ignores it. Changing the step cannot split a merged peak, broaden a stick, or improve reciprocal-space completeness.

Finite-system Debye scattering

For a finite collection of atoms, orientational averaging can be performed directly over pair distances. The Debye scattering equation is

I(q)=ijfi(q)fj(q)sin(qrij)qrij,I(q)=\sum_i\sum_j f_i(q)f_j(q) \frac{\sin(qr_{ij})}{qr_{ij}},

where rij=rjrir_{ij}=|\mathbf r_j-\mathbf r_i|. The self term has rii=0r_{ii}=0, and

limx0sinxx=1.\lim_{x\rightarrow0}\frac{\sin x}{x}=1.

Unlike reciprocal-lattice diffraction, the Debye equation does not require translational periodicity. It can describe finite clusters, nanoparticles, molecular assemblies, or atomistic models lacking a clean unit cell. Sharp crystalline features emerge from repeated pair correlations rather than being inserted as delta-function reciprocal reflections.

Exact pair construction in Tako

Tako converts all Cartesian positions to ångström and creates element-pair groups. It loops over iji\le j. Self pairs receive multiplicity one; distinct pairs receive multiplicity two. The effective ordered-pair count is therefore N2N^2, exactly matching the double sum.

Distances are ordinary Cartesian distances. The cell and periodic boundary conditions are ignored. There is no minimum-image convention and no replication of a unit cell. Selecting Debye for a small periodic unit cell therefore models an isolated finite motif, not a nanoparticle cut from an infinite crystal. A meaningful finite-particle calculation requires a finite structural model of the intended particle size and morphology.

The lower library contains a distance-histogram approximation, but the public XRD runtime does not use it. It stores every iji\le j distance. Preparation has O(N2)O(N^2) time and memory, and evaluating MM angular points has approximately O(MN2)O(MN^2) work. Large finite models and fine grids can be expensive in a browser worker.

Pair-sum convention

For each requested angle, Tako defines

sT=2sinθλ=q2π.s_{\mathrm T}=\frac{2\sin\theta}{\lambda}=\frac{q}{2\pi}.

Its normalized sinc helper is

sincπ(x)=sin(πx)πx.\operatorname{sinc}_{\pi}(x)=\frac{\sin(\pi x)}{\pi x}.

The implemented pair kernel is

sincπ(2sTr)=sin(2πsTr)2πsTr=sin(qr)qr.\operatorname{sinc}_{\pi}(2s_{\mathrm T}r) = \frac{\sin(2\pi s_{\mathrm T}r)}{2\pi s_{\mathrm T}r} = \frac{\sin(qr)}{qr}.

Thus the factor-of-two and π\pi conventions cancel correctly when read together.

Iwasa factors, damping, and element coverage

Tako hardcodes the Debye scattering method called Iwasa, with α=1.01\alpha=1.01. It first forms the pair sum and then multiplies the entire intensity by

P(sT,θ)=exp(DsT22)cosθ1+αcos2(2θ),P(s_{\mathrm T},\theta)= \exp\left(-\frac{D s_{\mathrm T}^2}{2}\right) \frac{\cos\theta}{1+\alpha\cos^2(2\theta)},

where DD is the user-facing damping value in Å2^2.

This angular factor is not the same as the periodic branch’s Lorentz–polarization expression. Consequently, periodic and Debye intensities for the same finite motif should not be expected to agree by a constant scale.

Exact meaning of damping

The damping factor attenuates the complete curve increasingly with scattering variable. It suppresses high-angle oscillations in reciprocal space. It is not a convolution with a Gaussian, Lorentzian, pseudo-Voigt, or instrumental resolution function. It does not convert an ideal line into a peak of finite full width at half maximum. It is not a crystallite-size parameter and cannot be inserted into the Scherrer equation.

The default is D=0.04D=0.04 Å2^2. Negative input is rejected or normalized to the default before runtime; runtime additionally clamps it to zero or greater. The output does not record the damping value, Iwasa method name, or α\alpha, so the requested setting must be preserved separately.

Waasmaier-style form factors and a severe coverage limit

The Debye branch evaluates each supported element using a five-Gaussian-plus-constant form,

f(sT)=c+n=15anexp(bnsT2).f(s_{\mathrm T})=c+\sum_{n=1}^{5}a_n\exp(-b_n s_{\mathrm T}^2).

The current hardcoded table covers only C, N, O, P, S, Cl, Ni, Cu, Pd, Ag, Pt, and Au. Hydrogen is explicitly assigned zero, and every other unsupported element also silently receives zero rather than causing an error, so a cluster built from unsupported elements can return a complete, warning-free curve that is scientifically empty. Successful periodic calculation for an element does not imply Debye coverage — audit every element against the coverage list above before using Debye mode. See Known Limitations for the exact scope and a validation snippet.

No Debye scaling

scaledIntensities and symmetry standardization are both ignored in the Debye branch — pair distances come from the supplied finite coordinates and returned values are the raw pair sum times damping and the Iwasa angular factor — while the viewer still maps the maximum displayed value to the top of its plot, so the screen can look normalized even though the artifact was not. See Known Limitations for the complete list of inert Debye controls.

Angular grid and computational limits

The effective Debye angular step is the requested positive value, with invalid values falling back to 0.02 degree and a hard lower bound of 0.001 degree. For a minimum aa, maximum bb, and step Δ\Delta, Tako calculates

M=min(20000,baΔ+1)M=\min\left(20000, \left\lfloor\frac{b-a}{\Delta}\right\rfloor+1\right)

points,

(2θ)m=a+mΔ,m=0,,M1.(2\theta)_m=a+m\Delta, \qquad m=0,\ldots,M-1.

The minimum is included. The maximum is included only when the range is an integer number of steps within floating-point behavior. Otherwise the last value lies below the maximum. Reaching the 20,000-point cap silently truncates the curve below the requested maximum while reported metadata still shows the full range, which can leave an apparently empty tail in the viewer (Known Limitations).

Negative minimum angles are not rejected by public normalization. In Debye mode they produce negative sTs_{\mathrm T}, which the lower calculator rejects. Use physically meaningful ranges within 0–180 degrees.

The grid is a numerical sampling grid, not an experimental step-scan model. No integration over bin width is performed. Decreasing the step samples the same ideal function more densely but does not add instrumental resolution, reduce finite-particle artifacts, or improve the underlying form factors.

Runtime branch selection and silent fallback

The requested mode is not always the executed mode. Tako runs Debye scattering when any of the following is true:

  1. mode is explicitly Debye;
  2. the converted structure has no cell;
  3. periodic boundary conditions are None.

A request labeled periodic can therefore silently fall back to Debye for a molecule or cell-less structure, leaving the settings surface inconsistent with the branch that actually ran (damping hidden though relevant; symmetry refinement and scaled intensities shown though ignored). Scientific records must use the returned mode, not the requested one; see Known Limitations for the complete fallback and inert-control contract.

The periodic diffraction model itself is three-dimensional and does not calculate grazing-incidence surface diffraction, rods, or two-dimensional reciprocal features — a limitation independent of the fallback above, since any structure with a cell is currently serialized as periodic along all three axes (Known Limitations).

@startuml tako-xrd-branch-semantics title Current Tako XRD branch selection and output character skinparam backgroundColor White skinparam titleFontColor #24292f skinparam titleBackgroundColor White skinparam titleBorderColor White skinparam shadowing false skinparam defaultFontName "Helvetica" skinparam ArrowColor #24292f skinparam rectangle { BorderColor #24292f BackgroundColor #f6f8fa FontColor #24292f } start :Structure + XRD settings\nno electronic calculator; if (Explicit Debye or missing cell/PBC?) then (yes) :Debye branch\nexact finite Cartesian pairs\nIwasa factors + damping\nangle grid capped at 20,000; note right: includes silent fallback from a periodic request else (no) :Periodic branch\noptional standardization\nreciprocal hkl enumeration\nideal merged sticks; endif :One complete partial result\nonly after calculation finishes; :xrd.json + result.json\nviewer rescales vertically; stop @enduml

Radiation choices and line assumptions

Tako supports the following fixed labels and wavelengths:

Runtime labelDisplay labelWavelength (Å)
CuKaCu Kα1.54184
CuKa1Cu Kα11.5405981
CuKa2Cu Kα21.54443
CuKb1Cu Kβ11.39225
MoKaMo Kα0.71073
MoKa1Mo Kα10.70930
MoKa2Mo Kα20.71359
MoKb1Mo Kβ10.63229
CrKaCr Kα2.29100
FeKaFe Kα1.93735
CoKaCo Kα1.79026
AgKaAg Kα0.560885
WLa1W Lα11.47642
WLa2W Lα21.48748

Each calculation uses one scalar wavelength. The unsuffixed Kα choices are average wavelengths, not explicit Kα1/Kα2 doublets with intensity weights. Selecting Cu Kα does not produce a resolved doublet or asymmetric instrumental line shape. Kβ filtering, monochromator transmission, spectral bandwidth, tube spectrum, and detector energy response are absent.

Wavelength changes peak positions through Bragg’s law and changes form-factor/angular evaluation. It does not alter the structure. Comparing patterns measured with different sources requires converting or recomputing peak positions, not merely relabeling the axis.

The artifact stores ASCII labels such as CuKa1. The viewer prints the wavelength to four decimals, so it visually rounds the higher-precision constants. The JSON retains the full floating-point constant shown above.

Exact result schemas

Exact field names, types, units, and availability conditions for both the periodic and Debye result objects are generated in tako.xrd Settings. Programmatic handling of periodic peaks, Debye points, and artifact/progress-event timing is documented in Powder Diffraction with Tako Script.

The XRD viewer’s rendering, normalization, and display-only behavior are documented in XRD viewer semantics.

What is missing relative to experiment

An experimental powder pattern can be represented schematically as

y(2θ)=b(2θ)+kSkIk[Φk(2θ)R(2θ)]+ϵ(2θ),y(2\theta)=b(2\theta)+ \sum_k S_k I_k \left[\Phi_k(2\theta)\otimes R(2\theta)\right] +\epsilon(2\theta),

where bb is background, SkS_k includes scale and specimen effects, IkI_k is integrated structural intensity, Φk\Phi_k is sample-dependent broadening, RR is instrument response, and ϵ\epsilon is noise. Tako periodic XRD principally supplies idealized positions and relative integrated structural/geometric intensities. Debye mode supplies a finite-model orientational pair sum with a fixed angular factor and damping. Neither supplies the complete expression.

Occupancy and disorder

Partial occupancy changes average structure factors. Correlated disorder produces diffuse scattering that cannot be represented by simply reducing a Bragg-site occupancy. Tako assumes every listed site is fully occupied and provides no diffuse component.

Anomalous scattering and absorption edges

Near an absorption edge, ff' and ff'' change intensities and break Friedel equivalence. Tako uses real neutral-atom factors only. Resonant diffraction and absolute structure determination are outside its model.

Background and fluorescence

No background is calculated. Experimental fluorescence can be severe when source energy excites specimen absorption. Air scatter, amorphous holders, capillaries, substrates, and detector dark counts are absent.

Peak profile and instrumental resolution

Periodic peaks are zero-width sticks. Debye damping is not a profile convolution. Axial divergence, wavelength dispersion, receiving-slit width, detector point spread, Kα doublet structure, transparency, specimen displacement, and zero shift are absent. Peak maxima and widths cannot be compared quantitatively until an appropriate instrument function is applied.

Crystallite size and microstrain

Finite coherent domain size broadens reflections approximately according to the Scherrer relation,

βsizeKλLcosθ,\beta_{\mathrm{size}}\approx\frac{K\lambda}{L\cos\theta},

while distributions of lattice spacing produce strain broadening that often increases with tanθ\tan\theta. Tako’s periodic branch includes neither. A finite nanoparticle represented explicitly in Debye mode naturally contains finite-size pair correlations, but its present form factors, morphology, surface relaxation, damping, and finite atom count must all be physically appropriate before interpreting widths.

Preferred orientation and texture

Powder multiplicity assumes random crystallite orientation. Plates, needles, films, pressed powders, and additively manufactured materials can be strongly textured. Their measured intensity ratios may differ dramatically without implying a different phase. Tako has no March–Dollase, spherical-harmonic, or orientation-distribution correction.

Absorption, extinction, and specimen geometry

No absorption coefficient, sample thickness, packing density, capillary geometry, transparency, primary extinction, or secondary extinction is modeled. These effects alter integrated intensities and sometimes apparent positions or shapes.

Multiple phases and refinement

Tako calculates one supplied structural model. It does not combine phases by scale fraction, fit lattice parameters, refine coordinates, determine phase fractions, calculate statistical residuals, or estimate parameter covariance. A visual overlay cannot provide a quantitative phase fraction.

Intensity interpretation

Peak positions are generally the most robust output because they depend directly on cell metric and wavelength. Even they inherit structural and experimental uncertainty. Relative intensities are more model dependent. A careful interpretation distinguishes at least four levels:

  1. Reflection allowed or absent. Useful for lattice and symmetry fingerprints, subject to occupancy and disorder limitations.
  2. Qualitative intensity class. Strong, medium, or weak peaks can help distinguish candidate phases.
  3. Relative integrated intensity. Requires compatible polarization, multiplicity, occupancy, displacement, texture, and absorption assumptions.
  4. Observed profile intensity. Requires line shapes, background, instrument response, specimen effects, and statistical noise.

Tako periodic output is most defensible at levels 1–2 and sometimes level 3 for ideal full-occupancy structures under comparable assumptions. The current Debye branch can support qualitative finite-model comparisons only after confirming element coverage.

Never infer phase purity from the absence of an unmodeled experimental peak without checking detection limits, overlap, background, and alternative phases. Never infer occupancy from a single relative intensity when thermal motion and texture are unmodeled.

Validation protocol

Validate the structure before diffraction

Confirm composition, atom count, site mapping, cell vectors, periodicity, and coordinate units. Inspect close contacts and duplicate atoms. Determine whether the structure is experimental, relaxed, idealized, standardized, or generated. For a calculated cell, record calculator, convergence, pressure, temperature interpretation, and dispersion treatment.

For periodic mode, verify the cell determinant and condition. Extremely skewed or elongated cells enlarge reciprocal enumeration and may indicate a nonprimitive representation. Ensure the chosen cell represents three-dimensional periodicity. For a slab or molecule in vacuum, ideal three-dimensional powder diffraction of the artificial box is usually not the intended observable.

For Debye mode, construct the actual finite model whose pair correlations are meant to scatter. A single unit cell is not a generic nanoparticle. Audit the element list against C, N, O, P, S, Cl, Ni, Cu, Pd, Ag, Pt, and Au, remembering that H contributes zero.

Validate symmetry handling

Compare patterns with standardization on and off. A large difference may be appropriate if the input was a nonstandard cell, but it can also reveal that a subtle distortion was erased or a strict tolerance caused fallback. Because the result does not expose the standardized cell or success status, standardize the structure independently and archive it.

Check systematic absences against a trusted crystallographic program and the expected space group. Tako family labels alone do not establish space-group assignment.

Validate numerical completeness

Periodic results should be invariant to the requested angular step because it is unused. Verify that the angular range contains the diagnostic reflections. Compare use of primitive and conventional representations; physically equivalent full-occupancy cells should yield compatible peak positions and normalized intensities when handled consistently.

For Debye mode, halve the angular step and verify that the plotted curve and any extracted peak positions are stable. Confirm that the expected point count is below 20,000 or calculate the actual final angle. Increasing explicit particle size is a structural convergence test; its cost grows quadratically in atom count.

Vary damping only as a documented modeling sensitivity. Do not tune it to imitate experimental peak widths and then interpret it as crystallite size.

Compare with an independent implementation

For important work, reproduce periodic peak positions and intensities with a crystallographic library such as pymatgen, cctbx, GSAS-II, FullProf, TOPAS, or another validated program using matched assumptions. For Debye scattering, compare the pair sum with a tool supporting the same form factors and angular correction. Agreement should be assessed before adding experimental broadening, because profile differences can conceal structural discrepancies.

Uncertainty and comparison strategy

There is no iterative convergence flag for XRD because neither branch optimizes a structure. Scientific uncertainty still exists.

Structural uncertainty

Uncertain lattice parameters shift peaks. Uncertain fractional coordinates and occupancy change intensities. Thermal expansion, polymorphism, composition, defects, and surface relaxation can dominate differences between ideal calculation and experiment.

Propagate plausible cell uncertainty by recalculating perturbed cells or an ensemble. For a cubic parameter aa, the approximate angular sensitivity above provides a first diagnostic. For general cells, numerical perturbation of lengths and angles is safer.

Model uncertainty

Neutral-atom factors, zero displacement parameters, absent anomalous corrections, and fixed geometric factors define model uncertainty. Debye’s silent zero factors create a categorical validity condition rather than a small uncertainty.

Numerical uncertainty

Periodic enumeration and merging use tight tolerances, but symmetry recognition, cell conditioning, and floating-point degeneracy can affect family organization. Debye grid spacing and finite model size affect sampled features. Browser cancellation can interrupt a calculation without recoverable partial data.

Experimental uncertainty

Instrument calibration, wavelength, specimen displacement, transparency, background subtraction, counting statistics, and profile fitting all have uncertainties. Overlaying a stick pattern on raw data without modeling these terms is only a qualitative comparison.

A defensible comparison reports tolerances rather than declaring “match” from visual proximity. Define angular windows, intensity metrics, ignored peaks, and phase hypotheses before inspecting the result where possible.

Diagnostics

Requested periodic mode returns Debye

Inspect the returned mode. The structure lacked either a cell or nonzero PBC after conversion. Add a physically valid three-dimensional periodic cell only if the specimen is crystalline. Otherwise accept Debye mode and audit its finite model and element coverage. Do not infer the executed branch from the setup selection.

Periodic calculation fails with a cell error

The cell may be singular, nearly singular, or invalid after unit conversion. Check determinant, vector lengths, angles, and duplicate/coplanar vectors. A two-dimensional cell embedded without a nonzero vacuum vector is singular for the three-dimensional reciprocal model.

No periodic peaks

The angular range may exclude all accessible reflections; the wavelength may be too long for the selected range; structure factors may cancel; or retained intensities may fall below 10810^{-8}. Expand the range and verify the cell with an independent reflection list. An empty result can complete but will not open in the current visualizer.

Debye curve is zero or unexpectedly weak

Audit element coverage first. Unsupported elements and H have zero form factor without an error. Then check whether the finite structure contains atoms, whether the damping is excessive, and whether the range is physically valid.

Debye calculation is slow

Cost grows as O(MN2)O(MN^2). Increase angular step, narrow the range, or reduce the finite model only when scientifically justified. The public runtime does not use the available histogram approximation. Cancellation discards computational progress.

Peak positions disagree systematically

Check wavelength choice, cell scale and units, temperature/pressure, specimen zero shift, and whether the experimental line was Kα1, Kα average, or a doublet. A uniform angular offset suggests calibration or displacement; a high-angle-growing difference suggests lattice strain or scale error.

Relative intensities disagree

Check occupancy, atomic displacement, preferred orientation, absorption, phase mixture, anomalous scattering, and source polarization before changing the structural model. Tako omits all but ideal full-occupancy structure factors and its fixed geometric correction.

Symmetry-on and symmetry-off patterns differ

Determine the standardized cell outside Tako. The strict internal tolerance may recognize or reject symmetry differently from another program. Decide whether the distortion is noise or the scientific signal. The output Boolean cannot tell whether standardization actually succeeded.

Periodic step has no effect

This is expected. Periodic output is a reflection list. The step is metadata only. Apply an explicitly documented profile/grid transformation downstream if a continuous curve is needed.

Scaled checkbox has no effect in Debye mode

This is also current behavior. Debye ignores the setting, while the viewer scales vertically for display. Normalize the JSON explicitly in downstream analysis if needed and record the operation.

Failure, cancellation, and restart semantics

XRD runs in the shared calculation worker. Unsupported radiation, invalid periodic metric, missing periodic scattering coefficients, invalid Debye scattering variable, or another runtime error fails the calculation. Pending output artifacts are marked failed.

Cancellation terminates the worker. It can also synthesize errors for other calculations sharing that worker. There is no reflection-enumeration checkpoint, saved pair table, sampled-curve checkpoint, or restart state. A rerun starts from the structure and settings.

Because the complete partialResult appears only after branch calculation finishes, a cancellation during reciprocal enumeration or Debye pair summation normally leaves no scientific partial curve. The log and coarse progress state are not substitutes for a partially validated pattern.

Reproducibility record

The shared record skeleton (structure provenance, versions, artifacts, failures) is defined in Reproducibility and Reporting. A reproducible periodic XRD report additionally preserves:

  • cell vectors, coordinate convention, and periodic axes before frontend conversion;
  • whether the cell is primitive, conventional, supercell, relaxed, or experimental;
  • composition and the fact that all modeled occupancies are one;
  • radiation label and exact scalar wavelength;
  • requested and returned mode;
  • angular range;
  • symmetry-standardization request, fixed tolerance, and independently archived standardized cell or evidence of fallback;
  • reciprocal convention and first-order Bragg relation;
  • atomic form-factor source and neutral-atom assumption;
  • zero Debye–Waller assumption;
  • Lorentz–polarization expression;
  • 10810^{-8} reflection cutoff and 10510^{-5}-degree merge tolerance;
  • family/multiplicity convention;
  • scaling state;
  • all omitted experimental profile and specimen effects.

A reproducible Debye report should additionally preserve:

  • exact finite Cartesian model rather than only a nominal unit cell;
  • atom count and pair count;
  • complete element list and coverage audit;
  • the zero factor for H and unsupported elements;
  • exact sTs_{\mathrm T} and normalized-sinc conventions;
  • Iwasa method and α=1.01\alpha=1.01;
  • damping value and its multiplicative reciprocal-space meaning;
  • requested step, actual point count, actual final grid angle, and whether the 20,000-point cap applied;
  • absence of numerical scaling despite the public checkbox;
  • O(MN2)O(MN^2) exact-pair evaluation and lack of periodic images.

For comparison with experiment, also record instrument geometry, source spectrum, monochromator/filter, calibration standard, detector, scan range and step, sample preparation, temperature, environment, background treatment, peak-profile function, preferred-orientation model, absorption treatment, crystallite-size/strain model, phase list, and refinement statistics. Without those details a numerical overlay is not reproducible experimental analysis.

Scientific completeness checklist

Before using a Tako pattern to support a conclusion, answer the following.

Structural definition

  1. Is the supplied object genuinely periodic or genuinely finite?
  2. Are the cell, coordinates, composition, and atom identities correct?
  3. Are occupancies and disorder important, even though Tako cannot represent them?
  4. Does the structure correspond to the experimental temperature, pressure, composition, and phase?
  5. For Debye mode, does the explicit finite model represent the intended particle size and morphology?

Executed model

  1. Does the returned mode equal the intended branch?
  2. Is the wavelength the actual experimental line or only an average?
  3. If periodic, was standardization independently inspected?
  4. If Debye, are all scientifically important elements supported?
  5. Is the angular range physical and sufficient?
  6. Did the Debye grid hit the 20,000-point cap?

Intensity assumptions

  1. Is strongest-peak scaling appropriate, and was it actually applied only in periodic mode?
  2. Are zero thermal factors acceptable?
  3. Can full occupancy be justified?
  4. Are anomalous scattering, absorption, texture, and extinction negligible for the claim?
  5. Is the chosen geometric correction compatible with the comparison?
  6. Is Debye damping being interpreted as attenuation rather than peak broadening?

Experimental comparison

  1. Has an instrument profile or wavelength doublet been applied where needed?
  2. Are background and noise handled independently?
  3. Are crystallite size and microstrain treated with a physical model?
  4. Are multiple phases considered?
  5. Is the comparison based on several diagnostic reflections rather than one peak?
  6. Are angular and intensity tolerances stated?
  7. Has an independent crystallographic implementation reproduced the essential result?

Evidence and provenance

  1. Does the record meet the shared standard in Reproducibility and Reporting?
  2. Are returned-mode fallback, symmetry uncertainty, form-factor coverage, and viewer normalization disclosed?
  3. Is the conclusion limited to what idealized kinematic scattering can establish?

If any relevant answer is unknown, describe the result as a simulated structural fingerprint, not a phase refinement or quantitative reproduction of experiment.

References and standards

  • P. Debye, “Zerstreuung von Röntgenstrahlen,” Annalen der Physik 351, 809–823 (1915), doi:10.1002/andp.19153510606.
  • W. H. Bragg and W. L. Bragg, “The reflection of X-rays by crystals,” Proceedings of the Royal Society A 88, 428–438 (1913), doi:10.1098/rspa.1913.0040.
  • D. Waasmaier and A. Kirfel, “New analytical scattering-factor functions for free atoms and ions,” Acta Crystallographica A 51, 416–431 (1995), doi:10.1107/S0108767394013292.
  • A. L. Patterson, “The Scherrer formula for X-ray particle size determination,” Physical Review 56, 978–982 (1939), doi:10.1103/PhysRev.56.978.
  • H. M. Rietveld, “A profile refinement method for nuclear and magnetic structures,” Journal of Applied Crystallography 2, 65–71 (1969), doi:10.1107/S0021889869006558.
  • A. W. Coelho, “TOPAS and TOPAS-Academic: an optimization program integrating computer algebra and crystallographic objects written in C++,” Journal of Applied Crystallography 51, 210–218 (2018), doi:10.1107/S1600576718000183.
  • B. H. Toby and R. B. Von Dreele, “GSAS-II: the genesis of a modern open-source all purpose crystallography software package,” Journal of Applied Crystallography 46, 544–549 (2013), doi:10.1107/S0021889813003531.
  • International Union of Crystallography, International Tables for Crystallography, Volume C: Mathematical, Physical and Chemical Tables, Wiley. Definitions and terminology are also available through the IUCr Online Dictionary of Crystallography.

The equations, assumptions, and validation criteria are grounded in crystallographic and scattering sources and in the exact Tako runtime described above.