DiffAtOnce: Molecular Diffusion

DiffAtOnce: advanced algorithms and features

DiffAtOnce integrates in a single environment the numerical algorithms, physical models and artificial intelligence modules developed in the FUNPOLYMER project to solve the inverse Laplace transform (ILT) problem in diffusion NMR experiments and turn this information into diffusion and molecular weight distributions for polymers.

The software is not conceived as a standard commercial product, but as a research platform that unifies published methods (CONTIN, DISCRETE, MaxEnt, ITAMeD, TRAIn, PALMA, SILT, dART, etc.), new regularization variants, universal calibration (UCC), extended diffusion methodologies (ediffNMR), AI models and deployment on high-performance computing (HPC) hardware.

Inverse Laplace transform (ILT) engine

The core of DiffAtOnce is an ILT engine specifically designed for multiexponential decay curves arising from diffusion NMR experiments. The problem is formulated as a regularized minimization under positivity and boundedness constraints on the diffusion coefficient, combining different algorithm families to handle discrete, continuous, polydisperse and spectrally overlapped systems.

CONTIN and DISCRETE

CONTIN implements a regularized solution for Fredholm integral equations of the first kind, enforcing smoothness and non-negativity of the distribution. It is suited to continuous diffusion coefficient distributions. DISCRETE deals with discrete sums of exponentials with white noise and unknown baseline, and is useful when a finite number of well-separated components is expected.

MaxEnt and PALMA

The maximum entropy (MaxEnt) formulation estimates Laplace amplitudes by maximizing entropy under fitting constraints, favouring smooth and stable solutions. PALMA combines in a multi-objective fashion the quadratic norm and entropy, helping to discriminate between narrow (monodisperse) and broad (polydisperse) diffusion distributions.

ITAMeD, TRAIn and tailored regularization

ITAMeD (Iterative Thresholding Algorithm for Multiexponential Decay) uses fast iterative thresholding (FISTA) with ℓ1 penalization, well suited to sparse distributions or a small number of dominant components. TRAIn is a trust-region algorithm that adaptively sets the search region using Morozov's discrepancy principle. Tailored regularization explores ℓp norms (1 ≤ p ≤ 2) to tune the balance between sparsity and smoothness in the recovered distribution.

SILT and dART

SILT (Simultaneous Inversion of the Laplace Transform) solves several decays at once, assuming a shared distribution; the resulting problem is convex and can be cast as a quadratic optimization, providing robustness against noise. dART applies algebraic reconstruction with orthogonalization in Hilbert space, without an explicit regularization term but imposing orthogonality between the error and the generated subspace. It is especially effective over wide diffusion domains and mixtures with multiple components.

Conceptual diagram of ILT algorithms integrated in DiffAtOnce
Conceptual overview of the ILT algorithm families (CONTIN, DISCRETE, MaxEnt, ITAMeD, TRAIn, PALMA, SILT, dART) integrated into DiffAtOnce.

Universal calibration (UCC) and molecular weight

Once diffusion coefficient distributions have been obtained, DiffAtOnce applies universal calibration (UCC) models developed by the NMRMBC group to transform D into molecular weight distributions, minimizing the dependence on solvent viscosity and other experimental conditions.

The models incorporate the β parameter and the fractal dimension of the polymer, in line with Flory's theory and empirical relationships between hydrodynamic radius, diffusion coefficient and molecular weight. The software accesses a database of UCC curves (for polystyrene, polypropylene, globular proteins, etc.) and allows extensions with new calibrations generated within FUNPOLYMER.

UCC parameters are stored in a database server and exposed through dynamic libraries, so that other applications can reuse the calibration curves for predicting molecular weight from D, viscosity and polymer type.

Extended diffusion NMR (ediffNMR)

Beyond classical diffusion experiments, DiffAtOnce includes the extended diffusion NMR (ediffNMR) methodology, in which both gradient duration and gradient strength are varied. This ensures that the data set is informative for both low and high molecular weight species, while keeping experimental time under control.

This methodology requires a full adaptation of ILT algorithms to bi-multiexponential decays depending on δ and G, and has been developed within FUNPOLYMER together with the optimization of pulse sequences, noise assessment and resolution of components with very close diffusion coefficients.

Workflow of ediffNMR from experimental decays to diffusion and molecular weight distributions
Simplified ediffNMR workflow: experiment design, regularized ILT, UCC and molecular weight distributions.

Artificial intelligence for diffusion NMR

The project incorporates a deep neural network with several hidden layers (with up to 1024 positions in the output layer) trained to reconstruct diffusion coefficient distributions from experimental decay curves with different numbers of points and gradient configurations.

The cost function is formulated as a regularized ℓ2 norm with regularized backpropagation and has been tested on data sets with 23 and 46 gradient values. The goal is to obtain a deep learning model that accelerates inversion in scenarios where classical ILT algorithms are too expensive or too sensitive to noise.

As an alternative in challenging cases, support vector machine (SVM) models are considered for predicting diffusion or molecular weight distributions.

Software architecture and high-performance computing

DiffAtOnce relies on a multi-language architecture: ILT and UCC algorithms have been reimplemented in Visual C# (.NET), MATLAB and Python, and are exposed as dynamic libraries for use by the desktop application and by external analysis tools.

The most computationally demanding algorithms have been ported to High Performance Computing using CUDA on NVIDIA GPUs (workstations and embedded systems such as Jetson), enabling the simultaneous inversion of all spectral points instead of working only with selected windows.

Communication with embedded hardware relies on Node.js services with dedicated APIs for intensive transfer of diffusion data and retrieval of accelerated ILT results.

From experiment to molecular weight distribution

In practice, users interact with DiffAtOnce through a guided workflow:

  • Import diffusion data (PGSE, DOSY, ediffNMR, etc.) and define the physical model.
  • Select an appropriate ILT algorithm (CONTIN, MaxEnt, ITAMeD, TRAIn, PALMA, SILT, dART, neural network, …).
  • Obtain diffusion coefficient distributions and assess fit quality.
  • Convert to molecular weight distributions via UCC and compute polydispersity indices.
  • Visualize, export and prepare figures for reports and publications.
Logical architecture of DiffAtOnce with ILT, UCC, AI and HPC layers
Logical architecture of DiffAtOnce: data ingestion layer, ILT engine, universal calibration (UCC) module, AI models and optional deployment on high-performance hardware.