Skip to content

Taurine on SENJU

Fit the amino-sulfonic acid taurine to six time-of-flight neutron single-crystal datasets from SENJU at J-PARC together, each reflection measured at its own wavelength.

The project is the catalogue case sc-neut-tof_taurine-senju, the one the command line and the app's Examples open. Banks 2 to 6 share bank 1's three extinction terms, from the start.

Fitting Joint sc neut tof Bragg Crystal structure

import easydiffraction as edi

Load the project

project_path = edi.download_data('sc-neut-tof_taurine-senju', destination='data')
project = edi.Project.load(project_path)
structure = project.structures['taurine']
senju_1 = project.experiments['senju_1']
senju_2 = project.experiments['senju_2']
senju_3 = project.experiments['senju_3']
senju_4 = project.experiments['senju_4']
senju_5 = project.experiments['senju_5']
senju_6 = project.experiments['senju_6']
project.display.constraints()
Data 'sc-neut-tof_taurine-senju' is at data/sc-neut-tof_taurine-senju-b5deb357e7e8/sc-neut-tof_taurine-senju

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('senju_1')

Perform the analysis

The fit follows diffraction-lib's change of model for this case: isotropic displacements first, then anisotropic tensors. diffraction-lib does not fit the positions, which this case does, so they get a stage of their own.

Scales, every site isotropic

Each bank's scale, with every site's displacement isotropic for now.

for site in structure.atom_sites:
    site.adp_type = 'Biso'
for experiment in project.experiments:
    experiment.linked_structures['taurine'].scale.free = True
project.display.parameters.free()
project.analysis.fit()
project.display.fit.results()
edi fit: joint project sc-neut-tof_taurine-senju, 6 banks (senju_1, senju_2, senju_3, senju_4, senju_5, senju_6), 947 pts fitted / 1540 loaded, 6 free
   iter   time (s) wR(F²) (%)  reduced χ²   change
                       179.47      5665.97
      1      0.003      51.73       470.74   91.7% ↓
      2      0.006      51.73       470.73   
  done · converged · 2 iters · reduced χ² 470.73 · wR(F²) 51.73 % · 0.01 s
project.display.pattern('senju_1')

Isotropic displacements

Every site's isotropic displacement.

for site in structure.atom_sites:
    site.adp_iso.free = True
project.analysis.fit()
project.display.fit.results()
edi fit: joint project sc-neut-tof_taurine-senju, 6 banks (senju_1, senju_2, senju_3, senju_4, senju_5, senju_6), 947 pts fitted / 1540 loaded, 20 free
   iter   time (s) wR(F²) (%)  reduced χ²   change
                        51.73       477.84
      1      0.005      31.17       173.48   63.7% ↓
      2      0.010      27.18       131.89   24.0% ↓
      3      0.014      26.94       129.62   1.7% ↓
      4      0.018      26.94       129.57   
      5      0.021      26.94       129.56   
      6      0.027      26.94       129.56   
  done · converged · 6 iters · reduced χ² 129.56 · wR(F²) 26.94 % · 0.03 s
project.display.pattern('senju_1')

Extinction

Bank 1's three extinction terms, which the other banks share.

senju_1.extinction.coefficient_11.free = True
senju_1.extinction.coefficient_22.free = True
senju_1.extinction.coefficient_33.free = True
project.analysis.fit()
project.display.fit.results()
edi fit: joint project sc-neut-tof_taurine-senju, 6 banks (senju_1, senju_2, senju_3, senju_4, senju_5, senju_6), 947 pts fitted / 1540 loaded, 23 free
   iter   time (s) wR(F²) (%)  reduced χ²   change
                        26.94       129.98
      1      0.003      22.14        87.84   32.4% ↓
      2      0.008      20.47        75.09   14.5% ↓
      3      0.012      20.27        73.57   2.0% ↓
      4      0.016      20.26        73.55   
      5      0.021      20.26        73.55   
  done · converged · 5 iters · reduced χ² 73.55 · wR(F²) 20.26 % · 0.03 s
project.display.pattern('senju_1')

Positions

All fourteen sites' coordinates.

for site in structure.atom_sites:
    site.fract_x.free = True
    site.fract_y.free = True
    site.fract_z.free = True
project.analysis.fit()
project.display.fit.results()
edi fit: joint project sc-neut-tof_taurine-senju, 6 banks (senju_1, senju_2, senju_3, senju_4, senju_5, senju_6), 947 pts fitted / 1540 loaded, 65 free
   iter   time (s) wR(F²) (%)  reduced χ²   change
                        20.26        77.05
      1      0.006      17.17        55.36   28.2% ↓
      2      0.013      17.04        54.51   1.5% ↓
      3      0.019      17.04        54.49   
      4      0.025      17.04        54.49   
  done · converged · 4 iters · reduced χ² 54.49 · wR(F²) 17.04 % · 0.04 s
project.display.pattern('senju_1')

Anisotropic displacements

Back to anisotropic displacements (edi converts the values), with every tensor component free.

for site in structure.atom_sites:
    site.adp_type = 'beta'
for tensor in structure.atom_site_aniso:
    tensor.adp_11.free = True
    tensor.adp_22.free = True
    tensor.adp_33.free = True
    tensor.adp_12.free = True
    tensor.adp_13.free = True
    tensor.adp_23.free = True
/tmp/ipykernel_4219/4011545669.py:4: UserWarning: crysta.domain.dependent_free_ignored: parameter 'taurine.atom_site.S1.adp_iso' is constrained by 'the equivalent isotropic value of its beta tensor'; free = True is ignored and it stays dependent (cannot be fitted: set by a constraint)
  tensor.adp_11.free = True
