Powder 6

Refine powder diffraction patterns in the browser. Several phases and several patterns in one session, each phase by Rietveld, Le Bail or WPPF, individually or in one global fit, with structure solution from the extracted intensities.

Overview

Powder 6 is a single page, index.html, that runs entirely on your machine. Nothing is uploaded. It descends from PowderV2 (Dragoe 2001). It does file reading, space groups, scattering factors, peak shapes, charge flipping and the Wyckoff search, together with Rietveld refinement, several phases and several patterns in one session, and global fits.

  • Many patterns, many phases. Every dataset holds its own value of every parameter of its phases. A phase can be in some datasets and not in others.
  • Three ways to get the intensities. Rietveld (from atoms), Le Bail (partitioned from the data) and WPPF (free non-negative intensities solved exactly at each step). Phases using different methods can share a dataset.
  • Individual or global fits. Fit each selected pattern on its own, or fit them together and decide per parameter whether it is shared or local.
  • Constrained models. Special positions, crystal-system cell metrics, GSAS-II style atomic constraints and symmetry-restricted anisotropic broadening are built into the parameter set rather than corrected afterwards (see Constraints).
  • Constant-wavelength X-ray and neutron data, with Kα2, polarisation, sample displacement and transparency.
  • Structure solution. Space-group test, charge flipping and a Wyckoff-site search, handing the atoms back to the phase for a Rietveld fit.
  • Local and private. Fits run in Web Workers. Settings and the Solve options are kept in the browser's local storage. Projects are saved as compressed .project files (.archive and the .powder6 files of earlier versions open too), with observations stored once and persistent calculation history.
Scope. Powder 6 is for educational and research use. It implements standard algorithms but is not a substitute for fully validated, peer-reviewed packages such as GSAS-II, FullProf or TOPAS for analyses intended for publication.

Getting started

Run it

Open index.html through a web server, not by double-clicking it. The page loads workers, shader files and databases with fetch, which browsers block on file://. From the folder that holds index.html:

python -m http.server 8000

then open http://localhost:8000/index.html. Any static server works. Use a current Chrome, Edge or Firefox. The Wyckoff search requires WebGPU in Web Workers. LM fits, intensity extraction and atomic-model symmetry analysis run on the CPU; parallel-tempering fits and charge flipping have CPU fallbacks. See GPU and CPU execution.

Files it needs

The page is made of the files below. The ones marked data are data files that are not code; Powder 6 starts without them but loses the features noted.

PathRoleWithout it
index.html, powder6.cssThe program and its stylesheet.Nothing works.
js/, js/rietveld/All code, workers included.Nothing works.
charge_flipping.wgsl, swarm_reflection.wgslGPU kernels for charge flipping and the Wyckoff search.Charge flipping falls back to the CPU; the Wyckoff search stops with a message.
sg/all.json dataThe 530-odd space-group settings, with operators and Wyckoff positions.No space groups: no new phases, no CIF import, no Solve.
scatters/index.json and the element files dataX-ray and neutron scattering factors.Rietveld calculations and the demo are unavailable. Le Bail and WPPF remain usable.
lib/jszip.min.js dataJSZip, to open the ZIP-based .brml and .rasx files.Those two formats are refused with a message; all others work.
lib/moyo/moyo_wasm.js, lib/moyo/moyo_wasm_bg.wasmPublic Moyo 0.21.0 bindings and compiled atomic-model symmetry engine.Find higher symmetry cannot run. The powder-intensity space-group test remains available.
absorption.json dataMass attenuation coefficients for the transparency estimate.Load your own table in Datasets → Absorption.
Voigt_default.json, TCH_default.json, Split_default.jsonStarting peak-shape presets, offered by Load a peak-shape preset.Load a preset of your own, or start from the built-in defaults.

When a file is missing the status bar says which one and why; the rest of the program keeps working. All numerical work (the banded and skyline solvers behind the covariance matrix and the uncertainties, the non-negative least squares, the Levenberg–Marquardt and parallel-tempering minimisers) is implemented in the program itself, so a fit never depends on a network library. Space-group symmetry data is derived from the Computational Crystallography Toolbox (cctbx; Grosse-Kunstleve et al. 2002), which is also the source of the systematic-absence rules.

A first fit

  1. Click load the demo in the Datasets panel when it is empty, or type demo in the command line (NaCl and Si, simulated with Cu and Co radiation), or read your own pattern with Read patterns… (Datasets tab or File menu) or by dropping it on the window.
  2. Check Datasets → Instrument: wavelength, radiation, polarisation and the 2θ range to fit.
  3. In Phases, read a structure CIF or make a new phase from a space group and cell.
  4. In Commands → Method, pick a method. Start with Le Bail or WPPF to settle the zero, cell and peak shape.
  5. Tick the groups to refine (background, zero and lattice, Sample, Resolution) and press Fit selected datasets or F9.
  6. Read the agreement factors in the results. Then, with atoms in the phase, switch it to Rietveld and tick positions, B and occupancies. The order that works is described in Strategy.

The window

One window with independent command and results panels (left: Datasets, Phases, Method, Structure, Settings; right: Plots, the three methods, Structure, Log, History), following the separation used in Powder5 and extending it to Rietveld. The tabs name each panel; there is no heading above them. Drag their divider to resize them, or double-click it to reset. The header’s ⇄ Panels button swaps their positions and remembers your choice.

Header
File, Data, Refine, Report and FIT, plus the panel swap and theme controls. The panel tabs navigate independently: changing commands keeps the selected results visible.
Plots
Observed and calculated curves and differences for the fit selection. Toggle Anchors, Backgnd, Phases, Refl and Subtract independently. Chebyshev backgrounds have polynomial coefficients and editable background point targets. Anchors remains visible for both background types and is greyed out during background subtraction or in a multi-dataset Overview; its checked preference is preserved. The View and Inspect line under the toolbar appears only when two or more datasets are selected. Overlay draws the selected datasets on the same axes, each in its colour with its fit and difference, and a labelled sample of them (at most the Maximum plots setting) when the selection is large; Overview draws every selected dataset as one thin normalised trace, stacked in a waterfall, without fit curves or anchors, for series of tens or hundreds; Inspect one dataset shows only the dataset chosen in Inspect (← → step through the selection) in full detail. Overview represents every selected dataset with bounded drawing cost; Inspect one dataset keeps the fit membership.
Datasets
Each dataset has a tab using its plot colour. Edit that dataset’s values and refine/fixed flags together, including acquisition corrections, instrument resolution, geometry, background X/Y, phase contributions, cell and atoms. Group toggles affect only that tab’s dataset. Bounds, sharing and links are edited here too. Switching tabs preserves fit/plot membership; setup dialogs default to the active dataset and import dialogs identify their targets.
Phases
Edit shared crystallographic definitions, atoms, broadening models and starting values. These starting-model edits do not rewrite existing dataset values. The used-in list opens the corresponding dataset tab.
Method
Select Le Bail, WPPF or Rietveld and the included phases, then start FIT. FIT runs that method directly. Dataset parameter values and refinement flags are edited in Datasets; numerical conditions are in Settings.
Le Bail, WPPF and Rietveld results
Each Results tab shows one completed run. The Run selector opens previous runs without changing the working method, values or dataset selection; Latest follows newly completed runs. Use as start explicitly restores the viewed calculation. Exports and Report use the viewed run. Saved atomic constraints are listed read-only.
Structure
Commands contains intensity extraction, Space group with separate Test · powder intensities and ADDSYM · atomic model sections, charge-flipping and Wyckoff search settings and actions. Results contains the space-group test output, CF density/sites and Wyckoff candidates, with a previous-solution selector for CF and Wyckoff. Atomic-model symmetry is reported in its own dialog.
History
Completed calculations grouped by method, showing one chosen run with Set, Keep and storage accounting. Global sets restore together.
Log
Verbose messages and diagnostics. Ctrl+Z separately undoes recent editing.
Fit selection
The expandable Datasets for fitting and plotting list in Commands → Datasets defines the plot/fit selection. Coloured tabs independently choose the dataset to inspect. Use Ctrl+A in the dataset list, or a range with Shift+click, for large batches. With multiple datasets, Copy transfers matching parameter values, refinement flags, or both from the named active dataset to all other datasets or one named destination; observations, phase assignments and instrument metadata are retained by the destinations. Copy controls are in the last accordion below Links and are hidden for a single dataset.
Settings
Numerical conditions (algorithm, PT controls, iteration limit, tolerance and weighting), application preferences and history budget. The About button immediately left of Panels opens application information and help.

The theme follows the system and can be switched at any time. A busy calculation locks editing and shows a Stop button. The difference plot is scaled relative to the main pattern for visibility.

Selection, history and project storage

One dataset selection drives fitting and plotting. Inspecting a selected member does not change membership. Choose All datasets, a range (Shift+click) or individual checkboxes; a search box above the list narrows it by name; it appears when there are more than eight datasets. Delete selected removes the checked datasets after confirmation. FIT uses each selected dataset's current values for the active method. Conflicting shared starting values in a global fit require an explicit choice.

A completed fit updates the dataset's working values. For example, if Le Bail changes a lattice from 3.5 to 3.49 Å, the next Le Bail fit starts at 3.49 Å; the shared phase starting model remains at 3.5 Å. Edit the dataset value, undo the fit or explicitly restore a saved run to return to an earlier starting point. The other way round, editing the cell or the atoms in Phases changes only the starting model (what a dataset the phase is newly assigned to starts from); to carry it into datasets that already hold the phase, press Starting model → datasets… under the atoms of the phase (cell, atoms or both, for every dataset holding the phase or one of them; the fit results are cleared, the refinement flags kept). Dataset → starting model… does the reverse: a dataset’s values, its fitted ones after a fit, become the starting model. The Structure block of a phase draws its structure, with coordination and distances, for the starting model or a dataset’s model. Empty Datasets shows only the loading hint and demo link. The phase chooser appears once a phase exists; Method setup appears once both phases and datasets exist.

Each method retains its own setup, background values and results. The background type is a project setting shared by all datasets and fitting methods; changing methods does not change it. Switching methods restores those values and reuses an unchanged calculated plot when its cache is still valid. Inspecting a saved fit similarly reuses its evaluated pattern. Editing the model or acquisition invalidates the affected cache. Wavelength, doublet ratio and fitted range remain acquisition properties of the dataset across method changes.

History stores immutable calculation checkpoints with values, flags, bounds, settings, uncertainties, intensities and the model needed to interpret them. Results → Run selects what is displayed and exported without changing the working setup.

Set
Restores the saved model, dataset values, refinement flags, settings and results into the working setup, just like Use as start. It does not launch a fit or mark the run as kept. Global fits restore their whole set; fixed sources used by cross-dataset links are restored too.
Keep
Protects the stored run from automatic pruning and includes it in compact project saves, without changing the working setup. Kept runs show ★ Kept in the run selectors and a badge on the History card. Unkeep removes this protection. A kept run can still be explicitly deleted once it is no longer current.

Set and Keep are independent: use both to restore a run and retain it for later. Automatic history defaults to 100 MB and 20 recent unkept records per method, with separate quotas of the same size for charge-flipping and Wyckoff results, so structure searches never push out fits; each method's current result is also protected while current. Delete asks for confirmation and Ctrl+Z undoes it. For the chosen run History lists everything: settings, refinement options, phases, limits, statistics, every parameter with its e.s.d., instrument and background, and for solutions their sites, random starts and search log. Save History… writes all records with their results and observations as JSON; Save run report and Save report of all runs write the same information as text. History is read back only as part of a saved project; when a project is opened, runs whose observations are missing are left out and named in the Log. Undo retains 40 recent editing states in memory and shares immutable observation/result arrays.

Full project saves contain retained history; compact saves contain current and kept records. Observation columns are stored once as binary 64-bit values in a compressed archive. CF sites/candidates are saved; density grids are optional. The completed save reports its compressed size. Calibration and structure transfers always identify their target datasets/phases, and transferred atoms retain their source provenance.

Datasets → Links supports exact links between phases and datasets, target = multiplier × source + offset. Dependent refinement flags are disabled; the source flag controls refinement. Values can be edited at either end, preserving the relationship and limits. Each dependent connects directly to an independent source; ambiguous link chains are rejected. See Links for the complete rules.

Concepts

Rietveld, Le Bail, WPPF

Every dataset is modelled as

y_calc(2θ) = background + Σ_phases Σ_hkl height · profile(2θ − 2θ_hkl)

The peak shape is the same whatever the method. The method decides where the intensity of each reflection comes from. Whatever the method, the reported intensities are integrated areas (peak height times the area of the unit-height profile), not heights: a height under-weights high-angle reflections by the full profile broadening.

MethodIntensityUse it to
RietveldS · m · Lp · P · |F|² from the atoms: scale S, multiplicity m, Lorentz-polarisation Lp, March–Dollase factor P.Refine a known structure: positions, occupancies, B, scale, weight fractions.
Le BailPartitioned from the observed pattern (Le Bail, Duroy and Fourquet 1988), starting from a flat set each time, so the intensities depend only on the parameters.Fit cell and peak shape without a structure.
WPPFFree intensities, solved exactly and non-negatively at each step by variable projection (Pawley 1981; Toraya 1986; Golub and Pereyra 1973). Standard uncertainties are those of a full Pawley fit.Extract intensities with uncertainties for space-group testing and structure solution.

Phases with different methods can share a dataset. A phase without atoms can only be Le Bail or WPPF. A phase whose last atom is deleted switches to Le Bail.

Le Bail in detail

The net observed intensity (observed minus background) at each point is shared between the reflections that contribute to it, in proportion to each reflection's calculated profile at that point; summing the shares gives an intensity for each reflection. Powder 6 applies this in a way that keeps the result a function of the parameters alone:

  1. Start. A Le Bail fit begins as a WPPF fit. Variable projection is exact and does not need a good starting point, whereas the partition does: from a poor cell or profile it extracts intensities at the wrong places and the cycles can settle on a profile that only fits those intensities.
  2. Cycles. The classic algorithm then takes over. At the top of each iteration the intensities are re-extracted from a flat start (every reflection given the same height) and iterated until the relative change falls below 10-4, with a floor of 6 passes and a cap of 24. They are then held fixed for the whole iteration: for the baseline residual, for every column of the Jacobian and for the trial step. Only cell and profile parameters move.
  3. Why not re-extract at every evaluation inside the step. The extraction would quietly compensate for any change in width, flattening the χ² surface and making the widths indeterminate. Alternating extraction with least squares, rather than fusing them, is the actual Le Bail method.
  4. Background. The background is held at the values the first stage found while the cycles run. The partition gives every count under a reflection to that reflection, so a background refined in the same cycles can sink while the peaks broaden to take up the difference, a little more at every cycle.
  5. Stop. The cycles stop when χ² stops falling or every shift is below a tenth of its uncertainty, since a re-partition moves χ² a little by itself.
  6. Iterations. Maximum iterations is the budget of the whole fit: the WPPF start uses at most half of it and the cycles use only the remaining budget. With a one-iteration budget only the WPPF start runs.

Le Bail intensities are partitioned, not fitted, so they carry no covariance matrix: their uncertainties are the counting statistics of the observed points propagated through the partition fractions. This is why the space-group test and charge flipping use WPPF intensities.

WPPF in detail

The pattern is linear in every intensity, y(x) = Σ_j I_j φ_j(x; θ) + b(x), so for given non-linear parameters θ (cell, zero, profile widths) the optimal intensities are the solution of a linear least-squares problem, not something to iterate towards. Powder 6 solves it at every step and lets the minimiser search only θ (variable projection; the Jacobian of each non-linear parameter is projected on the complement of the intensity columns, Kaufman 1975). Two consequences matter: the intensities are exactly optimal at every iteration, and the search space is the dozen or so truly non-linear parameters instead of several thousand, which is what makes parallel tempering usable.

  • Pawley or WPPF? The model is the one Pawley introduced: every intensity a free least-squares variable. What differs is the surroundings. Pawley worked with constant-wavelength neutron data and a Gaussian peak; Toraya's whole-powder-pattern fitting was developed for laboratory X-ray data (Kα1/Kα2 doublet, asymmetric peaks, Lorentzian character), which is what Powder 6 is built for. Pawley's slack constraints on near-coincident reflections are not used: exact coincidences are reported as groups instead (see Overlapping reflections). All WPPF reflections of a dataset, whatever their phase, are solved together, so overlaps between phases are handled like overlaps within one.
  • Speed. The normal matrix of the linear step is banded (two reflections interact only where their profile windows overlap and the list is sorted by 2θ), so the solve costs O(n·b²) in the bandwidth b, not O(n³).
  • Non-negativity. An intensity is physically non-negative, but unconstrained least squares can split two overlapping reflections into a large positive and a large negative value that sum correctly. An active-set non-negative least-squares solve removes that region. The uncertainties are nevertheless taken from the unconstrained normal equations, so a reflection pinned at zero still reports how poorly it is determined. This is what lets the French–Wilson treatment in charge flipping avoid the upward bias that clipping to zero would cause.
  • Limits. The information in the data is unchanged: strongly overlapping reflections stay correlated, exactly coincident ones determine only their sum, and a poor starting cell is still a poor starting cell. The separable form makes the surface in θ better behaved, not convex.

Parameters and sharing

Every value has a name and every dataset holds its own value of every name of its phases.

NameMeaning
zero, disp, transp2θ zero shift (°), sample displacement, transparency (dataset). disp is the dimensionless coefficient of the shift −(disp/1000)·cos θ (in radians, converted to degrees); with the goniometer radius R known, the displacement is s = R·disp/2000. transp multiplies sin 2θ (radians); a real, penetrable specimen moves the peaks to lower angle, so its value is negative, t = −1/(2µR).
bkg0 … bkgN-1Chebyshev background terms (dataset).
bga0 … bgaN-1Spline anchor heights (dataset).
p1.scaleScale of phase p1 in the dataset (Rietveld).
p1.a … p1.gammaThe free cell edges and angles of the phase (those its crystal system leaves free).
p1.GU, p1.GV …Peak-shape coefficients, which depend on the profile type (see Peak shape).
p1.poMarch–Dollase r.
p1.Na1.x, .y, .z, .occ, .BAtom parameters (Rietveld). B is the isotropic displacement parameter, B = 8π² Uiso.

Le Bail and WPPF intensities are not named parameters; they come back with every fit, with uncertainties. Parameters that are fixed by a constraint (a cell edge equal to another, a coordinate fixed by site symmetry, a dependent occupancy) are not parameters at all: they are computed from the independent ones. See Constraints.

Individual and global fits

The Mode selector appears only when two or more datasets are selected (with one dataset there is nothing to choose). Individual fits each selected dataset on its own, in parallel, starting from each dataset's current values for the active method. Global fits all selected datasets in one least-squares problem. In Global mode each refined parameter has a padlock: closed means shared (one value for all datasets that hold it), open means local (one per dataset). A dot on the padlock means shared by some of the selected datasets only. Refine → Sharing in the global fit edits this as a table. Scales and backgrounds stay local. If a shared refined parameter has different current values, choose a dataset value or enter a shared starting value before the global fit; cancelling leaves the model unchanged.

Datasets

Geometry contains displacement and transparency. The Sample refinement checkbox selects sample size and strain.

File formats

Drop files on the window or use Read patterns… in the Datasets tab or the File menu. The reader detects the format from the name and the content.

FormatNotes
Two-column text (.xy .csv .txt .dat .asc, .xye with σ)The fallback for anything that is not recognised. Decimal commas are recognised; a wavelength stated in the header ("Wavelength 0.79764", PANalytical CSV keys) is used.
Free-format constant step (FullProf, WinPLOTR, EXPO .dat)First line start step end, then the intensities, any number per line.
PANalytical .xrdmlWavelengths and Kα2 ratio read from the file; each scan becomes a dataset.
Bruker .brml, Rigaku .rasxZIP archives; need lib/jszip.min.js.
Bruker .uxd, Rigaku .ras, Philips .udfText formats; each UXD range or RAS scan becomes a dataset. Binary scans (Philips .rd .sd, binary .raw) are not read: export them as one of the formats above.
GSAS .xra, .esd (BANK lines)Standard and ESD banks.
Jade .mdiRead as two columns.
pdCIF / CIF with a powder profileBrings back wavelength, cell, space group, peak-shape parameters and, for a calculated profile, reflections and background. A structure CIF is not a pattern and is refused with a message.
Powder 6 project .project (also .archive, .powder6, or any zip holding project.json)Opens the whole session.

Several files can be read at once. New datasets appear at the top of the list.

Instrument

Every session starts as a Cu X-ray tube (Kα1 1.540598 Å, Kα2 1.544426 Å, ratio 0.5, no monochromator); the source of the last session is not remembered, and a pattern whose file states a wavelength or radiation takes that instead. Datasets → Instrument… (also in the Data menu) sets, for the selected datasets:

  • Radiation: X-rays or neutrons (constant wavelength). Polarisation does not apply to neutrons.
  • Source: Cu, Co, Fe, Cr, Mo, Ag with the tabulated Kα1, Kα2 and intensity ratio, or your own λ1, λ2 and ratio I(λ2)/I(λ1). The ratio runs from 0 to 1; set it to 0 for a monochromatic beam or synchrotron (no Kα2).
  • Polarisation: tube without monochromator (K = 1), monochromator (with its 2θM), synchrotron (with the polarised fraction f), or none (K = 0). See Lorentz-polarisation.
  • Anomalous scattering: on by default for X-rays, with a checkbox to compare on/off calculations; disabled for neutrons. The bundled scatters/anomalous_chantler.json contains Chantler f′ and f″ in electrons for H–U, copied from Hephaestus's anomalous-scattering file. Each dataset uses linear interpolation in photon energy E = 12398.419843320025/λ1 (eV for λ1 in Å), without extrapolation; exact tabulated energies retain their values. Corrections use the neutral element even when f0 uses an ion. They enter the Rietveld structure factors as f = f0 + f′ + i f″; a powder line holds h and −h in equal parts, so its intensity is the Friedel average (|F(h)|² + |F(−h)|²)/2. The correction is evaluated at λ1 for the pattern, including its doublet model. It is ignored for neutrons and free-intensity methods.
  • Goniometer radius: used for displacement in mm and for transparency estimates.
  • Zero is a refinable 2θ shift. It is highly correlated with the lattice parameters: refine it with care, and preferably against a standard.

Each doublet line obtains its own Bragg angle, displacement/transparency correction and profile area. The input ratio is the radiation weight: the secondary height is multiplied by the ratio of the primary and secondary profile areas and by their Lorentz-polarisation ratio. Refining widths therefore does not redefine the source strength. Extracted intensities retain the integrated primary-line convention.

Lorentz-polarisation

The integrated intensity of a powder reflection is not |F|² alone:

I(hkl) = s · m · Lp(2θ) · |F(hkl)|² Lp = L · P

m is the multiplicity and s an arbitrary overall scale. The Lorentz factor for a θ–2θ scan is L = 1/(sin²θ cos θ) (the usual extra factor 4 is constant and is absorbed in s); it has no parameters and applies to every polarisation setting. The polarisation factor is the same expression for all models, normalised so that P(0) = 1:

P(2θ) = (1 + K cos² 2θ) / (1 + K)
SettingKUse it when
Tube, no monochromator1Sealed tube or rotating anode with a filter, a multilayer mirror or no optic: P = ½(1 + cos² 2θ), the classical unpolarised expression. A Kβ filter absorbs but does not diffract, so it does not polarise.
Monochromatorcos² 2θMA crystal monochromator is in the beam. Enter its take-off angle 2θM.
Synchrotron(1 − f)/fA polarised source; f is the fraction polarised perpendicular to the diffraction plane. f = 1 gives K = 0, the same arithmetic as None.
None0Neutron data, intensities already corrected elsewhere, or a deliberate test of the correction.

