SpinDynamica is a set of packages for spin dynamical calculations in Mathematica. The software is intended as a useful tool for both analytical and numerical calculations in spin physics, in particular the spin dynamics encountered in magnetic resonance.
Overview
SpinDynamica includes routines for
• deriving and manipulating the matrix representations of nuclear spin operators, in arbitrary Hilbert space bases. There are routines for spin angular momentum operators, product operators, singlet-triplet bases, single transition operators, etc.
• deriving and manipulating the matrix representations of nuclear spin superoperators, in arbitrary Liouville space bases. Includes commutation superoperators, double commutation superoperators, coherence order filtration superoperators, and relaxation superoperators, which may be thermalized to provide the correct thermal equilibrium states.
• performing numerical and symbolic spin dynamics simulations of arbitrary pulse sequences or sequences of time-dependent events, including evolution under arbitrary spin Hamiltonians, arbitrary spin Liouvillian superoperators, arbitrary time-dependent functions of Hamiltonians or Liouvillian superoperators, and any combination of these. These routines allow trajectory tracing for any set of nuclear spin observables under arbitrary sequences of events. As default, numerical calculations are generated by Liouville-space evolution calculations employing the in-built Mathematica tools for numerical solution of differential equations (options for using diagonalisations and matrix exponentials are provided as well).
• useful packages for Euler angles, reference frame transformations, Wigner matrices, Clebsch-Gordon coefficients, quaternions.
• some useful 3D graphical objects and routines for visualizing rotations.
• manipulations of data, including one and two-dimensional Fourier transforms, presented according to common NMR conventions.
Malcolm Levitt’s research group uses these routines extensively to explore magnetic resonance concepts and develop new experimental methods. We expect them to be useful for the wider community as well. Mathematica is well-known as a powerful tool for symbolic mathematics but in its latest versions it is also becoming a serious tool for large-scale numerical mathematics as well. In particular, parallelization of tasks has been implemented in Mathematica 7.0. Using SpinDynamica for spin dynamical simulations provides immediate access to all of these features as well as the well-known symbolic and graphical features of Mathematica.
SpinDynamica is probably not as fast for numerical simulations as purpose-built lower-level routines such as SIMPSON and SPINEVOLUTION, although thorough head-to-head tests have not yet been done. However, it is much more general and optimized modules for specific numerical tasks, such as approximate large-spin-system simulations, may be developed in the future.
In its current state (2014), SpinDynamica allows acceptably fast numerical simulations for up to about 5 coupled spins-1/2, including arbitrary time-dependent Hamiltonians and relaxation superoperators. This is an on-going project and will continue to be developed over many years. Packages for assembling pulse sequences, spin Hamiltonians and relaxation superoperators are under development and will be released over time. More efficient powder averaging for solid-state NMR, and the incorporation of chemical exchange, are under preparation. Multidimensional spectroscopy if not yet fully implemented, as well. It takes some time to ensure that these features are implemented with full generality!