Table of Contents
Fetching ...

Scalable physical source-to-field inference with hypernetworks

Berian James, Stefan Pollok, Ignacio Peis, Elizabeth Louise Baker, Jes Frellsen, Rasmus Bjørk

TL;DR

This work tackles the expensive problem of computing fields generated by many physical sources by introducing hypernetwork-based surrogates that produce additive, field-conditioned representations. By enforcing superposition (via additive hypernetworks) and leveraging potential-based formulations, the authors achieve amortised evaluation with a theoretical runtime of ${\mathcal{O}}(M+N)$ while maintaining relative errors around ${\sim}4{-}6\%$, and enabling field evaluation at arbitrary locations for arbitrary numbers of sources. They develop three instantiations (Fourier hypernetwork, FC+ILR, and FC+INR) and demonstrate that Fourier and FC+ILR provide robust multi-source generalization in 2D across overlapping and prism-like geometries, often outperforming traditional Fast Multipole Method baselines in near-field regimes. The approach holds promise for accelerating physics simulations, particularly in magnetostatics and related conservative fields, with potential extensions to 3D and time-evolving systems, while highlighting limitations related to dynamic range, geometry variability, and retraining needs. Overall, the paper presents a scalable, physics-informed framework for amortised source-to-field inference that leverages additive hypernetworks to preserve linear superposition and enable rapid, continuous-space field evaluations.

Abstract

We present a generative model that amortises computation for the field and potential around e.g.~gravitational or electromagnetic sources. Exact numerical calculation has either computational complexity $\mathcal{O}(M\times{}N)$ in the number of sources $M$ and evaluation points $N$, or requires a fixed evaluation grid to exploit fast Fourier transforms. Using an architecture where a hypernetwork produces an implicit representation of the field or potential around a source collection, our model instead performs as $\mathcal{O}(M + N)$, achieves relative error of $\sim\!4\%-6\%$, and allows evaluation at arbitrary locations for arbitrary numbers of sources, greatly increasing the speed of e.g.~physics simulations. We compare with existing models and develop two-dimensional examples, including cases where sources overlap or have more complex geometries, to demonstrate its application.

Scalable physical source-to-field inference with hypernetworks

TL;DR

This work tackles the expensive problem of computing fields generated by many physical sources by introducing hypernetwork-based surrogates that produce additive, field-conditioned representations. By enforcing superposition (via additive hypernetworks) and leveraging potential-based formulations, the authors achieve amortised evaluation with a theoretical runtime of while maintaining relative errors around , and enabling field evaluation at arbitrary locations for arbitrary numbers of sources. They develop three instantiations (Fourier hypernetwork, FC+ILR, and FC+INR) and demonstrate that Fourier and FC+ILR provide robust multi-source generalization in 2D across overlapping and prism-like geometries, often outperforming traditional Fast Multipole Method baselines in near-field regimes. The approach holds promise for accelerating physics simulations, particularly in magnetostatics and related conservative fields, with potential extensions to 3D and time-evolving systems, while highlighting limitations related to dynamic range, geometry variability, and retraining needs. Overall, the paper presents a scalable, physics-informed framework for amortised source-to-field inference that leverages additive hypernetworks to preserve linear superposition and enable rapid, continuous-space field evaluations.

Abstract

We present a generative model that amortises computation for the field and potential around e.g.~gravitational or electromagnetic sources. Exact numerical calculation has either computational complexity in the number of sources and evaluation points , or requires a fixed evaluation grid to exploit fast Fourier transforms. Using an architecture where a hypernetwork produces an implicit representation of the field or potential around a source collection, our model instead performs as , achieves relative error of , and allows evaluation at arbitrary locations for arbitrary numbers of sources, greatly increasing the speed of e.g.~physics simulations. We compare with existing models and develop two-dimensional examples, including cases where sources overlap or have more complex geometries, to demonstrate its application.
Paper Structure (36 sections, 14 equations, 11 figures, 5 tables)

This paper contains 36 sections, 14 equations, 11 figures, 5 tables.

Figures (11)

  • Figure 1: In the template architecture, a basis function generator $\bm{\psi}: \mathbb{R}^d \rightarrow \mathbb{R}^L$ expands the $d$-dimensional spatial coordinate $\mathbf{r}_n \in \mathbb{R}^d$ in a (fixed or learnable) basis to specified order $L$. The coefficients $\mathbf{a}_{1:L} \in \mathbb{R}^L$ of the expansion, with $a_0 = b$ representing the bias term, are learned as a hypernetwork $g: \mathbb{R}^v \rightarrow \mathbb{R}^{L+1}$ of the $v$-dimensional features of the source geometry $\mathbf{V}'_m$ and magnetisation $\mathbf{M}_m$, which is additive across the sources, giving the cumulative magnetic field or scalar potential at $\mathbf{r}_n$. It follows that once the basis weights $\mathbf{a}$ are accumulated for all $M$ sources, only $\bm{\psi}(\mathbf{r}_n)$ has to be recalculated in $f$ for any other evaluation point.
  • Figure 2: Magnetic potential and field for three finite circular sources (a) and their approximation by a small fully-connected network (b). Sources with locations $\mathbf{r}'$ and direction and magnitude of the magnetisation $\mathbf{M}$ shown by the red arrows, are randomly positioned within a $[-3,3]\times[-3,3]$ domain, in units of the source radius, with the potential and field generated on a regular $100^2$ grid.
  • Figure 3: (a) Validation curves for predicting magnetic potential (red) and field (blue), either directly (solid) or indirectly via the potential (dashed), shown as relative error percentages. (b) Output of a 1D Fourier hypernetwork trained on single-source potentials (dotted black), successfully generalising to the combined potential of six randomly placed sources.
  • Figure 4: Multiple-source inference. (a) Ground-truth potential and field from four randomly placed circular magnets. (b-d) Predictions from models trained only on single-source examples, evaluated by first aggregating source representations before computing spatial values.
  • Figure 5: (a) Runtime as a function of the number of sources $M$ and keeping $N=M$, e.g. evaluation of $\phi$ in the centre of each source. The blue coloured lines show the sequential evaluation time to make the underlying computational complexity of each method apparent. The green lines show the runtimes when parallelising the workload on the GPU (NVIDIA GeForce RTX 5090) with FC+ILR and on 96 threads of the CPU (Intel$^\text{\textregistered}$ Xeon$^\text{\textregistered}$ Gold 6248R) in the case of FMM. The increased runtime visualised by the orange line originates from the additional correction required for evaluation points lying inside other sources in case sources overlap or $\phi$ is evaluated on a regular grid, which is denoted by $N_m > 0$. Notice that this only affects the evaluation time of FMM. (b) Relative error for single evaluation points $\epsilon_{\phi_n}$ from single-source configurations ($M=1$) grouped by distance to the source centre normalised by the side length $s_x$ of the source. Here, the data consists of $10^3$ 2D potentials generated by single prism-shaped source configurations with varying side lengths ($s_x = s_y \in [0.12, 0.48]$) in a $[-1.2,1.2]\times[-1.2,1.2]$ domain. Each validation sample is evaluated at $32^2$ randomly sampled potential points across the domain. The FMM method used as a benchmark is shown in yellow, while we depict in brown the "pure" FMM without any corrections for the physical extension of the magnetic source. FC+ILR, depicted in purple, outperforms FMM close to the edges of the sources.
  • ...and 6 more figures