Question about pepper and resfields error when specifying populations in Exp.Temperature

A place to report and discuss potential bugs
Post Reply
ndamrauer
Newbie
Posts: 4
Joined: Fri Jun 18, 2021 9:37 am

Question about pepper and resfields error when specifying populations in Exp.Temperature

Post by ndamrauer »

Hi, forgive me as I am new to this. I am trying to play with powder simulations of spin polarized systems using Exp.Temperature that specifies zero-field populations. When I run code such as that shown at the bottom of this post from your example I get the following error:

Error using resfields
If given, Exp.Temperature must be a single number.

Error in pepper

Error in pepper

One thing that is strange to me: This code worked fine for a while. As well, others that I have asked can run it without issues.

Thanks! And thanks for providing these wonderful tools.
-Niels

%Sample Code

clear

T.S = 1;
T.D = [500 100]; % MHz
T.lwpp = 1;
Exp.mwFreq = 9.5;
Exp.Range = [310 370];
Exp.Harmonic = 0; % no field modulation
Exp.Temperature = [0.1 1 0.2]; % zero-field populations

pepper(T,Exp);

Stefan Stoll
EasySpin Creator
Posts: 1050
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Question about pepper and resfields error when specifying populations in Exp.Temperature

Post by Stefan Stoll »

Which version are you using? If 5.2.31: There was a problem with the zip file which has been fixed in the meantime. Redownloading should fix the issue.

ndamrauer
Newbie
Posts: 4
Joined: Fri Jun 18, 2021 9:37 am

Re: Question about pepper and resfields error when specifying populations in Exp.Temperature

Post by ndamrauer »

Yes, 5.2.31. I will try to re-download. Thanks
-Niels

ndamrauer
Newbie
Posts: 4
Joined: Fri Jun 18, 2021 9:37 am

Re: Question about pepper and resfields error when specifying populations in Exp.Temperature

Post by ndamrauer »

That worked! thank you so much.

Stefan Stoll
EasySpin Creator
Posts: 1050
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Question about pepper and resfields error when specifying populations in Exp.Temperature

Post by Stefan Stoll »

Glad it worked!

Just FYI and for future reference, in the upcoming version 6.0 the field name to specify non-equilibrium spin populations will change. You will need to use Sys.Pop instead of Exp.Temperature. Exp.Temperature is going to be used only to specify the temperature if you have a thermal-equilibrium situation.

IYou already can download a non-final development version of 6.0, indicated by 6.0.0-dev.xx.

ndamrauer
Newbie
Posts: 4
Joined: Fri Jun 18, 2021 9:37 am

Re: Question about pepper and resfields error when specifying populations in Exp.Temperature

Post by ndamrauer »

That makes sense. Thanks for the heads up.

Hey one minor thing to mention to you. I went through the example given for the recombination triplet where Popul = [0 1 0] and I feel like the spectrum produced should be multiplied by -1.

Popul = [0 1 0]; % vector of populations
Pola = [Popul(2)-Popul(1), Popul(3)-Popul(2)]; % polarizations
spc = Pola(1)spcsep(1,:) + Pola(2)spcsep(2,:); % polarized spectrum
plot(B,spc)

Stefan Stoll
EasySpin Creator
Posts: 1050
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Question about pepper and resfields error when specifying populations in Exp.Temperature

Post by Stefan Stoll »

Indeed, the spectrum is upside down - thanks for noting and reporting! The array of polarizations has the wrong sign. It should be Pola = [Popul(1)-Popul(2), Popul(2)-Popul(3)];, i.e. subtract the lower-level population from the higher-level population to get the polarization.

Here is a more complete example (for 6.0.0-dev), including energy level plots that verify this:

Code: Select all

clear, clc, clf

T.S = 1;
T.D = 500;   % MHz
T.lwpp = 1;
Exp.mwFreq = 9.5;
Exp.Range = [310 370];
Exp.Harmonic = 0;                % no field modulation
Opt.Output = 'separate';         % separate transitions!
[B,spcsep,tr] = pepper(T,Exp,Opt);

Popul = [0 1 0];                                 % vector of populations
Pola = [Popul(1)-Popul(2), Popul(2)-Popul(3)];   % polarizations
spc = Pola(1)*spcsep(1,:) + Pola(2)*spcsep(2,:); % polarized spectrum

subplot(3,1,1)
levelsplot(T,'z',Exp.Range,Exp.mwFreq);
title('B_0 || D_z');
subplot(3,1,2)
levelsplot(T,'x',Exp.Range,Exp.mwFreq);
title('B_0 || D_{xy}');

subplot(3,1,3)
plot(B,spcsep,B,spc,'k')
Post Reply