Menu

Commit [r24160]  Maximize  Restore  History

Moved the calculation the evolution matrix out of for loops.

The trick is that numpy.einsum allows for dot product of higher dimension:

- The the essential evolution matrix.
- This is a dot product of the outer [7][7] matrix of the Rexpo_mat and r180x_mat matrixes, which
- have the shape [NE][NS][NM][NO][ND][7][7].
- This can be achieved by using numpy einsum, and where ellipsis notation will use the last axis.
evolution_matrix_mat = einsum('...ij,...jk', Rexpo_mat, r180x_mat)
evolution_matrix_mat = einsum('...ij,...jk', evolution_matrix_mat, Rexpo_mat)
evolution_matrix_mat = einsum('...ij,...jk', evolution_matrix_mat, evolution_matrix_mat)

Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis.

tlinnet 2014-06-19

changed /branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py
/branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py Diff Switch to side-by-side view
Loading...
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.