The Instrument dialog has no Fit from/to controls. Use Datasets → Exclusions to omit regions. Existing project range limits remain effective and can still be changed with the range>>from&to command. Text and PDF reports list whether anomalous scattering was used, the data source, λ1, energy, and each element's actual f′/f″. Completed History and project records retain those exact values, so a later wavelength or table change does not rewrite a saved calculation. Legacy explicit values are retained when reading older projects; applying Instrument uses the automatic table or the disabled setting.

Table reference: Chantler et al., NIST X-Ray Form Factor, Attenuation, and Scattering Tables. The copied arrays contain the anomalous correction f′, already excluding the ordinary f0 term; WK1995 Gaussian coefficients remain the separate source of f0.

Choosing 2θM

In Instrument, hover the Monochromator 2θ /° label or hover/focus its angle field for a table of graphite (002), quartz (10-11), Ge (111)/(220), Si (111)/(220) and LiF (200) take-off angles. The table uses the current λ1 displayed in that dialog and updates as you edit it or choose a source. It lists only reflections accessible at the current wavelength (λ1 ≤ 2d). Click any row to fill the angle field, or focus its crystal button and press Enter or Space. The Instrument dialog stays open until you Apply. These are approximate Bragg 2θ angles; choose the optic installed on the instrument, applying the perfect-crystal convention below when needed.

2θM is not free: it follows from Bragg's law at the monochromator, 2θ_M = 2 arcsin(λ / 2d_M), so the same crystal gives a different angle on every anode (graphite 002 sits at 26.6° on Cu and 12.2° on Mo). The static reference entries below are 2θM in degrees with K = cos² 2θM in brackets, for Kα weighted-mean wavelengths; the dialog tooltip instead uses its exact current λ1. Enter the angle, not K.

Optic (dM, Å)Cr 2.2910Fe 1.9374Co 1.7903Cu 1.5418Mo 0.7107Ag 0.5608
Graphite (002) (3.354)39.9 (0.588)33.6 (0.694)31.0 (0.735)26.6 (0.800)12.2 (0.956)9.6 (0.972)
Quartz (10-11) (3.343)40.1 (0.585)33.7 (0.692)31.1 (0.734)26.7 (0.799)12.2 (0.955)9.6 (0.972)
Ge (111) (3.266)41.1 (0.569)34.5 (0.679)31.8 (0.722)27.3 (0.790)12.5 (0.953)9.8 (0.971)
Si (111) (3.136)42.9 (0.537)36.0 (0.655)33.2 (0.701)28.5 (0.773)13.0 (0.949)10.3 (0.968)
LiF (200) (2.014)69.3 (0.124)57.5 (0.288)52.8 (0.366)45.0 (0.500)20.3 (0.879)16.0 (0.924)
Ge (220) (2.000)69.9 (0.118)57.9 (0.282)53.2 (0.359)45.3 (0.494)20.5 (0.878)16.1 (0.923)
Si (220) (1.920)73.3 (0.083)60.6 (0.241)55.6 (0.320)47.3 (0.459)21.3 (0.868)16.8 (0.917)

For a graded multilayer mirror (Göbel and similar) choose the tube setting: the beam meets the multilayer at grazing incidence, 2θM is a couple of degrees and K > 0.997. For an optic that is not listed, dhkl = a/√(h²+k²+l²) with a(Ge) = 5.6575 Å and a(Si) = 5.4310 Å; graphite's d002 is half its c axis.

  • Geometry. The formula is the parallel case: the monochromator diffracts in the equatorial plane, as for a Johansson Ge (111) incident-beam crystal or a diffracted-beam graphite crystal on essentially every laboratory instrument. A monochromator mounted with its diffraction plane perpendicular to the equatorial plane gives P = (K + cos² 2θ)/(1 + K), a different function that no value of 2θM can imitate.
  • Mosaic or perfect crystal. K = cos² 2θM is the ideally mosaic result, right for graphite. A perfect crystal needs K = |cos 2θM|; to use it, enter the equivalent angle arccos √K (19.1° instead of 26.6° for graphite geometry, K = 0.894 instead of 0.800). The two differ by well under 2 % in P.

Choosing f for a synchrotron

Bending-magnet and undulator radiation is polarised in the horizontal plane, f typically 0.90 to 0.98 there. What matters is the orientation of the diffractometer: with a vertical scattering plane (usual for high-resolution work) the field is perpendicular to it, f ≈ 0.95–1.0 and P is nearly flat; with a horizontal scattering plane the field lies in it, f ≈ 0.05–0.1 and P → cos² 2θ, a severe correction that vanishes at 2θ = 90°. Getting this backwards is a much worse error than misjudging f by a few per cent.

Where Lp matters

  • Rietveld phases. Lp is part of the model: height = S·m·Lp·P·|F|²/A. Changing the polarisation changes the calculated pattern, so it can move the refined atomic parameters, B and scale. Set it correctly before refining a structure.
  • Le Bail and WPPF phases. Every intensity is a free quantity and absorbs Lp completely. The polarisation model cannot move a cell parameter, a profile coefficient, Rwp or χ². It changes the meaning of the refined intensities: the |Fo| derived from them, the input to charge flipping, the Wilson prior behind the French–Wilson correction and the space-group test.
  • |Fo|. An observed structure-factor modulus is |Fo| = √(Ihkl/(m·Lp)) on an arbitrary scale, where Ihkl is the integrated Kα1 area of the reflection (the convention of the Rietveld model, I = S·m·Lp·P·|F|²) and Lp is evaluated at the corrected peak position with the polarisation model declared for the dataset.

Background and exclusions

Background… chooses Chebyshev or Spline for every dataset in the project, including unselected datasets and patterns imported later. The type is independent of dataset order and fitting method. Coefficients, term counts, anchor positions, heights and refinement flags remain dataset-specific; editing one dataset does not copy its values into the others.

  • Chebyshev polynomial over the fitted range, 0 to 24 terms. 0 terms disables the background: its contribution is zero everywhere, with no background coefficients to refine; use this for data whose background has already been subtracted. 1 term gives a constant background (polynomial degree 0). Fitting Chebyshev to background points requires at least 1 term. The range is mapped to −1 … +1; the coefficients may have either sign and enter the model linearly, so their derivatives are exact. Changing the fitted range re-expresses the coefficients to preserve the existing background at retained angles, including when restoring another method’s saved background. The Anchors control is always visible. Automatically estimated background points appear on the plot and in the dataset's Background group. Their number is independent of the term count: degree N needs at least N+1 selected points; six terms means degree five and needs six points. Edit each point's angle and intensity, or select its Use checkbox. Fit to points fits the polynomial by orthogonal least squares and holds the coefficients during Sample fitting. Place automatically replaces the targets with estimates from the included data and fits them. Ctrl+click adds or removes a target; right-drag moves it. Editing a target immediately refits and holds the coefficients. Excluded and out-of-range targets are ignored; insufficient or poorly distributed targets are refused. Tick Background or individual coefficient flags to resume whole-pattern refinement. Targets are used only in the separate polynomial fit, not as simultaneous restraints. Automatic targets and the fitted polynomial need inspection: selected points need not lie exactly on an overdetermined polynomial, and fixed-background uncertainties are conditional on that chosen background. Existing saved curves are preserved until a point fit or edit is requested.
  • Spline through anchors whose heights are the parameters (monotone cubic Hermite, Fritsch and Carlson 1980), 2 to 200 anchors. Their 2θ positions stay fixed during refinement. In Datasets → Background each anchor is a row with its 2θ and its height (both editable, one header for the columns), a × that removes it (at least two stay) and the refine tick. The monotone form gives a smooth, physically realistic baseline without overshoot between anchors. Place anchors now and anchors>>n put them at the two ends of the fitted range and at the lowest point of equal stretches between them, never in an excluded region; new heights are estimated from the data and existing anchors keep their values. With spline backgrounds, Ctrl+click on the pattern places an anchor at both cursor coordinates (on an anchor it removes it). This also works with logarithmic and square-root intensity axes. Right-drag an anchor to move it in angle and height; Escape cancels the move. Filled magenta squares are refinable anchors; hollow grey squares are fixed. Editing an anchor height in Parameters shows a yellow vertical line at its position.
  • Excluded regions, immediately after Background inside the dataset editor, are left out of the fit, the extraction and the statistics, but the pattern is still calculated there. Add zone asks for the start and the end 2θ of a zone; each zone is a row with its two boxes, an Apply tick and a × that deletes it. Untick Apply to compare a fit with and without a zone: the zone stays in the list but takes no part in the fit, the shading, the extraction or the statistics. These rows edit the active dataset tab (the command Excluded regions of selected… sets the zones of all the selected datasets at once). On the plot, Ctrl+Shift+drag marks a region and Ctrl+Shift+click inside removes it for the first selected dataset. Manual anchor placement also uses the first selected dataset; right-dragging edits the visible anchor under the cursor.

Fixed or fitted background: what it does to the numbers

Background fittedBackground fixed
UncertaintiesInclude the background: each anchor or term adds a column to the Jacobian, so the covariance knows that a free baseline absorbs part of what the peaks would otherwise explain.Every σ is conditional on the anchors being exactly right.
Parameter count and χ²Counted, so the degrees of freedom are honest.Not counted: χ², and every σ scaled by it, is optimistic by roughly the number of anchors.
Extracted intensitiesThe baseline adjusts with the fit, so a slightly misplaced anchor corrects itself.Any error in the anchors goes straight into the intensities, because the decomposition works on yobs − ybkg.

Fitting the background does not excuse poorly placed anchors. A refined anchor moves in height only, so a point put in the middle of a peak is pulled up under it and the peak loses intensity to the baseline. With few reflections, or a steeply sloping background sampled by too few anchors, a fitted background and a broad low-angle peak describe the data equally well and the fit cannot tell them apart. Fit the background when the anchors are already close; leave it fixed while the cell and the profile are still moving. In Le Bail cycles the background is held (see Le Bail in detail).

Resolution

Datasets → Resolution… holds the instrument contribution to peak width as a calibration, independent of sample broadening (U, V, W for the Gaussian part, X/cos θ, Y tan θ and Z for the Lorentzian part, plus the TCH axial asymmetry terms SL and HL; see Peak shape). Use Save calibration after fitting a standard, then load the calibration for other datasets. Sample broadening can be saved separately from File.

Load calibration and Save calibration appear above the coefficients. The current dataset determines the displayed coefficient family; loading a calibration detects its profile type automatically. Choose the profile in the active dataset’s Instrument resolution group. TCH is the default, with one TCH entry; pseudo-Voigt and split pseudo-Voigt also retain independent sample size and strain. Instrument profiles are edited only in Datasets.

Absorption

The bundled absorption.json file loads automatically at startup. With its elemental mass attenuation coefficients and the composition and density of the phases, Powder 6 estimates the physical transparency of the sample. Atoms, or a formula with an integer Z, are needed for composition and crystallographic density. If the file is missing, place it beside index.html and reload.

Phases

Create a phase with New phase… (a space group and a cell), Read CIF… (cell, space group and atoms; also in the File menu) or Simulate… to calculate a pattern from phases that have atoms. Each phase has a name and a colour used for its contribution and its reflection ticks. Assign phases to datasets with Datasets → Phases… (or phases>>p1&p2); a phase taken out keeps its values for when it comes back.

Simulate a pattern lists only phases with atoms. When exactly one phase is eligible, its name is shown and it is always included. When several are eligible, the Include checkboxes select their contributions. The dialog has the same wavelength-dependent monochromator angle picker and Anomalous scattering checkbox as Instrument. Click a crystal row to fill its angle. Anomalous scattering is disabled for neutrons; for X-rays it interpolates the selected phases' factors at the displayed λ1 before generating the pattern, including when starting from WPPF or Le Bail. The current fitting method is preserved. The generated dataset keeps the selected settings and the factors used in its simulation metadata.

Every phase is an accordion titled in the colour of its plot, with its space group and number of sites; the current phase is open with its editor, and opening another one selects it. Each phase’s complete atom list and its Add atom…, Atoms from CIF… and Fragment… controls sit in a collapsible Atoms accordion. A separate Structure block immediately below it offers the picture, coordination and distances even when Atoms is collapsed; Constraints and Restraints follow. The dataset’s Rietveld controls also group all atoms of each phase together and show that dataset’s Structure directly below them. The Phase name row selects the phase and its colour. Edit, immediately right of the colour picker, renames the phase. In Choose a phase, the × at the end of each row removes that phase after confirmation, including its assignments to datasets; Undo restores it.

Space group

Type a symbol, a number or a Hall symbol, or press Browse for the space-group browser: filter by crystal system, centring and axis choice, search by number or symbol, and read the reflection conditions of the selected setting before pressing Apply. Every setting of a group is offered separately, because the reflection conditions differ between them (No. 62 appears as Pnma, Pmnb, Pbnm, Pcmn, Pmcn and Pnam). Applying a space group re-derives the sites of the atoms, the free cell parameters and the constraints that still hold (see Constraints).

Subgroups. Commands → Structure → Space group → ADDSYM → Subgroups… lists the maximal subgroups of the phase's space group: translationengleiche (same lattice, lower point group; Fm-3m → I4/mmm, index 3) and klassengleiche (same point group, a sublattice of index 2, 3 or 4, so a larger cell; Fm-3m → Pm-3m). Choose one and press Convert…: it opens with that group, the new axes and the new origin (Axes and origin set to Enter them), and the atoms are kept, with the sites the lower symmetry no longer relates split. Repeat for the next step down. Rows of one group type that differ only by axes or origin are shown once.

Finding higher symmetry. Open Commands → Structure → Space group → ADDSYM → Find higher symmetry… to analyse the starting model, a dataset’s Rietveld model, or after a Le Bail or WPPF fit the dataset’s refined cell with its atoms, with Moyo WebAssembly. The active dataset is selected initially. See Atomic-model symmetry for the controls, conversion and limitations, and Bundled Moyo code for the local engine files and license.

Converting to another space group. Phases → Convert… (left of Browse…) describes the structure in another space group or setting, as in International Tables A, 1.5: new axes (a′, b′, c′) = (a, b, c)P and origin p, x′ = P−1(x − p), G′ = PTGP, h′ = hP. The structure is expanded to the full cell, carried to the new axes and reduced with the new symmetry. A subgroup keeps every atom and splits the sites the lower symmetry no longer relates (Fe1 → Fe1a, Fe1b); a supergroup merges atoms the new symmetry relates, and is refused, naming the atom and the distance, unless the structure and each dataset’s refined positions have that symmetry within the tolerance (0.1 Å by default); another setting of the same group changes only the axes and origin (P21/c → P21/n, Fd-3m origin choice 1 → 2). Work them out (Axes and origin) searches axis changes with entries −1, 0, 1 and origin shifts in eighths whose cell fits the new crystal system within 3 %, preferring unchanged axes, then the most compact cell with obtuse angles, then the smallest shift; Enter them takes any transformation, e.g. “a+b,-a+b,c” and “0,0,1/4”, including centred or larger cells. The cell, positions, B, occupancies and fit flags of the starting model, of every dataset holding the phase (from its own values) and of their saved calculations are converted; the preferred-orientation direction and uniaxial broadening axes follow the axes. Fit results are cleared, atomic constraints and parameter links of the old atoms are removed, and Ctrl+Z undoes the conversion.

Monoclinic settings. All three unique-axis choices are supported. The unique axis is read from the symmetry operators of the setting, and the cell then offers the one angle that is free: β for unique axis b (P121/c1), γ for unique axis c, α for unique axis a. The other two are fixed at 90° and are not parameters. Reflection orbits and multiplicities follow the same axis, so the three settings of one lattice give identical peak positions and intensities.

Reflections

The reflection list is built from the symmetry operators of the selected setting. Every hkl inside the resolution sphere is mapped onto its orbit under the Laue group; the orbit is kept once, labelled by a canonical member, and its size is the multiplicity m in I ∝ m·Lp·|F|². Systematic absences are tested on that representative, which decides the whole orbit: h is extinct if some operator (R, t) satisfies hR = h with h·t not an integer. Working from the operators, rather than from a fixed index range per crystal system, matters wherever two Laue classes share a crystal system and have genuinely different sets of independent reflections:

SystemLaue classesWhat separates them
Cubicm-3m / m-3m-3 permutes the axes cyclically only, so (210) and (201) are independent; in m-3m they are equivalent.
Tetragonal4/mmm / 4/m4/m has no mirror exchanging a and b, so (hkl) and (khl) are independent. P4 has Laue class 4/m: a general reflection has 8 equivalents, not the 16 of 4/mmm.
Hexagonal6/mmm / 6/mAs for tetragonal.
Trigonal-3m / -3In -3 the orbit is generated by the 3-fold axis and inversion alone and is half the size.
Trigonal-3m1 / -31mThe two settings differ in which form is special: -3m1 gives h0l multiplicity 6 and hhl 12, -31m the reverse.

In hexagonal and trigonal cells the special forms depend on the Bravais–Miller index i = −(h+k) as much as on h and k: a reflection lies on a mirror whenever any two of h, k, i are equal in magnitude, so (1 -2 l) and (2 -4 l) are special although |h| ≠ |k|. This follows automatically from the operators. The Laue class matters in two further places: the Stephens anisotropic-broadening terms allowed (see Profile symmetry) and the orbit sizes used by charge flipping (see Constraints in structure solution).

Atoms

Add atom… takes a label, an element or ion type, fractional coordinates, occupancy and B. Each atom shows its Wyckoff site; coordinates on special positions are constrained automatically. Relationships between atoms are made in the phase's Constraints section (Edit constraints in Datasets →), described in Atomic constraints. A CIF read with Read CIF… brings its atoms in the same way, and the sites are re-derived from the space group.

Atoms from CIF… reads the atom sites of a structure CIF into the current phase, replacing its atoms or adding to them; the phase keeps its own cell and space group, and a file in another space group or with a cell more than 2 % different is read with a warning. Fragment… puts a molecule (PDB, MOL/SDF V2000, XYZ or Z-matrix) into the current phase: its atoms are labelled by element (C1, C2 …, numbered past the labels already there) and placed with their centroid at a point of the cell (by default the point farthest from every symmetry element, so that the atoms sit on general positions) in the orientation of the file; a PDB with a CRYST1 cell can keep its own fractional coordinates instead. Hydrogens are left out by default for X-rays, and a rule for every bond and every angle of the molecule is added to the restraints of the phase with the same labels. A fragment is a starting model: its position and orientation are those you gave, so refine it with the restraints on, or move it, before trusting it. Hydrogen scatters weakly for X-rays and is usually not located by powder data; the Wyckoff search does not place it.

Peak shape

Each dataset has an instrument profile. Choose it in Datasets → Instrument resolution; TCH is the default. Every available family combines the instrument response with independent crystallite-size and microstrain broadening for each phase contribution. The Gaussian and Lorentzian widths depend on θ; the resulting peak is a pseudo-Voigt, pV(x) = η L(x) + (1 − η) G(x).

Profile typeParameters and widths
Thompson–Cox–Hastings (default)Instrument Gaussian variance U tan²θ + V tan θ + W and Lorentzian width X/cos θ + Y tan θ + Z, combined with sample broadening using the TCH polynomial approximations. SL and HL describe low-angle axial asymmetry.
Pseudo-VoigtInstrument coefficients U, V, W, X, Y and Z, with an independent mixing parameter η (0 pure Gaussian, 1 pure Lorentzian). Sample size and strain contribute independently to the widths.
Split pseudo-VoigtIndependent instrument coefficients U, V, W and X for the left and right flanks (U_L … X_R), plus eta_split. The same sample size and strain contribute to both flanks.

Units and conventions of X and Y

Instrument Lorentzian coefficients follow the GSAS convention, in centidegrees (1 cdeg = 0.01° 2θ): HL [°] = (X/cos θ + Y tan θ + Z)/100. X multiplies 1/cos θ, Y multiplies tan θ and Z is constant. The Gaussian coefficients are GSAS variances: HG [°] = √(8 ln 2·(U tan²θ + V tan θ + W))/100, with U, V, W in cdeg². Each phase contribution adds its own sample size (shown in nm) and strain (ppm), with Gaussian/Lorentzian mixing fractions. Size can be isotropic, uniaxial or ellipsoidal; strain can be isotropic, uniaxial or Stephens.

For orientation, with K = 1 and λ and D in the same unit, a crystallite size D gives a Lorentzian 1/cos θ coefficient of 18000 λ/(π D) cdeg (λ = 1.5406 Å and D = 100 nm give 8.8), and a microstrain S in µε gives a tan θ coefficient of 0.018 S/π cdeg (1000 µε give 5.7). These relations connect sample size and strain to the added Lorentzian widths.

Other programs. GSAS and GSAS-II use these names. FullProf uses the opposite ones, in degrees: their X multiplies tan θ (strain) and their Y multiplies 1/cos θ (size). To carry values over, exchange the two and multiply by 100: X = 100·YFullProf, Y = 100·XFullProf.

Anisotropic strain (Stephens)

Anisotropic microstrain, where broadening depends on direction in the crystal, is modelled by a fourth-order polynomial in the Miller indices (Stephens 1999). The refinable coefficients S400, S040 … are the symmetry-unique ones for the Laue class of the phase (see Profile symmetry). These are quartic reciprocal-metric variances (ppm²·Å-4); the strain width follows from √ΣS·d². This sample model is available with every instrument profile.

Position, asymmetry and truncation

Peak positions include the Kα2 doublet, zero shift, displacement and transparency. Instrument calibrations are saved in Datasets → Profile; sample broadening is saved from File. Each reflection is evaluated only within a finite window around its centre, from 8 FWHM for a Gaussian to 25 FWHM for a Lorentzian (interpolated with η) and never wider than 10° 2θ. The profile value at the window edge is subtracted from the whole peak as a small pedestal, so the profile reaches zero continuously rather than stepping off a cliff (a step would put a discontinuity in the pattern and in the derivatives). The exact area of the untruncated shape is carried along so that reported intensities are free of the truncation bias (the tails cut at the window are counted, as the background takes them up in the data). With the SL/HL asymmetry, which stretches one flank and compresses the other, that area includes the change the asymmetry makes, integrated numerically. The on-screen preview, final LM refinement, reported intensities and uncertainties use the same CPU implementation in double precision. PT can evaluate exploratory patterns on WebGPU, with numerical validation and CPU fallback as described below.

Preferred orientation

The March–Dollase axis of a phase (h k l, not all zero) is set in Phases (Preferred orientation) and its r, with its refine box, in the dataset's parameters (PO r). r = 1 means random orientation; r must lie between 0.1 and 5. The factor is averaged over each reflection's equivalents. Rietveld phases only.

Constraints

The exact constraints below remove independent refinement variables. Restraints instead add soft penalties, and limits restrict allowed values; these controls are distinguished explicitly below. A powder model has many more apparent degrees of freedom than the sample has. Powder 6 removes the redundant ones exactly, by eliminating dependent parameters from the least-squares problem, rather than by penalties or by correcting values afterwards. This description of elimination applies to exact constraints and links, not to the soft restraints listed alongside them. A constrained parameter has no Jacobian column of its own, takes no part in the count of refined parameters, and has the uncertainty that follows from its independent parameters. This section lists every kind of constraint, what it does, and where its limits are.

KindSet byApplies toEditable
Cell metricCrystal system of the space groupa, b, c, α, β, γThrough the space group
Special positionsSite symmetry of each atomx, y, zThrough the space group and the coordinates
Atomic constraintsYou (GSAS-II rules)x, y, z, occupancy, BYes
LinksYou (source, multiplier, offset)Named parameters within or between phases and datasetsYes
RestraintsYou (distance rules)Distances and angles between atoms (soft)Yes
Limits and step capsDefaults and DatasetsEvery parameterLimits yes; step caps no
SharingYou (padlocks)Parameters across datasetsYes
Profile symmetryLaue classStephens ShklThrough the space group
Structure solutionSpace group, youCharge flipping, Wyckoff searchPartly

Cell and crystal system

