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

Simulate a Powder Diffraction Pattern

Page type: Task guide
On this page

The XRD command has two different geometry-only algorithms. Periodic enumerates reciprocal-lattice reflections and returns a stick pattern. Debye sums scattering over finite Cartesian atom pairs on an angular grid. Neither branch calls the selected energy calculator. This page describes the visible controls and result artifacts; the scattering equations and approximation hierarchy are developed in Powder X-ray Diffraction, while JavaScript belongs in Powder Diffraction with Tako Script.

Debye mode supports form factors for only twelve elements — C, N, O, P, S, Cl, Ni, Cu, Pd, Ag, Pt, and Au — and silently zeroes every other element, including hydrogen, without a warning or error. Audit the element list against that coverage before trusting a Debye curve; see Known Limitations.

Prepare the structure

For a periodic pattern, use a nonsingular three-dimensional cell and periodic boundary conditions. Verify lattice parameters, atomic coordinates, composition, and the intended conventional/primitive representation. Tako does not model occupancy, site disorder, preferred orientation, crystallite size, microstrain, background, absorption, or an instrumental line profile; the output is a calculated ideal stick pattern rather than a complete experimental powder trace.

For Debye scattering, use the finite cluster exactly as it should contribute. The branch ignores the cell and periodic images and computes ordinary Cartesian pair distances. It is not a powder average of an infinite periodic solid. Element coverage is limited; see the warning above before interpreting a curve.

Open XRD Setup

Select the structure, then choose CalcXRD. The dialog title is XRD Setup. XRD is geometry-only, so the model/calculator controls are not part of this operation.

Configure a periodic stick pattern

Choose ModePeriodic.

Periodic XRD controls showing radiation, angular range, nominal step, scaling, and symmetry refinement

Select Radiation to set the wavelength. The generic Cu Kα and Mo Kα choices use one stored average wavelength; they do not synthesize resolved Kα1/Kα2 doublets. Use an explicitly numbered line when comparison requires it.

Set 2theta min and 2theta max in degrees. If the maximum is not greater than the minimum, normalization replaces it with a valid interval. The periodic algorithm enumerates discrete reflections inside this range.

Step deg does not sample or broaden the periodic result. It is echoed in the returned metadata but is ignored by the reflection calculation, which returns sticks at their calculated Bragg angles. Changing the periodic step therefore cannot add resolution, split peaks, or create a continuous curve.

Leave Scaled intensities selected for a pattern whose strongest retained merged peak equals 100. Clearing it returns the model’s uncalibrated relative values, including structure-factor, multiplicity, and Lorentz-polarization contributions. Those values are not absolute detector counts.

Symmetry refinement asks the periodic implementation to standardize the cell with a fixed internal tolerance before enumerating reflections. The standardization may rotate or replace the cell representation, reorder sites, and change site count. It is not a structural relaxation. The result does not expose the standardized structure, space group, tolerance, or whether standardization failed and silently fell back to the exact input. Clear the switch when a subtle distortion must be preserved and compared directly.

Configure a finite Debye curve

Choose ModeDebye. The Damping field appears.

Debye XRD controls showing the sampled angular grid and damping field while scaling and symmetry switches remain visible

2theta min, 2theta max, and Step deg define the returned angular grid. The minimum is included. The maximum is included only when the interval is an integer multiple of the effective step. The step is clamped to at least 0.001°, and the grid is capped at 20,000 points. If that cap is reached, the actual curve can end below the reported maximum without a warning.

Keep the minimum nonnegative. A negative Debye angle produces a negative scattering coordinate and the operation rejects.

Damping is in Ų. It multiplies the total Debye intensity by an exponential reciprocal-space attenuation. It is not an instrumental peak-width parameter, crystallite-size convolution, or periodic Debye–Waller site factor. Increasing it suppresses high-angle intensity; it does not broaden a discrete peak profile.

The two remaining switches stay visible but are ignored by the Debye runtime:

Visible switchDebye behavior
Scaled intensitiesignored; the artifact retains raw Iwasa/Debye-model values
Symmetry refinementignored; ordinary finite Cartesian pairs are used

The XRD viewer normalizes its vertical display to the largest plotted value regardless of Scaled intensities. Use the JSON artifact, not the plot height alone, when comparing returned numerical values.

Understand automatic branch fallback

Requesting Periodic does not guarantee periodic execution. If the calculation input has no cell or no periodic boundary condition, Tako silently runs the Debye branch. The result’s mode field records the actual branch.

This fallback creates two interface traps: Damping was hidden because the requested mode was periodic, while Scaled intensities and Symmetry refinement remained visible even though the actual Debye branch ignores them. After completion, check mode before interpreting any setting or result array. Add a valid periodic cell and rerun if a stick pattern was intended.

The frontend currently promotes any structure carrying a cell to three-dimensional PBC. Partial slab or chain periodicity is not preserved at this calculation boundary.

