Author Topic: Euler angles in orientation.m  (Read 1122 times)

johncprice

  • Member
  • *
  • Posts: 2
    • View Profile
Euler angles in orientation.m
« on: September 25, 2016, 01:24:12 AM »
I have a question about Euler angles in Spinach.

I created a set of spin coordinates, rotated them using Euler angles (alpha,beta,gamma), and then created the full dipole Hamiltonian using

spin_system=assume(spin_system,'nmr');
[H,Q]=hamiltonian(spin_system,'comm');
H1=H+orientation(Q,[0,0,0]);

Now I do the same thing another way, by creating a spin system using the un-rotated coordinates and passing the Euler angles to orientation.m as follows:

spin_system=assume(spin_system,'nmr');
[H,Q]=hamiltonian(spin_system,'comm');
H2=H+orientation(Q,[gamma,-beta,alpha]);

It works! The two Hamiltonians are the same to high precision for various values of the angles.

But the call to orientation(Q,[gamma,-beta,alpha]) suggests to me that I am using the wrong Euler angle convention.  I am using the one given in Kuprov's lecture sd_m2_lecture_03.pdf which corresponds to gamma rotation about z, beta rotation about y, alpha rotation about z. Is a different one being used?

kuprov

  • Administrator
  • Member
  • *****
  • Posts: 58
    • View Profile
Re: Euler angles in orientation.m
« Reply #1 on: September 25, 2016, 09:47:38 AM »
Investigating...

The most likely answer is that the lectures are wrong -- rotations in Spinach kernel are extensively tested against a dozen different calculation types.

kuprov

  • Administrator
  • Member
  • *****
  • Posts: 58
    • View Profile
Re: Euler angles in orientation.m
« Reply #2 on: September 27, 2016, 10:42:32 AM »
OK, tracked it down to a stray rotation sign convention. The patch is below -- unzip and put into the corresponding kernel directories, overwirting the pre-existing files. Rotations are now all syncronised to Brink and Satchler - Equation 2.13 and the preceding paragraph. Note that "rotation around Y" means that Z axis is tilting towards X, hence the the different sign pattern in the middle rotation matrix in euler2dcm(). The attached test file is now passed successfully, as well as all the other tests that we typically run for release.
« Last Edit: September 27, 2016, 02:20:19 PM by kuprov »