The crystal system decides which cell parameters exist at all. Only the free ones are parameters; the others are fixed numbers (90°, 120°) or equal to another parameter, and cannot be ticked.

SystemFree parametersImplied
Cubicab = c = a; α = β = γ = 90°
Tetragonala, cb = a; angles 90°
Hexagonal, trigonal, rhombohedrala, cb = a; α = β = 90°, γ = 120° (rhombohedral groups are on hexagonal axes)
Orthorhombica, b, cangles 90°
Monoclinica, b, c and the angle of the unique axis (β, γ or α)the other two angles 90°
Triclinica, b, c, α, β, γnone

Because an implied parameter is computed from its master, it has the master's uncertainty exactly: in a hexagonal cell b is not an assumption, it is determined as precisely as a. Changing the space group to another system re-derives the free set and carries over the values that still apply. Cell edges have default limits of half to twice the starting value, angles 30° to 150°.

Special positions

An atom on a symmetry element has fewer free coordinates than three. Powder 6 finds each atom's site from the operators of the space group: the stabiliser of the position (the operators that map it onto itself within a small distance tolerance, using the minimum-image distance), the multiplicity N/|stabiliser|, the position projected exactly onto the site, and the free directions. The free directions are the null space of the stacked (R − I) of the stabiliser, in reduced row-echelon form with the columns taken z, y, x, so that x stays free whenever it can. Examples:

  • (x, x, x): one free coordinate, x. y and z are computed from it, and the Jacobian has one column, not three of which two are copies.
  • (x, 0, 0): x is free, y and z are fixed numbers.
  • (0, 0, 0), (½, ½, ½): no free coordinate. The three coordinates cannot be ticked.

The position is always r = r₀ + Σ u_f · basis_f, with uf the values of the free coordinates and r0 what the site fixes. This is why a special position is constrained, not corrected after each step: a refinement can never walk an atom off its site, and the standard uncertainty of a dependent coordinate is that of its master. Each atom shows its Wyckoff letter and site expression in the Phases tab. Adding or editing an atom, or changing the space group, re-derives the site; relationships that became impossible are trimmed (see below).

Constraints: atomic relationships

The rules follow GSAS-II. They relate parameters of atoms of one phase and are linear. They apply to Rietveld phases only (the atomic model may be retained in Le Bail and WPPF, but these relationships are not used during those fits) and to every dataset that holds the phase. Edit relationships in Commands → Datasets → Constraints, reached also from the Constraints section of the phase in Phases. Choose a type and parameter, select the atoms, then click Add. The small question-mark button beside the description explains the GSAS-II relationships. Dataset parameter links and sharing are under Links. Every change is validated and applied at once, and can be undone. Results → Rietveld lists the relationships saved with the selected run as read-only output.

The three kinds

KindMeaningWhich flags count
EquivalenceB = mB · A, C = mC · A … for the same parameter (x, y, z, occupancy or B) of several atoms. The first atom you pick is the independent parameter A; the others follow it, with the multipliers you set (default 1).Only the refine flag of the independent parameter. The dependents follow it whether or not they are ticked.
Constraint equationmA·A + mB·B + … = c for the same parameter of several atoms, with multipliers m and a total c.The refine checkboxes enable or fix the whole equation together. The last term is computed from the others: N terms give N − 1 independent values. Editing either term updates its partner while preserving the equation and parameter limits. A message identifies equations whose limits leave no freedom to refine.
HoldThe listed parameters are not refined.Whatever their refine flag says.

In the Parameters list, constrained parameters are marked: H held, • independent parameter of an equivalence, ≡ dependent, Σ an equation term. An equivalence dependent has a disabled refine flag; a sum dependent still has an active checkbox that controls the entire sum. A tooltip gives the relationship in words, for example “= 0.5 × A.x (equivalence); its refine flag is ignored”.

Rules the editor enforces

  • A parameter belongs to one relationship only: it is held, or it is in one equivalence or equation. (GSAS-II: a parameter is dependent in at most one constraint, and a held parameter in none.)
  • An atom appears at most once in a relationship. Equivalences and equations need at least two atoms, a hold at least one.
  • Multipliers are finite and non-zero (the first multiplier of an equivalence is always 1); the total of an equation is a finite number.
  • Coordinates fixed or dependent by site symmetry cannot be used. Only a free direction of a site can be constrained: (x, x, x) offers x; (0, 0, 0) offers nothing. The atom chips for such coordinates are disabled with the reason in the tooltip.
  • Constraints apply per component. To tie x, y and z, add one relationship for each, or use the mixed-site shortcut.

Editing values and refinement flags

Valid manual edits to an equivalence update its independent value and all dependent values, even when you edit a dependent textbox. Its refine flag remains disabled: only the independent flag determines whether the group is refined. A sum equation behaves differently: checking or unchecking any term updates all of its refine flags in the inspected dataset. Imported or older partially enabled sums appear mixed, with a warning; click a term to enable the whole group.

For Na1.occ + Cl1.occ = 1, entering 0.30 for Na sets Cl to 0.70; entering 0.40 for Cl sets Na to 0.60. Both refine checkboxes are checked together, but only one independent occupancy is refined. For sums with more than two terms, editing one value preserves it and recomputes the last other term; the remaining current values are retained. Changes must satisfy every term’s limits.

Bounds can remove the remaining freedom. Two occupancies limited to 0–1 and constrained to sum to 2 must both equal 1: the editor reports that the limits leave no freedom to refine. An attempt to enter 0.90 for either term is rejected because it would force the other to 1.10. To change the model, edit the total or a justified limit; a refine checkbox cannot create freedom that the equation forbids.

Mixed site shortcut

For two or more atoms that share one position (a solid solution, a site with a vacancy), the type Mixed site adds, in one step, equivalences for x, y, z (only those the site leaves free) and B, plus the equation occ1 + occ2 + … = 1. The atoms must have the same site symmetry (same expression and multiplicity). Click any occupancy refine checkbox to enable all terms together; one occupancy is computed from the others, leaving at most N − 1 independent occupancy values. Unchecking any term fixes the whole occupancy group. Position and B equivalences still use only their independent atom’s refine flag.

Worked examples

IntentionRelationship
Same B for two oxygensEquivalence on B: O1 (independent), O2.
B of O2 = 1.5 × B of O1Equivalence on B, then edit the multiplier of O2 to 1.5.
Fe and Ni mixed on one siteMixed site: Fe1, Ni1. Occupancies sum to 1; same x, y, z and B.
Na and Li partial occupancy summing to 0.8Constraint equation on occupancy: Na1 + Li1 = 0.8.
Stoichiometry: 2·occ(A) + occ(B) = 2Constraint equation on occupancy with multipliers 2 and 1, total 2.
Keep B of a heavy atom fixed while others refineHold on B for that atom (or simply leave it unticked: Hold also overrides a ticked flag).

What happens when you apply one

  1. Starting values are aligned. For an equation, the current values are projected onto Σ mi vi = c inside the parameter limits (each value is moved along the multiplier direction and clamped to its limits; the monotone dependence of the sum on the shift is solved by bisection). If the equation cannot be met within the limits (for example a total of 3 for two occupancies limited to 0–1), the editor says so and nothing changes. For an equivalence, the dependents are computed from the independent parameter. Atoms are then put back on their sites.
  2. Previous fits are cleared. The statistics, uncertainties and intensities of the Rietveld calculation of the phase's datasets are invalidated, because the model changed. The change is one undo step.
  3. The fit eliminates the dependents. At each evaluation the dependent value is the affine function offset + Σ tk · xk of the free parameters, so derivatives are exact (chain rule), and the number of refined parameters is that of the independent ones. A dependent of fixed parameters is simply a constant, set once.

Bounds and uncertainties

  • Limits apply to dependents too. Constrained occupancies must remain within 0–1 as well as any tighter user limits; an invalid manual edit is rejected, rather than silently changing the constraint. If a dependent has a single independent term, its bounds are translated into bounds on the independent parameter (divided by the multiplier) so the minimiser cannot cross them; incompatible bounds are reported (“Incompatible constraint bounds for …”). With several terms the combination is checked at the starting values and at each step (“Starting values conflict with a constraint or the parameter limits”).
  • The uncertainty of a dependent is propagated from the covariance of its independent terms, var = Σjk tj tk covjk, including their correlation. It is not shown when a term is at a bound or the matrix is ill-conditioned, and the Parameters list says why. A coordinate whose uncertainty reaches half a cell edge is flagged as not constrained by the data.

When the model changes under a constraint

Deleting an atom, changing a site or the space group, or renaming a label can invalidate a relationship. Powder 6 trims it rather than refusing the edit: the atom (or a coordinate that became fixed by symmetry) is removed from the relationship; if the independent atom of an equivalence goes, the next atom becomes the independent one with multipliers rescaled; relationships left too small are dropped. Every trimming is written to the Log (“A1.x removed from: …”). Projects saved with the older plain “equal” groups are read as equivalences with multipliers 1.

Dos and don'ts

  • Constrain what chemistry demands (a shared site, a charge or stoichiometry sum, a common displacement parameter for chemically similar atoms), not what makes the fit look better.
  • Refine a mixed-site total only if scattering contrast allows it: Fe and Ni (Z = 26, 28) are nearly indistinguishable for Cu X-rays, and the occupancy ratio is then undetermined whatever the constraint.
  • Occupancy and B are strongly correlated; constrain one of them (or refine them in separate steps) when the data are poor.
  • Atomic constraints are linear. For bond lengths or angles, use Restraints, which penalize departures from a distance or angle window; an exact rigid-body parameterization is not provided. Wyckoff-search distance rules belong to a separate structure-solution calculation.

Open Datasets → Links → Add parameter link…. Select the source dataset and independent parameter, target dataset and dependent parameter, multiplier and offset. The equation is target = multiplier × source + offset. Unlike an atomic equivalence, a link may connect different parameters, phases or datasets, and applies to the active calculation method. Rietveld, Le Bail and WPPF save and restore their method setups, including links. When a method has no saved setup yet, it starts from the current setup; verify that its parameter choices remain appropriate.

  1. Source and target must be available, independently editable parameter names. They may have the same name in different datasets; a parameter cannot link to itself in the same dataset.
  2. A target has exactly one source. A source may drive several targets. A target cannot itself be a source of another link: chains and cycles are rejected. Connect each target directly to the independent source.
  3. The multiplier must be finite and nonzero; the offset must be finite. The dialog uses displayed parameter units, including nm for crystallite size and the target’s display units for offsets. Choose physically meaningful relationships; the numerical link does not establish that two parameters have compatible physical meanings.
  4. Adding a link immediately aligns the target value, validates limits, clears affected fit results and records Undo. If the values exceed limits or conflict with another dependency, the link is not added. An atomic constraint and a parameter link cannot independently prescribe the same dependent parameter; incompatible combinations are rejected.

Editing and refining linked values

During refinement the target follows the source exactly and has no independent refinement variable. Its refine checkbox is disabled; tick the source to refine the relationship. With a fixed source, all its targets remain fixed by the equation. Source and target limits still apply.

You can edit either value manually. Editing the source updates every target. Editing a target computes source = (target − offset) / multiplier, then updates the other targets of that source. For example, with multiplier 2 and offset 0.01, source 0.03 gives target 0.07; entering target 0.09 sets source to 0.04. A limit violation rejects the edit without changing any participating dataset.

A source outside a particular fit is held at its current value. In an individual fit of a dependent dataset, a source in another dataset is therefore a fixed reference for that job. Use a global fit including the relevant datasets to refine the independent source jointly with the dependent patterns. Sharing and atomic dependencies must remain compatible with the link equations.

Remove deletes a link, with Undo, while retaining the target’s current numerical value. Decide whether to refine or fix the now-independent target. Links are stored with projects and the active method setup.

Links, sharing and Copy are different operations

ControlEffectScope
ConstraintsExact atomic equivalences, sums and holds.One phase, applied to its Rietveld datasets.
RestraintsSoft distance/angle penalties outside chosen windows.One phase, applied to its Rietveld datasets when rules exist.
LinksExact multiplier and offset between explicitly named parameters.Chosen source and target datasets/phases, for the active method.
ParametersLimits and shared flags; global sharing uses one value for a parameter across its sharing group.Global-fit dataset groups; scales and backgrounds remain local.
Copy from…A one-time copy of matching values, refinement flags or both. It creates no continuing relationship.Final dataset accordion below Links; all other datasets or one named destination.

Limits and shared flags have their own accordion, Datasets → Parameters, immediately before Links and at the same level. The Shared column and Sharing… button appear only for a global fit with multiple selected datasets that can share the parameter; per-row checkboxes are omitted for local, dependent or single-dataset parameters. Preferences are preserved when those controls are hidden. An empty Links block is hidden: use Add parameter link… in Parameters to create the first relationship, which reveals Links. Removing the last relationship hides Links again. Copying values does not turn on sharing or add links, and later edits remain independent unless a constraint, link or sharing rule already connects them.

Restraints

