Chromatix: a differentiable, GPU-accelerated wave-optics library

Diptodip Deb, Gert‐Jan Both, Eric Bezzam, Amit Kohli, Siqi Yang, Amey Chaware, Cédric Allier, Changjia Cai, Geneva Schlafly, M. Hossein Eybposh, Magdalena C. Schneider, Rainer Heintzmann, Fabrizio A. Rivera-Sanchez, Corey Simmerer, Guanghan Meng, Jovan Tormes-Vaquerano, SeungYun Han, Sibi Chakravarthy Shanmugavel, Teja Maruvada, Xi Yang, Yewon Kim, Benedict Diederich, Chulmin Joo, Laura Waller, Nicholas J. Durr, Nicolas C. Pégard, Patrick J. La Rivière, Roarke Horstmeyer, Shwetadwip Chowdhury, Srinivas C. TuragabioRxiv 2025 · DOI

TL;DR

This paper introduces Chromatix, an open-source, GPU-accelerated, and differentiable wave optics simulation library. It addresses the lack of standardized, reusable, and performant tools for computational optics, enabling researchers to design and optimize complex optical systems more efficiently.

What Problem Does This Paper Address?

Modern microscopy and optical imaging techniques increasingly rely on computational modeling for tasks like reconstructing images from limited data (inverse problems) or optimizing the design of optical systems themselves. These methods often require "differentiable" simulations, meaning the simulation can be automatically differentiated to guide optimization. However, the field of computational optics has lacked a standardized, reusable, and high-performance framework for these simulations. Researchers have historically had to build these complex simulations from scratch for each project, leading to duplicated effort, limited reusability, and often suboptimal performance due to the difficulty of leveraging modern hardware like GPUs. This fragmentation hinders progress and limits the exploration of novel optical designs.

Methods

Chromatix is built on JAX, a Python library for high-performance numerical computation and automatic differentiation (AD). This foundation allows Chromatix to:

  • GPU Acceleration: Seamlessly leverage GPUs for significantly faster computations.
  • Automatic Differentiation: Automatically compute gradients, crucial for optimization tasks, without manual implementation.
  • Composability: Model optical systems as a sequence of fundamental building blocks (optical elements and propagation models), similar to layers in deep learning frameworks. This allows for flexible combination and easy modification of optical setups.
  • Scalability: Easily scale simulations across multiple GPUs with minimal code changes, enabling the tackling of larger and more complex problems.

The library implements a wide range of optical elements (lenses, polarizers, SLMs, sensors) and wave propagation models (scalar and vectorial, free-space, scattering media).

Datasets

The paper demonstrates Chromatix's capabilities by reproducing results from existing studies. Therefore, the datasets used are those previously published and made available by the original research groups. Specific datasets are mentioned in the "Data Availability" section and linked to the respective figures and experiments.

Key Insights and Ideas

  • Bridging the Gap: Chromatix effectively bridges the gap between deep learning frameworks and computational optics by adopting a similar modular, differentiable, and GPU-accelerated architecture. This makes advanced computational optics accessible to a broader audience.
  • Democratizing Complex Simulations: By providing a standardized, easy-to-use, and performant library, Chromatix lowers the barrier to entry for complex wave optics simulations, enabling researchers to focus on scientific discovery rather than low-level implementation.
  • The Power of Composability: The library's component-based design allows for rapid prototyping and exploration of novel optical system designs by simply combining existing elements, accelerating innovation.
  • Performance Gains are Significant: The substantial speedups achieved, especially with multi-GPU parallelization, make previously intractable simulations and optimizations feasible within practical timeframes.

Key Results

  • Speedup: Chromatix offers significant performance improvements, ranging from 2-6x on a single GPU to up to 22x on 8 GPUs compared to original implementations for various computational optics tasks.
  • Accuracy: Chromatix reproduces results from existing studies with high fidelity, often achieving nearly identical outcomes.
  • Scalability: The library demonstrates excellent scalability, allowing researchers to easily transition from single-GPU to multi-GPU setups with minimal code modifications.
  • Reconstruction Quality: In several examples, Chromatix's implementations achieve comparable or even improved reconstruction quality (e.g., larger field of view, reduced artifacts) compared to previous methods, often due to its ability to leverage more computational resources.

Limitations and Future Work

  • Idealized Models: Chromatix currently models some optical elements (e.g., lenses) in idealized ways. Future work aims to incorporate more realistic modeling of lens geometries, coatings, and sensors with noise patterns.
  • Ray-Based Modeling: While Chromatix focuses on wave optics, there's a need to integrate efficient ray-based modeling for complex lens systems.
  • Advanced Propagation Models: Support for rigorous coupled-wave analysis (RCWA) for metasurface design and more advanced scattering models (e.g., modified Born series) are areas for future development.
  • Partial Coherence: Current models focus on coherent propagation; extending this to partially coherent light and spectral changes is planned.
  • Hardware Integration: Future applications envision integration with hardware control software for automated calibration and alignment.

Summary updated

Abstract

Abstract Modern microscopy methods incorporate computational modeling of optical systems as an integral part of the imaging process, either to solve inverse problems or enable optimization of the optical system design. These methods often depend on differentiable simulations of optical systems, yet no standardized framework exists—forcing computational optics researchers to repeatedly and independently implement simulations that are prone to errors, difficult to reuse in other applications, and often computationally suboptimal. These common problems limit the potential impact of computational optics as a field. We present Chromatix: an open-source, GPU-accelerated differentiable wave optics library. Chromatix builds on JAX to enable fast simulation of diverse optical systems and inverse problem solving, scaling these simulations from single-CPU laptops to multi-GPU servers. The library implements various optical elements (e.g., lenses, polarizers and spatial light modulators) and multiple light propagation models (e.g., Fresnel approximation, angular spectrum and off-axis propagation) that can be flexibly combined to model various computational optics applications such as snapshot microscopy, holography, and phase retrieval of multiple scattering samples. These simulations can be automatically parallelized to scale across multiple GPUs with a single-line change to the modeling code, enabling simulation and optimization of previously impractical optical system designs. We demonstrate Chromatix’s capacity to substantially accelerate optics simulation and optimization on existing methods in computational optics, speeding up optical simulation and optimization from 2-6× on a single GPU to up to 22× on 8 GPUs (depending on the particular system being modeled) compared to the original implementations. Chromatix establishes a standard for wave optics simulations, democratizing access to and expanding the design space of computational optics.
BibTeX
@misc{deb2025chromatix,
  author = {Diptodip Deb and Gert‐Jan Both and Eric Bezzam and Amit Kohli and Siqi Yang and Amey Chaware and Cédric Allier and Changjia Cai and Geneva Schlafly and M. Hossein Eybposh and Magdalena C. Schneider and Rainer Heintzmann and Fabrizio A. Rivera-Sanchez and Corey Simmerer and Guanghan Meng and Jovan Tormes-Vaquerano and SeungYun Han and Sibi Chakravarthy Shanmugavel and Teja Maruvada and Xi Yang and Yewon Kim and Benedict Diederich and Chulmin Joo and Laura Waller and Nicholas J. Durr and Nicolas C. Pégard and Patrick J. La Rivière and Roarke Horstmeyer and Shwetadwip Chowdhury and Srinivas C. Turaga},
  title = {{Chromatix: a differentiable, GPU-accelerated wave-optics library}},
  year = {2025},
  doi = {10.1101/2025.04.29.651152},
  howpublished = {bioRxiv},
}
Figure