Start and monitor the calculation

Choose Start. The Console reports preparation and one branch calculation stage. Periodic XRD normally completes quickly. Debye work grows with the number of atom pairs times the number of angle points and can become expensive for large clusters or fine grids.

The operation emits a complete partial-result event only after the entire branch has been computed. It does not stream incremental peaks or curve segments. Cancellation terminates the calculation worker, leaves no scientific checkpoint, and a later run starts from the beginning.

Open the outputs

The calculation folder contains result.json, xrd.json, and log.txt. xrd.json duplicates the complete public XRD result; it is not a nested field or a separately processed pattern.

The two result shapes differ:

Actual modeMain arrayEntries
periodicpeakstwo_theta_degrees, d_spacing_angstrom, intensity, and one or more { hkl, multiplicity } families
debyepointssampled two_theta_degrees and raw model intensity

Both include the radiation label, wavelength in ångström, reported two-theta range, and effective step. Periodic results additionally echo the requested scaling and symmetry booleans. Debye results do not record damping, form-factor coverage, Iwasa method/alpha, atom count, pair count, or the actual last grid angle.

The viewer draws periodic peaks as sticks and the Debye pattern as a connected curve. It clamps negative displayed intensities to zero, although the raw artifact is authoritative. Periodic family labels are shown only for relatively strong sticks; inspect JSON for full Miller indices and multiplicities.

Validate a periodic result

Check these layers independently:

  1. Verify mode === "periodic" and a nonempty peaks array.
  2. Confirm the radiation/wavelength and angular interval.
  3. Recalculate representative dd spacings and Bragg angles from the cell.
  4. Inspect families and multiplicities rather than assigning phases from one peak.
  5. Repeat with Symmetry refinement cleared when distortions or superstructure peaks matter.
  6. Compare peak positions before intensities. Peak positions primarily test cell geometry; intensities are more sensitive to coordinates, composition, scattering factors, multiplicity, and the missing experimental corrections.
  7. Add a separately declared instrument/background/profile model before comparing a calculated stick pattern with a measured continuous trace.

Peaks within 10510^{-5} degrees are merged. Families are grouped by metric index conventions rather than a returned space-group equivalence analysis. The displayed family is therefore useful indexing metadata, not a complete crystallographic refinement result.

Validate a Debye result

Check mode === "debye", a nonempty points array, a nonnegative minimum, the actual final point, and element coverage. Because unsupported atoms scatter as zero, a smooth curve can be numerically complete yet chemically incomplete.

Repeat the curve with a coarser step to establish that conclusions are insensitive to grid sampling. Repeat with declared damping values only when high-angle attenuation is part of the analysis. Damping is not an experimental full width at half maximum.

The finite Debye sum includes self terms and ordered pair multiplicity but no minimum-image convention or periodic replicas. Cluster size, surface termination, atom count, and shape therefore directly change the pattern. A finite cluster and a periodic cell answer different scientific questions even when they share a local motif.

Compare with experiment

Record radiation line, wavelength, branch, cell/cluster construction, symmetry setting, angular interval, actual last sample, scaling state, damping, element coverage, and software revision. Experimental comparison additionally requires wavelength calibration, zero shift, background, instrument profile, sample displacement, absorption, texture, crystallite size/strain, and occupancy/disorder treatment as applicable.

A single matching peak does not identify a phase, and the viewer polyline is not a basis for an R-factor. Tako returns no refinement objective, uncertainty model, covariance matrix, background model, or experimental calibration. Use the pattern for structural screening and hypothesis generation, then move quantitative refinement to a crystallographic workflow designed for measured data.

Diagnose failures and misleading states

ObservationInterpretationResponse
Requested Periodic, result says Debyecell or PBC was absentadd/verify periodic cell and rerun
Damping field was absent but Debye ranautomatic fallback occurred after requested-mode UI renderingrerun explicitly in Debye if damping must be controlled
Changing Step deg does not move/add periodic sticksperiodic branch ignores stepuse angular range/image structure; apply external broadening separately
Clearing Scaled intensities does not change Debye JSONswitch is ignored in Debyecompare raw points and document viewer normalization
Symmetry on/off gives same patternstructure may already be standard, or standardization may have silently failedcompare exact input externally; result has no success flag
Debye curve is unexpectedly weak/emptyelements lack hardcoded nonzero form factorscheck the supported-element list; do not interpret incomplete curve
Debye curve stops below maximum20,000-point cap truncated the gridincrease step or reduce range
Periodic pattern is emptyno retained reflections in interval or invalid/unsuitable geometrywiden interval, verify wavelength/cell, and inspect logs
Viewer refuses an empty completed resultvisualizer requires at least one normalized pointinspect JSON and revise the calculation interval/structure

The field-level contract and every branch-specific availability condition are generated in tako.xrd Settings.