Page 1 of 1

Hybrid method in pepper for two electrons

Posted: Fri Oct 13, 2017 11:07 pm
by katarkon
If matrix method used, the pepper works fine but slow. But with hybrid methods some bugs occur although it still possible to make it working. If Sys.J is used, the pepperthrows an error.

Code: Select all

Error using resfields (line 317)
Both Sys.ee and (Sys.J,Sys.dvec,Sys.eeD) are given - use only one or the other!
Error in E:\easyspin-5.2.2\easyspin\pepper.p>pepper (line 636)
Error in E:\easyspin-5.2.2\easyspin\pepper.p>pepper (line 153)
It looks that pepper calculates ee matrix from J one but does not remove Sys.J field before calling resfieldsfunction. Here the script illustrating the problem.

Code: Select all

    clear
    Sys.S = [0.5,0.5];
    Sys.g = [2.00986,2.009967];
    Sys.J = 200;
    %Sys.ee=[200 200 200];
    Sys.Nucs = ['14N,1H'];
    Sys.A = [3.5,0;0,18];
    Sys.lwpp = [0 0.05];
    
    Exp.mwFreq = 9.452387;
    Exp.Range = [335 337];
    Exp.nPoints = 4096;
    Exp.CrystalOrientation = [0 0 0];

    Opt.Method = 'hybrid';
    Opt.Verbosity=2;
    Opt.Sparse=1;

    pepper(Sys,Exp,Opt);
If Sys.ee matrix used instead Sys.J the pepperworks fine. But if number of nuclei more then two, another error is occur.

Code: Select all

Operands to the || and && operators must be convertible to logical scalar values.
Error in E:\easyspin-5.2.2\easyspin\private\validatespinsys.p>validatespinsys (line 649)
Error in E:\easyspin-5.2.2\easyspin\resfields.p>resfields (line 316)
Error in E:\easyspin-5.2.2\easyspin\pepper.p>pepper (line 636)
Error in E:\easyspin-5.2.2\easyspin\pepper.p>pepper (line 153)
Here the script illustrating the problem.

Code: Select all

    clear
    Sys.S = [0.5,0.5];
    Sys.g = [2.00986,2.009967];
    %Sys.J = 200;
    Sys.ee=[200 200 200];
    Sys.Nucs = ['14N,1H,1H'];
    Sys.A = [3.5,0,6;0,18,0];
    Sys.lwpp = [0 0.05];
    
    Exp.mwFreq = 9.452387;
    Exp.Range = [335 337];
    Exp.nPoints = 4096;
    Exp.CrystalOrientation = [0 0 0];

    Opt.Method = 'hybrid';
    Opt.Verbosity=2;
    Opt.HybridCoreNuclei = [];

    pepper(Sys,Exp,Opt);
If add all of nuclei to Opt.HybridCoreNuclei, there are no errors. If some of the nuclei added, another error occur.

Code: Select all

Error using resfields (line 317)
Full matrices are specified in Sys.nn, so nnFrame is not allowed.
Error in E:\easyspin-5.2.2\easyspin\pepper.p>pepper (line 636)
Error in E:\easyspin-5.2.2\easyspin\pepper.p>pepper (line 153)
It looks that pepper builds wrong spin system for core nuclei.

Re: Hybrid method in pepper for two electrons

Posted: Sun Oct 15, 2017 10:19 pm
by Stefan Stoll
Thanks for reporting. These bugs are fixed in 5.2.7.

Re: Hybrid method in pepper for two electrons

Posted: Sun Oct 15, 2017 11:12 pm
by katarkon
Thanks. Is there any way to grant the access to source code of EasySpin for me? Sometimes it is much faster to find a bug by myself than try to reproduce it.