# Corrfun.m

Rotational correlation function, normalized to be the correlation func- tion between second rank Wigner functions. Syntax:

             [weights,rates]=corrfun(spin_system,k,m,p,q)


where the indices k,m,p,q correspond to the four indices found in the ensemble-averaged Wigner function product:

                       G=<D2(k,m)'*D2(p,q)>


the function requires spin_system.rlx.tau_c to be either a single cor- relation time (in which case the isotropic rotational diffusion model is used) or vector with two correlation times (in which case they are assumed to be correlation times for rotation around and perpendicular- ly to the main axis respectively) or vector with three correlation ti- mes (in which case those are assumed to be the correlation times for the rotation around the XX, YY and ZZ direction respectively of the rotational diffusion tensor).

The function returns the weights and decay rates of the individual ex- ponentials in the correlation function. Note that the decay rates re- turned are negative numbers.

Note: Wigner function indices are sorted in descending order, that is, [1 2 3 4 5] in the input maps onto [2 1 0 -1 -2].