## Transformation of thermal parameters

This area is a space for discussions about programming, scripting, algorithms... related to crystallography. Bash, Python, C, Fortran are welcome but also R, gnuplot and other scientific scripting languages.

### Transformation of thermal parameters

Hi All,

Have been looking at the literature but did not found a simple way to do it. How to transform themal parameters expressed as $U_{ij}$'s or $\beta_{ij}$'s which were rotated along some arbitrary axis and arbitrary angle? I mean I have a, for example, rotation matrix along some Cartesian X-axis (I know the transformation from crystallographic system of course). How one should transform thermal parameters respectively?

rkaminski
Sealed Tube

Posts: 22
Joined: 11 Apr 2009, 17:35
Location: Warsaw, Poland

### Re: Transformation of thermal parameters

Assuming your U is in the Cartesian frame and M is the rotation matrix:

U' = M*U*Mt, where Mt is the transpose of M,

Cheers,

o

oleg
Olex2 Boffin

Posts: 366
Joined: 24 Nov 2008, 21:34

### Re: Transformation of thermal parameters

It will work in any basis for a symmetry operation (the coordinate system does not change). So, you don't need to be in a cartesian coordinate system.

For a more general case (change of basis), you need the dimensionless mean-square displacement tensor and the metric tensor.
pascalp
Rotating Anode With Optics

Posts: 288
Joined: 17 Dec 2007, 16:01
Location: Oxford, UK

### Re: Transformation of thermal parameters

Imagine I would like to change the basis as my rotation matrix $\mathrm{R}$ is given in the Cartesian system. For example like:

$\mathrm{R}=\left[\begin{array}{ccc}
\cos\theta & -\sin\theta & 0\\
\sin\theta & \cos\theta & 0\\
0 & 0 & 1
\end{array}\right]$

How should I then transform $\beta$ matrix. Is it something like this below?

$\beta'=\mathrm{M}^{-1}\mathrm{R}\mathrm{M}\beta\mathrm{M}\mathrm{R}^{T}\mathrm{M}^{-1}$

where $\mathrm{M}$ transforms coordinates from fractional to Cartesian system.
rkaminski
Sealed Tube

Posts: 22
Joined: 11 Apr 2009, 17:35
Location: Warsaw, Poland

### Re: Transformation of thermal parameters

$\mathrm{R}$ is in a cartesian basis
$\beta$ is in the crystal basis
$\beta$ is dimensionless, this is important, as in:
$T = exp( -( \beta^{11}h^2 + \beta^{22}k^2 + \beta^{33}l^2 + 2\beta^{12}hk + 2\beta^{13}hl + 2\beta^{23}kl ) )$
$\cdot^{-1}$ is the inverse
$\cdot^{t}$ is the transpose
$\cdot^{-t}$ is the inverse transpose

To transform a vector of coordinates using M
$v_{\text{car}} = \mathrm{M} v_{\text{crys}}$

To transform a tensor:
$\beta_{car} = \mathrm{M} \beta_{crys} \mathrm{M}^t$

$\beta_{\text{car-rot}} =\mathrm{R} (\mathrm{M} \beta_{\text{crys}} \mathrm{M}^t) \mathrm{R}^t$

If you want go back into the crystal system:
$\beta_{\text{crys-rot}} =\mathrm{M}^{-1} (\mathrm{R} (\mathrm{M} \beta_{\text{crys}} \mathrm{M}^t) \mathrm{R}^t) \mathrm{M}^{-t}$

After simplification:
$\beta_{\text{crys-rot}} =(\mathrm{M}^{-1} \mathrm{R} \mathrm{M}) \beta_{\text{crys}} (\mathrm{M}^t \mathrm{R}^t \mathrm{M}^{-t})$
$\beta_{\text{crys-rot}} =(\mathrm{M}^{-1} \mathrm{R} \mathrm{M}) \beta_{\text{crys}} (\mathrm{M}^{-1} \mathrm{R} \mathrm{M})^t$

I thought I explained this in a publication but not this case, not when the transformation is defined in a diferent basis.
http://scripts.iucr.org/cgi-bin/paper?S0108767311018216

I forgot to mention that this is valid for beta but not for U as in the cif file. There are couple of steps more.
pascalp
Rotating Anode With Optics

Posts: 288
Joined: 17 Dec 2007, 16:01
Location: Oxford, UK

### Re: Transformation of thermal parameters

one more thing, you may have noticed:

the transformed beta tensor is
$\beta_{car} = \mathrm{M} \beta_{crys} \mathrm{M}^t$

and the new rotation matrix:
$\mathrm{M'} \mathrm{R} \mathrm{M'}^{-1}$

Formula are differents because beta is a doubly contravariant second rank tensor and R a mixed second rank tensor.
pascalp
Rotating Anode With Optics

Posts: 288
Joined: 17 Dec 2007, 16:01
Location: Oxford, UK

### Re: Transformation of thermal parameters

To the answer below, problem solved:) It was a stupid error in the Excel worksheet. Above transformations work perfectly.

*********

Thank you. This is basically the result I have obtained a bit later. However, after putting everything in Excel I get ADPs that after visualization the ellipsoids differ a bit in their shape. I always thought that such transformation should retain the principal axes magnitudes. How sensitive are those operations for numerical errors? Or maybe being much too tired I miss some stupid error...
rkaminski
Sealed Tube

Posts: 22
Joined: 11 Apr 2009, 17:35
Location: Warsaw, Poland

### Re: Transformation of thermal parameters

It is the case, the eigenvalues and eigen vectors remains the same. But the formula is different in the crystal basis. You need to use the general formula:
http://en.wikipedia.org/wiki/Generalize ... ue_problem
A is your tensor, B is the metric tensor.

In python you need to use scipy.linalg.eig and not numpy.linalg.eig I don't think excel can do that.

If the matrices are ill conditioned you can have some problems but it should not be the case.

I can have a look at your xls sheet if your want.
pascalp
Rotating Anode With Optics

Posts: 288
Joined: 17 Dec 2007, 16:01
Location: Oxford, UK