# Spin Dynamics Forum

## Spinach support => Simulations => Topic started by: faq_user on November 15, 2013, 05:54:16 PM

Title: relaxation time calculation using Spinach
Post by: faq_user on November 15, 2013, 05:54:16 PM
Dear Prof. Kuprov,
I want to extract T1 and T2 relaxation time in a ESR calculation. Is it possible with Spinach code?
Title: Re: relaxation time calculation using Spinach
Post by: kuprov on November 15, 2013, 05:55:04 PM
Yes – see the ESR relaxation calculations in the example set. You would need to generate the relaxation superoperator and then extract <Lz|R|Lz> matrix element for 1/T1 and <L+|R|L+> matrix element for 1/T2.
Title: Re: relaxation time calculation using Spinach
Post by: ScottR on April 11, 2014, 06:33:51 PM
I am trying to do something similar with liquid nmr simulations. I can set up a spin system and create the relaxation matrix with something like:

bas.formalism='sphten-liouv';
bas.approximation='none';
inter.relaxation='redfield';
inter.rlx_keep='secular';
inter.tau_c=5e-9;
spin_system=create(sys,inter);
spin_system=basis(spin_system,bas);
R=relaxation(spin_system);

Is this sufficient to determine an estimate of R1 and R2 rates for each spin in the system? I've looked but can not find an example of how I could extract the rates from the matrix. Can you provide an example? Or is there a nice example that returns the R2 and/or R1 rate that I have overlooked in the examples?

Thanks
Title: Re: relaxation time calculation using Spinach
Post by: kuprov on April 21, 2014, 02:49:57 PM
Dear Scott,

yes, you would get the full relaxation matrix. To extract a specific relaxation rate:

1. Generate the state in question (see state.m).
2. Normalize the state (rho=rho/norm(rho,2))
3. Compute rho'*R*rho

Best wishes,
Ilya.