Abstract
In physics, density $\rho(\cdot)$ is a fundamentally important scalar function to model, since it describes a scalar field or a probability density function that governs a physical process. Modeling $\rho(\cdot)$ typically scales poorly with parameter space, however, and quickly becomes prohibitively difficult and computationally expensive. One promising avenue to bypass this is to leverage the capabilities of denoising diffusion models often used in high-fidelity image generation to parameterize $\rho(\cdot)$ from existing scientific data, from which new samples can be trivially sampled from. In this paper, we propose $\rho$-Diffusion, an implementation of denoising diffusion probabilistic models for multidimensional density estimation in physics, which is currently in active development and, from our results, performs well on physically motivated 2D and 3D density functions. Moreover, we propose a novel hashing technique that allows $\rho$-Diffusion to be conditioned by arbitrary amounts of physical parameters of interest.
Introduction
In the physical sciences, the scalar density function $\rho(\cdot)$ is a fundamental quantity, representing everything from matter distribution in galactic simulations to electron probability densities in quantum chemistry. Accurately estimating these densities is critical for understanding the underlying fields governing physical processes. However, traditional estimation methods—such as histograms or Markov Chain Monte Carlo (MCMC)—suffer from the curse of dimensionality, becoming computationally prohibitive as parameter spaces expand. While modern generative models like GANs or Normalizing Flows offer potential solutions, they are often optimized for 2D image data and lack the flexibility required for $n$-dimensional physical data and complex conditioning on continuous variables.
Methodology
We introduce $\rho$-Diffusion, a physics-centric framework based on Denoising Diffusion Probabilistic Models (DDPM). The core architecture utilizes an $n$-dimensional U-Net enhanced with residual blocks and multi-head attention, supporting 1D sequences, 2D images, and 3D volumetric data.
Deterministic Hashing for Conditioning
A primary challenge in applying diffusion models to physics is conditioning on continuous, multivariate physical parameters (e.g., mass, velocity, time). Unlike categorical labels used in standard image generation, physical parameters require a flexible, non-parametric approach. $\rho$-Diffusion employs a novel hashing technique: physical parameters are stored in a dictionary and processed via the SHA512 algorithm into a unique hexadecimal digest. This digest is then converted into a float vector for the model's embedding layer. This approach allows the model to be conditioned on an arbitrary number of parameters without requiring architectural changes.
Experimental Results
The framework was evaluated across three distinct physical domains:
- 2D Galaxy Mergers: Using snapshots from the BONSAI N-body simulation code, the model was conditioned on the time parameter. The results demonstrate that $\rho$-Diffusion can effectively emulate the evolution of colliding galaxies, potentially bypassing the need for expensive numerical simulations.
- 3D Spherical Harmonics: The model generated $32^3$ voxel volumes of mathematical basis functions. Generated samples were visually indistinguishable from ground truth data, achieving a Wasserstein distance of approximately 0.035, indicating high distributional fidelity.
- 1D Molecular Spectra: This served as a stress test for the model. The high sparsity of high-resolution rotational spectra proved challenging for the standard convolutional U-Net, highlighting the need for architectures capable of capturing longer-range correlations.
Discussion and Limitations
While $\rho$-Diffusion shows significant promise, several challenges remain. The SHA512 hashing method exhibits an "avalanche effect," where minor changes in input parameters lead to drastically different hashes. This prevents the model from naturally interpolating between unseen parameter values. Furthermore, the model currently lacks explicit physical constraints, such as the conservation of mass, and the inference process remains relatively slow, requiring approximately 1,000 steps per sample.
Conclusion
$\rho$-Diffusion provides a robust foundation for applying generative diffusion models to computational physics. Future work will focus on implementing faster sampling methods like DDIM, incorporating inductive physical biases into the architecture, and exploring joint training with language models to improve parameter interpolation. The source code is available at github.com/intel/rho-diffusion.
Summary updated