Numerical field optimization for enhanced efficiency in time-reversible gradient computation of open-source GPU-accelerated FDTD simulations

Yannik Mahlau, Lukas Berg, Bodo Rosenhahn · 2026

Read Numerical field optimization for enhanced efficiency in time-reversible gradient computation of open-source GPU-accelerated FDTD simulations by Yannik Mahlau, Lukas Berg, Bodo Rosenhahn (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2603-24027.txt.

Introduction

Mahlau and co-authors cut memory use in GPU simulations of electromagnetic fields. Time-reversible gradient computation must save field values at the domain boundary, and memory often limits inverse design work. They store those values with fewer bits and with interpolation. Accuracy stays close while memory cost drops. The method fits reduced-precision data types that GPUs and machine learning tools favor. They add it to FDTDX, an open-source differentiable solver, to support large-scale nanophotonics simulations.

Catalog record

CREATORYannik Mahlau, Lukas Berg, Bodo Rosenhahn
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE15294
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2603.24027

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Numerical field optimization for enhanced efficiency in time-reversible gradient computation of open-source GPU-accelerated FDTD simulations Yannik Mahlau, Lukas Berg, Bodo Rosenhahn Abstract Finite-difference time-domain (FDTD) simulations often involve physical quantities spanning multiple orders of magnitude, such as the speed of light or electromagnetic field amplitudes. The standard practice for maintaining numerical accuracy in many FDTD implementations is to use 32-bit or 64-bit floating-point values to represent the electric and magnetic fields. However, this approach is not always optimal when recording field values, particularly during time-reversible gradient computation where electric and magnetic field values need to be saved at the boundary of the simulation domain. Since this memory bottleneck is often the limiting factor in time-reversible inverse design for nanophotonics, we present two field optimizations for enhancing memory efficiency in FDTD simulations. Using a smaller bit-width representation of field values as well as interpolation, we achieve similar accuracy at lower memory cost. This approach is particularly beneficial for GPU-accelerated computing, where reduced-precision data types are increasingly preferred due to their computational efficiency and prevalence in machine learning frameworks. We integrate our approach into FDTDX, an open-source, differentiable FDTD solver that natively supports time-reversible gradient computation. Our approach is especially important for future developments towards large-scale open-source simulations, which are critical for advancing computational nanophotonic applications. a]Institute of Information Processing, Leibniz University Hannover, Appelstraße 9a, 30167 Hannover, Germany keywords Inverse design, FDTD, Numerical Accuracy, GPU-acceleration, Open-source, Automatic differentiation, Time-reversibility † † authorinfo: Further author information: (Send correspondence to Yannik Mahlau) Yannik Mahlau: E-mail: [email protected], Telephone: +49 511 762-5316 1 Introduction Inverse design in nanophotonics [ 24 ] is a growing field since it enables the automated design of high-performance components without manual intervention. It encompasses both free-form topology optimization [ 8 , 33 , 20 ] and shape optimization [ 31 , 19 ] with fixed shape parameterizations of photonic nanostructures. In inverse design, gradient computation is typically performed using the adjoint method [ 18 , 29 ] , which only requires one additional simulation to calculate the gradient. Recently, time-reversible gradient computation [ 37 , 32 ] has emerged as a powerful technique, as it enables the gradient calculation of arbitrary time-dependent objective functions. This opens the possibility to apply inverse design to many applications such as pulse shaping [ 9 , 34 ] , supercontinuum generation [ 25 , 35 ] or spatio-temporal metamaterials [ 4 ] . Similar to the adjoint method, this approach also requires only a single additional simulation. It begins at the final time step of the forward simulation and propagates backward through time [ 1 ] . This allows for memory-efficient gradient computation through the time domain, because it eliminates the need to save electric and magnetic fields at every time step of the entire simulation volume. However, since absorbing boundaries such as Perfectly Matched Layers (PML) [ 30 ] are non-invertible in time, field values for these boundaries need to be saved during the forward simulation [ 26 ] . For long simulations, storing this field data is highly memory-intensive and becomes the main bottleneck for scaling simulation size. To alleviate this issue, we introduce two straightforward techniques to improve memory efficiency. By reducing the field data bit-width and subsampling every k time steps, we drastically reduce the memory requirements of gradient computation while keeping reasonable accuracy. This is particularly beneficial for GPU-accelerated simulations [ 22 , 7 ] , where memory is expensive and reduced-precision data types are often preferred due to their prevalence in machine learning frameworks [ 2 ] . To summarize, our main contributions are • We present two compression techniques for reducing memory requirements of time-domain gradient computation: temporal subsampling of the fields and reducing their bit-width representation. • Using these techniques, we are able to show a reduction in memory requirements of 64x without result degradation. Because these savings scale with simulation resolution, optimizations at finer grid sizes will yield even greater benefits. • To facilitate adoption of our work, we integrate the compression techniques into the open-source solver FDTDX [ 21 ] . 2 Methods (a) Data Type Conversion (b) Linear Interpolation Figure 1 : Compression of an original sine wave (blue) in 32 bit precision (a) and 136 time steps per period (b). The original wave is compressed to a smaller data type (a) or subsampled at every k time steps (b). The phase offset between different curves in the plots is added for visualization purposes and has no connection to the compression. For time-reversible gradient computation, the field values at the interface slices between the simulation volume and PML must be recorded in the forward simulation. In the time-reversed simulation, these field values are injected back at the respective interface slices. Effectively, the boundary interfaces act as sources during the time reversed simulation. The standard bit-widths for numerical simulations are float32 or float64 [ 11 , 27 ] , also called single and double precision, respectively. Using these large bit-widths is necessary to ensure accuracy [ 17 , 36 ] . However, it may not be necessary to use a large bit-width for storing field values if they are not directly used in any computation. To reduce memory overhead, we propose converting the recorded field values to smaller bit-widths such as float16 (half precision) or float8_e4m3b11fnuz [ 15 ] . We convert the stored values back to the larger bit-widths of either single or double precision during time-reversed simulation. Therefore, there is no direct computation performed on smaller bit-widths. Instead, the only loss in accuracy stems from the conversion error when converting values of large to smaller bit-width. Furthermore, depending on the spatial resolution and source frequency, saving field values at every time step is often unnecessary. When running a three-dimensional FDTD simulation with a uniform spatial resolution of \Delta x , the Courant-Friedrichs-Levy (CFL) stability condition [ 5 ] dictates a maximum time step of \displaystyle\Delta t=\frac{C\,\Delta x}{c\,\sqrt{3}}, (1) where C=0.99 is a typical Courant factor and c=299792458\,\frac{\text{m}}{\text{s}} is the speed of light in vacuum. For a resolution of \Delta x=20 nm, this yields a time step of \Delta t=3.81\times 10^{-17} seconds. A typical infrared source of 1550 nm has a period of 5.17\times 10^{-15} seconds, which corresponds to approximately 136 time steps. To accurately reconstruct the electric and magnetic fields of such a wave, recording every time step is redundant. Instead, subsampling at every k -th time step and applying linear interpolation provides sufficient accuracy. To illustrate the effect of reduced bit-width and temporal subsampling, we represent a sine wave using both techniques in fig. 1 . Figure 2 : Simulation setup for the inverse design of a grating coupler. A source (orange) injects light into the simulation towards the design region (pink). The design is optimized such that light is redirected into the output waveguide (blue). The ratio between input and output poynting flux is measured through two detectors (green). The simulation volume is surrounded by PML boundary objects (grey). 3 Results and Discussion We evaluate our methods on the topology optimization of a silicon coupler [ 13 ] , designed to direct free-space light into a waveguide. Because this application lacks a time-dependent objective function, it could alternatively be optimized using

Read the complete text