/tmp/ipykernel_4219/4011545669.py:4: UserWarning: crysta.domain.dependent_free_ignored: parameter 'taurine.atom_site.O1.adp_iso' is constrained by 'the equivalent isotropic value of its beta tensor'; free = True is ignored and it stays dependent (cannot be fitted: set by a constraint)
  tensor.adp_11.free = True
/tmp/ipykernel_4219/4011545669.py:4: UserWarning: crysta.domain.dependent_free_ignored: parameter 'taurine.atom_site.O2.adp_iso' is constrained by 'the equivalent isotropic value of its beta tensor'; free = True is ignored and it stays dependent (cannot be fitted: set by a constraint)
  tensor.adp_11.free = True
/tmp/ipykernel_4219/4011545669.py:4: UserWarning: crysta.domain.dependent_free_ignored: parameter 'taurine.atom_site.O3.adp_iso' is constrained by 'the equivalent isotropic value of its beta tensor'; free = True is ignored and it stays dependent (cannot be fitted: set by a constraint)
  tensor.adp_11.free = True
/tmp/ipykernel_4219/4011545669.py:4: UserWarning: crysta.domain.dependent_free_ignored: parameter 'taurine.atom_site.N1.adp_iso' is constrained by 'the equivalent isotropic value of its beta tensor'; free = True is ignored and it stays dependent (cannot be fitted: set by a constraint)
  tensor.adp_11.free = True
/tmp/ipykernel_4219/4011545669.py:4: UserWarning: crysta.domain.dependent_free_ignored: parameter 'taurine.atom_site.H1.adp_iso' is constrained by 'the equivalent isotropic value of its beta tensor'; free = True is ignored and it stays dependent (cannot be fitted: set by a constraint)
  tensor.adp_11.free = True
/tmp/ipykernel_4219/4011545669.py:4: UserWarning: crysta.domain.dependent_free_ignored: parameter 'taurine.atom_site.H2.adp_iso' is constrained by 'the equivalent isotropic value of its beta tensor'; free = True is ignored and it stays dependent (cannot be fitted: set by a constraint)
  tensor.adp_11.free = True
/tmp/ipykernel_4219/4011545669.py:4: UserWarning: crysta.domain.dependent_free_ignored: parameter 'taurine.atom_site.H3.adp_iso' is constrained by 'the equivalent isotropic value of its beta tensor'; free = True is ignored and it stays dependent (cannot be fitted: set by a constraint)
  tensor.adp_11.free = True
/tmp/ipykernel_4219/4011545669.py:4: UserWarning: crysta.domain.dependent_free_ignored: parameter 'taurine.atom_site.C1.adp_iso' is constrained by 'the equivalent isotropic value of its beta tensor'; free = True is ignored and it stays dependent (cannot be fitted: set by a constraint)
  tensor.adp_11.free = True
/tmp/ipykernel_4219/4011545669.py:4: UserWarning: crysta.domain.dependent_free_ignored: parameter 'taurine.atom_site.H11.adp_iso' is constrained by 'the equivalent isotropic value of its beta tensor'; free = True is ignored and it stays dependent (cannot be fitted: set by a constraint)
  tensor.adp_11.free = True
/tmp/ipykernel_4219/4011545669.py:4: UserWarning: crysta.domain.dependent_free_ignored: parameter 'taurine.atom_site.H12.adp_iso' is constrained by 'the equivalent isotropic value of its beta tensor'; free = True is ignored and it stays dependent (cannot be fitted: set by a constraint)
  tensor.adp_11.free = True
/tmp/ipykernel_4219/4011545669.py:4: UserWarning: crysta.domain.dependent_free_ignored: parameter 'taurine.atom_site.C2.adp_iso' is constrained by 'the equivalent isotropic value of its beta tensor'; free = True is ignored and it stays dependent (cannot be fitted: set by a constraint)
  tensor.adp_11.free = True
/tmp/ipykernel_4219/4011545669.py:4: UserWarning: crysta.domain.dependent_free_ignored: parameter 'taurine.atom_site.H21.adp_iso' is constrained by 'the equivalent isotropic value of its beta tensor'; free = True is ignored and it stays dependent (cannot be fitted: set by a constraint)
  tensor.adp_11.free = True
/tmp/ipykernel_4219/4011545669.py:4: UserWarning: crysta.domain.dependent_free_ignored: parameter 'taurine.atom_site.H22.adp_iso' is constrained by 'the equivalent isotropic value of its beta tensor'; free = True is ignored and it stays dependent (cannot be fitted: set by a constraint)
  tensor.adp_11.free = True
project.analysis.fit()
project.display.fit.results()
edi fit: joint project sc-neut-tof_taurine-senju, 6 banks (senju_1, senju_2, senju_3, senju_4, senju_5, senju_6), 947 pts fitted / 1540 loaded, 135 free
   iter   time (s) wR(F²) (%)  reduced χ²   change
                        17.04        59.19
      1      0.015      13.02        34.56   41.6% ↓
      2      0.031      12.20        30.32   12.3% ↓
      3      0.046      12.19        30.27   0.2% ↓
      4      0.068      12.19        30.27   
  done · converged · 4 iters · reduced χ² 30.27 · wR(F²) 12.19 % · 0.13 s
project.display.pattern('senju_1')
project.display.fit.correlations()
project.display.structure('taurine')

Save the project

project.save_as('sc-neut-tof_taurine-senju')
project.report.save_html('sc-neut-tof_taurine-senju.html')
Saving project to 'sc-neut-tof_taurine-senju'
Saving report to 'sc-neut-tof_taurine-senju.html'