Page 1 of 1

nucspinadd error in version-6.0.0-dev.19

Posted: Wed Jan 08, 2020 5:24 am
by fhecker
Hey,

there appears to be a bug using nucspinadd in easyspin version 6.0.0-dev.19. Adding a nucleus with a nonzero quadrupole coupling to a spinsystem of S=1/2 coupled to two or more nuclei without quadrupole coupling as shown in the example:

Code: Select all

clear
Sys.S=1/2;
Sys.g = [2.0054 2.0042 2.0022];
Sys = nucspinadd(Sys,'1H',[1 1 1]);
Sys = nucspinadd(Sys,'1H',[1 1 1]); 
Sys = nucspinadd(Sys,'17O',[1 1 1],[],[1 1 1],[]); 
results in the following error message:

Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second
matrix. To perform elementwise multiplication, use '.*'.

Error in nucspinadd>@(T)T(:)./(4*I.*(2*I-1))*[-1,-1,2]


This problem does not occur in the easyspin version 5.2.27.
It also does not occur if you add the nucleus with quadrupole coupling to the spinsystem first, as shown here:

Code: Select all

clear
Sys.S=1/2;
Sys.g = [2.0054 2.0042 2.0022];
Sys = nucspinadd(Sys,'17O',[1 1 1],[],[1 1 1],[]);
Sys = nucspinadd(Sys,'1H',[1 1 1]);
Sys = nucspinadd(Sys,'1H',[1 1 1]); 
Best,
Fabian

Re: nucspinadd error in version-6.0.0-dev.19

Posted: Thu Jan 09, 2020 11:04 am
by Stefan Stoll
This is a bug - thanks for reporting. It will be fixed in 6.0.0-dev.20.