Page 2 of 2

Re: Amp in resfield

Posted: Wed Oct 21, 2020 12:21 pm
by thanasis

Yet another follow-up on this thread: eigfields documentation says Int is given in (MHz2/mT2).

Are the same units used in resfields for Amp?

Thanks!


Re: Amp in resfield

Posted: Thu Oct 22, 2020 4:42 pm
by Stefan Stoll

Yes. Both functions calculate the same quantity.


Re: Amp in resfield

Posted: Wed Dec 08, 2021 9:58 am
by phys98

I am trying to calculate the transition probability for a spin-5/2 system using the following code:

Code: Select all


clear, clc

Sys = struct('S',5/2,'g',2, 'D', -256*[0 0 0; 0 0 0; 0 0 1]);
Exp.Range = [0 1500];
Exp.Temperature = 4.2; 
Exp.mwFreq = 9.708;
[B,TransRate0] = resfields(Sys,Exp);

for k = 1:length(B)
    H = sham(Sys,[0 0 1]*B(k));
    [V,E] = eig(H);

for i = 1:6
    for j = i+1:6
        u = V(:,i);
        v = V(:,j);
        [S_x,S_y,S_z] = sop(Sys.S,'x','y','z');
        c = bmagn*2/planck/1e9;
        
        pop_diff = (-1/exp(abs(E(i, i))*1e6*planck/boltzm/Exp.Temperature) + 1/exp(abs(E(j, j))*1e6*planck/boltzm/Exp.Temperature)); 

        TransRate(i, j) = c^2 * pop_diff * (abs(u'*S_x*v)^2 + abs(u'*S_y*v)^2)/2/Sys.g; 
    end
end
TransRate1(k) = sum(TransRate, 'all');
end

When I compare TransRate0 (the estimate given by resfields) and TransRate1 (my estimate), they do not coincide. Can you see where I got wrong?

Thanks!


Re: Amp in resfield

Posted: Fri Jan 14, 2022 12:05 pm
by Stefan Stoll

It looks like your population difference is not correct.

Try something like:

Code: Select all

pop = exp(-diag(E)*1e6*planck/boltzm/Exp.Temperature);
pop = pop/sum(pop);
pop_diff = pop - pop.';