Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pepper: gStrain and gFrame #336

Open
cetait opened this issue May 3, 2024 · 3 comments
Open

pepper: gStrain and gFrame #336

cetait opened this issue May 3, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@cetait
Copy link
Collaborator

cetait commented May 3, 2024

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 stestoll self-assigned this May 3, 2024
@stestoll stestoll added the bug Something isn't working label May 3, 2024
@stestoll
Copy link
Member

stestoll commented May 3, 2024

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
Copy link
Member

stestoll commented May 7, 2024

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
Copy link
Member

stestoll commented May 7, 2024

Error message for 6.0.x added with 567a0c9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants