Hi Troels, Again such tests should not be added to the repository. What you are doing here is perfectly suited to being added as a unit test, and that would have future benefits for the stability of the code. So if you would like to check how a function performs as you change it, please try to create a quick unit test instead.
Cheers, Edward On 19 June 2014 17:42, <[email protected]> wrote: > Author: tlinnet > Date: Thu Jun 19 17:42:02 2014 > New Revision: 24157 > > URL: http://svn.gna.org/viewcvs/relax?rev=24157&view=rev > Log: > Inserted intermediate step, to check if the matrix propagator to evolve the > magnetization is equal > when done for lower dimensional data of shape [7][7] and higher dimensional > data of shape [NE][NS][NM][NO][ND][7][7]. > > A short example is shown at the wiki: > http://wiki.nmr-relax.com/Numpy_linalg#Ellipsis_broadcasting_in_numpy.einsum > > 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_cpmg_2site_3d.py > > Modified: branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py > URL: > http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py?rev=24157&r1=24156&r2=24157&view=diff > ============================================================================== > --- branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py (original) > +++ branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py Thu Jun 19 > 17:42:02 2014 > @@ -62,7 +62,7 @@ > # relax module imports. > from lib.dispersion.ns_matrices import rcpmg_3d, rcpmg_3d_rankN > from lib.float import isNaN > -from lib.linear_algebra.matrix_exponential import matrix_exponential > +from lib.linear_algebra.matrix_exponential import matrix_exponential, > matrix_exponential_rankN > > > def r2eff_ns_cpmg_2site_3D(r180x=None, M0=None, r10a=0.0, r10b=0.0, > r20a=None, r20b=None, pA=None, dw=None, dw_orig=None, kex=None, > inv_tcpmg=None, tcp=None, back_calc=None, num_points=None, power=None): > @@ -131,8 +131,9 @@ > # The matrix R that contains all the contributions to the evolution, > i.e. relaxation, exchange and chemical shift evolution. > R_mat = rcpmg_3d_rankN(R1A=r10a, R1B=r10b, R2A=r20a, R2B=r20b, pA=pA, > pB=pB, dw=dw, k_AB=k_AB, k_BA=k_BA, tcp=tcp) > > - # Holds the Rexpo. > - Rexpo_mat = R_mat * 0.0 > + # This matrix is a propagator that will evolve the magnetization with > the matrix R for a delay tcp. > + Rexpo_mat = matrix_exponential_rankN(R_mat) > + > # Loop over the spins > for si in range(NS): > # Loop over the spectrometer frequencies. > @@ -148,14 +149,17 @@ > > # Store the Rexpo. Is it not possible to find the matrix > exponential of higher dimensional data? > Rexpo = matrix_exponential(R_mat_i) > - Rexpo_mat[0, si, mi, 0, di] = Rexpo > + Rexpo_t = Rexpo_mat[0, si, mi, 0, di] > + > + diff = Rexpo - Rexpo_t > + if abs(sum(diff)) > 1e-15: > + print abs(sum(diff)) > + import sys > + sys.exit() > > # Initial magnetisation. > Mint_mat = tile(M0[None, None, None, None, None, :, None], (NE, NS, NM, > NO, ND, 1, 1) ) > r180x_mat = tile(r180x[None, None, None, None, None, :, :], (NE, NS, NM, > NO, ND, 1, 1) ) > - #print Mint.shape > - #print r180x_mat.shape > - #print Rexpo_mat.shape > > # Loop over the spins > for si in range(NS): > > > _______________________________________________ > relax (http://www.nmr-relax.com) > > This is the relax-commits mailing list > [email protected] > > To unsubscribe from this list, get a password > reminder, or change your subscription options, > visit the list information page at > https://mail.gna.org/listinfo/relax-commits _______________________________________________ relax (http://www.nmr-relax.com) This is the relax-devel mailing list [email protected] To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-devel

