Spin algebra and NMR theory using numerical software

A simple method to execute spin algebra computations is presented. It uses the high-level numerical program Scilab and its large and convenient set of linear algebra routines. The techniques thus developed are applied to various nuclear magnetic resonance (NMR)-related simulations. Static spectra of AB and ABC spin systems are computed. Free precession of single or multispin systems are simulated using the density matrix formalism. Magnetization transfer under simple pulse sequences is examined. Matrices representing product operators are displayed and coherence orders are explained. COSY correlation maps for two and three spins are obtained without approximation. The simulation of a DQF-COSY spectrum, with its eight-step phase program, is explained. Two simple pulsed field gradient experiments are described. Computation times are under 100 s on a 1.66-GHz laptop computer. The approach is elementary, requiring only a basic knowledge of spin quantum mechanics.