Page 1 of 1

Rotate Principal Frame for high order crystal field terms

Posted: Fri Apr 02, 2021 7:54 am
by robstew500

Hello, I would like to change the principal frame for some higher order crystal field terms, and found this example for how to do so in the documentation:

angles = rand(1,3)*pi; % Euler tilt angles, in radians
B2 = [3 4 5 0 2]; % B(2,q) tensor components
R = wignerd(2,angles); % rotation matrix for rank-2 tensor
B2 = R * B2; % rotated tensor
Sys.B2 = B2.';

However in this example R has 2k+1 columns and B2 has only one row, is this a typo?


Re: Rotate Principal Frame for high order crystal field terms

Posted: Thu May 20, 2021 10:51 pm
by Stefan Stoll

There is a bug in this example: The second to last line should have R*B2.', with a transpose.