StollLab / EasySpin

MATLAB toolbox for Electron Paramagnetic Resonance (EPR) spectroscopy
http://easyspin.org
MIT License
49 stars 26 forks source link

pepper: gStrain and gFrame #336

Open cetait opened 6 months ago

cetait commented 6 months ago

If g and gStrain are meant to always be collinear, I would have expected gFrame not to affect the powder spectrum for a single spin 1/2 with electron Zeeman interaction only. It does however change quite significantly. The same is true for A and AStrain, while for D and DStrain, changing DFrame does not affect the spectrum as long as it is the only anisotropic interaction provided.

clear, clc, clf

Sys.S = 1/2;
Sys.g = [2.000 2.005 2.010];
Sys.gStrain = [0.0001 0.0001 0.005];

Exp.mwFreq = 34; % GHz
Exp.Range = [1204 1217]; % mT
Exp.Harmonic = 0;

gFrame = [0 0 0; -20 90 0; -20 50 80; -90 30 0]*pi/180;

for i = 1:size(gFrame,1)
  Sys.gFrame = gFrame(i,:);
  [B,spc(:,i)] = pepper(Sys,Exp);
end

plot(B,spc)
stestoll commented 6 months ago

Problem localized: g-to-molecular frame transformation is currently done before element-wise squaring of the g strain tensor, but must be done after squaring. Working on fix.

stestoll commented 6 months ago

It turns out that this fix requires a substantial refactor of strain-related code in resfields, resfields_perturb, resfreqs_matrix and resfreqs_perturb. This is more than just a simple bug fix, so this will be put into 6.1. For 6.0.x, I am adding an error message whenever g strain or A strain are requested with non-zero Sys.gFrame or Sys.AFrame.

stestoll commented 6 months ago

Error message for 6.0.x added with 567a0c9