Package lib :: Package dispersion :: Module ns_r1rho_3site
[hide private]
[frames] | no frames]

Module ns_r1rho_3site

source code

The numerical solution for the 3-site Bloch-McConnell equations for R1rho-type data, the NS R1rho 3-site linear and NS R1rho 3-site model.

Description

This is the model of the numerical solution for the 3-site Bloch-McConnell equations. It originates from the funNumrho.m file from the Skrynikov & Tollinger code (the sim_all.tar file https://web.archive.org/web/https://gna.org/support/download.php?file_id=18404 attached to https://web.archive.org/web/https://gna.org/task/?7712#comment5).

References

The solution has been modified to use the from presented in:

Links

More information on the NS R1rho 3-site linear model can be found in the:

More information on the NS R1rho 3-site model can be found in the:

Functions [hide private]
 
rr1rho_3d_3site_rankN(R1=None, r1rho_prime=None, dw_AB=None, dw_AC=None, omega=None, offset=None, w1=None, k_AB=None, k_BA=None, k_BC=None, k_CB=None, k_AC=None, k_CA=None, relax_time=None)
Definition of the 3D exchange matrix.
source code
 
ns_r1rho_3site(M0=None, M0_T=None, r1rho_prime=None, omega=None, offset=None, r1=0.0, pA=None, pB=None, dw_AB=None, dw_BC=None, kex_AB=None, kex_BC=None, kex_AC=None, spin_lock_fields=None, relax_time=None, inv_relax_time=None, back_calc=None, num_points=None)
The 3-site numerical solution to the Bloch-McConnell equation for R1rho data.
source code
Variables [hide private]
  m_R1 = array([[ 0., 0., 0., 0., 0., 0., 0., 0., 0...
  m_r1rho_prime = array([[-1., 0., 0., 0., 0., 0., 0., 0....
  m_wA = array([[ 0., -1., 0., 0., 0., 0., 0., 0., 0...
  m_wB = array([[ 0., 0., 0., 0., 0., 0., 0., 0., 0...
  m_wC = array([[ 0., 0., 0., 0., 0., 0., 0., 0., 0...
  m_w1 = array([[ 0., 0., 0., 0., 0., 0., 0., 0., 0...
  m_k_AB = array([[-1., 0., 0., 0., 0., 0., 0., 0., 0...
  m_k_BA = array([[ 0., 0., 0., 1., 0., 0., 0., 0., 0...
  m_k_BC = array([[ 0., 0., 0., 0., 0., 0., 0., 0., 0...
  m_k_CB = array([[ 0., 0., 0., 0., 0., 0., 0., 0., 0...
  m_k_AC = array([[-1., 0., 0., 0., 0., 0., 0., 0., 0...
  m_k_CA = array([[ 0., 0., 0., 0., 0., 0., 1., 0., 0...
  __package__ = 'lib.dispersion'

Imports: array, einsum, float64, isfinite, log, min, multiply, sum, fix_invalid, masked_less, matrix_exponential


Function Details [hide private]

rr1rho_3d_3site_rankN(R1=None, r1rho_prime=None, dw_AB=None, dw_AC=None, omega=None, offset=None, w1=None, k_AB=None, k_BA=None, k_BC=None, k_CB=None, k_AC=None, k_CA=None, relax_time=None)

source code 

Definition of the 3D exchange matrix.

Parameters:
  • R1 (numpy float array of rank [NE][NS][NM][NO][ND]) - The longitudinal, spin-lattice relaxation rate.
  • r1rho_prime (numpy float array of rank [NE][NS][NM][NO][ND]) - The R1rho transverse, spin-spin relaxation rate in the absence of exchange.
  • omega (numpy float array of rank [NS][NM][NO][ND]) - The chemical shift for the spin in rad/s.
  • offset (numpy float array of rank [NE][NS][NM][NO][ND]) - The spin-lock offsets for the data.
  • dw_AB (numpy float array of rank [NE][NS][NM][NO][ND]) - The chemical exchange difference between states A and B in rad/s.
  • dw_AC (numpy float array of rank [NE][NS][NM][NO][ND]) - The chemical exchange difference between states A and C in rad/s.
  • w1 (numpy float array of rank [NE][NS][NM][NO][ND]) - The spin-lock field strength in rad/s.
  • k_AB (float) - The forward exchange rate from state A to state B.
  • k_BA (float) - The reverse exchange rate from state B to state A.
  • k_BC (float) - The forward exchange rate from state B to state C.
  • k_CB (float) - The reverse exchange rate from state C to state B.
  • k_AC (float) - The forward exchange rate from state A to state C.
  • k_CA (float) - The reverse exchange rate from state C to state A.
  • relax_time (numpy float array of rank [NE][NS][NM][NO][ND]) - The total relaxation time period for each spin-lock field strength (in seconds).

ns_r1rho_3site(M0=None, M0_T=None, r1rho_prime=None, omega=None, offset=None, r1=0.0, pA=None, pB=None, dw_AB=None, dw_BC=None, kex_AB=None, kex_BC=None, kex_AC=None, spin_lock_fields=None, relax_time=None, inv_relax_time=None, back_calc=None, num_points=None)

source code 

The 3-site numerical solution to the Bloch-McConnell equation for R1rho data.

This function calculates and stores the R1rho values.

Parameters:
  • M0 (numpy float array of rank [NE][NS][NM][NO][ND][9][1]) - This is a vector that contains the initial magnetizations corresponding to the A and B state transverse magnetizations.
  • M0_T - This is a vector that contains the initial magnetizations corresponding to the A and B state transverse magnetizations, where the outer two axis has been swapped for efficient dot operations.
  • r1rho_prime (numpy float array of rank [NE][NS][NM][NO][ND][1][9]) - The R1rho_prime parameter value (R1rho with no exchange).
  • omega (numpy float array of rank [NS][NM][NO][ND]) - The chemical shift for the spin in rad/s.
  • offset (numpy float array of rank [NS][NM][NO][ND]) - The spin-lock offsets for the data.
  • r1 (numpy float array of rank [NS][NM][NO][ND]) - The R1 relaxation rate.
  • pA (float) - The population of state A.
  • pB (float) - The population of state B.
  • dw_AB (numpy float array of rank [NS][NM][NO][ND]) - The chemical exchange difference between states A and B in rad/s.
  • dw_BC (numpy float array of rank [NS][NM][NO][ND]) - The chemical exchange difference between states B and C in rad/s.
  • kex_AB (float) - The exchange rate between sites A and B for 3-site exchange with kex_AB = k_AB + k_BA (rad.s^-1)
  • kex_BC (float) - The exchange rate between sites A and C for 3-site exchange with kex_AC = k_AC + k_CA (rad.s^-1)
  • kex_AC (float) - The exchange rate between sites B and C for 3-site exchange with kex_BC = k_BC + k_CB (rad.s^-1)
  • spin_lock_fields (numpy float array of rank [NS][NM][NO][ND]) - The R1rho spin-lock field strengths (in rad.s^-1).
  • relax_time (numpy float array of rank [NS][NM][NO][ND]) - The total relaxation time period for each spin-lock field strength (in seconds).
  • inv_relax_time (numpy float array of rank [NS][NM][NO][ND]) - The inverse of the relaxation time period for each spin-lock field strength (in inverse seconds). This is used for faster calculations.
  • back_calc (numpy float array of rank [NS][NM][NO][ND]) - The array for holding the back calculated R2eff values. Each element corresponds to one of the CPMG nu1 frequencies.
  • num_points (numpy int array of rank [NS][NM][NO]) - The number of points on the dispersion curve, equal to the length of the tcp and back_calc arguments.

Variables Details [hide private]

m_R1

Value:
array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0., -1.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0., -1.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
...

m_r1rho_prime

Value:
array([[-1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0., -1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0., -1.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0., -1.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0., -1.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0., -1.,  0.],
...

m_wA

Value:
array([[ 0., -1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
...

m_wB

Value:
array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0., -1.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  1.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
...

m_wC

Value:
array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0., -1.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  1.,  0.,  0.],
...

m_w1

Value:
array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0., -1.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0., -1.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  1.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0., -1.],
...

m_k_AB

Value:
array([[-1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0., -1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0., -1.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  1.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
...

m_k_BA

Value:
array([[ 0.,  0.,  0.,  1.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  1.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  1.,  0.,  0.,  0.],
       [ 0.,  0.,  0., -1.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0., -1.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0., -1.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
...

m_k_BC

Value:
array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0., -1.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0., -1.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0., -1.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  1.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  1.,  0.,  0.,  0.,  0.],
...

m_k_CB

Value:
array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  1.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  1.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  1.],
       [ 0.,  0.,  0.,  0.,  0.,  0., -1.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0., -1.,  0.],
...

m_k_AC

Value:
array([[-1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0., -1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0., -1.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
...

m_k_CA

Value:
array([[ 0.,  0.,  0.,  0.,  0.,  0.,  1.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  1.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  1.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0., -1.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0., -1.,  0.],
...