Page 1 of 1

Breit-Rabi solver as separate function

Posted: Tue Jan 16, 2018 3:38 am
by katarkon
Is it possible to extract Breit-Rabi solver from garlic and write separate functions like resfields/resfreqs? It seems not to be extremely hard.

Re: Breit-Rabi solver as separate function

Posted: Tue Jan 16, 2018 8:56 am
by Stefan Stoll
That's in principle possible, but it is not sure how much that functionality is needed.

Here is a short script for the Breit-Rabi fixed-point solver:

Code: Select all

clear

giso = 2;
Nuc = '1H';
aiso = 1000; % MHz
mwFreq = 9.6; % MHz

Opt.MaxIterations = 15;
Opt.Accuracy = 1e-12;

gn = nucgval(Nuc);
I = nucspin(Nuc);

mI = -I:I;
B = 0;

mwFreq = mwFreq*1e9; % MHz -> Hz
aiso = aiso*1e6*planck; % MHz -> J
gammae = giso*bmagn;
gamman = 0; % to obtain start field, neglect NZI
relChangeB = inf;
for iter = 1:Opt.MaxIterations
  nu = mwFreq + gamman/planck*B;
  q = 1 - (aiso./(2*planck*nu)).^2;
  Bnew = aiso./(gammae+gamman)./q.* ...
    (-mI+sign(aiso)*sqrt(mI.^2+q.*((planck*nu/aiso).^2 - (I+1/2)^2)));
  if ~isreal(Bnew)
    error('Hyperfine coupling too large compared to microwave frequency.');
  end
  if (B~=0), relChangeB = 1 - Bnew./B; end
  B = Bnew;
  gamman = gn*nmagn; % re-include NZI
  if abs(relChangeB)<Opt.Accuracy, break; end
end
B

Re: Breit-Rabi solver as separate function

Posted: Wed Jan 17, 2018 5:00 am
by katarkon
Thanks a lot. It isn't completely clear how to treat several nuclei however. I suggest that resonances for first nucleus should be converted into frequency and each one should be used as mwFreq for second nucleus. Is it right way?

Re: Breit-Rabi solver as separate function

Posted: Wed Jan 17, 2018 11:40 am
by Stefan Stoll
There is no exact solution for this except diagonalizing the full Hamiltonian. garlic neglects the nuclear-nuclear cross terms. With that assumption, the shifts from different nuclei are additive.

Re: Breit-Rabi solver as separate function

Posted: Thu Jan 18, 2018 1:51 am
by katarkon
Thanks. I suggest that proposed solution should be working at least for systems with only one large HFC constant (like metalloradicals). I would like to adapt exchange function for systems like copper(II) or rhodium(II) complexes with relatively large hyperfine splitting (over 100G). Default first-order solver should be absolutely inappropriate, although it may be used for nuclei with I=1/2 with some tricks. Nuclei with I>1/2 (like Cu or As) cannot be treated absolutely. The function resfields_perturb in second-order treatment gives better results but I have certain doubts about its applicability for such large HFC constants. Unfortunately, resfields returns resonances in unpredictable order (viewtopic.php?f=4&t=411) although it should be the best choice of course.
And one more question, how garlic treats equivalent nuclei? I think it uses equivcouple representation with followed accumulation of the spectra, is it so?

Re: Breit-Rabi solver as separate function

Posted: Thu Jan 18, 2018 8:22 am
by Stefan Stoll
Correct, garlic uses equivcouple to deal with equivalent spins.