Error in nucfrq2d (HYSCORE blindspots)

A place to report and discuss potential bugs
Post Reply
danielmartins
Newbie
Posts: 2
Joined: Tue Jul 20, 2021 3:12 pm

Error in nucfrq2d (HYSCORE blindspots)

Post by danielmartins »

Hi,

I am trying to calculate blindspots region in HYSCORE using nucfrq2d but I believe there is a typo in the code.
I am using in EasySpin 6.0.0-dev.33 (2021-06-18) and Matlab R2020b and whenever I try to run:

Code: Select all

Sys = struct('S',1/2,'g',[2 2 2],'Nucs','1H','A',[-1 -1 2]*4+2);
B0 = 350; % in mT
Larmor = larmorfrq(Sys.Nucs,B0)/1e3; % in GHz
tauvec = [1 0.5]./Larmor; % in ns
nucfrq2d(Sys,B0,tauvec) 

I get this:

Reference to non-existent field 'closePhi'.

Error in nucfrq2d

Error in untitled4 (line 5)
nucfrq2d(Sys,B0,tauvec)

So I went to GitHub, downloaded the code and changed the line:

Code: Select all

closedPhi = grid.closePhi;

to

Code: Select all

closedPhi = grid.closedPhi;

and it seems to work.

Best regards,
Daniel Martins

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

Re: Error in nucfrq2d (HYSCORE blindspots)

Post by Stefan Stoll »

This is indeed a bug, thanks for reporting! It's now fixed on GitHub and will be in the next 6.0.0-dev prerelease.

Small note regarding your code snipped: tauvec needs to be in µs, not in ns.

danielmartins
Newbie
Posts: 2
Joined: Tue Jul 20, 2021 3:12 pm

Re: Error in nucfrq2d (HYSCORE blindspots)

Post by danielmartins »

Thanks a ton, Stefan.

The piece of code I posted is from the documentation on nucfrq2d.

Best regards,
Daniel

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

Re: Error in nucfrq2d (HYSCORE blindspots)

Post by Stefan Stoll »

Thanks, we'll update the documentation as well.

Post Reply