Constraints remove parameters exactly. A restraint is softer: a distance or an angle that should stay near a known value is added to χ² as an extra observation, so the fit is steered toward chemically sensible geometry without fixing anything. Restraints belong to a phase (open Datasets → Restraints, immediately below Constraints, or Edit restraints… in the phase's Restraints section in Phases), apply to Rietveld calculations only and act in every dataset that holds the phase. In a global fit the phase counts once, shared between its datasets.

The rules use the same language as the distance constraints of the Wyckoff search, one per line, but A and B are atom labels of the phase (they are unique in a phase; case matters, though a label that differs only in case is accepted when it is unambiguous):

RuleMeaning
Fe1 C1 6 1.6/2.2 octThe six nearest C1 around Fe1 lie between 1.6 and 2.2 Å and form an octahedron (all B–A–B angles against 90°/180°). Shapes: lin, tri, tet, sq, oct. A count without + also pushes the next neighbour beyond the upper distance.
C1 C2 - 1.38/1.42The nearest C2 to C1 is between 1.38 and 1.42 Å (one value on each side, 1.40/1.40, is a target).
O1 O1 - 2.4/No O1 closer than 2.4 Å to another O1 (a floor); /3.0 is a ceiling.

The symmetry images of B (every operator and neighbouring cell) are searched, so atoms of the asymmetric unit restrain each other through the whole structure. A value inside its window costs nothing; outside it, the cost is ((value − nearest bound)/σ)² × weight, with σ(distance) in Å and σ(angle) in degrees, both set beside the rules (defaults 0.02 Å, 3°, weight 1). The restraint rows enter the normal equations, so the uncertainties of the parameters they touch include them, and the degrees of freedom count them as observations. Rwp, Rp and the other agreement factors use the pattern only.

Geometry helper

Choose a central atom and a bond, angle, tetrahedron, octahedron, square planar, triangle or linear geometry. Set the bond distance and distance window, and the angle window where applicable. With distinct atom labels, select the neighbours in order; for square and octahedral geometries, #1/#2, #3/#4 and #5/#6 are opposite pairs. Angle rules are converted to neighbour-to-neighbour (1-3) distance windows using the target bond lengths, so their angular tolerance is approximate when the bonds vary. An individual angle accepts two different bond lengths.

For a geometry built from symmetry copies of one site, choose Symmetry copies of one site and one neighbour label. The generated counted shape rule includes its own angular window, for example Si1 O1 4 1.59/1.65 tet angle=3. This Rietveld-only suffix means a flat window of ±3° around each ideal angle; without it the ideal angle remains a point target. The phase-wide sigma sets how strongly values outside the window are penalized.

The editable active-restraints textbox appears first, under a coloured phase heading. Rules apply automatically when present; clearing the textbox removes them, including for projects saved with a legacy disabled flag. The short restraint description and its question-mark tooltip appear once above the phase headings, matching Constraints. The tooltip covers the complete syntax and fitting behavior. Click Helper to open a modal with Geometry, Molecule and Suggest tabs. Each tab’s Add generates and merges rules into the shared collected-rules textbox below the tabs. It leaves the dataset rules unchanged. Duplicate or conflicting pairs keep the first collected rule and are reported. Copy copies the validated collection to the clipboard; paste it into the main dataset restraints textbox to apply it with Undo. Close closes the modal without changing the dataset. These are soft geometric restraints, rather than a true rigid-body parameterization. The inline editor keeps direct rule editing and weights; the Helper dialog contains all rule-generation tools.

A nearest-distance rule (A B - …) is about an atom-label pair: A–B and B–A refer to the same pair, even with different windows. A counted or geometry rule is about the B around A, one per ordered pair: Fe1 O1 6 1.9/2.2 oct (the octahedron around Fe1) and O1 Fe1 2 1.9/2.2 (the two Fe1 around O1) are two rules. Renaming an atom renames it in the rules, whatever case they wrote it in; deleting an atom removes the rules that name it (listed in the Log). Helper additions keep the first collected rule and report duplicates and conflicting windows skipped; Copy also prunes any duplicate or conflicting lines typed into the collection. This also prevents overlapping generated angle-distance rules from being counted twice. To change a pair’s tolerance or geometry, edit its existing rule in the active-restraints textbox; manually duplicated pairs are rejected. This pruning checks repeated pairs and conflicting definitions for a pair; it does not prove that the complete set of distances forms a realizable molecule or is compatible with the chosen space group.

Rules editor and molecule guide

  • The rules are checked as they are typed (unknown labels, bad windows, shapes); a valid text is applied when you leave the box, with Undo. Under it, a table lists the restrained values (those outside their window first, the others marked in window) in the inspected dataset if it holds the phase (else a selected dataset or the starting model): the value now, the window and the deviation.
  • Molecule tab. Open a PDB, MOL/SDF, XYZ or Z-matrix file (or paste it) and press Add to generate and collect rules. Bonds are the pairs closer than 1.2 × the sum of the covalent radii; each bond becomes A B - d−0.03/d+0.03, and each pair of atoms two bonds apart (an angle) a rule on its 1-3 distance with a ±0.06 Å window, so bond lengths and angles are both held. The atoms of the file are matched to the atoms of the phase by name or by order; rules for atoms the phase does not have are left out, so a molecule on a special position needs only its asymmetric unit. Z-matrix lines are label, label ref d, label ref d ref angle and label ref d ref angle ref dihedral, the references being line numbers or labels. The result joins the helper collection; use Copy, then paste into the dataset textbox to apply it. To bring the atoms and their rules in one step, use Phases → Fragment….
  • Suggest tab. Add collects one counted rule per atom and neighbour label from the contacts shorter than 1.2 × the covalent radii, widened by the window you give; it freezes the geometry the model has now and is meant to be edited.

Renaming an atom renames it in the rules; deleting an atom leaves its rules, and the next Rietveld fit stops with a message that names the missing label. Parallel tempering with restraints runs on the CPU (the WebGPU kernel does not know them). Restraints are saved in the project, in restore points and in the text and PDF reports.

Limits and step caps

Every parameter has a lower and an upper limit, and every iteration has a maximum step per kind of parameter. Limits are set in Datasets → Parameters (type inf for none); the defaults below apply to any parameter without an entry. A step that would cross a limit is clipped to it, and the gain ratio of Levenberg–Marquardt is evaluated for the step actually taken, so parameters parked at a limit (weak reflections at zero in WPPF) do not throttle the rest. If an entire step is blocked (the model sits in a corner of the limit box with the gradient pointing out of it) the fit stops and says so, rather than raising the damping against a wall. A parameter whose Jacobian column is identically zero is left out of the solve and reported once by name.

ParameterDefault limitsLargest step per iteration
Scale0 … ∞none
Cell edges a, b, c0.5 … 2 × starting value2 % of the value
Cell angles30° … 150°1°
Atom x, y, znone0.05
Occupancy0 … 2 (0 … 1 under an atomic constraint)0.2
B−2 … 30 Ų2
March–Dollase r0.1 … 50.25
Zero shift−2° … 2°0.1°
Displacement / transparencynone2 / 0.01
η, mixing parameters0 … 10.25 (size and strain mixing 0.2)
Lorentzian widths (X, Y, Z, SL, LX …)≥ 00.5 × max(|value|, 1) (SL, HL: 0.01 to 0.05)
Size (µm)0.001 … 1020 % of the value
Strain (µε)0 … 1060.5 × max(|value|, 5)
Stephens S400, S040, S004≥ 00.5 × max(|value|, 5)
Everything elsenonenone

The Gaussian variance of a profile (U tan²θ + V tanθ + W, and its phase-owned counterpart) is a physical quantity and is enforced separately from these boxes: a refinement step that would make it negative anywhere in the fitted range is cut back to that boundary, so the coefficients stop there instead of walking past it (see Ill-conditioned profile refinements).

Physically, GU, GW, GP, U and W should be non-negative, and a Lorentzian width below zero has no effect at all (the profile code floors it), so the fit would wander off there and lose the parameter. If a limit is reached, check the starting model before widening it.

Sharing in global fits

In a global fit, sharing is itself a constraint: a shared parameter is one unknown for all datasets that hold it. Scales and backgrounds stay local. Atomic constraints and sharing combine, with two rules: the terms of one constraint equation must have the same sharing (all shared by the same set of datasets, or all local), otherwise the fit stops with “Constraint sharing conflict: use the same global/local sharing for …”; and a globally shared dependent parameter must have the same equation in every dataset that holds it.

Profile symmetry

Anisotropic strain is described by the symmetry-allowed terms of a quartic form in hkl (Stephens 1999). Which coefficients exist follows from the Laue class, so symmetry-equivalent terms are not separate parameters:

SystemIndependent coefficients
CubicS400 (= S040 = S004), S220 (= S202 = S022)
TetragonalS400 (= S040), S004, S220, S202 (= S022)
Hexagonal, trigonalS400, S004, S202
LowerThe terms the point group allows, derived from the symmetry operators

The dependent terms are not shown and have the uncertainty of their master, exactly. Uniaxial size and strain models take their axis as hkl and weight each reflection by its angle to it.

Constraints in structure solution

Structure solution uses its own constraints, summarised here and detailed in Structure solution:

  • Charge flipping works from the operators of the selected space group: reflections in one orbit share one amplitude, overlapping distinct reflections share only their total, systematic absences are held at zero, phases are symmetrised with a strength λ, and a fraction of the weakest reflections is freed (Charge flipping).
  • Wyckoff search places atoms only on Wyckoff positions, enforces the formula and Z, applies the contact floor and your distance rules, and checks the space-group arithmetic on Z (Wyckoff search).
  • Space-group test works only with reflections that were free parameters in the WPPF fit: run it from the condition-free group of the Laue class (Space-group test).

Fitting

What gets refined

Tick parameters in the Parameters panel, or tick groups in Solve: background, zero and lattice, Sample, Resolution, and for Rietveld also atomic positions, B and occupancies. Sample selects the phase broadening parameters (or the effective profile parameters of a legacy profile). Resolution independently selects the active instrument broadening coefficients shown in Parameters → Resolution. Each group changes only its own parameters in the selected datasets. A dash in a group box means some of its parameters are ticked. Refine → Tick scales and background and the next entries tick the parameters of a step and of the steps before it. Parameters that a constraint makes dependent cannot be ticked independently; their flag is ignored.

Le Bail and WPPF retain the dataset's Rietveld atomic model without displaying an Atoms section in their results. pdCIF includes these atoms when available, with the cell of the current calculation, and labels them unused by the free-intensity method. Use Rietveld to refine atomic values. Each method retains its own background values and fitted results under the common project background type.

scales (and Refine → Estimate scales and background) estimate the scales and a constant background to get started; Refine → Fit scales only (untick the rest) unticks every flag of the selected datasets except the phase scales and fits them. Every fit also begins with one linear step on the scales and background (the model is linear in them), taken before the full fit.

Algorithms

Levenberg–Marquardt (LM)

LM is a gradient-based method for non-linear least squares that interpolates between Gauss–Newton and steepest descent. It converges quadratically near the minimum and is the method that gives the standard uncertainties. Powder 6 uses Marquardt scaling, solves the damped normal equations by Cholesky factorisation (an indefinite matrix means the normal equations are corrupt, and Cholesky fails exactly there, which makes the loop raise the damping and retry), holds limits by an active set, and caps the step per kind of parameter (Limits and step caps).

Derivatives are exact for background terms, scales and atom parameters (x, y, z, occupancy, B, through the unit profiles of the reflections), differences of the heights for the March–Dollase parameter, differences of the spline for anchors, and central differences (one-sided at a limit) for cell, profile, zero, displacement and transparency. With WPPF phases in the dataset, the Jacobian is projected on the complement of the intensity columns; with Le Bail phases, see Le Bail in detail.

Cross-dataset links contribute derivatives in every dataset they affect, even when the independent parameter belongs to another dataset. Reflection enumeration follows the current geometry and includes the entire allowed tail window. Intensities and saved uncertainties carry HKL identities so a peak crossing cannot exchange their errors.

Parallel tempering (PT), then LM

WebGPU PT. All three fitting methods try WebGPU automatically. The GPU performs proposals, cell and structure-factor calculations, all four profile types, backgrounds, joint non-negative intensity solves, χ² evaluation, acceptance decisions and replica exchanges. Initial and perturbed trial costs must agree with the double-precision CPU model within 0.1% of max(1, χ²); promising candidates are checked again on the CPU before the final LM fit. The GPU intensity solve uses a scaled KKT tolerance of 10−5. Unavailable devices, failed numerical checks, unconverged solves, device loss and resource limits restart CPU PT. There is a setup budget of one million Miller-index triples and 2048 potential free intensities per dataset; actual buffer limits may be lower. Results, the Log and text exports record the backend and fallback reason. A seed repeats the proposal stream for the same backend; GPU arithmetic can differ across devices, and CPU and GPU streams differ. The Wyckoff search already uses its own GPU replica-exchange search against extracted intensities.

PT, also called replica-exchange Monte Carlo (Swendsen and Wang 1986), runs several copies (replicas) of the model at fixed temperatures T = Tmaxr/(R−1), from 1 to the highest temperature. Each sweep every replica makes as many proposals as there are refined variables, each a Gaussian change of one parameter chosen at random (step scale from the local curvature and the parameter's step cap, widened by √T, reflected at the limits) and accepts it with probability min(1, exp(−Δχ²/2T)). Adjacent replicas then attempt to swap configurations, alternating even and odd pairs. A good solution found by a hot replica in a distant valley thereby percolates down to the cold ones. The best configuration is handed to LM, which converges locally and produces the uncertainties. A seed makes a run repeatable. PT costs many more model evaluations; use it when the starting cell or profile is uncertain.

  • WPPF under PT. The intensities are not searched; they are solved exactly at each evaluation, so a replica walks the same non-linear parameters it would in Le Bail mode, and its cost is the reduced objective, the residual after the intensities have been optimised. That is the function whose minimum in θ is the true minimum, so the Metropolis test and the swaps mean what they are supposed to mean.
  • Le Bail under PT. The PT stage and the first LM stage treat the Le Bail phases as WPPF (exact intensities at each evaluation); only the closing cycles are classical Le Bail. A cost that re-extracted partitioned intensities for every proposal would be non-stationary.
  • Which algorithm? LM alone when the model is already close; PT with the LM finish when it is not (typically a cell known only roughly).

Stopping

The fit stops when the relative change of χ² is below the tolerance twice in a row, when every refined parameter is at a limit or has no effect, or at the maximum number of iterations. Stop (or stop) ends a run; a stopped fit keeps nothing from the half-finished stage.

Weights

Supplied weights in a pdCIF take precedence over standard uncertainties. ESD, FXYE and XYE files retain their supplied σ values; otherwise the default is 1/max(counts, 1). Imported zero weights exclude those points even in unit-weight mode. Weights and uncertainties remain attached to their observations when the axis is sorted and are saved with the project.

Each point has weight 1/σ², with σ² the counts (Poisson) or the σ read from the file; a unit weight can be chosen in Settings. This is the right model for measured counts and for nothing else; see χ² and the weights for what happens when the intensities are not counts. The structure fitting steps (Wyckoff search and final coordinate refinement) use a different weight: 1/σ² of each extracted intensity from the WPPF decomposition, because the uncertainty of an extracted intensity comes from the decomposition and not from photon counting (see Wyckoff search).

Strategy

A sequential refinement is far more reliable than releasing everything from a poor starting model. The usual order, which the Refine menu steps follow:

  1. Set the model. Load the data, check the instrument (wavelength, doublet, polarisation, range), assign the phases, choose the space group and a starting cell. Exclude regions with artefacts or an unmodelled phase.
  2. Scales and background. Place the background (Chebyshev terms, or spline anchors close to the baseline) and let scales or the first step estimate them. Keep spline anchors out of peaks.
  3. Zero and cell (Le Bail or WPPF). Refine the lattice parameters and, if needed, the zero shift, so the calculated ticks fall on the observed maxima. If LM drifts to a poor solution from a rough cell, run PT once, then LM for the precise minimisation.
  4. Isotropic peak shape. Calibrate instrument widths against a standard, then refine sample size and strain for each phase contribution. Instrument and sample refinement have independent controls in Datasets.
  5. Asymmetry and shape. Introduce asymmetry (SL/HL, or the left/right widths) if there is a clear misfit at low angles, and η where it is free.
  6. Anisotropic broadening (last, and only if systematic misfits remain: some reflections consistently broader than the model). Refine only the symmetry-independent Stephens terms.
  7. WPPF for intensities. With a stable model, a final WPPF fit gives the most statistically sound intensities and uncertainties for the space-group test and structure solution. LM is generally the recommended algorithm for this step.
  8. Rietveld. Switch a phase with atoms to Rietveld. Release the scale first, then positions, then B, then occupancies, checking the difference curve after each. Use atomic constraints for shared sites and chemically similar atoms. Release the orientation parameter last, and only for a reason (visible texture).
Visual inspection comes first. Numerical indicators can mislead. A good fit has a difference curve of random noise centred on zero. Structured residuals (“M-shaped” features at peaks, broad humps where the background is inadequate, un-indexed peaks) mean a systematic error: wrong peak shape, unmodelled anisotropy or asymmetry, poor background, or an impurity phase.

Results and export

The selected completed calculation appears in its Results → Le Bail, WPPF or Rietveld tab, in folding blocks: Results and quantitative analysis (agreement factors, scale, weight fraction, RBragg and cell of each phase in each dataset that holds it), Atoms (Rietveld only), Reflections (or Intensities for Le Bail and WPPF, with their uncertainties). The Run selector opens previous results without editing the working setup. Weight fractions follow Hill and Howard: W_p = S_p M_p V_p / Σ S_i M_i V_i, valid when every crystalline phase of the sample is in the model.

The main export controls are Save pdCIF, Save results and Save Patterns, plus Save HKL for WPPF. Save CIF remains in Rietveld's 3D structure block. Save results contains the full reflection tables, including rows beyond the on-screen limit. Structure results use four sticky tabs with the same styling as Method; charge flipping and Wyckoff show their structure directly below the sites.

Zero convention: zero = 2theta_obs - 2theta_calc_without_zero (experimental minus calculated), in degrees 2theta. Positive zero shifts calculated peaks to higher measured angles. The pdCIF tag _pd_calib_2theta_offset = -zero is calculated minus experimental: add it to measured angles to obtain calibrated angles. Both signs are stated in pdCIF comments and in Save results.

Agreement factors

R_p = Σ|y_obs − y_calc| / Σ|y_obs| R_wp = [ Σ w (y_obs − y_calc)² / Σ w y_obs² ]^½ R_exp = [ (N − P) / Σ w y_obs² ]^½ χ² = (R_wp / R_exp)² (reduced); GOF = √χ² R_Bragg = Σ|I_obs − I_calc| / Σ I_obs (Rietveld phases)

Rp is computed on the gross intensities (background included) and is sensitive mainly to the strong reflections. Rwp is the primary figure of merit because its weights follow the counting statistics across the whole pattern. N is the number of fitted points and P the number of refined parameters, including the determined intensities of Le Bail and WPPF phases, so the degrees of freedom are honest. RBragg uses Iobs obtained by sharing the observed net counts among overlapping reflections in proportion to the calculated profiles. χ² ≈ 1 is the target only when the weights are the true variances. A global fit also reports overall factors computed from the combined weighted residual sums, not the mean of the dataset percentages.

What does RBragg mean?

RBragg = 100 × Σ|Iobs − Icalc| / Σ|Iobs| compares integrated reflection intensities. The observed intensities are not measured directly: they are estimated from the profile by sharing the observed net counts among overlapping reflections, so they depend on the model, especially for overlapping peaks. A value of 0.04 % means a residual ratio of 0.0004; it alone does not establish a correct structure. RF is the same comparison on √I. Le Bail and WPPF phases refine free intensities, so their structural RBragg and RF are not defined and are omitted. Judge a structure by Rwp, the difference curve and physical plausibility too.

Powder 6 has no Williamson–Hall plot. Read crystallite size (nm) and strain (ppm) directly from each dataset’s phase contribution. They remain independent of the instrument coefficients for every available profile family.

Uncertainties

A refined value is printed in the crystallographic compact form, a = 5.4639(3) Å: the parenthesis is the standard uncertainty in units of the last digit shown, so this reads 5.4639 ± 0.0003. The value is rounded to the digit its uncertainty reaches and no further; the uncertainty is quoted to one significant figure, except where its leading digit is 1, which gets two (rounding 0.00012 to 0.0001 would misstate it by 17 %).

The uncertainties are the diagonal of the covariance matrix from the final normal equations, scaled by the reduced χ²: σj = √(χ²red Cjj), with χ²red = χ²/(N − P). They are the precision of the fit, not the accuracy of the measurement: they exclude sample displacement not modelled, any systematic error in the wavelength, and (with a fixed background) the background itself. A cell edge good to 3 × 10-4 Å by this measure can still be wrong in the third decimal for reasons the refinement cannot see. Parameters on a limit have no uncertainty. A parameter that a constraint makes dependent has the uncertainty of its independent parameters, with their correlation (Bounds and uncertainties).

WPPF intensity covariance propagates integrated area, including the profile-area derivative and its covariance with height. Extraction after a global fit keeps the complete fitted dataset set, variable sharing and limits; it does not substitute individual-dataset errors. Bound and exactly coincident intensities have conditional uncertainties. Singular nonlinear covariance or a regularized intensity system is labelled conditional in Results and reflection exports. Legacy tables without HKL identities cannot safely assign saved errors to newly ordered reflections.

Site-symmetry dependent coordinates carry the covariance of their free coordinates. FWHM diagnostics measure the actual pedestal-subtracted profile, including each split flank and asymmetry. This diagnostic is independent of the existing truncation-window heuristic and is evaluated only when needed.

Ill-conditioned profile refinements

Uncertainty unavailable means that the final joint covariance could not be estimated. It does not establish that every displayed parameter is unconstrained: one redundant combination can prevent inversion of the whole matrix, including uncertainties for otherwise measurable parameters such as zero shift. The dataset parameter list shows no s.u. with an explanation on hover. Fit diagnostics in Datasets, Results and saved reports identify locally dependent combinations, including combinations of three or more variables, and variables with zero derivative. The check uses a unit-diagonal normal matrix so different parameter units do not determine which variables are flagged. It does not manufacture uncertainties using extra damping or a pseudoinverse. Diagnostics are retained in calculation history and projects.

In the instrument model the Gaussian variance is U tan²θ + V tanθ + W. A negative V is common and is allowed; the combined variance must remain non-negative over the fitted range. Powder 6 checks the endpoints and any interior minimum — of a separated profile's inst.U, inst.V, inst.W and, for a phase with its own profile, of its own coefficients (pN.U, pN.V, pN.W, pN.GU, pN.GV, pN.GW with GP/cos²θ included, or the two split flanks). A phase-owned polynomial is checked too because it is the one a legacy TCH phase refines: before 2.42.14 it was not, and a refinement could end with a variance of −300 cdeg² at the high-angle end without a word.

A negative variance is not a narrow peak: it is the width floor pretending there is no Gaussian component at all, and once that width is far below the sampling floor the coefficients have almost no effect on the pattern, so their refinement is unstable. Powder 6 therefore treats combined variance ≥ 0 as part of the model and not as advice. Active constraint faces and weighted feasible projections permit improvement along the variance boundary without shrinking unrelated parameters to zero. Bisection remains a final safeguard. Convergence checks the feasible gradient; a tiny clipped step alone is not sufficient. Nothing is reset, no refinement flag is changed, and a fit that starts outside the region (an old project, or values typed in) is not walled in, so it can still come back. Parallel tempering applies the same rule to its proposals, and a WebGPU result outside the region is not taken by the double-precision finish.

When a fit ends on that boundary the diagnostics name the polynomial, the angle where its variance reaches zero and the fact that the Gaussian component is at the floor, and point at the usual cause: an instrument resolution that does not belong to these data. Calibrate it on a standard, or drop the Gaussian coefficients from the refinement and let sample size and strain carry the broadening.

Stephens strain is checked as a combined quartic variance on every modelled reflection direction and additional reciprocal-space probes. Negative cross coefficients are allowed when the resulting variance is non-negative; clamping a negative variance to zero is diagnosed as invalid. CPU and GPU searches preserve this valid region, and GPU best-candidate selection also checks feasibility on the CPU. For uniaxial strain, two free components starting at zero receive a joint numerical start of up to 1 ppm, recorded in fit diagnostics. Fixed parameters and evaluate-only extraction are unchanged.

Instrument and specimen broadening cannot always be separated from a single unknown specimen. With isotropic Lorentzian broadening, instrument X and inverse crystallite size both multiply 1/cosθ, while instrument Y and microstrain both multiply tanθ. Refining the instrument term and all corresponding sample terms together can leave an undetermined exchange between them. Gaussian strain can similarly trade against instrument U. A good Rwp cannot resolve that ambiguity.

For sample size/strain analysis, determine the instrument resolution from a suitable standard with known or negligible sample broadening, load that calibration and keep its coefficients fixed while refining the sample. When fitting the calibration standard, fix its sample broadening instead. Release width and asymmetry terms gradually after the peak positions agree, retaining only parameters supported by the data. These practices follow the IUCr refinement guidelines and International Tables: Rietveld refinement. Numerical diagnostics describe the current fit and refinement flags; they are not a substitute for instrument calibration.

χ² and the weights

χ² ≈ 1 is the right target only when wi is the real variance of yi. The Poisson weight assumes σ² = y, which is exact for raw counts and for nothing else. Three ways a dataset stops being counts:

  • Normalisation. Synchrotron data are often divided by a monitor, the ring current or the exposure time. A pattern whose strongest peak reads 100 “a.u.” would, as counts, scatter by ±10 at the peak and by about a quarter of its own height in the background. If the trace is visibly smoother, the numbers are not counts.
  • Averaging. Multi-analyser crystals, strip and area detectors and repeated scans average many measurements into each point. That cuts the noise by √n and leaves the scale alone, so √y overstates σ.
  • Smoothing or rebinning. Both correlate neighbours, which removes scatter without touching y. This cannot be undone afterwards: fit the unsmoothed data.

The relationship is linear: with w = 1/y, multiplying every intensity by k multiplies χ² by exactly k. A run reporting χ² = 0.05 says its data sit about twenty times below a count scale; scale the intensities up by twenty before loading and χ² arrives near 1. If a σ column comes with the file, Powder 6 uses it and the problem does not arise.

  • Unaffected by a wrong weight scale: the refined parameters (a constant factor on all weights does not move the minimum), Rwp and Rp (ratios in which the scale cancels) and the standard uncertainties (the covariance is scaled by χ², which cancels the error exactly). Intensity uncertainties scale with the intensities, so the relative ones are invariant. A low χ² is therefore not a reason to distrust the table.
  • Broken: χ² as a figure of merit, Rexp = Rwp/√χ², and any judgement “χ² is near 1, so the model is adequate”. Read Rwp and the difference curve instead.

The failure is asymmetric. A χ² far below 1 is almost always this scale problem and leaves the model intact. A χ² far above 1 can come from an over-optimistic σ, but much more often it is a real deficiency (a missing phase, a wrong peak shape, an unmodelled background) and should not be scaled away.

Overlapping reflections

Two reflections closer together than their profile width have nearly parallel derivatives. Intensity can move from one to the other with almost no change to the calculated pattern, so the data cannot say how it divides between them: the normal matrix is near-singular in that direction and the diagonal of its inverse blows up. A large σ there is the fit reporting, correctly, that the reflection's share is undetermined; it is not a failed fit, and the peak may look perfect on screen. What is determined is the total of the cluster. Its uncertainty needs the full covariance (var = Σij covij), because the off-diagonal terms are large and negative and it is their cancellation that makes the sum well determined; adding the individual variances in quadrature gives a hugely pessimistic total. Kα2 belongs in the decision of what overlaps: at high angle the satellite lands on unrelated reflections. Use cluster totals, not individual values, for anything downstream.

Exactly coincident reflections

Some sets cannot be separated at all. In a cubic F cell 333 and 511 have the same h²+k²+l² and therefore the same 2θ, the same profile and identical columns in the normal matrix; so do 700 and 522, and a dozen more pairs; accidental coincidences in low-symmetry cells do the same. The linear system is then exactly singular in those directions, and the solver (a modified Cholesky that repairs only the pivots that fail, Gill and Murray 1974: a pivot at or below 10−8 of its own diagonal, a column all but identical to earlier ones) puts the whole group intensity on one member and leaves the others near zero, so that the several hundred intensities that are determined are not biased by a damping term large enough to cope with every coincidence. The split within such a group is arbitrary; the sum is not. Without a warning a coincident pair would read as one strong reflection and one absent one, a conclusion the data never supported. Powder 6 flags these rows overlap in the Intensities table and in the saved reflection files, and the intensity of a weak reflection held at zero by the non-negativity is flagged at 0; its σ is still that of the unconstrained solution. Read the group, not the rows, for a space-group test or a structure solution.

Export

WhereWhat it writes
File → Save project (Ctrl+S)powder6_<timestamp>.project: compressed binary observations, datasets, phases, method setup, groups, retained history and structure candidates. After the options, Choose file… opens the browser's Save As dialog (name and folder) before compressing; where the browser has none, the file goes to its download folder and the message names it. Saving is refused, with a message, while a calculation runs; a failure is reported. Read it later with File → Read project, or drop it on the window.
File → Save results of selected<calculation>_results_<timestamp>.txt: a report with fit summaries, geometry and background settings, parameter values and standard uncertainties, refinement states, phases and complete reflection tables. States distinguish refined, fixed, linked, constrained and unused values. Rietveld includes atomic sites; Le Bail/WPPF keep available atoms in pdCIF.
File → Save reflections and intensities…_reflections_….txt: the reflection list, with extracted intensities and uncertainties for Le Bail and WPPF phases, and the flags above.
File → Save patterns…_patterns_….txt: observed and calculated patterns of each selected dataset.
Save buttons in the results blocksThe selected completed calculation as pdCIF, results text or patterns; Save CIF is in Rietveld's 3D structure block. WPPF also exports the extracted F² = I/(m·Lp) and σ as a SHELX HKLF 4 file.
Save CIF… on a phase in Datasetsstructure_<phase>_<timestamp>.cif: that phase alone, from the values of the dataset being edited — cell, space group, the operators of the setting, the atoms, and their standard uncertainties after a Rietveld fit. It appears on a phase's parameter group once the phase has atoms (a cell and a group alone are not a structure). The Save buttons in Results write every selected phase; this one writes the phase whose group carries it.
Report (PDF)A PDF of the selected datasets: results, plots (drawn in the light theme for paper) and, if present, the structure solution. Written by a small built-in PDF writer: no library, A4 pages.
File → Export to GSAS-IIpowder6_gsas2_<timestamp>.zip (also the command gsas2): see below.
Save PNGThe pattern plot as an image.

Export to GSAS-II

File → Export to GSAS-II writes plain files for the selected datasets, readable by GSAS-II without a script. It is built in the page (the ZIP is written in JavaScript), so it needs no Python.

FileContent
phases/<phase>.cifCell, space group (H-M symbol, Hall symbol and the operators of the setting used here), atoms with positions, occupancy and Uiso = B/(8π²). One file per phase; when the datasets hold different values of a phase there is one per set of values. A phase without atoms gets one placeholder H atom, because GSAS-II needs an atom list.
data/<dataset>.xye2θ, counts, standard uncertainty for every point.
data/<dataset>.instprmSame name as the .xye, so that GSAS-II uses it when the pattern is imported: wavelength(s) and ratio, Zero, Polariz. = 1/(1+K), U V W X Y Z (same units and the same X/cos θ + Y tan θ form), SH/L = 0.002, geometry and goniometer radius. With the separated profile these are the instrument values of the dataset; otherwise the profile of the first phase.
README.txtThe steps in GSAS-II, and per dataset the values to type there: Limits and excluded regions, the Chebyshev background coefficients, Shift and Transparency (computed from the displacement and transparency here and the goniometer radius), and the size and mustrain of each phase with the separated profile.

Not transferred: the scale factors (another normalisation), preferred orientation, the SL and HL axial asymmetry, a spline background, and the split pseudo-Voigt asymmetry. The README lists each one that applies. For an effective profile (the broadening is inside U V W X Y) set the size very large and the mustrain to 0 in GSAS-II so that the broadening is not counted twice.

The reflection table

ColumnMeaning
h k l, mCanonical member of the reflection orbit and the multiplicity (the size of the orbit under the Laue group). One row per orbit.
d, 2θInterplanar spacing (Å) and the peak position after zero, displacement and transparency.
I, σ(I)Le Bail and WPPF: the integrated Kα1 area and its standard uncertainty. For WPPF, marginal errors propagate integrated intensity through the full normal matrix, retaining global sharing where applicable. Bound/overlapped intensities and unavailable joint covariance are labelled conditional. For Le Bail it propagates the counting statistics through the partition.
I/(m·Lp)Intensity on the |F|² scale, arbitrary units. |Fo| is its square root; this is the quantity written to the HKLF 4 file.
|F|², I calc, I obsRietveld phases: the calculated squared structure factor, the calculated intensity and the observed intensity shared out in proportion to the calculated ones (the basis of RBragg).
flagoverlap exactly coincident: only the sum of the group is determined; at 0 held at zero by the non-negativity.

Structure solution

Use Commands → Structure for setup and Results → Structure for output. Start from a WPPF phase whose cell and peak shape are settled: they decide what the intensities are. The order is extract, test the space group, then charge flipping and/or the Wyckoff search; the sites found are handed back to the phase for a Rietveld fit.

Check the result. Charge flipping and the Wyckoff search find candidates, not proofs. Look at the difference curve, the contacts, the density and the chemistry before trusting a solution.

1. Extract

WPPF determines reflection intensities during fitting. In Commands → Structure → WPPF intensities, choose the phase and dataset. The program automatically prepares uncertainties, correlations and the space-group test's precision block at the fitted values; this does not iterate or run another fit. Single-phase datasets are prepared after fitting; sources in multiphase datasets are prepared when selected. Previously prepared sources are reused until invalidated. The status reports availability or the need for a WPPF fit. ADDSYM does not require this preparation. All determined intensities remain available for structure solution and export. Refit after changing the cell, profile, model or point weights. Intensities are Kα1 areas; |Fo|² = I/(m·Lp) uses the dataset's polarisation model (Lorentz-polarisation).

2. Space-group test

Open Commands → Structure → Space group → Test · powder intensities. The test scores every setting compatible with the current Laue class against the extracted intensities and returns a ranked list of posterior probabilities (Markvardsen, David, Johnson and Shankland 2001). The separate ADDSYM section searches atomic coordinates.

Number of reflections specifies how many lowest-angle determined intensities enter the test. Its default is the available count, capped at 600 to bound the matrix calculation. Only whole numbers from 4 to the smaller of the available count and 600 are accepted; letters, fractions and excessive counts are rejected. The input and test stay disabled until enough intensities are available, and the available count is shown below the input. Changing the count rebuilds the precision block at the current WPPF model before testing, without iterating the fit; refit first if that model has changed. The old value 220 was a fixed computation default, with no relationship to the number of intensities in a dataset.

Principle

A candidate space group makes exactly one testable statement about a powder pattern: a particular subset of the reflections is systematically absent, so their true integrated intensities are zero. The question is not “does this space group fit?” but “are the reflections it forbids consistent with zero, given how well the data determine them?” A WPPF refinement makes this answerable because every intensity is a least-squares parameter, so the refinement returns not only the intensities but the normal matrix behind them, hence their full covariance. In a powder pattern overlapping intensities are strongly correlated: a reflection that should be absent can carry a large apparent intensity simply by borrowing it from a neighbour it cannot be resolved from. Judging each reflection on its own I/σ ignores this and can mislead in either direction. Le Bail intensities are partitioned, not fitted; they have no covariance, so the test needs WPPF intensities.

Statistical model

The true intensities are given a Gaussian prior that encodes what the group claims: variance 0 for reflections absent under S, a local Wilson-like scale τ² otherwise. Marginalising over the true intensities, the extracted ones follow a multivariate normal with covariance Q-1 + PS (Q the intensity precision matrix, PS the prior), so the evidence for S is one density evaluation:

−2 ln P(D|S) = Σ_{j∈f} ln τ_j² + ln det B_S − b_S' B_S⁻¹ b_S B_S = Q_ff + diag(1/τ_f²), b_S = (Q·Î)_f (f = reflections the group allows)

The quadratic form is the evidence carried by the would-be-absent reflections, evaluated with the full correlation structure. The log-determinant is an Occam factor: without it the group with no extinction conditions would always win, since nothing contradicts it. Posterior probabilities follow by normalising over the candidate list. The intensity block is marginalised over the lattice, profile and background parameters by a Schur complement, so their uncertainties are folded in. τ is estimated separately for each candidate from the reflections it says are present (a single global estimate collapses in centred lattices, where most reflections are absent). The original paper uses a Wilson (exponential) prior; a Gaussian of the same scale makes the marginalisation exact, so rankings are essentially unchanged but absolute probabilities are approximate.

Reading the result

Each row is a distinct extinction symbol: powder diffraction cannot separate groups that predict identical absences (centrosymmetric and non-centrosymmetric pairs, for instance), so those share one probability. The setting matters: Pnma and Pbnm are the same group but predict different absences relative to fixed axes and appear separately. Columns: P(SG|data), the number of refined reflections the group forbids (a group forbidding nothing is always in the list as a baseline), and ⟨I/σ⟩ and worst I/σ over the would-be-absent set (diagonal errors only; the familiar numbers, but not what drives the ranking). Choose a row to set the space group of the phase.

Requirements

  • Run the WPPF fit in a condition-free group. A reflection can only be tested if it was a parameter of the fit. If the fit was run in Pnma, every reflection Pnma forbids was never refined and carries no information, so the test is blind exactly where it matters. Use the group of the correct Laue class that imposes no conditions: P-1, P2/m, Pmmm, P4/m, P4/mmm, P-3, P-3m1, P6/m, P6/mmm, Pm-3 or Pm-3m. The test detects the situation and marks affected candidates as partial.
  • The Laue class is not under test, only the absences. It fixes the reflection orbits and multiplicities. A test run from Pm-3m cannot return Pa-3. If the Laue class is in doubt, run the test from each candidate in turn.
  • Exact coincidences (333/511 in a cubic cell) are handled, because the test is formulated in precision space, where Q may be singular while BS never is. The I/σ columns fall back to conditional estimates and are flagged.

Atomic-model symmetry (ADDSYM)

Commands → Structure → Space group contains two sections: Test · powder intensities and ADDSYM · atomic model. ADDSYM has its own phase selector and a blue Find higher symmetry… button, matching the Test button. It needs a phase with atomic coordinates; it works without a WPPF fit or extracted intensities. Comparing Pmmm and Pnma from measured intensities uses Test.

The engine is Moyo 0.21.0. ADDSYM is Powder 6’s interface label for this atomic-model search; the bundled code is Moyo’s public WebAssembly implementation. PLATON’s ADDSYM implementation is a separate program. Moyo runs locally in a worker, with no WebGPU requirement and no upload of the model. See the bundled code and license.

Choose the model and tolerances

  1. Select the phase in the ADDSYM section and open Find higher symmetry….
  2. In Positions of, choose The starting model (Phases) or a dataset. The active dataset is selected initially when it holds the phase. A dataset’s Rietveld model supplies its coordinates and cell together; while using Le Bail or WPPF, the saved Rietveld calculation supplies these values. A dataset fitted by Le Bail or WPPF also offers its refined cell with its atoms (the Rietveld atoms when there are any, otherwise the atoms of the phase), so ADDSYM runs directly after a WPPF fit, with or without a Rietveld model.
  3. Atoms within /Å sets the distance tolerance passed to Moyo (default 0.2 Å). The report also scans 0.05, 0.1, 0.2, 0.3, 0.5, 0.75 and 1 Å, plus the entered value; when a higher symmetry appears only at a larger tolerance, the report names it and offers a button that sets that tolerance. Atoms refined in P1 from powder data scatter around the true positions, and a symmetry operation can need about twice that scatter (a P1 refinement of PbSO4 was recognised as Pnma only at about 0.75 Å). The entered value is shown as soon as it is done; the scan follows.
  4. Cell within /% and ° limits the permitted adjustment to the standardized lattice: 1 % for lengths and 1° for angles by default. Length and angle adjustments are checked separately before conversion is allowed.
  5. Occupancies within (default 0.02): atoms of one type whose occupancies differ by less are one kind of atom, so refined occupancies of sites that are equivalent in the higher group (0.987 and 0.991) do not hide it. 0 asks for equal occupancies. Merged atoms take the mean occupancy.

A mixed site (atoms of different kinds on one point, such as Fe and Mg sharing a position) is searched as one atom of the combined kind; the report counts these points. Two atoms of the same kind on one point are an error of the model and are reported by the engine.

Changing a source or tolerance starts a new search and cancels the previous one; an edit that fires both an input and a change event searches once. The engine stays loaded between searches.

The same atom and occupancy tolerances reach Convert…, so the conversion merges exactly the atoms the search related. The report identifies the selected model and engine, the returned space group, lattice points, new axes and origin, standardized cell, site count and atomic mismatches. Errors from the engine are shown. A higher group that exceeds the permitted cell adjustment or fails conversion checks is still displayed, together with the reason conversion is blocked.

Preview and apply the conversion

Convert converts the phase at once to the setting, axes and origin found, with the tolerance and atomic source of the search (the report is the preview). Only when the conversion needs a look (atoms off the new symmetry, a dataset whose own positions lack it) does it open the Convert… dialog with these values, whose preview lists merged sites, cell content and model mismatches. Choosing a dataset as the atomic source adopts its Rietveld atoms and cell as the phase’s starting model; the message after the conversion says so. Each dataset’s own Rietveld model must also satisfy the new symmetry within the conversion tolerance. Conversion transforms the starting model, dataset values and saved calculation banks, clears affected fit results, and can be undone with Ctrl+Z.

What the search can establish

The selected atoms are expanded with the phase’s assigned space-group operators, then the lattice and full-cell positions are passed to Moyo. The assigned group number is not passed to the engine. Atom types are distinguished by their stored scattering type and by their occupancy, within Occupancies within; B values do not enter the symmetry search. Occupancy differences larger than that tolerance can therefore reduce the detected positional symmetry even when the coordinates are close.

In P1, every atom of the full cell must be present. Typing P1 into the space-group field of an asymmetric-unit model changes its symmetry without generating the missing equivalent atoms; use Phases → Convert… when the full structure must be preserved in a subgroup. If every tolerance returns P1, inspect the actual full-cell atom list, types, occupancies and cell. A known composition or an expected space group alone does not supply missing coordinates.

The result characterizes the supplied model at the chosen tolerances. A powder pattern may not distinguish a small distortion from a higher-symmetry model: refine the alternatives and compare the data, geometry and chemistry.

3. Charge flipping

The running panel reports preparation, GPU shader loading and compilation, then the calculated cycles. Preparation uses an animated indicator; percentages begin once cycles have actually completed. GPU startup waits are bounded, and a stalled or failed GPU falls back to the CPU for the remaining starts of that search. Stop is available during preparation as well as iteration.

Principle

Diffraction gives amplitudes |F| but not phases. Charge flipping (Oszlányi and Sütő 2004, 2008) iterates between real space (electron density ρ on a grid) and reciprocal space, enforcing one simple constraint in each. In real space, a correct density is non-negative almost everywhere, so every voxel with ρ below a small positive threshold δ has its sign flipped; this deliberately wrong perturbation drives the phases towards consistency. In reciprocal space, the Fourier transform of the flipped density is corrected by reimposing what is known: the measured amplitudes, the point-group symmetry and the systematic absences, keeping the calculated phases. Reflections that were never measured stay free, which lets the map extend beyond the data. The threshold is in units of the map's own RMS density σ, so it is scale-independent.

The agreement tracked every cycle is R = Σ_c |√I_calc,c − √I_obs,c| / Σ_c √I_obs,c, summed over measured peaks c, not individual reflections: a powder pattern cannot tell overlapping reflections apart, and scoring them separately would score noise. Icalc,c is the total calculated intensity under peak c. A run that has found the structure typically drops below R ≈ 0.15 and then oscillates; above ≈ 0.30 it has usually not converged. The best iterate of the run is kept, not the last. Weak and negative intensities are replaced by their posterior expectation (French and Wilson 1978), which is why the WPPF uncertainties of zero-clipped intensities matter.

Controls

ControlDefaultMeaning
GridautoEdge of the density grid (a power of two). Auto picks the smallest of 32, 64, 128 that holds every symmetry-expanded index (N ≥ 2hmax + 2); reflections that do not fit are lost, and the summary says how many. Aim for a voxel of 0.25–0.35 Å. 128³ is about eight times the cost of 64³.
Threshold δ (σ)1.1Density below δ standard deviations of the map is flipped. The most sensitive parameter: working range 0.8–1.2. If R plateaus above 0.3 with no oscillation, lower it in steps of 0.1; if R is erratic from the first cycles, raise it. Weak or noisy data generally want a slightly lower value.
Cycles1000Cycles per random start (10–100000). Charge flipping stays flat and then drops abruptly when the phases lock in, often after several hundred cycles; judge a run by whether the drop happened.
Random starts3Independent trials from random phases (1–100); the map with the lowest R is kept. More starts is usually a better investment than more cycles: 10–20 starts of 1000 cycles beat 2 of 10000.
Symmetry in the loop (λ)0.50 = none (P1 charge flipping), 1 = strict. See rule 4 below.
Weak reflections0.15Fraction (0–0.33) of the weakest units whose phase is advanced by π/2 instead of being forced onto |Fobs| (Oszlányi and Sütő 2005). 0 reproduces the 2004 algorithm. Scan it (0, 0.10, 0.20, 0.30) over all starts rather than tuning it.
GroupingclustersWhether the weak fraction counts unresolved peak clusters (default) or individual reflection orbits (see rule 5).
Overlap (° 2θ)0.05Reflections closer than this share one observation: their sum is kept, the split is free. Roughly half the FWHM of a mid-angle peak. Too small imposes intensities the data never determined; too large lets resolved reflections trade intensity. Broad peaks or high-symmetry cells with many coincidences want 0.10–0.15°. If the number of reflections sharing a peak is close to the total, it is too large.
Peak merge (Å)0.9Density peaks closer than this are one site.

Adapting the search to data quality

Enable Adapt search to data quality for an optional parameter scan. Manual parameter values are retained. A preview shows the data assessment and three candidate settings before Run; Random starts sets a total budget of 6–128 (manual mode 1–128), with at least two starts per setting. Only the twelve lowest-R maps are kept for the map-agreement check, so large budgets do not hold every density map in memory. Enabling the mode brings a smaller budget up to six. Grid, cycles per start and peak merge remain under your control. The density threshold is expressed in the map's standard deviation, which is distinct from intensity uncertainty.

The assessment uses raw WPPF intensities and their uncertainties, measured dmin, and three equal-width shells in 1/d². It reports median I/σ in each shell. Guidance from I/σ is considered usable only if the extraction reports a valid nonlinear covariance and at least four noncoincident intensities have usable uncertainties, with finite positive σ for at least 80% of noncoincident entries. Exact-overlap partitions are excluded from I/σ guidance, while remaining in the CF input. Missing or conditional uncertainties are shown explicitly. Reflection widths are retained at extraction from the dataset's actual instrument and sample profile; older extractions can reconstruct them from their stored profile.

Adaptive overlap groups join neighbouring reflections when their angular separation is at most half their mean fitted FWHM. Missing widths fall back to the manual overlap tolerance. This follows peak width as a function of angle; the group count is a profile-based approximation, not the statistical rank of the intensity covariance. All starts use exactly the same groups and observations. Adaptive mode adds no I/σ or resolution cutoff.

Search emphasisCandidate (δ/σ density, weak fraction, symmetry λ)
Baseline exploration(1.0, 0.10, 0), (1.1, 0.15, 0.5), (1.2, 0.20, 0.5)
Limited data guidance(1.0, 0.25, 0.5), (1.1, 0.15, 0.5), (1.2, 0.25, 0.75)

The second set is explored if any of these explicit heuristics applies: median I/σ below 3; high-angle-shell median below 2 with at least three usable noncoincident reflections; measured dmin above 1.5 Å; profile grouping merges more than 35% of reflection entries; or uncertainties are unavailable or conditional. Without usable symmetry operators every λ is zero. These cutoffs are practical search rules, not universal optimal settings. The literature supports exploring parameters across repeated random starts and shows that data resolution affects useful settings: Oszlányi and Sütő (2008) and Šišak et al. (2012). The present implementation has controlled numerical and workflow tests; a broad experimental success-rate benchmark remains to be done.

Seed. Every start of the run is drawn from the number in the Seed field, and the run records it. Leave the field blank for a new seed each time; type the seed the Log or History reports to repeat a run exactly, with the same extracted intensities and settings. The per-start seeds of the random starts, the backend of each start and its residual are kept in the result.

The settings share the same initial seed within each round, with independent seeds across rounds. The completed result records every setting, seed, backend, residual and failed start. The lowest CF R selects the retained map. Other maps are compared with it by maximum mean-centred correlation over periodic grid translations and inversion; scaling and a constant density offset are removed. A correlation of at least 0.90 is counted as agreement, with different seeds counted once. This reports reproducibility separately from the residual and does not prove the structure. Stopping during comparison retains the best completed map and attempts site extraction. In P1 the map keeps its arbitrary origin, since no symmetry operation constrains it. History and reports retain the search metadata; temporary maps from the other starts are released.

Starting points by problem type

The following manual starting points remain available when adaptive mode is unchecked.

SituationGridδ/σCyclesStartsλOverlap
First attempt (group known, dmin ≈ 1.0 Å)32³1.150030.50.05°
Small cell (V ≲ 500 ų, few atoms)32³1.0–1.1300–50031.00.05°
Medium cell (500–2000 ų)64³1.0–1.2100050.50.05°
Large or organic (> 2000 ų)64–128³0.9–1.11500–300010–200.50.08°
Space group uncertain32–64³1.110001000.05°
Heavy overlap (high symmetry, broad peaks)as above1.11500101.00.10–0.15°

When a run fails, in order: (1) check the warnings about reflection counts (a grid too small, or intensities on systematically absent reflections are input problems no parameter will fix); (2) add random starts; (3) adjust δ by ±0.1; (4) try λ = 0 and λ = 1: a solution that appears at 0 but not at 1 says the space group is wrong; (5) only then increase the grid or the cycles.

Space-group constraints in the loop

Classical charge flipping works in P1, discarding the symmetry and letting the algorithm rediscover it, which is a safeguard when the group is uncertain. Powder 6 keeps that mode (λ = 0) but by default uses the selected space group inside the iteration. Five different constraints come from it, and they behave differently.

  1. Orbits: symmetry equivalents share one intensity. A WPPF fit reports one intensity per symmetry-unique reflection. Its equivalents hR are generated from the actual operators of the group and placed on the P1 grid. The Laue class is not the holohedry of the crystal system: P4 has Laue class 4/m, so a general reflection has 8 equivalents, not 16; likewise -3 versus -3m, 6/m versus 6/mmm, m-3 versus m-3m. Spreading one intensity over twice as many positions as exist would put half of it on reflections that are not equivalent. Within an orbit the amplitudes are equal, |F| = √(Iobs/m). Hard constraint, every cycle. Only the phases are free.
  2. Overlap: distinct reflections may share one peak. Reflections that are not symmetry-equivalent can fall at the same 2θ (exactly, as 511/333 in a cubic cell, or accidentally). The pattern gives only their sum. Such reflections are grouped into a cluster and its total is re-partitioned between them each cycle in proportion to the current calculated values (the idea of Le Bail extraction applied inside the loop; Baerlocher, McCusker and Palatinus 2007). The split is free; the total is fixed. Symmetry equivalents must be equal (constraint); overlapping distinct reflections are free to differ (unknown). Letting the members of an orbit float would discard exactly the information the space group provides.
  3. Systematic absences are excluded and held at zero. Reflections forbidden by centring, screw axes or glide planes are removed before the orbits are built and their grid points are forced to F = 0 every cycle. Leaving them free lets the density break the centring outright (for an F or I lattice that is most of the reciprocal grid). A fitted reflection that the selected group forbids never becomes an ordinary charge-flipping reflection; if it overlaps an allowed reflection, its corrected intensity stays in the measured cluster total and is re-partitioned among the allowed orbits only. An isolated forbidden reflection with raw I/σ ≥ 3 is inconsistent with strict symmetry: a strict run (λ = 1) is refused and names an example, while λ below 1 may still be run for diagnosis. The result records how many forbidden reflections were excluded, transferred from clusters or significant while isolated.
  4. Symmetrisation of the phases. For an operator x′ = xR + t the structure factors of a correct structure satisfy F(hR) = F(h) exp(−2πi h·t). Each cycle the members of an orbit are reduced to a common representative, averaged and pushed back: F ← (1 − λ)F + λFsym. λ = 0 imposes nothing (classical P1); λ = 1 is the exact projection, which converges faster and puts the solution on a standard origin. The trade-off: strict symmetry cannot recover from a wrong group and will happily converge to a low R for a structure that does not exist. If the group is uncertain, run at λ = 0 as well: a density that is genuinely consistent with the group will symmetrise well afterwards without having been forced to. Without the symmetry operators of the group, the effective λ is 0.
  5. Weak reflections are freed, not forced. The rules above impose |Fobs| on every ordinary reflection. The weak fraction exempts the selected weakest units: their calculated moduli are kept and their phases advanced by π/2 each cycle instead (Oszlányi and Sütő 2005); their measured intensity is used only for the knowledge that they are weak. The perturbation can help the iteration escape the flat, featureless maps the 2004 algorithm can settle into. Classification is made once, before iteration, and cannot change as overlaps are re-partitioned. By default (clusters) the unresolved peak clusters are ranked by total observed intensity per reciprocal-grid member and every orbit in a selected cluster is flagged weak, which avoids classifying an arbitrary, changing overlap partition as if it were an independent measurement; the number of phase-shifted orbits can therefore exceed the number of selected clusters. Individual mode ranks each orbit by its own initial target intensity. This is a different mechanism from rule 2: overlap re-partitioning frees a reflection's share of a cluster while holding the total; the weak flip frees a reflection's modulus entirely and perturbs its phase. A reflection can be subject to both.

The CPU and WebGPU paths apply the same classification and operations. If the adapter cannot take the grid, the run falls back to the CPU with a message; the CPU at 128³ takes minutes per start.

From the map to atoms

Name them from the formula is a checkbox for Atoms to the phase. When checked, element types are assigned to the selected sites using the current Formula unit and Z in Commands → Structure when preparing the atom transfer. When unchecked, their edited element types are retained. Editing an element unchecks it automatically. Toggling the checkbox does not change the sites or the phase; the phase changes only when the copy dialog is confirmed. Excluded sites stay excluded, cancellation changes nothing, and the saved CF result is preserved.

CF starts obey the centric phase restrictions, and weak Friedel partners receive opposite phase rotations to keep the density real. The site-count limit applies after symmetry-equivalent full-cell peaks are merged, so a high-multiplicity orbit does not consume the limit before other independent sites are considered. Formula assignment and automatic Z rank the peaks by their integrated density above a local baseline; the sites table shows this as Charge, normalized to the largest integral, alongside Height. Older saved results without integrals use heights. These are relative values, not absolute electron counts or proof of an element assignment. An edited dataset needs a fresh intensity extraction before another search can run.

Density peaks are picked as centres of mass of the density above the threshold, merged within the peak-merge distance, snapped to special positions in the space group, and arranged into a structure; an origin search checks the result on a standard origin. The 3D viewer shows the density with the cell, the sites and an iso-level. The 3D structure block under the sites draws the solution (cell, atoms, bonds) and nothing else: the two actions that change the phase — Atoms to the phase… and Save CIF… — belong to the sites table above it and appear there once. Non-uniqueness is real: different random starts can land on different origins or enantiomorphs, and the density often contains ghost peaks and merged atoms. Assign elements from the chemistry, not from peak heights alone.

4. Wyckoff search

A WebGPU replica-exchange Monte Carlo search places atoms on trial Wyckoff-position assignments and scores them against the WPPF intensities. It needs the formula and, directly or by a scan, Z. It runs one complete search per value of Z, refines the coordinates of each best structure, and lists the solutions.

GPU work, CPU work and fallback

The Wyckoff calculation runs in a Web Worker and uses both processors. WebGPU is required for the search; there is no CPU-only Wyckoff search backend. A worker is a separate JavaScript execution context, not a promise that every step runs on the GPU. All data and calculations remain on your machine.

StageWhere it runsWhat happens
PreparationCPU, in the workerRead the composition and symmetry, plan Z values, enumerate assignments, group observations and pack the GPU tables.
Screening and full-search generationsGPU with CPU controlThe GPU proposes coordinates, expands symmetry, evaluates structure factors and geometry penalties, accepts or rejects moves and caches each chain's best. The CPU schedules waves and restarts, exchanges replicas, prunes assignments and sends progress to the page.
Closing quenchCPU control, GPU fitnessThe CPU proposes progressively smaller coordinate moves and retains improvements; each trial is evaluated on the GPU against all reflection groups. This step follows the generations and can take additional time.
Fitness cross-checkCPU, double precisionRecompute the leading search candidate's fitness from the same reflection and scattering arrays uploaded to the GPU. The log reports agreement or a mismatch exceeding 1e-3; a mismatch does not trigger a CPU-only search.
Coordinate refinement and validationCPULocally refine the best legal candidate for each Z against the WPPF intensities, then re-check the hard distance and coordination rules. Keep the search positions if refinement violates those rules.

CPU activity while a Wyckoff search is running is expected. GPU utilisation varies between the batched generations, readbacks, exchanges, quench and final CPU refinement; the generation counter does not include every one of these stages. Numerical agreement between the CPU and GPU checks the reported search fitness, not the correctness or uniqueness of the crystal structure.

If a WebGPU device cannot be obtained, the search reports the reason and cannot start. A lost device or failed GPU work reports an error; it does not restart the search on the CPU. Charge flipping and parallel-tempering fits have their own CPU fallbacks. LM fits, intensity extraction and atomic-model symmetry analysis do not require WebGPU.

The objective

Each candidate is scored by score = (1 − wR2) − pen, and the candidate list is ordered by it. wR2 is the scale-only weighted residual over the observed group intensities; eliminating the optimal multiplicative scale gives

wR2 = √( 1 − (Σ w Ic Io)² / ( (Σ w Ic²)(Σ w Io²) ) )

This is invariant to overall scale but deliberately not to an additive shift: centring the intensities would silently fit a constant structure-factor intercept, which has no physical place in this model. Reflections the powder pattern cannot separate are summed into one group first, so the comparison is made where the measurement exists. Each group is weighted by 1/σ² of its total when usable WPPF uncertainties exist, σ² being the members' variances plus twice their WPPF covariances (large and negative for overlapped lines, so the total is far better determined than the sum of variances says); if at least one complete group has a σ, incomplete groups receive zero weight (never 1 or 1/I); only when no group has a usable σ is the whole problem unweighted. The final coordinate refinement uses the same policy and the same scale-only form, and reports the weighted residual it minimised, wR(F²).

Penalties: soft during the search, hard afterwards

TermWeightCharged for
penClash0.05Each pair closer than the contact floor dmin: 0.05 × (1 + 9δ), δ = (dmin − d)/dmin. A pair barely touching costs one unit, a collapsed pair ten: a soft wall that steepens.
penBond0.10Each bond outside a distance window. A bare nearest-neighbour rule charges the overshoot in ångström; a coordination-shell rule charges each of its n slots by miss·(1 + miss/0.25 Å); a slot with no partner costs a flat 5. The 0.10 is divided by the number of neighbour slots the rules charge across the cell (centres × count, or one per centre for a bare upper bound, both ways when mirrored), so it is a penalty per bond on average and stays commensurate with the correlation however many atoms and rules there are.
penCoord0.03Each neighbour in excess of the requested coordination number (a shortfall is charged through penBond's empty-slot route), divided by the number of counted centres in the cell.
shapepenBond × Shape weight (1)For a shaped shell (tet, oct, sq, tri, lin): the sum over every pair of the centre's nearest partners of (cos θ − cos θideal)², with the ideal cosines −1 (linear), −½ (trigonal), −⅓ (tetrahedral), and 0 or −1, whichever is nearer, for square-planar and octahedral pairs. It uses the normalised penBond above, so with the default weight a tetrahedron whose six angles are all 10° off (6 × 0.16² ≈ 0.15) costs about as much as one bond 0.1 Å outside its window (0.1 × (1 + 0.1/0.25) = 0.14). Soft only: shapes are not re-checked as hard filters.

These weights are fixed constants of the search (SW_DEFAULTS in js/swarm_wyckoff.js); only the Shape weight is a control. They steer the search and never rank its results: candidates are ranked on the fit to the intensities alone, and the distance rules are then applied as filters.

The total is multiplied by a factor that ramps from 0.2 at the start of a run to 4.0 at the end: geometry is nearly free early, so the search can pass through crowded configurations between two good basins, and expensive late, so the answer has to be physically legal. Archived bests are stored unscaled and re-scored at the current weight when compared. Because every geometry term is soft, a winning candidate can still be illegal; the result stage therefore re-checks floors, bare upper bounds and exact or at-least coordination counts as hard filters, and repeats the check after coordinate refinement. A violating structure is rejected rather than reported, which is why a run can report “search positions kept” after refinement broke a rule.

The search starts with only the first 25 % of the reflection groups (lowest angle first) and has all of them active by 60 % of the run (resolution ramp), because a low-resolution picture of the intensities lets the swarm find the right basin before high-angle detail makes the landscape rough. The running wR2 during the ramp is therefore not comparable to the final one.

Controls

ControlDefaultMeaning
Formula, ZblankFormula unit and number of formula units in the cell. Blank Z selects Auto: a scan over plausible values (see below).
Density window2–8 g/cm³Whole g/cm³, 1 to 22; bounds are rounded inward so every candidate density lies in the window. The only control that carries knowledge about the sample.
Values of Z, at most3 (1–12)How many Z one scan may search. Each is a full run. The least plausible are dropped first and the log names them.
Sites per element, at mostauto (4)Distinct Wyckoff sites per element; raised automatically when the composition demands more.
Atoms per position, at mostauto (4)Independent atoms on one Wyckoff position at different coordinates.
Particles512 (auto)Trial structures held at once (64 up to the hardware budget).
Iterations2000Generations per restart (10–10000). Screening uses 10 % of them, at least 60 but never more than the requested full-search generations.
Restarts4Independent starts per full-search wave for each Z. Any positive whole number, including values above 10; the entered count is used exactly. Screening uses one start.
Shortest contact (Å)1.0A structure with two unlike atoms closer than this is rejected. A distance rule on the pair replaces it for that pair.
Shape weight1How strongly the angles of shaped shells count, as a multiple of the bond penalty (0–10; 0 turns the angle term off and keeps the site-symmetry filter of the shape). Raise it when a shell keeps coming out distorted, lower it when the shape is only approximate. Disabled when no rule has a shape.
Polyhedron moves (%)0The percentage of proposals that move a coordination shell as a unit (below). 0 moves single atoms only, the search as it was before these moves. 20–40 % helps isolated polyhedra on general positions; it gains little when partners are shared between centres or sit on special positions (PbSO4 is solved either way). 0–100; disabled when no rule has a count.
Distance constraintsnoneOne rule per line (next subsection).

A field that has no effect is disabled, with the reason as its tooltip: the density window and Values of Z when Z is typed (no Z is scanned), Shape weight without a shaped rule, Polyhedron moves without a counted rule.

Under the hood the search is a replica-exchange ladder of 8 rungs at fixed temperatures from 5×10-4 to 0.05 (in correlation units), proposal widths adapting towards a 30 % acceptance, swaps every 10 generations. A proposal moves one independent site, or all of them; when a distance rule has a count and Polyhedron moves is above 0 %, that share of the proposals are polyhedron moves instead: one centre of the rule and its nearest partners are translated together, the partners are rotated about the centre, or they are put at one distance inside the rule's window and, for a shaped rule, on the ideal shape best aligned with the shell. Moving single atoms nearly always breaks a shell, so these moves let the search explore positions and orientations of whole polyhedra; they are scored and accepted like any other proposal, so a shell whose partners are shared with another centre is simply moved less often. Temperatures are fixed, not annealed: a single chain that anneals into a wrong basin has no way back out. Stopping returns the best structure found so far. The GPU kernel has fixed capacities: 32 independent Wyckoff sites in one assignment (summed over elements), 8 elements, up to 4096 operators. Distance rules and coordination slots are sized per run when the kernel is compiled: 8 rules and 64 slots unless the constraints need more, up to 32 rules and 256 slots. A run that needs more is refused with a message naming the total and the limit; nothing is silently truncated. These limits and the defaults of the form are kept in one file, js/wyckoff_limits.js, read by the page, the worker and the kernel.

Assignments, waves and screening

Assignments that give the same intensities and distances are searched once: two assignments related by an origin shift (in quarters of the cell) or the inversion through the origin that maps the space group onto itself describe the same structure (P-1 has eight equivalent inversion centres; Pnma 4a and 4b are equivalent). The log says how many were left out.

Each assignment needs its own sub-swarm, so the particles hold only a few assignments at once (10 at 512 particles); the rest wait in later waves. When the assignments need more than two waves, the search runs in two stages. Screening: every assignment is searched for 10 % of the iterations (at least 60, capped at the requested full-search iterations), one restart, and its best is re-scored on every reflection group. Full search: the best two waves’ worth continue from what the screening found, with all iterations and restarts, and are polished by the final quench. A long enumeration (hundreds of assignments, which used to mean hundreds of full waves) therefore costs a few full waves. The progress bar covers both stages and every Z; it reads “screening i/n” during the first.

Restart count, progress and stopping

Restarts counts the initial start as well as the reseeded starts. With Restarts = 20, each full-search wave for each Z gets 20 starts in total: the first start followed by 19 reseedings. Chains receive fresh coordinates, while each assignment's best candidate is retained across starts. Two full-search waves therefore run 40 wave starts for that Z; scanning additional Z values repeats their own plans. Screening waves use one start each, independently of Restarts.

The entered count is validated before the worker starts, again in the worker, and at the search entry point. Values above 10 are passed unchanged; zero, negative, fractional and invalid counts are refused. Increasing Restarts extends the full search approximately in proportion, while screening and the closing quench are additional work. The progress readout names the stage, wave, restart and Z so a new wave or Z does not look like a reset of the requested count.

Seed and repeatability

Seed. The initial coordinates of every chain, every restart, the replica exchanges, the Gaussian proposals and the per-chain seeds the kernel runs from are all drawn from one 32-bit number. The search prints it when it starts and keeps it in the result, in History and in saved projects. Leave the field blank and a new seed is drawn for each run; type a reported seed and the search repeats exactly from the same extracted intensities, settings and assignments. That is what makes two settings comparable on the same stream of starts instead of on luck, and what lets a search that worked be run again.

Stop or Escape asks the worker to stop cooperatively, preserve its best available candidates and finish the available result's coordinate refinement; the closing quench is skipped or interrupted. Wait for the stopping/refinement message to finish. Pressing Stop again terminates the worker immediately: finished Z results and a live best already received by the page can be kept, with unfinished coordinates identified. Stopped or failed searches may therefore complete fewer starts than requested. The Log gives a summary; the full search log, settings and available results remain in History and saved projects.

Distance constraints

Helper. The Helper button to the right of the box opens the same tabbed dialog as the restraint Helper, on the elements of the formula unit (it is greyed out until a formula unit that can be read is given). Geometry writes a coordination shell (count, or a shape: linear, triangle, tetrahedron, square, octahedron), a nearest-distance window or a shortest contact between two elements. Molecule reads a PDB, XYZ or Z-matrix and writes the bonds of each element pair: A B N lo/hi when every A has N neighbours B, the nearest B when the counts differ, nothing when some A has none; elements outside the formula are left out. Suggest writes a shortest contact for every pair of elements, a factor (0.8) times the sum of their covalent radii. Add collects the rules in one box (the first rule of a pair is kept, duplicates and conflicts are reported, and the kernel limits are checked); Copy puts them on the clipboard, and only pasting them into the box applies them; Close closes the Helper without changing anything.

One rule per line; blank lines and lines starting with # are ignored. Element symbols are case-insensitive and must appear in the formula; anything else is reported as an error rather than skipped. The general form is

ElemA ElemB [count] dmin/dmax [shape]

Everything except the two symbols is optional. What matters is which of four mechanisms a line switches on:

FieldWhat it does
dminA hard floor on the pair. It replaces the Shortest-contact value for this pair, in either direction, so a rule can hold one pair further apart than the global floor or admit an approach it would forbid. Charged as a clash penalty that grows with the depth of the overlap. Costs no rule.
dmaxWith no count: the nearest partner must be within it. A pure nearest-neighbour condition, applied in both directions when the two elements differ, so it costs two rules (one when both symbols are the same). With a count: the upper edge of the window the shell is measured against.
countA coordination number: 4 exactly four, 4+ at least four. The kernel keeps the count nearest partners and charges each by how far it misses the window, so the penalty is graded by distance. Directed and never mirrored: costs one rule and count slots.
shapeOnly after a count and an upper distance: linear (2), triangle (3), tetrahedron (4), square (4, planar), octahedron (6); the count must be the shape's. Two letters or more of a shape's name are enough when they belong to one shape only: lin, tri, tet, sq, oct, even li, tr, te, oc. The angles between the count nearest partners are charged against the shape's (180°, 120°, 109.5°, and 90° or 180° for square and octahedral pairs), so the shell is held as a rigid-ish polyhedron within each centre's own neighbours, which an element-wide O–O rule cannot do. A soft restraint like the others, not a hard filter. The shape also keeps the centre off positions whose site symmetry the polyhedron does not have (a tetrahedron or a triangle cannot sit on an inversion centre). Costs no extra rule or slot.
LineMeaningRulesSlots
S O 4 1.40/1.80Every S wants exactly four O between 1.40 and 1.80 Å; also floors S–O at 1.40.14
S O 4+ 1.40/1.80At least four: a fifth O in the window is not penalised. Use when the coordination is uncertain.14
Pb O 8 2.00/3.00Every Pb wants eight O in 2.00–3.00 Å.18
O O 2.40O–O no closer than 2.40 Å. A floor and nothing else: the cheapest kind of line.00
O O - 2.40/The same: - is an explicit “no count”, the empty right-hand side an explicit “no upper bound”.00
Pb O /3.00The nearest O to any Pb must be within 3.00 Å, and vice versa. No count, so it is mirrored.20
S O 4 1.40/1.60 tetrahedronFour O around each S, and the angles of those four at the tetrahedral 109.5°. Also keeps S off positions whose site symmetry no tetrahedron has.14
Pb O 2.00 3.00The same window without a slash: two bare numbers are dmin then dmax.20

Example, anglesite PbSO4 (Pnma, Z = 4):

S  O   4  1.40/1.80     # sulfate tetrahedron
Pb O   8  2.00/3.00     # lead coordination shell
O  O      2.40          # keep the tetrahedra from interpenetrating

Two rules and twelve slots, well within the budget; the third line costs nothing because floors live in the clash matrix, not the rule table. No Pb–S rule, because there is no Pb–S bond: constraining a distance you have no chemical reason to constrain is the commonest way to make the right answer unreachable.

  • Direction matters. A coordination number is tested from its first element outward. S O 4 1.40/1.80 asks every sulfur for four oxygens; O S 4 1.40/1.80 asks every oxygen for four sulfurs, which in a sulfate is false and is paid on every evaluation. Writing both is two independent demands (two rules, eight slots) and the box warns. Put the count on the centre of the polyhedron.
  • Running out of budget (32 rules, 256 slots; the rule count is the binding one, almost always through mirrored upper bounds): drop upper bounds you do not need (Pb O 8 2.00/3.00 says it better than Pb O /3.00 and costs one rule); turn windows into floors if you only care about the near side; constrain the cation polyhedra, not the anion–anion contacts, which follow from them.
  • A count without an upper distance counts the whole cell. S O 4 1.40/ asks for four oxygens further than 1.40 Å, which every oxygen in the structure satisfies; it constrains nothing and the box warns. A bare integer with no distance, S O 4, is rejected as ambiguous (it is equally a 4 Å distance).

Z, the density window and the scan

Z is the number of formula units in the cell and the one input that is neither measured nor refined. The stoichiometry is enforced by construction, so a wrong Z is fitted dutifully and reported with a residual that names no error. Blank Z does not estimate Z; it scans: every plausible value is searched in full and the best structure for each is offered, because a rule of thumb about cell volume is a prior and the intensities are evidence. The density fixes the relation Z = ρV/(1.66054·M), with M the formula mass (g/mol) and V the cell volume (ų). The candidate list is cut three times before any GPU time is spent: the density window; what the space group permits (below); and whether a legal assignment of atoms to Wyckoff positions exists at all (a Z that cannot be built is discarded in milliseconds).

What the space group says about Z

Atoms of one element occupy Wyckoff positions, so their number in the cell is a sum of multiplicities. Let g be the greatest common divisor of every multiplicity the setting offers. For each element with subscript ke in the formula unit, Z·ke ≡ 0 (mod g), hence Z must be a multiple of lcme g/gcd(g, ke). For a pyrochlore A2B2O7 in Fd-3m the multiplicities are 8, 16, 32, 48, 96 and 192, so g = 8; oxygen requires 7Z ≡ 0 (mod 8), so Z is a multiple of 8, and of the eleven values from 3 to 11 only Z = 8 survives. The step and g are not always equal: in Pnma (g = 4) Fe2O4 gives a step of 2. In P1 and P-1 the rule says nothing (g = 1), correctly: a triclinic cell can hold any Z, which is why low-symmetry problems are the expensive ones. A fractional subscript (Fe0.5Ni0.5) voids the argument and the rule is skipped. The log states the derivation, not just the answer.

Solutions

Every surviving Z gets its own complete search (all restarts, the resolution ramp, the closing quench, the contact filter and the coordinate refinement). The plausibility ranking (volume per atom nearest 16 ų, with a mild preference for a Z commensurate with the group order) decides only the order of the searches, so stopping early means the likeliest candidates are done. The results open with a Solutions table, one row per Z, with density, atoms per cell, assignment, search wR2 and wR(F²); click a row and everything below (coordinates, R factor, CIF, contacts, bond valences, structure plot, report) switches to it. Ranking is by wR(F²); a solution whose refinement did not run is placed below those that have one. A better wR does not make a Z right: more atoms mean more free parameters and often a better fit for that reason alone. Read the table beside the density, the contacts and the bond valences. Two Z that both fit respectably is a real result.

A typed Z is honoured exactly as typed and the density window is ignored; the panel still shows the implied density. A Z implying a density outside about 0.5–22.5 g/cm³ is refused (lithium is 0.53, osmium 22.59), because the Z, the formula and the cell cannot describe the same solid; the usual cause is Z counting atoms rather than formula units. A typed Z that breaks the space-group rule is warned about, not blocked.

How many sites a structure needs

The number of free parameters is three per general-position site, fewer for special positions, plus nothing else (scale is eliminated). A structure with 17 independent sites has around fifty parameters; the search needs enough effective observations to determine them (next subsection). Raising the number of sites per element increases the search space steeply; keep it at what the composition and the group demand.

Final coordinate refinement

After the GPU search and closing quench, the best structure of each Z is refined on the CPU as a local least-squares problem in the free coordinates, with the same scale-only objective and weights as the search, then validated again against the hard geometry rules. If the refinement breaks a rule the search positions are kept and the log says so. The reported wR(F²) is the weighted residual actually minimised; an unweighted figure printed beside a weighted refinement would describe a fit nobody performed.

When the ranking is withheld

A high fitness is not by itself evidence that a structure is right. wR2 compares a distribution of intensity, and a model can reproduce the few highest-leverage points while every other reflection is wrong by any amount. The number of reflections is also not the number of observations: because the residual is weighted, a group counts for its share of the observed denominator wiIi², and 1/σ² rewards sharp low-angle reflections and all but erases high-angle overlaps whose σ exceeds their value. The search reports the effective number of observations

N_eff = 1 / Σ p_i², p_i = w_i I_i² / Σ_j w_j I_j²

which equals N when all shares are equal and 1 when one group is everything; a list of 35 groups is routinely 5 or 6 effective observations. Distance constraints count as observations: a coordination-shell rule asking for n partners adds n pseudo-observations per independent site (not per atom in the cell), reported separately from Neff because a structure held up by restraints is a different claim from one determined by the data.

The behaviour has two thresholds, measured as (Neff + restraints) per free parameter of the best candidate:

  • Below 1.0: the ranking is withheld. A model with at least as many free parameters as effective observations reproduces them exactly whatever the structure, so every candidate scores near 1 and the ordering is noise. The candidates are still returned and worth testing (the coordinates are real), but the list is unordered, the panel says “candidates, not a solution”, and no best is claimed.
  • Between 1.0 and 3.0: “thin data”. The ranking is kept, because a correct structure can and does appear at this ratio (a correct ab initio solution of PbSO4 at 1.83 is the reason the threshold is not 3), but the gap between leading candidates carries little weight: check the chemistry and the refinement wR before accepting one.

To lift a withheld ranking, extract more reflections (particularly at high angle, where severe overlap leaves σ/I near or above 1 and the weighting correctly discards them) or add distance constraints, which count; or reduce the free-parameter count with a smaller Z or higher-symmetry sites. This is a test of meaningfulness, not of quality: above it a low score is still a real answer, and below it a high one is not.

Fourier maps

Fourier maps currently use ordinary X-ray form factors or neutron scattering lengths. With anomalous scattering enabled for the selected X-ray model, computation is refused with a reason. Disable the correction in Instrument and refit WPPF before computing a map; an anomalous-corrected Fourier model is not implemented.

A Fourier map shows the scattering density of the cell. It is the natural next step after a solution or in the middle of a Rietveld refinement: a difference map (Fobs − Fcalc) shows where the model lacks density (a missing atom, a wrong element, an under-occupied site) and where it has too much; the observed map (Fobs) shows the atoms the data support; 2Fobs − Fcalc and the calculated map are also offered. The block sits in Commands → Structure beside the space-group test, charge flipping and the Wyckoff search, uses the same phase and dataset chosen at the top (so it works for a single phase, in any dataset that holds it), and shows its result in Results → Structure → Fourier map. Compute the map stays disabled, with the reason on its tooltip, until both halves of its input exist: atoms in the phase (they give the phases of F) and its WPPF intensities in the chosen dataset.

How the map is made

  1. The reflections come from the WPPF extraction (the same intensities as the other tools; they are prepared automatically). The phases come from the model: the atoms of the phase, with their values in the dataset or in the starting model (Atoms from). So the map shows the model’s own atoms best, and a difference map shows only what the model lacks.
  2. A powder line holds several reflections. The observed intensity of each overlap group of the extraction is shared among its reflections in proportion to m·Lp·(|Fcalc|² + ε), the partition of the Rietveld method; ε is a small share of the mean |Fcalc|², so a reflection that the model forbids can still come out non-zero. One scale factor puts the observed amplitudes on the scale of Fcalc. Reflections the extraction does not have keep their calculated amplitude, so they do not enter a difference map.
  3. The coefficients on the whole reciprocal sphere to the chosen resolution d (blank: the smallest d extracted) are summed by an FFT on a cubic grid (a power of two, at most 128³; Finer grid doubles the points per axis). F(000) is left out, so the map is relative to its mean; σ is its standard deviation.

Reading the result

  • The isosurface is drawn at a level in σ (the density viewer of charge flipping: drag to rotate, wheel to zoom). For a difference map, Holes (negative) draws the negative surface instead. Atoms of the model are drawn in the map.
  • The peak table lists the extrema above the chosen Peaks above (σ) (default 4; peaks of 3σ or less are usually noise), one per set of symmetry-equivalent positions (Copies), with the nearest atom and its distance. Heights are in e/ų for X-rays and fm/ų for neutrons, approximate because of the single scale factor.
  • Add atom… on a positive peak puts it into the phase: you name the scatterer, since a peak cannot, and the site is found from the position. Compute the map again to see what is left. A positive difference peak within about 1 Å of an atom usually means a wrong element or displacement, not a new atom.
  • Save map writes the grid as JSON (the format of the charge-flipping density); Save PNG the view.

Limits: phases from the model mean a bad model gives a biased map; severe overlap shares intensity by the model, which smooths a difference map towards the model; anomalous dispersion is not included in the phases. Maps are recomputed on demand and are not stored in projects.

5. Contacts and bond valence

Each solution has a structure plot (cell, atoms with covalent-radius bonds; Cordero et al. 2008), a contact table and a bond-valence analysis. The wR says the fit converged; this table says whether the result is chemistry.

  • Coordination number is the number of neighbours within a cutoff (default 3.5 Å, with element-specific limits so that a sulfate sulfur and a lead are not judged by one number). The count depends on the cutoff, which is stated under the table.
  • Bond-valence sum (Brown and Altermatt 1985; Brese and O'Keeffe 1991): s = Σ exp((R0 − d)/b) over the coordination shell, with b = 0.37 Å and R0 from the Brese–O'Keeffe table, compared with the formal valence of the site. The verdict is plausible within 15 % of the formal valence, borderline within 30 %, and check beyond (Brown 2009 on the method as a validation tool).
  • Which atoms are anions and in what oxidation state is a choice: the analysis states the assignment it used. A wrong oxidation state gives a wrong verdict for a right structure.
  • Limits. Hydrogen is not located by these methods, so hydrogen-bond contributions are missing from every oxygen sum in a hydrate or a hydroxide: expect them to read low. A mixed or partially occupied site will not balance against a single formal valence.

6. Back to the phase

The sites found replace the atoms of the phase in every dataset. Switch the phase to Rietveld and fit again, in the order of Strategy. Constrain shared sites and displacement parameters (Atomic constraints) and refine B last.

Command line

Type in the field at the bottom of the window and press Enter. Commands act on the selected datasets. Every command is logged. cmd or the ? button lists them; help opens this documentation in a new tab.

CommandDoes
fit, globalfitRefine the selected datasets one by one, or together.
stopStop the running refinement.
steps>>scale|cell|profile|atoms|noneTick the parameters of a step and of the steps before it.
tick>>pattern, untick>>patternTick or untick the parameters whose name matches a regular expression, e.g. tick>>p1\.a.
scalesEstimate scales and a constant background.
range>>a&bFit from 2θ = a to b.
bkg>>nn Chebyshev background terms (0–24).
anchors>>nSpline background through n automatically placed anchors (2–200).
exclude>>a&b, include>>a&bLeave a region out of the fit, or take it back.
method>>rietveld|lebail|wppfChoose the calculation method of the phases.
phases, phases>>p1&p2|all|noneShow the phase table, or set the phases of the selected datasets.
sharingOpen the sharing table of the global fit.
simulateCalculate a pattern from phases with atoms.
clone_all, clone_activeCopy matching values and refinement flags from the inspected dataset to all other datasets, or to the other selected datasets. The Copy accordion also offers one named destination and separate values/flags options.
select>>textSelect the datasets whose name matches the text (a regular expression).
demoLoad NaCl and Si.
gsas2Export the selected datasets and their phases to a ZIP for GSAS-II.
undoGo back one step; repeat to go further.
cmdList the commands.
helpOpen this documentation in a new tab.

Parameter names for tick: zero, disp, transp, bkg0 …, bga0 …, p1.scale, p1.a, p1.GW, p1.po, p1.Na1.x, p1.Na1.occ, p1.Na1.B. p1 is the first phase.

Mouse and keys

WhereAction
AnywhereF9 fit · Ctrl+S save the project · Ctrl+Z undo (not while typing in a field or with a dialog open). On a Mac, ⌘ works in place of Ctrl.
PlotsThe round i at the right of the plot toolbar lists these controls when you hover or tab to it. Drag to zoom. Shift-drag or right-drag to pan. Wheel zooms 2θ about the cursor (Alt: intensity). A thin box zooms one axis only. Double-click autoscales both plots. Autoscale appears after zooming or panning and hides after either plot is reset. The difference plot follows.
Background and regionsCtrl+click adds or removes an anchor. Ctrl+Shift+drag marks an excluded region.
Parameter valueMouse wheel or arrow keys change it; Shift for larger steps, Alt for smaller.
Parameters panel← → beside the dataset name show the previous or next dataset. A group header folds the group; its box ticks the whole group. In Global mode a padlock shares a parameter; right-click it for more.
Dataset listCtrl+A all · Shift+click a range · Ctrl+click one more · Delete · F2 or double-click renames · drag reorders.
Phase listClick or use ↑ ↓ to select the active phase, whose definition the Phases tab shows. Assign phases to datasets with Datasets → Phases… or Refine → Phases of the datasets….
Side panel edgeDrag to resize; double-click to reset.

Settings

SettingMeaning
AlgorithmLM, or PT with an LM finish.
PT sweeps · replicas · highest temperature · seed10–100000 sweeps (default 50; a sweep is one proposal per refined variable per replica); 2–16 replicas per fit worker; ladder from 1 to the highest temperature (> 1); seed for repeatable runs. Shown only with PT.
Maximum iterationsLM iterations of the whole fit, 1–10000 (Le Bail shares them between its WPPF start and its cycles). PT sweeps are additional.
Stop when χ² changes less thanRelative change, twice in a row.
Weight of each pointFile weights, supplied 1/σ², Poisson fallback, or unit.
Chebyshev terms of new datasets0–24. 0 disables the background; 1 gives a constant background (degree 0). Point fitting requires at least 1 term.
Automatic background points2–200, used by automatic placement.
Datasets drawn at mostLarger selections are thinned evenly for drawing only; fits use all of them.
Parameter limits and shared flagsPer parameter. All limits and shared flags to their defaults resets them.

Saved data

  • Local storage (keys start with powder6.): the settings including the theme, and the Solve options (formula, Z and the charge-flipping and Wyckoff options). Clearing site data resets them.
  • Project files: Compressed .project archives with format-4 metadata tagged powder6-project. Observation columns and the WPPF precision block are stored as one little-endian binary entry each, never in the JSON, and a structure solution refers to its extraction instead of carrying a second copy of it. Format 3 still opens.
  • Calibration and peak-shape presets: JSON files (powder6-instrument-resolution, powder6-profile).
  • Nothing leaves the browser. There are no accounts and no network calls apart from reading the files of the program itself.

Reading a project replaces the previous session’s datasets, model, saved method states, numerical settings, profile defaults and structure-search options, and clears every restore point: the project is read as it was saved, and Undo cannot bring the previous session back (save it first if you need it). Instrument values are restored per dataset, including λ1, λ2, their ratio, radiation and polarisation, together with the extracted intensities of the active method, the values each dataset remembers for parameters it does not hold at the moment, and an absorption table loaded by hand. Previous extraction and display caches are cleared. Fields absent from older projects use clean defaults, so an old session’s wavelength or search options are not inherited. The formula unit, Z and the distance constraints of the Structure commands belong to the project: they are saved with it and not kept by the browser between sessions.

Code layout

For anyone extending the program. Most application and numerical files are classic scripts; the numerical workers load their dependencies with importScripts. The symmetry worker is an ES module and imports the public Moyo bindings.

index.html              the page: header, panes, side panel, dialogs
powder6.css             tokens (light/dark), layout, components
charge_flipping.wgsl    GPU kernel for charge flipping
swarm_reflection.wgsl   GPU kernel for the Wyckoff search

js/
  constants.js          shared physical and numerical constants
  crystal.js            cell metrics, d-spacings, hkl positions, Lp
  profile.js            peak shapes, background, peak shift, pattern assembly
  wppf_linear.js        skyline matrix, non-negative least squares
  polarization.js       polarisation modes, French-Wilson
  absorption_table.js   attenuation-table rules: units, element keys, log-log interpolation
  scatterers.js         X-ray / neutron scattering factors
  parsers.js            pattern file readers (all formats above)
  cif_reader.js         shared CIF tokens, loops and data blocks
  data_io.js            pdCIF reader
  cif_structure.js      structure CIF reader
  sg_engine.js          space-group lookup (loaded after sg/all.json)
  sg_convert.js         structure conversion and the Moyo input/output adapter
  sg_subgroups.js       maximal subgroups (t and k) from the operators of a space group
  symmetry_worker.js    ES module calling the public Moyo WebAssembly API
  spacegroup_ui.js      the space-group browser
  wyckoff_report.js     structure report (packing, contacts, bond valence)
  density3d.js          3D density and cell viewer
  atomic_constraints.js GSAS-II style linear constraints
  distance_rules.js     the rule language of the Wyckoff search and the restraints
  atom_restraints.js    Rietveld restraints on atom labels (soft rows in chi^2)
  molecule_rules.js     a PDB / MOL / SDF / XYZ / Z-matrix molecule as bond and angle rules
  wyckoff_limits.js     limits, defaults and shape codes of the Wyckoff search
  fourier_map.js        Fourier maps from WPPF intensities and a model
  pt_gpu.js             WebGPU parallel tempering (f32, validated against the f64 model)
  cf_adaptive.js        charge-flipping quality diagnostics and the adaptive search plan
  rietveld_core.js      the fit: Rietveld, Le Bail, WPPF, LM, PT (DOM-free)
  rietveld_worker.js    runs one fit off the main thread
  charge_flipping_worker.js
  wyckoff_worker.js     with symmetry_utils, observations, wyckoff_assign,
                        contacts, swarm_wyckoff, coord_refine.js
  rietveld/
    rv_state.js         the single state object, history, settings, storage
    rv_ui.js            toasts, dialogs, menus, formatting
    rv_plot2d.js, rv_plots.js   canvas plots
    rv_phases.js, rv_datasets.js, rv_panels.js   panes and side panel
    rv_commands.js      menus, command line, file reading, fits
    rv_results.js, rv_pdf.js    results, text export, PDF writer
    rv_gsas2.js                 export to GSAS-II (CIF, xye, instprm, ZIP writer)
    rv_sgtest.js, rv_solve.js   space-group test and the Solve tab
    rv_absorption.js, rv_constraints.js, rv_rietveld_structure.js
    rv_fit_history.js   calculation records, History Set / Keep
    rv_project.js       project archives (JSZip): save, open, fingerprints
    rv_restraints.js    the restraint editor and its geometry guide
    rv_wyhelper.js      the Wyckoff-search constraint helper
    rv_fourier.js       the Fourier map form and result
    rv_layout.js, rv_workspace.js   panels, result tabs, parameter workspace
    rv_app.js           start-up, tabs, databases, keyboard
    rv_theme_startup.js applies the saved theme before first paint

lib/moyo/
  moyo_wasm.js          public JavaScript bindings and WASM loader
  moyo_wasm_bg.wasm     compiled Moyo 0.21.0 symmetry engine
  moyo_wasm.d.ts        public API types
  package.json          upstream package identity and version
  NOTICE.md, LICENSE-MIT attribution and redistribution terms

Bundled Moyo code and license

Powder 6 includes a local copy of the public @spglib/moyo-wasm package, version 0.21.0. The compiled WASM binary and JavaScript bindings are distributed with the application. No npm installation, compilation, external service or CDN is needed to run this copy. Serve these files over HTTP with the rest of Powder 6.

rv_phases.js selects the model and calls SGConvert.symmetryJob in sg_convert.js. That adapter builds Cartesian lattice vectors, fractional full-cell positions and integer identifiers for the stored atom-type/occupancy classes. It starts js/symmetry_worker.js, which initializes the bundled binary and makes this direct public API call:

import init, { analyze_cell } from '../lib/moyo/moyo_wasm.js';
await init({
  module_or_path: new URL('../lib/moyo/moyo_wasm_bg.wasm', import.meta.url)
});
const dataset = analyze_cell(JSON.stringify(cell), tolerance, 'Standard');

The worker returns Moyo’s dataset and Hall symbol. The adapter uses the returned space-group number, standardized lattice, axes and origin shift, converts Moyo’s column-major matrices to the application’s row-major convention, measures atomic mismatches and checks permitted cell adjustments. It sends no assigned group number to Moyo. Cancelling the dialog or changing its inputs terminates the worker. A load failure or timeout is reported in the search dialog.

Upstream offers MIT OR Apache-2.0; this bundled copy is distributed under the included MIT license. Retain its copyright and permission notice when redistributing the code. Attribution and the upstream citation are in NOTICE.md. See the Moyo source repository and public JavaScript API reference.

Browser checks in tests/project-symmetry.html, tests/addsym-pbso4.html and tests/convert-files.html exercise the public engine, model selection, conversion and undo. The PbSO4 fixture supplies known Pnma coordinates as a P1 dataset’s fitted values: 24 full-cell atoms become five independent sites. These checks verify the integration and transformations; they do not run an actual PbSO4 refinement.

Design rules worth knowing

  • One fit core. rietveld_core.js has no DOM access. The page, the worker and tests load the same file.
  • Plot colours are plain values. Variables read by canvas code (--plot-*, --series-*, --phase-*, --calc-line …) must be #hex, rgb() or px: a canvas cannot evaluate var() or color-mix(). The JavaScript keeps no colours of its own.
  • Single stylesheet source of truth. powder6.css defines all light/dark design tokens, layout and component rules in one place.

Troubleshooting

Message or symptomCause and fix
“The space groups are not loaded … Open index.html through a web server.”sg/all.json could not be fetched. Serve the folder over HTTP and check the file is present.
“The scattering factors are not loaded (scatters/index.json: 404)”The scatters/ folder is missing or the page is not served from the right folder. Rietveld calculations require the factors for every assigned atom and radiation type; Le Bail and WPPF remain usable.
A .brml or .rasx file is refusedlib/jszip.min.js is missing.
Wyckoff search says the shader failed to loadswarm_reflection.wgsl is missing, stale or cached. Reload with the cache cleared. The message also appears if the WGSL and wyckoff_assign.js constants disagree.
The Wyckoff search will not startRead the reported reason. The search needs a WebGPU device available to a Web Worker and has no CPU-only fallback. Check the next row for hardware access, and the shader row for missing or stale files. CPU fitting and charge flipping remain available.
The Structure tab warns that WebGPU was not foundServe the page on localhost or over HTTPS with a browser that exposes WebGPU in workers. Enable browser graphics acceleration, restart and reload; check GPU access in the browser’s diagnostics, graphics drivers and any virtual-machine or remote-session restrictions. For Chromium browsers, chrome://gpu or edge://gpu reports GPU feature status. Charge flipping and parallel-tempering fits can fall back to the CPU; LM fitting needs no GPU. The Wyckoff search requires WebGPU.
A fit does not moveCheck that parameters are ticked for the selected datasets, that the phases are assigned to them, and the fitted 2θ range. Fit scales and background first.
Rwp is good but the cell drifts or intensities go to zeroToo many parameters at once, or overlapping reflections. Use Le Bail or WPPF to settle cell and shape, then a Rietveld step by step. Check the limits.
Everything is slow with many datasetsIndividual fits run in parallel workers; global fits are one large problem. Lower Datasets drawn at most for drawing speed.
χ² is far below 1 but the fit looks goodThe intensities are probably not counts (normalised, averaged or smoothed data), so the Poisson weights are on the wrong scale. Parameters, Rwp and the uncertainties are unaffected; read Rwp and the difference curve. See χ² and the weights.
A constraint is refused: “already in another relationship”, “fixed or dependent by site symmetry”, “cannot be met within the parameter limits”A parameter can be in one relationship only; only free directions of a site can be constrained; a sum that the limits cannot reach (occupancies limited to 0–1 summing to 3) is refused. See Atomic constraints.
“Restraints of …: “X” is not an atom label”A restraint rule names an atom the phase does not have (deleted or renamed outside the dialog). Fix the rule or clear the rules textbox under Restraints…; labels are case-sensitive.
The difference map has no peaks, or only noiseThe model may already account for the data at this resolution; lower the resolution d, tick Finer grid, or check that the extraction has enough reflections at high angle. A very strong overlap hands the intensity to the model, which hides what it lacks; a map from a poor model is biased towards it.
“Constraint sharing conflict”In a global fit, the terms of one constraint equation have different shared/local flags. Make them all shared or all local.
The space-group test finds no difference between groupsThe WPPF fit was run in a group that already forbids the reflections. Refit in the condition-free group of the Laue class. See Space-group test.
Find higher symmetry returns P1 for both parameter sourcesInspect the actual coordinates and cell for each source, the full-cell atom count, stored atom types and occupancies. The result describes the supplied model at the selected tolerances; diagnosing an unexpected group requires that model’s input. See Atomic-model symmetry.
Find higher symmetry cannot load its WASM engineServe the folder over HTTP and check js/symmetry_worker.js, lib/moyo/moyo_wasm.js and lib/moyo/moyo_wasm_bg.wasm are present and served from their original relative paths. Moyo needs WebAssembly and module workers; it needs no WebGPU. The dialog reports the load error.
Higher symmetry is found but Convert… is refusedThe report separates detection from conversion. Check the lattice-adjustment limit, atomic mismatch messages and each dataset’s Rietveld model in the conversion preview. A group reported at a larger tolerance may be pseudo-symmetry.
Charge flipping is still preparing its first cycleThe running panel reports GPU preparation, shader loading and compilation before cycle percentages begin. GPU startup waits have timeouts and CPU fallback; Stop works during preparation. See Charge flipping.
Wyckoff uses the CPU even though WebGPU is availableCPU preparation, replica exchange, restart control, quench orchestration, fitness checks and final coordinate refinement are expected. The quench still uses GPU fitness evaluation. See the execution stages.
Wyckoff Restarts = 20 appears to stop at 10Check the About version and reload the current application: versions before 2.37.1 silently capped the count at 10. Current versions run the requested count per full-search wave. Screening still uses one start; Stop or a GPU failure can end the run early. Inspect the full search log in History.
Wyckoff reports a fitness cross-check failureThe CPU and GPU disagree on the same search coordinates and reflection arrays by more than 1e-3. Reload the application and shader together to rule out stale files, then inspect the recorded mismatch before relying on that fitness. Agreement alone does not establish the structure.
The Wyckoff search says the ranking is withheldFewer effective observations than free parameters. Extract more reflections, add distance constraints, or lower Z. See Wyckoff search.
Distance constraints refused (“make N rules; the kernel holds 32”)Drop upper bounds you do not need or turn them into floors. See Distance constraints.
Settings or theme came back unexpectedlyThey live in local storage under powder6.. Use Reset settings or clear site data.

Recent changes

Version 2.49.3 uses one lattice search for every minimum-image distance, so Fourier peak matching, cell conversion, ADDSYM and the Wyckoff search agree on skewed cells. The contact report now lists every neighbour within the cutoff, so a cell with a short axis or a strong skew can show higher coordination numbers and bond-valence sums.

Version 2.49.2 corrects minimum-image distances in highly skewed cells using a metric-bounded lattice search. Secondary-line crystallite-size broadening now uses the secondary wavelength, on the CPU and in WebGPU parallel tempering, while preserving the integrated source ratio. This changes the calculated pattern of a Kα1/Kα2 dataset with a refined size, so refit older projects before comparing their sizes or History records.

Version 2.49.1 preserves independent Fourier observations, imports every supported GSAS BANK with counter-dependent STD uncertainties, and preserves small values in GSAS-II XYE export. Cell contraction checks atomic repetition and species content; invalid unit-cell metrics are rejected. Shared restraints count once in global degrees of freedom, including linked geometries. Fourier maps explicitly refuse enabled anomalous corrections instead of silently omitting them. Refit restrained global results before using the revised uncertainties.

Version 2.49.0 shows the Phases plot checkbox only when the project contains at least two phases. Its setting is preserved while hidden.

Version 2.48.1 fixes project isolation for Fourier maps and absorption tables, enforces unique phase identities, protects pending imports against concurrent calculations and project replacement, handles idle fit-worker failures, and preserves dataset filtering and phase keyboard focus across refreshes. Project-symmetry checks follow the dataset title tooltip and run in browser CI.

Version 2.48.0 uses native dataset and phase lists. Phase and dataset title help contains the editor descriptions and measurement details, with icons visible only when open. Empty-plot guidance stays within the plotting frame. Phase name and colour editing moves to the list Edit dialog, removing duplicate identity controls from the shared-model editor. Checkboxes include datasets in plots and fitting; name buttons inspect parameters independently. The inspected name is underlined and marked for assistive technology. Range selection, keyboard shortcuts and drag reordering remain available.

Version 2.47.2 preserves small uncertainties in reports, validates precision-block memory before project decoding, includes all participating phases in global-fit summaries, and makes limits and sharing edits undoable. Startup without JSZip remains available for uncompressed workflows.

Version 2.47.1 clarifies in LICENCE that the Creative Commons terms cover original Powder 6 material, while bundled third-party components retain their own licences. Moyo is distributed under its included MIT licence; its copyright and permission notice are preserved.

Version 2.47.0 simplifies the fitting results, uses sticky Structure tabs and removes duplicate Show structure and export actions. Geometry names the displacement/transparency group; Sample selects size and strain. Save results now groups the fit settings, parameter refinement states and full reflection tables into a readable report. pdCIF retains available atoms, and both exports explain the zero-shift sign explicitly.

Version 2.46.1 clarifies that 0 Chebyshev terms disables the background, 1 term gives a constant background (degree 0), and fitting to background points requires at least 1 term.

Version 2.46.0 adds Chebyshev background point targets. Anchors is always visible; automatically estimated points can be added, moved, selected and removed without changing the term count. Fit to points uses orthogonal least squares and holds the resulting coefficients during Sample fitting. Degree N requires at least N+1 selected points in the fitted, non-excluded range. Point targets remain separate from diffraction parameters and are preserved by projects, undo, calculation History and method switching. Existing saved curves remain unchanged until points are fitted or edited.

Version 2.45.1 corrects linked global derivatives, integrated-intensity covariance and precision, joint extraction, reflection coverage and HKL matching, doublet positions and area-normalized radiation weights, strain validity and zero starts, active-boundary convergence, feasible GPU selection, FWHM diagnostics, dependent-coordinate errors and the one-step Le Bail budget. Prepared profiles and isotropic geometry are reused. Refit older calculations before comparing residuals or using their intensity errors: corrected profiles and tails can change fitted values. Historical records remain readable.

Version 2.45.0 makes the background type an explicit project-wide choice in Background…. Selected and unselected datasets, new patterns and fitting methods all use that type, while their coefficients, anchor positions, heights and refinement flags remain independent. Dataset order does not control the choice. Ctrl+click has no effect in Chebyshev mode and the Anchors checkbox is hidden; it edits anchors only after Spline has been selected explicitly.

Version 2.44.0 renames the parameter limits and sharing section Parameters and places it immediately before Links. Sharing controls appear only where applicable in global fits. Empty Links is hidden; add the first relationship from Parameters, and Links appears to manage it. Switching mode or selection preserves hidden sharing preferences.

Version 2.43.1 removes the horizontal scrollbar below Structure in Datasets by keeping the parameter rows inside their container.

Version 2.43.0 corrects centric starting phases and weak Friedel-pair updates in CPU and GPU charge flipping, limits independent sites after symmetry reduction, refuses stale extracted intensities, and uses integrated charge to name CF peaks (height remains the fallback for older results). Each phase’s atom list is collapsible, with an independent Structure block directly below it in Phases and the dataset’s Rietveld controls.

Version 2.42.17 shows the per-phase Save CIF… of 2.42.16 only on a phase that has atoms (a cell and a space group with no sites would be saved as an "atomless phase", which is not a structure), and refuses an atomless phase in the save routine itself.

Version 2.42.16 fixes a check that was not running: the Gaussian-variance guard of 2.42.14–15 read inst.GU, inst.GV, inst.GW, but a separated profile is the instrument's U, V, W whatever its type, so a dataset whose resolution type is gsas_cw reported a variance of zero — no warning and no boundary. The names follow the owner now, and a Node test walks all four resolution types. It also hides a block's question mark while the block is closed, drops the duplicate Atoms to the phase… and Save CIF… buttons from the two 3D structure blocks (they stay once, beside the sites), disables Compute the map with the reason on its tooltip until the phase has atoms and WPPF intensities, and adds Save CIF… to every phase's parameter group in Datasets, which writes that phase alone from the values of the dataset being edited.

Version 2.42.15 makes a non-negative Gaussian variance part of the model instead of a warning. A refinement step that would drive U tan²θ + V tanθ + W — or a phase's own pN.U/V/W, pN.GU/GV/GW, or the two split flanks — negative anywhere in the fitted range is cut back to that boundary (the step fraction is bisected until it no longer crosses), so a TCH fit stops at the limit instead of wandering into a region where the width floor has removed the Gaussian component and the coefficients no longer mean anything. Parallel tempering rejects proposals that cross it, a WebGPU result outside it is not taken, a fit that starts outside is left free to come back, and a fit that ends on the boundary says which polynomial, at which angle, and that the Gaussian width is at the floor.

Version 2.42.14 replaces the Thompson–Cox–Hastings start values, which described a profile that cannot exist. TCH_default.json shipped U = 17.4, V = −45.2, W = 16.5 cdeg², and that Gaussian variance is negative from 47.4° to 130.3° 2θ (minimum −12.854 cdeg² at 104.8°): every TCH refinement began with no Gaussian component over most of the pattern, the width floor hid it, the coefficients had no effect on χ², and the fit drifted through the flat valley that leaves behind — a synthetic fit from a valid start reached a variance of −302 cdeg² at 145° without a word. The start values are now 2, −2, 5 (as in the Voigt and Split presets), X = 1, Y = 0, SL = HL = 0. The negative-variance diagnostic also covers a phase's own coefficients now (pN.U, pN.V, pN.W, pN.GU/GV/GW, the split flanks), not only the inst.* of a separated profile.

Version 2.42.13 moves the attenuation-table rules (units, element keys, ordering, the post-edge row, log-log interpolation and the refusal to interpolate across an absorption edge) into js/absorption_table.js, which the Node suite now tests, and makes the density and transparency estimates name what is missing instead of returning NaN. It also stops a structure CIF from silently completing a cell: a parameter the crystal system leaves free must be in the file, and the reader counts the sites whose coordinates it could not read.

Version 2.42.12 keeps only the space-group file the page reads: the 230 per-group files and sg/index.json (4.69 MB) that nothing fetched are gone, and the generator that produced them now writes just sg/all.json, the split layout only with --split. It also removes three scripts that described a generator this repository no longer has (or that produced a superseded schema 7) and the 522 KB powder CIF dictionary under tools/, which no code read.

Version 2.42.11 removes the last references to code deleted in 2.42.9: intensityDerivativeColumn() takes the bucketed contributions its one caller passes and no longer documents a flat-list form that is gone, and the note on automatic Z describes the volume-per-atom estimate instead of naming the removed suggestZ().

Version 2.42.10 completes the code layout in this document (fourteen files were missing), corrects comments that named a file and a caller that no longer exist, removes two dead CSS rules and nine unreferenced element ids, and adds file-readers, pattern-only, project-save and solve-fixes to the browser checks that run on every push.

Version 2.42.9 removes code nothing called: most of symmetry_utils.js (a 3-D FFT, a Patterson synthesis, map smearing and space-group setting resolution, leaving the two cell-geometry functions the Wyckoff search uses), a second WPPF solver in wppf_linear.js, the unused statistical block of observations.js and structure-quality block of contacts.js, two dead exports of wyckoff_assign.js, three of crystal.js and four wrappers in polarization.js — about 1,300 lines in all — plus a tarball that duplicated lib/moyo/ and a duplicated Python script in tools/. A no-op inner loop in the Wyckoff quench went too. Nothing the program computes changed: 178 Node tests and the Wyckoff, Solve and structure browser pages pass.

Version 2.42.8 leaves one erfc in JavaScript: profile.js defines it for both signs and the French-Wilson correction in polarization.js calls it, instead of a second copy that would have been right only while every caller passed a positive argument. The GPU kernel keeps its own f32 copy. A Node test now pins erfc(0), erfc(1) and the reflection formula.

Version 2.42.7 keeps the keyboard shortcuts out of open dialogs (F9 no longer starts a fit behind a save prompt, Ctrl+S no longer opens a second one, and F9 does nothing while a field has focus), reports a start-up that fails after the databases have loaded instead of leaving an unhandled rejection, and checks the decoded size of project.json as well as the size JSZip's header claims, so the limit does not depend on a private field.

Version 2.42.6 closes three small ways a number could be wrong without saying so: a distance rule of the form S O 4 1.40/1.60 2.0 used to be accepted with the trailing number discarded (it is an error now), the scattering loader's fallback named a table file this repository does not contain, and an ionic f0 the table lacks silently became the neutral atom (it is still used — a point atom would be worse — but the substitution is logged once per species). It also stops the adaptive charge-flipping diagnostics passing one argument per reflection to Math.min.

Version 2.42.5 makes the numerical constants in js/constants.js the values the fit actually uses, or removes them: the parallel-tempering replica count and hottest temperature, the number of consecutive converged LM iterations and the base finite-difference probe are read from there, and the switches that nothing read (a trust region, a probe ladder, a PT refresh interval, an exact variable-projection Jacobian) are gone. The values are unchanged, so a fit gives the same numbers; what changes is that editing one of them now does something, and that no comment describes a value the code does not use.

Version 2.42.4 keeps phase restraints and per-element anomalous-scattering tables in History checkpoints and reports, updates or prunes parameter links when atoms or phases change, converts displayed link multipliers to display units, fixes negative-peak parabolic interpolation and oblique minimum-image distances in Fourier maps, uses single movable-site proposals (75 %) in the Wyckoff closing quench without a duplicate initial GPU evaluation, and reports actual accepted step counts in coordinate refinement.

Version 2.42.3 makes the question-mark help icon four fifths of its former size, and gives Constraints, Restraints, Links and Parameter links and sharing their help in the title of their accordion, as the Structure blocks already had it. Parameter links and sharing is no longer an accordion inside Links: it is the section below it, at the same level, and its explanation is in its title.

Version 2.42.2 puts the explanation of every Structure block into the question mark at the right of its title: WPPF intensities, Space group (the space-group test and ADDSYM in one text, the Moyo engine included), Charge flipping (the method, the formula unit and Z, and the density the form gives) and Wyckoff search, with the Fourier map's question mark moved there from the top of its form. Each form now begins directly under its title.

Version 2.42.1 moves the help of the charge-flipping formula unit out of the form: the question mark after Z is gone, and one question mark sits at the right of the Charge flipping title, holding the formula and Z explanation together with the density the form currently gives (and why it cannot be used when it cannot). Neither formula row carries a question mark of its own.

Version 2.42.0 adds a Seed to the Wyckoff search and to charge flipping: every random start of a run is drawn from it, the Log, History and the project record it, and typing it back repeats the run exactly. A saved project is no longer reported as modified when the preset files beside the page finish loading after it, and the check that decides this no longer copies the structure archive. Project format 4 stores the WPPF precision block and each structure solution once, as binary entries, and still opens format 3. Distance rules no longer drop a third number, and A B 4 1.4 1.6 now says to write A B 4 1.4/1.6 instead of complaining that dmax is below dmin.

Version 2.41.0 adds Subgroups… to ADDSYM: the maximal translationengleiche and klassengleiche subgroups of the phase's space group (Fm-3m gives F432, F-43m, Fm-3, I4/mmm, R-3m, Pm-3m and Pn-3m), each opening Convert… with its axes and origin. It also clarifies Convert… (the Find box is now Filter list, and Find it / Enter it are Axes and origin: Work them out / Enter them), stops Convert… calling a transformation to a larger cell "the same group", and lets an atomic constraint be set on a phase that was added while Le Bail or WPPF was the active method (it failed with "No value for constrained parameter").

Version 2.40.0 makes a dependent parameter (equivalence constraint or link) show the tick of the parameter it follows, lists every restrained value, satisfied ones included, in the restraint geometry table, and adds Save peaks (CSV) to the Fourier peak list.

Version 2.39.0 bundles Chantler anomalous-scattering data from Hephaestus and interpolates f′/f″ automatically at each dataset's λ1. Anomalous scattering defaults on for X-rays and can be switched off for comparison; the control is disabled for neutrons. Reports retain the factors actually used. Instrument omits Fit from/to fields, and its monochromator tooltip lists accessible reflections only.

Version 2.38.0 replaces the fixed Cu/graphite example in Instrument and range with wavelength-dependent monochromator tooltips on the label and angle field. The common-crystal table updates from the dialog's λ1, including source changes and manually entered wavelengths.

Version 2.37.2 documents which Wyckoff stages use the GPU and CPU, the lack of a CPU-only search fallback, per-wave restart counting, progress and stopping, and numerical cross-checks. It also corrects troubleshooting to describe CPU fallback for parallel-tempering fits.

Version 2.37.1 removes the silent ten-restart limit from the Wyckoff form and validates the count in the form, worker and search. It restores keyboard navigation during calculations, keeps the Anchors checkbox synchronized when adding anchors, hides Autoscale after either plot is reset, and names the dataset calibration button Profile.

Version 2.37.0 shows every phase as an accordion titled in its plot colour, removes the per-phase buttons from the top of Phases (they are in each phase), removes Preferred orientation… and moves Refine scales only from the Datasets bar to the Refine menu, takes Delete the current phase out of the Refine menu, and makes the polyhedron moves of the Wyckoff search a setting (Polyhedron moves, %, default 0: the search as before) and disables Wyckoff fields that have no effect.

Version 2.36.0 makes the Wyckoff search move coordination shells as units when a distance rule has a count (an octahedron is translated, rotated or snapped to its ideal shape as one), which made a simulated FeC6 solve reliably where it often did not.

Version 2.35.0 adds Atoms from CIF… and Fragment… to Phases: the atoms of a structure CIF, or a molecule (PDB, MOL/SDF, XYZ, Z-matrix) with restraints for its bonds and angles, go into the current phase.

Version 2.34.0 reads "start step end" pattern files (FullProf, WinPLOTR, EXPO), refuses a misread 2θ axis, and corrects the GSAS STD, UXD, RAS, XRDML and BRML readers (several scans per file, wavelengths, attenuators, counter fields). It also gives a dataset saved without an id in an older project its own id, and keeps the Le Bail / WPPF intensities through Undo and Restore before.

Version 2.33.3 gives every question-mark help button the same round look and shows its help whole in a popup (the Restraints rules help was cut short as a tooltip).

Version 2.33.2 explains the Factor of the Wyckoff Helper's Suggest tab in a tooltip.

Version 2.33.1 places the Helper buttons to the right of their rules boxes, in Datasets / Restraints and in the Wyckoff search.

Version 2.33.0 adds a Helper for the Wyckoff search distance constraints, like the restraint Helper but on the elements of the formula unit; it is disabled until the formula unit can be read.

Version 2.32.0 corrects restraints and constraints: rules naming a deleted atom are removed instead of stopping fits, renames follow labels in any case, counted rules A→B and B→A are distinct, neighbour searches are exact in oblique cells and never take a missing neighbour at the search radius, restraint derivatives include linked variables of other phases, an equivalence or equation term may be a link target, removing an atom drops (and reports) its constraint equations, copied values follow constraints and links, and typed constrained values apply when typing pauses.

Version 2.31.2 documents atomic constraints, grouped sum flags, manual linked edits, parameter links, sharing, and the clipboard-only restraint Helper. It corrects mixed-site flag instructions, obsolete section names and the location of limits, and adds worked examples and a comparison of the controls.

Version 2.31.0 places Copy in the last dataset accordion and rule help in an inline tooltip. Helper has Geometry, Molecule and Suggest tabs that collect unique rules for clipboard copying. It never applies rules to datasets; paste the collection into the main restraints textbox when wanted.

Version 2.30.0 moves constraint-rule help into an inline question-mark tooltip, matches the coloured phase headings in Restraints to Constraints, applies nonempty restraint text automatically, and consolidates geometry, molecule and structure-suggestion tools into one Helper modal. The complete rule explanation is collapsible.

Version 2.29.1 prevents duplicate restraint pairs in direct text edits and helper additions, including reversed pairs and overlapping generated angle-distance rules.

Version 2.29.0 places the active-restraints textbox before the collapsed geometry helper. Proposed rules update automatically, and Add appends them directly. Numeric edits no longer rebuild the Add button before its pending click.

Version 2.28.1 moves the Wyckoff formula help and current density guidance onto the Formula unit label and input, removing both question-mark markers.

Version 2.28.0 adds a Restraints block below Constraints in Datasets, with a geometry helper for bonds, angles and coordination polyhedra. Preview distance and angle tolerances before adding rules for distinct atom labels or symmetry-related shells. Counted Rietveld shape rules support a per-rule angular window via angle=3.

Version 2.27.0: sum constraints share refine controls and update related values while typing; either end of an equivalence or dataset link can be edited. Dataset copy controls separate values and flags and offer named destinations. Atomic Constraints exposes its editor, with Links and sharing below it. Constraint rows keep their alignment. Periodic Fourier density includes boundary equivalents; structure help uses tooltips, and view-reset controls appear after view changes.

Set on a saved Wyckoff or charge-flipping run restores the intensities it was made from again (they were marked out of date when restored).

Fourier maps in Structure: difference, observed and 2Fo − Fc maps of a phase from its WPPF intensities and the atoms of its model, drawn with the density viewer, with a peak list that adds atoms to the phase.

Rietveld restraints: soft distance and angle rules between atoms of a phase, written in the rule language of the Wyckoff search, with a guide that writes the rules from a PDB, XYZ or Z-matrix molecule and a suggestion from the current structure.

Philips UDF RawScan intensity blocks use the stated starting angle and increment, retain wavelength metadata, and warn about inconsistent endpoints without dropping measured points.

GSAS patterns with fewer points than declared in their BANK header load the available complete points with a warning; missing measurements are not padded.

Observed patterns can be viewed without a phase. Reading patterns opens Plots; if a remembered background-subtraction setting cannot be applied, raw intensities are shown with an explanation.

Commands → Structure selects the phase/dataset source in WPPF intensities. Intensity uncertainties and correlations are prepared automatically; no manual extraction is required. ADDSYM remains independent of this step.

The help opens in the same theme as the program, with a Light/Dark slider at the top right, matching the program’s toggle. Text uses the available window width.

The Datasets accordion contains selection and Individual / Global mode; FIT and F9 run the selected datasets. Edit beside each dataset changes its name and colour; automatic theme colours can be restored. The separate Selection and batch section and duplicate table have been removed.

Dataset and phase palettes use more distinct early hues. Active and fixed background anchors, axes and background curves have stronger contrast in both themes.

Wyckoff MCMC now mixes single free-site proposals (75%) with collective proposals (25%). Each site retains its full symmetry orbit. Command action headers and result selectors use a consistent theme-aware background.

Version 2.49.1, 28 October 2026. The complete version history and regression details are in CHANGELOG.md.

  • Le Bail keeps to Maximum iterations for the whole fit (it ran up to twice as many). Phases has Starting model → datasets… and Dataset → starting model… to carry the cell and atoms between the phase and its datasets, and a Structure block with the picture and distances of the starting model or a dataset’s model. Find higher symmetry converts at once with Convert. The Wyckoff search writes a summary to the Log (the whole log is in History). File → Read project….
  • Charge flipping imposes the space-group phase relation with the sign of its own Fourier convention, so the map obeys the group as written (it obeyed the inverted group before, and only the hand search put it right). Datasets take anomalous f′, f″ per element for the Rietveld structure factors. The SL/HL asymmetry is included in the peak area; transparency estimates carry the physical (negative) sign; the WPPF intensity solve no longer breaks down on nearly coincident or range-truncated reflections (it used to return zeros silently), and a failure is reported; the displacement moves at most about 0.1° per iteration.
  • The Wyckoff search and coordinate refinement weight overlapped groups with the WPPF covariances, use each reflection's own d in the scattering table, sum structure factors over one image per centring class (a half to a quarter of the work for C, I, R and F lattices), and no longer assume a tetrahedron for four-coordinate oxygen. A PT sweep is one proposal per refined variable per replica (default 50 sweeps).
  • Excluded regions are rows like the background anchors: from, to, an Apply tick (untick it to fit with and without a zone), a × to remove it, and Add zone to open a window for the two angles. Zones not applied are saved with the project.
  • The Structure pane has one note instead of two and warns when WebGPU is missing; Troubleshooting says how to switch on the browser’s hardware acceleration. The datasets search box appears from nine datasets; the limits accordion no longer repeats its title.
  • The look is uniform: one spacing scale, one tab height, three shadows, and the same box for dialogs, menus and the space-group browser.
  • Settings boxes have one width and their labels wrap; the Datasets parameter rows, the background anchors (with a × to remove each) and the parameter limits follow the width of the panel.
  • The help of the Wyckoff, charge-flipping and Settings fields is in tooltips (hover a label or a box), so every label stays level with its box; the Mode selector appears only with two or more datasets selected.
  • ADDSYM scans up to 1 Å and points to the tolerance at which a higher symmetry appears; the Structure pane starts with its three methods closed and its notes aligned.
  • Wyckoff distance constraints can give a coordination shell a shape (tetrahedron, octahedron, square, triangle, linear, or tet, oct, sq, tri, lin), restraining its angles with an adjustable Shape weight.
  • The Commands and Results headings and the plot help line are gone; the plot's mouse controls are in the tooltip of a round “i” at the right of its toolbar. Every session starts as a Cu X-ray tube.
  • Dataset groups are removed: datasets are chosen with the selection alone.
  • Convert… shows the standard setting of each space group in bold, marked “standard”.
  • The Wyckoff search screens long lists of assignments before the full search, searches equivalent assignments once, accepts up to 32 distance rules and 256 coordination slots, and reports its live best structure and the progress of the whole run.
  • ADDSYM runs directly after a Le Bail or WPPF fit, tolerates slightly different refined occupancies, searches mixed sites and keeps its engine loaded between searches.
  • Reading a project (File → Read project) clears the restore points and reads the project as saved, including the active method’s intensities.
  • Structure → Space group now groups the powder-intensity Test and atomic-model ADDSYM controls, with a separate phase selector for the latter.
  • Find higher symmetry calls the bundled public Moyo WebAssembly engine in a cancellable worker. Reports show the selected atomic source, returned group and conversion restrictions. Conversion retains the selected model and uses each dataset’s Rietveld coordinates and cell together.
  • Project opening replaces saved acquisition, method and search settings and clears the previous session’s calculation caches.
  • Chebyshev coefficients are re-expressed when the fitted range changes. Method switches and saved-result inspection reuse unchanged calculated plots.
  • Charge flipping reports GPU startup stages and completed cycles, with bounded startup waits, CPU fallback and Stop during preparation.

Corrections in 2.6

Released 21 October 2026.

  • Restored scale estimation and cleared obsolete fit statistics and uncertainties after phase additions or deletions.
  • Preserved measurement uncertainties, explicit weights and zero-weight exclusions through import, saving and undo.
  • Read each pdCIF profile with its own metadata and referenced phases; preserved neutron radiation and single-wavelength measurements.
  • Handled CIF comments, quoted values, wrapped loop rows and multiline text without losing atoms.
  • Required the scattering factors needed by each Rietveld model before calculating or fitting it.
  • Exported pdCIF radiation, wavelength components and zero correction, and restored calculation-affecting settings when undoing a project load.

References

Powder 6 and its predecessors

  • Dragoe, N. (2001). PowderV2: a suite of applications for powder X-ray diffraction calculations. J. Appl. Cryst. 34, 535.

Pattern decomposition and fitting

  • Le Bail, A., Duroy, H., Fourquet, J. L. (1988). Ab-initio structure determination of LiSbWO6 by X-ray powder diffraction. Mater. Res. Bull. 23, 447–452.
  • Pawley, G. S. (1981). Unit-cell refinement from powder diffraction scans. J. Appl. Cryst. 14, 357–361.
  • Toraya, H. (1986). Whole-powder-pattern fitting without reference to a structural model: application to X-ray powder diffractometer data. J. Appl. Cryst. 19, 440–447.
  • Golub, G. H., Pereyra, V. (1973). The differentiation of pseudo-inverses and nonlinear least squares problems whose variables separate. SIAM J. Numer. Anal. 10, 413–432.
  • Kaufman, L. (1975). A variable projection method for solving separable nonlinear least squares problems. BIT 15, 49–57.
  • Lawson, C. L., Hanson, R. J. (1974). Solving Least Squares Problems. Prentice-Hall, Englewood Cliffs, NJ.
  • Gill, P. E., Murray, W. (1974). Newton-type methods for unconstrained and linearly constrained optimization. Math. Program. 7, 311–350.
  • Swendsen, R. H., Wang, J. S. (1986). Replica Monte Carlo simulation of spin-glasses. Phys. Rev. Lett. 57, 2607.
  • Fritsch, F. N., Carlson, R. E. (1980). Monotone piecewise cubic interpolation. SIAM J. Numer. Anal. 17, 238–246.
  • Hill, R. J., Howard, C. J. (1987). Quantitative phase analysis from neutron powder diffraction data using the Rietveld method. J. Appl. Cryst. 20, 467–474.

Profiles, polarisation and conventions

  • Thompson, P., Cox, D. E., Hastings, J. B. (1987). Rietveld refinement of Debye–Scherrer synchrotron X-ray data from Al2O3. J. Appl. Cryst. 20, 79–83.
  • Stephens, P. W. (1999). Phenomenological model of anisotropic peak broadening in powder diffraction. J. Appl. Cryst. 32, 281–289.
  • Larson, A. C., Von Dreele, R. B. (2004). General Structure Analysis System (GSAS). Los Alamos National Laboratory Report LAUR 86-748.
  • Toby, B. H., Von Dreele, R. B. (2013). GSAS-II: the genesis of a modern open-source all purpose crystallography software package. J. Appl. Cryst. 46, 544–549. (Source of the constraint rules, the separated size/strain profile and the single-parameter polarisation convention.)
  • Azaroff, L. V. (1955). Polarization correction for crystal-monochromatized X-radiation. Acta Cryst. 8, 701–704.
  • Klug, H. P., Alexander, L. E. (1974). X-Ray Diffraction Procedures for Polycrystalline and Amorphous Materials, 2nd ed. Wiley, New York.

Structure solution

  • Markvardsen, A. J., David, W. I. F., Johnson, J. C., Shankland, K. (2001). A probabilistic approach to space-group determination from powder diffraction data. Acta Cryst. A57, 47–54.
  • Oszlányi, G., Sütő, A. (2004). Ab initio structure solution by charge flipping. Acta Cryst. A60, 134–141.
  • Oszlányi, G., Sütő, A. (2005). Ab initio structure solution by charge flipping. II. Use of weak reflections. Acta Cryst. A61, 147–152.
  • Oszlányi, G., Sütő, A. (2008). The charge flipping algorithm. Acta Cryst. A64, 123–134.
  • Palatinus, L., Chapuis, G. (2007). SUPERFLIP: a computer program for the solution of crystal structures by charge flipping in arbitrary dimensions. J. Appl. Cryst. 40, 786–790.
  • Baerlocher, C., McCusker, L. B., Palatinus, L. (2007). Charge flipping combined with histogram matching to solve complex crystal structures from powder diffraction data. Z. Kristallogr. 222, 47–53.
  • French, S., Wilson, K. (1978). On the treatment of negative intensity observations. Acta Cryst. A34, 517–525.
  • Brown, I. D., Altermatt, D. (1985). Bond-valence parameters obtained from a systematic analysis of the Inorganic Crystal Structure Database. Acta Cryst. B41, 244–247.
  • Brese, N. E., O'Keeffe, M. (1991). Bond-valence parameters for solids. Acta Cryst. B47, 192–197.
  • Brown, I. D. (2009). Recent developments in the methods and applications of the bond valence model. Chem. Rev. 109, 6858–6919.
  • Cordero, B., Gómez, V., Platero-Prats, A. E., Revés, M., Echeverría, J., Cremades, E., Barragán, F., Alvarez, S. (2008). Covalent radii revisited. Dalton Trans. (21), 2832–2838.
  • Grosse-Kunstleve, R. W., Sauter, N. K., Moriarty, N. W., Adams, P. D. (2002). The Computational Crystallography Toolbox: crystallographic algorithms in a reusable software framework. J. Appl. Cryst. 35, 126–136. (Space-group symmetry and systematic-absence rules.)
  • Shinohara, K. (2026). moyo: A fast and robust crystal symmetry finder, written in Rust. doi:10.6084/m9.figshare.31081162.v1. Powder 6 bundles @spglib/moyo-wasm 0.21.0 for atomic-model symmetry; see attribution and the MIT license.

About

Powder 6 was developed by Nita Dragoe, Université Paris-Saclay, as a browser-based implementation of powder pattern decomposition, Rietveld refinement and structure solution. It descends from PowderV2 (Dragoe, N. (2001). J. Appl. Cryst. 34, 535) and includes whole-powder-pattern fitting (WPPF; Toraya 1986, with Pawley-type intensity extraction) and modern global optimisation.

The fit solvers (skyline Cholesky for covariance and uncertainties, the banded WPPF intensity solver, non-negative least squares and the minimisers) are implemented in the program itself. Atomic-model symmetry uses the locally bundled public Moyo WebAssembly code. These calculations require no content-delivery network. Plots are drawn on canvas and the PDF report by a built-in writer. Space-group lookup data and systematic-absence rules are derived from the Computational Crystallography Toolbox (cctbx).

This document was written and checked against the code with the assistance of an AI.

Disclaimer. This application is provided for educational and research purposes. While it implements standard and robust algorithms, it is not a substitute for fully validated, peer-reviewed software packages (for example GSAS-II, FullProf or TOPAS) for analyses intended for publication.