Context

A key ingredient for an accurate description of \(^1\mathrm{H}\) nuclear spin relaxation in soft matter systems is a realistic representation of the stochastic rotational and translational motions of molecules. Classical molecular dynamics (MD) simulations naturally provide access to these dynamics and have therefore become the reference approach for studying NMR relaxation. Initially developed for simple fluids such as Lennard-Jones liquids, MD has been used to characterize dipolar relaxation mechanisms [1, 2]. It has since been extended to increasingly realistic systems, including water and other molecular liquids [3, 4, 5, 6, 7, 8], confined fluids in nanoporous materials [9, 10, 11], and more complex soft matter systems such as polymers, lipid membranes, proteins, and glass-forming liquids [8, 12, 13, 14, 15].

Beyond classical MD, other simulation techniques have also been employed. Ab initio molecular dynamics has been used when electronic structure effects are important, for example to study quadrupolar relaxation [4, 16, 17]. Monte Carlo simulations have also been explored [18], although care must be taken when extracting time-dependent correlation functions from non-dynamical trajectories [19]. More recently, coarse-grained models combined with structural backmapping have been shown to reproduce NMR relaxation observables [20].

Despite the breadth of existing work, publicly available codes for computing NMR relaxation from MD trajectories remain scarce. This limits reproducibility and makes it difficult to apply established methods to new systems without significant reimplementation effort.

NMRDfromMD addresses this gap by providing an open-source, general-purpose code for extracting NMR relaxation quantities directly from molecular dynamics trajectories. It is designed to work with any MD engine capable of producing standard trajectory formats, and covers isotropic liquids, polymer solutions, and confined fluids. Numerical correctness and reproducibility are ensured through a series of automated tests validated against well-established reference systems.