Page 1 of 1

Unexpected behaviour of eigfields()

Posted: Wed Jan 31, 2018 1:16 am
by katarkon
I found that Opt.Threshold parameters is ignored if output of intensities is not requested. Here the script illustrating the problem.

Code: Select all

clear;
Op.Threshold=0.001;
Exp.mwFreq=9.65;
Sys.g=gfree;
Sys.A=mt2mhz([10 20]/10);
Sys.Nucs='31P,31P';
[Pos,I]=eigfields(Sys,Exp,Op);
disp(Pos');
Pos=eigfields(Sys,Exp,Op);
disp(Pos');
The second problem concerns the order of output. The swaping or the nuclei order in the spin system have no effect on the output sequence, although spin hamiltonians are different. Here the script illustrating the problem.

Code: Select all

clear;
Op.Threshold=0.001;
Exp.mwFreq=9.65;
Sys.g=gfree;
Sys.A=mt2mhz([10 20]/10);
Sys.Nucs='31P,31P';
B0=344;
B=[0 0 B0]; %in mT
H=sham(Sys,B);
disp(H);
[Pos,I]=eigfields(Sys,Exp,Op);
disp(Pos');
Sys.A=mt2mhz([20 10]/10);
H=sham(Sys,B);
disp(H);
[Pos,I]=eigfields(Sys,Exp,Op);
disp(Pos');
UPD. It seems that MATLAB function eig() sorts its output according to increment of eigenvalues.

Re: Unexpected behaviour of eigfields()

Posted: Wed Jan 31, 2018 10:38 am
by Stefan Stoll
The first is an inconsistency in the interface, we will fix it in the next bug-fix release. Thanks for noting.

The second observation is correct. eigfields is agnostic about the particular ordering of spins (and the associated Zeeman basis functions) in the spin Hamiltonian. It calculates all resonance fields and returns them sorted by increasing value. Since the eigenfields approach is so general, there is no way of defining any other order that would be generally valid.

Re: Unexpected behaviour of eigfields()

Posted: Thu Feb 01, 2018 12:36 am
by katarkon
Thanks. The similar problem was found for Opt.Threshold parameter in pepper function with hybrid method.If some nuclei are treated perturbationally, several transitions with zero intensities are kept in the output. Here the script illustrating the problem.

Code: Select all

clear
Sys.Nucs = '63Cu,14N';
Sys.S=[0.5 0.5];
Sys.g = [2.15; 2.0023];
Sys.A=mt2mhz([120 0;0 15]/10);
Sys.lwpp = [0 0.65];   
Sys.J=1000;
Exp.mwFreq = 9.65;     
Exp.Range = [300 360]; 
Opt.Method = 'hybrid';
Opt.Output='separate';
Opt.HybridCoreNuclei=[];
Opt.Threshold=0.1;
[x,y]=pepper(Sys,Exp,Opt);
stackplot(x,y,0,50);
y1=sum(cumsum(y,2),2); %estimate transition intensity
disp(y1');

Re: Unexpected behaviour of eigfields()

Posted: Thu Feb 01, 2018 1:04 am
by katarkon
I don't completely shure, but the problem of the output ordering may be solved by using of qz and ordeig instead of eig. It's a topic of special study, of course.
UPD. It seems to be working. The computing of eigenvalues by qz-ordeig sequence really keeps their ordering according to initial spin hamiltonian. But it isn't so clear how to calculate the intesities by this way because ordeig does not return eigenvectors.
UPD2. The flag 'qz' for eig function probably makes the same. So simple changing of the [U,B]=eig(A,B) on the [U,B]=eig(A,B,'qz') should leads to ordered output of eigfields function. It still have to be tested, of course.

Re: Unexpected behaviour of eigfields()

Posted: Wed Feb 07, 2018 12:17 pm
by Stefan Stoll
The issue with Opt.Threshold in eigfields is now fixed in ES 5.2.13.