ZnCu₃(OD)₆Cl₂ on HRPT¶
Fit herbertsmithite, ZnCu₃(OD)₆Cl₂, a deuterated kagome antiferromagnet, to constant-wavelength neutron powder data from HRPT at PSI, with a pseudo-Voigt profile and Bérar-Baldinozzi asymmetry.
The project is the catalogue case pd-neut-cwl_hs-hrpt, the one the command line and the app's
Examples open.
Fitting
Single pd neut cwl Bragg
Crystal structure
import easydiffraction as edi
Load the project¶
project_path = edi.download_data('pd-neut-cwl_hs-hrpt', destination='data')
project = edi.Project.load(project_path)
structure = project.structures['hs']
experiment = project.experiments['hrpt']
Data 'pd-neut-cwl_hs-hrpt' is at data/pd-neut-cwl_hs-hrpt-dc870810b0b3/pd-neut-cwl_hs-hrpt
The project marks what its fit frees. The fit below frees it in stages, so start with all of it fixed.
for parameter in project.free_parameters:
parameter.free = False
project.display.pattern('hrpt')
Perform the analysis¶
The fit follows diffraction-lib's four cycles for this case.
Cell, scale and 2θ zero¶
The cell lengths, the scale and the zero shift put the peaks in place and at the right height.
structure.cell.length_a.free = True
structure.cell.length_c.free = True
experiment.linked_structures['hs'].scale.free = True
experiment.instrument.calib_twotheta_offset.free = True
project.display.parameters.free()
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-cwl_hs-hrpt, 3220 pts fitted / 3220 loaded, 4 free
iter time (s) Rwp (%) reduced χ² change
39.94 121.13
1 0.002 27.45 57.20 52.8% ↓
2 0.004 26.38 52.82 7.6% ↓
3 0.005 25.56 49.61 6.1% ↓
4 0.008 25.02 47.54 4.2% ↓
5 0.009 24.70 46.30 2.6% ↓
6 0.011 24.51 45.59 1.5% ↓
7 0.013 24.40 45.19 0.9% ↓
8 0.015 24.34 44.97 0.5% ↓
9 0.017 24.30 44.84 0.3% ↓
10 0.018 24.28 44.77 0.2% ↓
11 0.020 24.27 44.73 0.1% ↓
12 0.022 24.27 44.71
13 0.024 24.26 44.70
14 0.025 24.26 44.69
15 0.027 24.26 44.69
16 0.029 24.26 44.69
17 0.031 24.26 44.68
18 0.033 24.26 44.68
19 0.035 24.26 44.68
done · converged · 19 iters · reduced χ² 44.68 · Rwp 24.26 % · 0.04 s
project.display.pattern('hrpt')
Background¶
The estimated points are a starting point; fit them now that the peaks are in place.
for point in experiment.background:
point.intensity.free = True
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-cwl_hs-hrpt, 3220 pts fitted / 3220 loaded, 14 free
iter time (s) Rwp (%) reduced χ² change
24.26 44.82
1 0.003 21.75 36.02 19.6% ↓
2 0.005 21.75 36.02
3 0.007 21.75 36.02
4 0.011 21.75 36.02
done · converged · 4 iters · reduced χ² 36.02 · Rwp 21.75 % · 0.01 s
project.display.pattern('hrpt')
Peak widths¶
The Gaussian widths and the mixing η₀, with the background staying free. diffraction-lib frees the Lorentzian Y where this profile has η₀.
experiment.peak.broad_gauss_u.free = True
experiment.peak.broad_gauss_v.free = True
experiment.peak.broad_gauss_w.free = True
experiment.peak.mixing_eta_0.free = True
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-cwl_hs-hrpt, 3220 pts fitted / 3220 loaded, 18 free
iter time (s) Rwp (%) reduced χ² change
21.75 36.07
1 0.003 16.60 21.01 41.8% ↓
2 0.006 14.23 15.45 26.5% ↓
3 0.008 13.53 13.96 9.6% ↓
4 0.011 13.45 13.79 1.2% ↓
5 0.014 13.44 13.77 0.1% ↓
6 0.017 13.44 13.77
7 0.020 13.44 13.77
8 0.023 13.44 13.77
9 0.027 13.44 13.77
done · converged · 9 iters · reduced χ² 13.77 · Rwp 13.44 % · 0.03 s
project.display.pattern('hrpt')
Atom positions¶
The coordinates the symmetry leaves free: O and H in x and z, Cl in z.
for site in structure.atom_sites:
for coordinate in (site.fract_x, site.fract_y, site.fract_z):
coordinate.free = not coordinate.symmetry_constrained
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-cwl_hs-hrpt, 3220 pts fitted / 3220 loaded, 23 free
iter time (s) Rwp (%) reduced χ² change
13.44 13.79
1 0.007 8.42 5.41 60.7% ↓
2 0.012 8.21 5.15 4.8% ↓
3 0.017 8.21 5.15 0.1% ↓
4 0.021 8.21 5.15
5 0.029 8.21 5.15
done · converged · 5 iters · reduced χ² 5.15 · Rwp 8.21 % · 0.03 s
project.display.pattern('hrpt')
Displacements¶
Every site's displacement.
for site in structure.atom_sites:
site.adp_iso.free = True
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-cwl_hs-hrpt, 3220 pts fitted / 3220 loaded, 28 free
iter time (s) Rwp (%) reduced χ² change
8.21 5.16
1 0.006 5.71 2.50 51.5% ↓
2 0.010 5.45 2.27 9.1% ↓
3 0.014 5.45 2.27
4 0.020 5.45 2.27
done · converged · 4 iters · reduced χ² 2.27 · Rwp 5.45 % · 0.02 s
project.display.pattern('hrpt')
Asymmetry¶
Last, the four Bérar-Baldinozzi asymmetry terms.
experiment.peak.asym_beba_a0.free = True
experiment.peak.asym_beba_b0.free = True
experiment.peak.asym_beba_a1.free = True
experiment.peak.asym_beba_b1.free = True
project.analysis.fit()
project.display.fit.results()
edi fit: project pd-neut-cwl_hs-hrpt, 3220 pts fitted / 3220 loaded, 32 free
iter time (s) Rwp (%) reduced χ² change
5.45 2.27
1 0.006 5.31 2.16 4.9% ↓
2 0.011 5.30 2.15 0.4% ↓
3 0.015 5.30 2.15
4 0.020 5.30 2.15
5 0.026 5.30 2.15
done · converged · 5 iters · reduced χ² 2.15 · Rwp 5.30 % · 0.03 s
project.display.pattern('hrpt')
project.display.fit.correlations()
project.display.structure('hs')
Save the project¶
project.save_as('pd-neut-cwl_hs-hrpt')
project.report.save_html('pd-neut-cwl_hs-hrpt.html')
Saving project to 'pd-neut-cwl_hs-hrpt'
Saving report to 'pd-neut-cwl_hs-hrpt.html'