Spinach library

Spinach is a fast (polynomial complexity scaling for liquid state NMR) open-source spin dynamics simulation library that supports NMR, EPR, MRI, DNP, MAS, Optimal Control, PHIP, singlet state NMR, and other forms of Magnetic Resonance spectroscopy. Historical notes on its development are published here and here. The complete list of developers and contributors is here.


Version 2.4.5157 (latest stable version, 6 Aug 2019, documentation)
Version 2.3.4934
Version 2.2.4619
Version 2.1.4400

System requirements

  • Matlab 2018b (64-bit) or later
  • Matlab Parallel Computing Toolbox
  • Matlab Optimization Toolbox
  • At least 2 CPU cores and 8 GB of RAM
Spinach supports NVidia GPUs (we recommend Titan V) and large-scale (1024+ cores) parallel deployments using Matlab Distributed Computing Server. Please email Ilya Kuprov with any tough questions or new feature requests; you would normally get an instant reply.

New features

  • Support for Markov State Model simulations with linear compexity scaling for both liquid and solid state magnetic resonance simulations.
  • Major parallel efficiency improvements (collaboration with Maria Grazia Concilio at Southampton, and Alison Eele, Jos Martin, and Raymond Norris at MathWorks). Much improved parallelisation control and profiling functionality when running on MDCS clusters.
  • Optimal control module now supports wire distance modulation in magic angle spinning optimisations (collaboration with Marina Carravetta with good advice from Steffen Glaser). Some examples of MAS NMR optimal control simulations are now provided.
  • COLOC (collaboration with Bud MacAulay) and PSYCOSY (collaboration with Alan Kenwright) pulse sequences added to the liquid state NMR module.
  • iDOSY-ZS and one-shot DOSY pulse sequences added to the spatially encoded NMR module (collaboration with Maria Grazia Concilio and Gareth Morris).
  • Absolute zero temperature now supported in the equilibrium function.
  • Lots of numerical efficiency improvements, documentation improvements, and fixing of minor annoyances throughout the code.
  • Performance and memory footprint improvements (collaboration with Jos Martin at MathWorks) for MRI and spatially encoded NMR simulations, particularly on GPUs. NVidia Titan V cards are much recommended. Spinach has been tested and optimised for cluster MDCS deployments with hundreds of worker processes.
  • New liquid state NMR pulse sequences: INEPT, DEPT, DEPTQ, PANSY-COSY, INADEQUATE, HMBC (by Andrew Porter and Bud Macaulay). Multiple-quantum correlation sequences (by Maria Grazia Concilio).
  • New solid state NMR pulse sequences (RESPIRATION-CP by Venkata Subbarao Redrouthu) and examples (overtone, CPMAS, CPMAS with chemical exchange, by Marina Carravetta, Phil Williamson, and Maria Grazia Concilio).
  • New MRI and spatially encoded NMR functionality: ultrafast MQ (by Maria Grazia Concilio), better MRI examples (by Ahmed Allami), gradient tilting support at the kernel level and improved MRI plotting (by Maria Grazia Concilio). Spatial grid accuracy analysis function.
  • Optimal control module extended to support time-dependent drift Hamiltonians, prefix and suffix pulse sequences, keyhole functions, interval-selective optimisation, and optimisation checkpoints (collaboration with Marina Carravetta, Phil Williamson, Jack Saywell, Tim Freegarde, and David Goodwin).
  • New relaxation-driven NMR pulse sequences: HOESY, SAT-REC, INV-REC (by Zak El-Machachi). Extra analytical examples and textbook cases for relaxation theory.
  • CPU and GPU support for polyadic arithmetic. Polyadic object can buffer additions and multiplications. The kernel transparently supports polyadic evolution generators.
  • Eigenfields and eigentracks calculation for field-swept experiments.
  • SIFTER and RIDME pulse sequences and examples by Alice Bowen. RYDMR experiment now uses full Zeeman Hamiltonian that includes nuclear Zeeman interactions and catches nuclear Zeeman resonances.
  • An option to re-calculate the thermal equilibrium for each orientation in the powder context.
  • Spin system data import from GISSMO files.
  • Faster REPULSION grid generation by Fred Mentink-Vigier.
  • Improved isotope dilution functionality and new standard large spin system (cyprinol) by Bud Macaulay.
  • Vast amounts of additional documentation, stability improvements, and console reporting improvements.
  • Much faster symmetry treatment, particularly in systems with multiple non-Abelian symmetry groups.

  • Kernel-wide support for spherical rank 1 interactions (such as antisymmetric CSA), including relaxation theory.

  • Kernel-wide support for high spherical rank zero-field splitting, including relaxation theory.

  • Polyadic representation option for large Kronecker products – many operations may be carried out without opening them.

  • PRESS, DWI, EPI, and DPFGSE pulse sequences and examples in the imaging module (collaboration with Ahmed Allami).

  • TROSY relaxation theory examples.

  • An option to add magnetisation pumping (e.g. CIDNP or SABRE) terms to the relaxation superoperator.

  • Arbitrary pulse timing grids, major improvements in parallel efficiency, and ensemble control options in the optimal control module.

  • A huge amount of additional documentation.