Spinach (software)

Spinach is an open-source magnetic resonance simulation package initially released in 2011[1] and continuously updated since.

[2] The package is written in Matlab and makes use of the built-in parallel computing and GPU interfaces of Matlab.

[3] The name of the package whimsically refers to the physical concept of spin and to Popeye the Sailor who, in the eponymous comic books, becomes stronger after consuming spinach.

[4] Spinach implements magnetic resonance spectroscopy and imaging simulations by solving the equation of motion for the density matrix

, and potentially other terms that govern spatial dynamics and coupling to other degrees of freedom:[2] Computational efficiency is achieved through the use of reduced state spaces, sparse matrix arithmetic, on-the-fly trajectory analysis, and dynamic parallelization.

[5] As of 2023, Spinach is cited in over 300 academic publications.

[1] According to the documentation[2] and academic papers citing its features, the most recent version 2.8 of the package performs: Common models of spin relaxation (Redfield theory, stochastic Liouville equation, Lindblad theory) and chemical kinetics are supported, and a library of powder averaging grids is included with the package.

[2] Spinach contains an implementation the gradient ascent pulse engineering (GRAPE) algorithm[16] for quantum optimal control.

The documentation[2] and the book describing the optimal control module of the package[17] list the following features: Dissipative background evolution generators and control operators are supported, as well as ensemble control over distributions in common instrument calibration parameters, such as control channel power and offset.

250 MHz ECOSY NMR spectrum of strychnine alkaloid simulated using Spinach .