Author: tlinnet Date: Fri Jun 20 15:48:33 2014 New Revision: 24206 URL: http://svn.gna.org/viewcvs/relax?rev=24206&view=rev Log: Code cleanup and copyright adding to lib/dispersion/ns_matrices.py. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/lib/dispersion/ns_matrices.py Modified: branches/disp_spin_speed/lib/dispersion/ns_matrices.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_matrices.py?rev=24206&r1=24205&r2=24206&view=diff ============================================================================== --- branches/disp_spin_speed/lib/dispersion/ns_matrices.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_matrices.py Fri Jun 20 15:48:33 2014 @@ -5,6 +5,7 @@ # Copyright (C) 2013 Mathilde Lescanne # # Copyright (C) 2013 Dominique Marion # # Copyright (C) 2013 Edward d'Auvergne # +# Copyright (C) 2014 Troels E. Linnet # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # @@ -211,7 +212,7 @@ [1.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.0]]) m_pA = array([ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], @@ -220,7 +221,7 @@ [2.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.0, 0.0, 0.0, 0.0]]) m_r10b = array([ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], @@ -229,7 +230,7 @@ [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, 0.0, 0.0, -1.0], ]) + [1.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0]]) m_pB = array([ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], @@ -238,7 +239,7 @@ [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], - [2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ]) + [2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]]) m_r20a = array([ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], @@ -247,7 +248,7 @@ [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, 0.0, 0.0, 0.0, 0.0]]) m_r20b = array([ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], @@ -256,7 +257,7 @@ [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, -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]]) m_k_AB = array([ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], @@ -265,7 +266,7 @@ [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, 1.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, 1.0, 0.0, 0.0, 0.0]]) m_k_BA = array([ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], @@ -274,7 +275,7 @@ [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, -1.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, -1.0]]) m_wA = array([ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], @@ -283,7 +284,7 @@ [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, 0.0, 0.0, 0.0, 0.0]]) m_wB = array([ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], @@ -292,7 +293,7 @@ [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, 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]]) # Multiply and expand. m_r10a_tcp = multiply.outer( r10a_tcp, m_r10a ) @@ -358,11 +359,11 @@ m_r20a = array([ [-1.0, 0.0], - [0.0, 0.0],], complex64) + [0.0, 0.0]]) m_r20b = array([ [0.0, 0.0], - [0.0, -1.0],], complex64) + [0.0, -1.0]]) # Multiply and expand. m_r20a_tcp = multiply.outer( r20a_tcp, m_r20a ) @@ -380,11 +381,11 @@ m_k_AB = array([ [-1.0, 0.0], - [1.0, 0.0],], complex64) + [1.0, 0.0]]) m_k_BA = array([ [0.0, 1.0], - [0.0, -1.0],], complex64) + [0.0, -1.0]]) # Multiply and expand. m_k_AB_tcp = multiply.outer( k_AB_tcp, m_k_AB ) @@ -399,7 +400,7 @@ m_dw = array([ [0.0, 0.0], - [0.0, 1.0],], complex64) + [0.0, 1.0]]) # Multiply and expand. m_dw_tcp_C = multiply.outer( dw_tcp_C, m_dw ) @@ -477,23 +478,23 @@ m_r20a = array([ [-1.0, 0.0], - [0.0, 0.0],]) + [0.0, 0.0]]) m_r20b = array([ [0.0, 0.0], - [0.0, -1.0],]) + [0.0, -1.0]]) m_k_AB = array([ [-1.0, 0.0], - [1.0, 0.0],]) + [1.0, 0.0]]) m_k_BA = array([ [0.0, 1.0], - [0.0, -1.0],]) + [0.0, -1.0]]) m_dw = array([ [0.0, 0.0], - [0.0, 1.0],]) + [0.0, 1.0]]) # Multiply and expand. m_r20a_tcp = multiply.outer( r20a_tcp, m_r20a ) @@ -707,9 +708,9 @@ # Offset of spin-lock from population-average. d = W - offset + # Alias to original parameter name. wA=dA wB=dB - m_r1rho_prime = array([ [-1.0, 0.0, 0.0, 0.0, 0.0, 0.0], @@ -717,7 +718,7 @@ [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, -1.0, 0.0], - [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ], float64) + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]]) m_wA = array([ [0.0, -1.0, 0.0, 0.0, 0.0, 0.0], @@ -725,7 +726,7 @@ [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], ], float64) + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]]) m_wB = array([ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], @@ -733,7 +734,7 @@ [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, 0.0, 0.0, 0.0, 0.0], ], float64) + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]]) m_w1 = array([ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], @@ -741,7 +742,7 @@ [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, -1.0], - [0.0, 0.0, 0.0, 0.0, 1.0, 0.0], ], float64) + [0.0, 0.0, 0.0, 0.0, 1.0, 0.0]]) m_k_AB = array([ [-1.0, 0.0, 0.0, 0.0, 0.0, 0.0], @@ -749,7 +750,7 @@ [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, 1.0, 0.0, 0.0, 0.0, 0.0], - [0.0, 0.0, 1.0, 0.0, 0.0, 0.0], ], float64) + [0.0, 0.0, 1.0, 0.0, 0.0, 0.0]]) m_k_BA = array([ [0.0, 0.0, 0.0, 1.0, 0.0, 0.0], @@ -757,7 +758,7 @@ [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, -1.0, 0.0], - [0.0, 0.0, 0.0, 0.0, 0.0, -1.0], ], float64) + [0.0, 0.0, 0.0, 0.0, 0.0, -1.0]]) m_R1 = array([ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], @@ -765,7 +766,7 @@ [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, -1.0], ], float64) + [0.0, 0.0, 0.0, 0.0, 0.0, -1.0]]) # Multiply and expand. mat_r1rho_prime = multiply.outer( r1rho_prime * relax_time, m_r1rho_prime )