mailr20343 - /branches/relax_disp/lib/dispersion/ns_matrices.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on July 17, 2013 - 09:46:
Author: bugman
Date: Wed Jul 17 09:46:18 2013
New Revision: 20343

URL: http://svn.gna.org/viewcvs/relax?rev=20343&view=rev
Log:
Converted the pi-pulse propagator matrices to numpy array format.

This is to enable the use of the much faster numpy.dot() function for 
performing the dot products.


Modified:
    branches/relax_disp/lib/dispersion/ns_matrices.py

Modified: branches/relax_disp/lib/dispersion/ns_matrices.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/lib/dispersion/ns_matrices.py?rev=20343&r1=20342&r2=20343&view=diff
==============================================================================
--- branches/relax_disp/lib/dispersion/ns_matrices.py (original)
+++ branches/relax_disp/lib/dispersion/ns_matrices.py Wed Jul 17 09:46:18 2013
@@ -27,7 +27,7 @@
 
 # Python module imports.
 from math import cos, sin, pi
-from numpy import matrix
+from numpy import array, float64, matrix
 
 
 def r180x_2d(flip=pi):
@@ -40,12 +40,12 @@
     """
 
     # Build the matrix.
-    R = matrix([ 
+    R = 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, -1.0]
-    ])
+    ], float64)
 
     # Return the matrix.
     return R
@@ -65,7 +65,7 @@
     st = sin(flip)
 
     # Build the matrix.
-    R = matrix([
+    R = array([
         [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,  ct, -st, 0.0, 0.0, 0.0],
@@ -73,7 +73,7 @@
         [0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0,  ct, -st],
         [0.0, 0.0, 0.0, 0.0, 0.0,  st,  ct]
-    ])
+    ], float64)
 
     # Return the matrix.
     return R




Related Messages


Powered by MHonArc, Updated Wed Jul 17 11:00:01 2013