{"id":526499,"date":"2026-06-09T16:30:28","date_gmt":"2026-06-09T16:30:28","guid":{"rendered":"https:\/\/www.europesays.com\/ie\/526499\/"},"modified":"2026-06-09T16:30:28","modified_gmt":"2026-06-09T16:30:28","slug":"chromatix-a-differentiable-gpu-accelerated-wave-optics-library","status":"publish","type":"post","link":"https:\/\/www.europesays.com\/ie\/526499\/","title":{"rendered":"Chromatix: a differentiable, GPU-accelerated wave-optics library"},"content":{"rendered":"<p>Design and implementation<\/p>\n<p>The design of Chromatix is strongly inspired by current deep learning frameworks. Here we detail the principles that informed our design choices and implementation decisions. We argue that effective frameworks for computational optics, like those for deep learning, must embody three key characteristics: differentiability, composability and scalability. We also discuss the high level implementation of Chromatix as it relates to these three characteristics.<\/p>\n<p>Differentiability<\/p>\n<p>Differentiability is the ability to calculate gradients, which can be used for gradient-based optimization (for example, of the parameters of an optical simulation). For small, low-dimensional inputs, numerical differentiation can be sufficient, but for high-dimensional inputs (for example, the pixels of an SLM) this becomes too computationally expensive to evaluate, and it is preferable to use backpropagation of the gradients of each step of the simulation. When combined with the wide variety of possible optical models or neural networks, automatic differentiation becomes a desirable property. Common programming languages such as MATLAB (<a href=\"http:\/\/www.mathworks.com\" rel=\"nofollow noopener\" target=\"_blank\">https:\/\/www.mathworks.com<\/a>) and C do not provide general-purpose automatic differentiation, requiring gradients to be manually derived and implemented: an error-prone, time-consuming and inflexible process. Current deep learning frameworks<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Paszke, A. et al. PyTorch: an imperative style, high-performance deep learning library. In Proc. 33rd International Conference on Neural Information Processing Systems, 721 (Curran Associates, 2019).\" href=\"#ref-CR24\" id=\"ref-link-section-d181470754e1309\">24<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Abadi, M. et al. TensorFlow: a system for large-scale machine learning. In Proc. 12th USENIX conference on Operating Systems Design and Implementation 265&#x2013;283 (USENIX, 2016).\" href=\"#ref-CR25\" id=\"ref-link-section-d181470754e1309_1\">25<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 26\" title=\"Bradbury, J. et al. JAX: composable transformations of Python+NumPy programs. GitHub &#010;                http:\/\/github.com\/jax-ml\/jax&#010;                &#010;               (2018).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR26\" id=\"ref-link-section-d181470754e1312\" rel=\"nofollow noopener\" target=\"_blank\">26<\/a> provide automatic differentiation: given a function, they can automatically calculate the gradient with respect to any parameter of that function as long as the function is differentiable with respect to that parameter. Similarly, Chromatix can automatically calculate the gradient with respect to any parameter of a simulation as it has been written using JAX.<\/p>\n<p>Differentiability has already found several uses in optical design, enabling end-to-end design of computational optics systems for a variety of problems<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 3\" title=\"Deb, D. et al. FourierNets enable the design of highly non-local optical encoders for computational imaging. Neural Inf. Proc. Syst. 35, 25224&#x2013;25236 (2022).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR3\" id=\"ref-link-section-d181470754e1319\" rel=\"nofollow noopener\" target=\"_blank\">3<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 9\" title=\"Nehme, E. et al. DeepSTORM3D: dense 3D localization microscopy and PSF design by deep learning. Nat. Methods 17, 734&#x2013;740 (2020).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR9\" id=\"ref-link-section-d181470754e1322\" rel=\"nofollow noopener\" target=\"_blank\">9<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Kellman, M. R., Bostan, E., Repina, N. A. &amp; Waller, L. Physics-based learned design: optimized coded-illumination for quantitative phase imaging. IEEE Trans. Comput. Imaging 5, 344&#x2013;353 (2019).\" href=\"#ref-CR18\" id=\"ref-link-section-d181470754e1325\">18<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Baek, S.-H. et al. Single-shot hyperspectral-depth imaging with learned diffractive optics. In Proc. IEEE\/CVF International Conference on Computer Vision (ICCV) 2631&#x2013;2640 (IEEE, 2021).\" href=\"#ref-CR19\" id=\"ref-link-section-d181470754e1325_1\">19<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Sitzmann, V. et al. End-to-end optimization of optics and image processing for achromatic extended depth of field and super-resolution imaging. ACM Trans. Graph. 37, 1&#x2013;13 (2018).\" href=\"#ref-CR20\" id=\"ref-link-section-d181470754e1325_2\">20<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Chang, J. &amp; Wetzstein, G. Deep optics for monocular depth estimation and 3D object detection. In Proc. IEEE\/CVF International Conference on Computer Vision (ICCV) 10192&#x2013;10201 (IEEE, 2019).\" href=\"#ref-CR21\" id=\"ref-link-section-d181470754e1325_3\">21<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Ikoma, H., Nguyen, C. M., Metzler, C. A., Peng, Y. &amp; Wetzstein, G. Depth from defocus with learned optics for imaging and occlusion-aware depth estimation. In Proc. IEEE International Conference on Computational Photography (ICCP) 1&#x2013;12 (IEEE, 2021).\" href=\"#ref-CR22\" id=\"ref-link-section-d181470754e1325_4\">22<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 23\" title=\"Sinha, A., Lee, J., Li, S. &amp; Barbastathis, G. Lensless computational imaging through deep learning. Optica 4, 1117 (2017).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR23\" id=\"ref-link-section-d181470754e1328\" rel=\"nofollow noopener\" target=\"_blank\">23<\/a>. Differentiability also has the potential to improve solutions to inverse problems in optics. Traditional inverse problem approaches simplify both the sample and the optics<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Fienup, J. R. Iterative method applied to image reconstruction and to computer-generated holograms. In Proc. Applications of Digital Image Processing III (ed. Tescher, A. G.) (SPIE, 1979).\" href=\"#ref-CR33\" id=\"ref-link-section-d181470754e1332\">33<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Gerchberg, R. A practical algorithm for the determination of phase from image and diffraction plane pictures. Optik 35, 237&#x2013;246 (1972).\" href=\"#ref-CR34\" id=\"ref-link-section-d181470754e1332_1\">34<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Beck, A. &amp; Teboulle, M. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM J. Imaging Sci. 2, 183&#x2013;202 (2009).\" href=\"#ref-CR35\" id=\"ref-link-section-d181470754e1332_2\">35<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 36\" title=\"Boyd, S. Distributed optimization and statistical learning via the alternating direction method of multipliers. Found. Trends Mach. Learn. 3, 1&#x2013;122 (2010).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR36\" id=\"ref-link-section-d181470754e1335\" rel=\"nofollow noopener\" target=\"_blank\">36<\/a>, whereas differentiable models can handle more realistic complexity. Automatic differentiation opens up a new class of gradient-based optimizers such as Adam<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 37\" title=\"Kingma, D. P. &amp; Ba, J. Adam: a method for stochastic optimization. Preprint at &#010;                http:\/\/arxiv.org\/abs\/1412.6980&#010;                &#010;               (2014).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR37\" id=\"ref-link-section-d181470754e1339\" rel=\"nofollow noopener\" target=\"_blank\">37<\/a>, which can improve reconstruction fidelity by allowing arbitrarily complex physics simulations (for example, scattering<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 16\" title=\"Chowdhury, S. et al. High-resolution 3D refractive index microscopy of multiple-scattering samples from intensity images. Optica 6, 1211&#x2013;1219 (2019).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR16\" id=\"ref-link-section-d181470754e1343\" rel=\"nofollow noopener\" target=\"_blank\">16<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 38\" title=\"Mu, S. et al. Multislice computational model for birefringent scattering. Optica 10, 81 (2023).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR38\" id=\"ref-link-section-d181470754e1346\" rel=\"nofollow noopener\" target=\"_blank\">38<\/a> or sample deformation<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 39\" title=\"Cao, R., Divekar, N. S., Nu&#xF1;ez, J. K., Upadhyayula, S. &amp; Waller, L. Neural space-time model for dynamic multi-shot imaging. Nat. Methods 21, 2336&#x2013;2341 (2024).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR39\" id=\"ref-link-section-d181470754e1350\" rel=\"nofollow noopener\" target=\"_blank\">39<\/a>) in the forward simulation. These benefits come at nearly zero programmer effort with automatic differentiation: once the forward model of the simulation has been defined, its gradients are automatically defined as well. Thus, automatic differentiation can also enable so-called self-calibrating algorithms<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 40\" title=\"Cao, R., Kellman, M., Ren, D., Eckert, R. &amp; Waller, L. Self-calibrated 3D differential phase contrast microscopy with optimized illumination. Biomed. Opt. Express 13, 1671&#x2013;1684 (2022).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR40\" id=\"ref-link-section-d181470754e1355\" rel=\"nofollow noopener\" target=\"_blank\">40<\/a>. As hardware has a finite accuracy, optimizing certain physical parameters (such as angle of illumination in tomography) together with the sample has been shown to improve fidelity<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 41\" title=\"R&#xFC;ckert, D., Wang, Y., Li, R., Idoughi, R. &amp; Heidrich, W. NeAT: neural adaptive tomography. ACM Trans. Graph. 41, 1&#x2013;13 (2022).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR41\" id=\"ref-link-section-d181470754e1359\" rel=\"nofollow noopener\" target=\"_blank\">41<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 42\" title=\"Peng, Y., Choi, S., Padmanaban, N. &amp; Wetzstein, G. Neural holography with camera-in-the-loop training. ACM Trans. Graph. 39, 1&#x2013;14 (2020).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR42\" id=\"ref-link-section-d181470754e1362\" rel=\"nofollow noopener\" target=\"_blank\">42<\/a>.<\/p>\n<p>A different line of work replaces discrete voxel-based representations with neural network-based continuous representations, a concept known as implicit neural representations (INRs) or neural radiance fields<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 39\" title=\"Cao, R., Divekar, N. S., Nu&#xF1;ez, J. K., Upadhyayula, S. &amp; Waller, L. Neural space-time model for dynamic multi-shot imaging. Nat. Methods 21, 2336&#x2013;2341 (2024).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR39\" id=\"ref-link-section-d181470754e1369\" rel=\"nofollow noopener\" target=\"_blank\">39<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Kang, I., Zhang, Q., Yu, S. X. &amp; Ji, N. Coordinate-based neural representations for computational adaptive optics in widefield microscopy. Nat. Mach. Intell. 6, 714&#x2013;725 (2024).\" href=\"#ref-CR43\" id=\"ref-link-section-d181470754e1372\">43<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Feng, B. Y. et al. NeuWS: neural wavefront shaping for guidestar-free imaging through static and dynamic scattering media. Sci. Adv. 9, eadg4671 (2023).\" href=\"#ref-CR44\" id=\"ref-link-section-d181470754e1372_1\">44<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 45\" title=\"Mildenhall, B. et al. NeRF: representing scenes as neural radiance fields for view synthesis. Commun. ACM 65, 99&#x2013;106 (2022).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR45\" id=\"ref-link-section-d181470754e1375\" rel=\"nofollow noopener\" target=\"_blank\">45<\/a>. INRs have been applied to separation of motion artifacts from sample dynamics<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 39\" title=\"Cao, R., Divekar, N. S., Nu&#xF1;ez, J. K., Upadhyayula, S. &amp; Waller, L. Neural space-time model for dynamic multi-shot imaging. Nat. Methods 21, 2336&#x2013;2341 (2024).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR39\" id=\"ref-link-section-d181470754e1379\" rel=\"nofollow noopener\" target=\"_blank\">39<\/a>, estimation of dynamic aberrations<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 44\" title=\"Feng, B. Y. et al. NeuWS: neural wavefront shaping for guidestar-free imaging through static and dynamic scattering media. Sci. Adv. 9, eadg4671 (2023).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR44\" id=\"ref-link-section-d181470754e1383\" rel=\"nofollow noopener\" target=\"_blank\">44<\/a>, reconstruction of 3D quantitative phase of scattering samples<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 46\" title=\"Liu, R., Sun, Y., Zhu, J., Tian, L. &amp; Kamilov, U. S. Recovery of continuous 3D refractive index maps from discrete intensity-only measurements using neural fields. Nat. Mach. Intell. 4, 781&#x2013;791 (2022).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR46\" id=\"ref-link-section-d181470754e1387\" rel=\"nofollow noopener\" target=\"_blank\">46<\/a> and aberration correction without wavefront sensors or calibration measurements<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 43\" title=\"Kang, I., Zhang, Q., Yu, S. X. &amp; Ji, N. Coordinate-based neural representations for computational adaptive optics in widefield microscopy. Nat. Mach. Intell. 6, 714&#x2013;725 (2024).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR43\" id=\"ref-link-section-d181470754e1391\" rel=\"nofollow noopener\" target=\"_blank\">43<\/a>. Here too, differentiable simulations are required to train these networks.<\/p>\n<p>Composability<\/p>\n<p>The principle underlying differentiability is composability: the gradient of a composition of two functions can be calculated from the gradient of each of those functions. Taking a broader and more practical view, we can interpret composability as being able to easily swap and replace components of a network, for example replacing the activation function in a multilayer perceptron, without requiring changes to the rest of the system. This composability is possible due to standardization in the field of machine learning, which enables machine learning researchers to conveniently incorporate their colleagues\u2019 advances by quickly replacing a function rather than having to rewrite their code from scratch. The field of optics stands in stark contrast: implementations are often project-specific, each with their own conventions and quirks, and a baseline to compare these codes to with respect to accuracy and speed does not exist. This practice is time-consuming, error-prone and makes reproducing results challenging. Chromatix proposes a standard for wave-optics simulations to enable composition of a wide array of optical models (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig1\" rel=\"nofollow noopener\" target=\"_blank\">1<\/a>). The experiments presented in this paper all share a common, well-tested codebase and many more components are available in our documentation. We believe that the existence of both a standard library and baseline implementations can substantially speed up research and make it more reproducible.<\/p>\n<p><b id=\"Fig1\" class=\"c-article-section__figure-caption\" data-test=\"figure-caption-text\">Fig. 1: The design and components of Chromatix.<\/b><img decoding=\"async\" aria-describedby=\"figure-1-desc ai-alt-disclaimer-figure-1-1\" src=\"https:\/\/www.europesays.com\/ie\/wp-content\/uploads\/2026\/06\/41592_2026_3121_Fig1_HTML.png\" alt=\"Fig. 1: The design and components of Chromatix.\" loading=\"lazy\" width=\"685\" height=\"618\"\/>The alternative text for this image may have been generated using AI.<\/p>\n<p><b>a<\/b>, Chromatix combines wave-optics models, GPU acceleration and differentiability in a single library, providing a unified modeling framework to allow a wide range of applications. <b>b<\/b>, Chromatix implements a wide range of optical elements such as lenses, sensors, free-space propagation models for scalar and vectorial waves<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Heintzmann, R., Loetgering, L. &amp; Wechsler, F. Scalable angular spectrum propagation. Optica 10, 1407&#x2013;1416 (2023).\" href=\"#ref-CR70\" id=\"ref-link-section-d181470754e1423\">70<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Matsushima, K. &amp; Shimobaba, T. Band-limited angular spectrum method for numerical simulation of free-space propagation in far and near fields. Opt. Express 17, 19662&#x2013;19673 (2009).\" href=\"#ref-CR71\" id=\"ref-link-section-d181470754e1423_1\">71<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 72\" title=\"Goodman, J. W. Introduction to Fourier Optics (W.H. Freeman, 2005).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR72\" id=\"ref-link-section-d181470754e1426\" rel=\"nofollow noopener\" target=\"_blank\">72<\/a> and complex scattering samples<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 16\" title=\"Chowdhury, S. et al. High-resolution 3D refractive index microscopy of multiple-scattering samples from intensity images. Optica 6, 1211&#x2013;1219 (2019).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR16\" id=\"ref-link-section-d181470754e1430\" rel=\"nofollow noopener\" target=\"_blank\">16<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 38\" title=\"Mu, S. et al. Multislice computational model for birefringent scattering. Optica 10, 81 (2023).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR38\" id=\"ref-link-section-d181470754e1433\" rel=\"nofollow noopener\" target=\"_blank\">38<\/a>. <b>c<\/b>, These elements can be combined to simulate a wide variety of experimental systems and solve a wide range of problems in computational optics. Green highlighted elements indicate the element or sample that would be optimized in each application. DMD, digital micromirror device; SLM, spatial light modulator; f, focal length; zn, propagation distance.<\/p>\n<p>Scalability<\/p>\n<p>Optics is moving to ever larger fields of view (FOVs) and higher resolutions, sometimes requiring large compute clusters for sample reconstruction. A key requirement for new optics simulations is thus the ability to scale; researchers may want to run code on laptops for quick prototyping, but also easily scale up to GPU-clusters for large-scale sample reconstruction. Previous popular programming environments have made this difficult: NumPy runs only on central processing units<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 47\" title=\"Harris et al. Array programming with NumPy. Nature 585, 357&#x2013;362 (2020).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR47\" id=\"ref-link-section-d181470754e1466\" rel=\"nofollow noopener\" target=\"_blank\">47<\/a>; MATLAB requires specific code for GPU usage and does not support general-purpose automatic differentiation; PyTorch<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 24\" title=\"Paszke, A. et al. PyTorch: an imperative style, high-performance deep learning library. In Proc. 33rd International Conference on Neural Information Processing Systems, 721 (Curran Associates, 2019).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR24\" id=\"ref-link-section-d181470754e1470\" rel=\"nofollow noopener\" target=\"_blank\">24<\/a>\/TensorFlow<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 25\" title=\"Abadi, M. et al. TensorFlow: a system for large-scale machine learning. In Proc. 12th USENIX conference on Operating Systems Design and Implementation 265&#x2013;283 (USENIX, 2016).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR25\" id=\"ref-link-section-d181470754e1474\" rel=\"nofollow noopener\" target=\"_blank\">25<\/a> make writing GPU code with automatic differentiation relatively easy but it can be tricky to support multiple GPUs (both PyTorch and TensorFlow) or achieve good performance for typical operations in optical simulation that differ greatly from typical operations in neural networks (PyTorch). Writing device-specific programs for simulations requires substantial effort and calcifies their capabilities, which is not appropriate for the fast iteration demanded by scientific research. Chromatix instead relies on JAX<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 26\" title=\"Bradbury, J. et al. JAX: composable transformations of Python+NumPy programs. GitHub &#010;                http:\/\/github.com\/jax-ml\/jax&#010;                &#010;               (2018).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR26\" id=\"ref-link-section-d181470754e1478\" rel=\"nofollow noopener\" target=\"_blank\">26<\/a> and its underlying XLA (accelerated linear algebra) compiler to support fast optical simulation on central processing units, GPUs and tensor processing units with only a single implementation (and without requiring custom lower level GPU code for fast operations as in PyTorch<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 24\" title=\"Paszke, A. et al. PyTorch: an imperative style, high-performance deep learning library. In Proc. 33rd International Conference on Neural Information Processing Systems, 721 (Curran Associates, 2019).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR24\" id=\"ref-link-section-d181470754e1482\" rel=\"nofollow noopener\" target=\"_blank\">24<\/a>). JAX also offers several functions to automatically vectorize code (that is, parallelize a batch on a single GPU) or parallelize over multiple GPUs, independently of the description of the optical elements in an optical system<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 26\" title=\"Bradbury, J. et al. JAX: composable transformations of Python+NumPy programs. GitHub &#010;                http:\/\/github.com\/jax-ml\/jax&#010;                &#010;               (2018).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR26\" id=\"ref-link-section-d181470754e1487\" rel=\"nofollow noopener\" target=\"_blank\">26<\/a>. For example, with only a couple of lines of changes to the code we can scale a two-dimensional (2D), single-wavelength simulation to a 3D, multi-wavelength simulation running on multiple GPUs in parallel (see Extended Data Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig6\" rel=\"nofollow noopener\" target=\"_blank\">1<\/a> for code examples).<\/p>\n<p>Implementation<\/p>\n<p>In deep learning frameworks, these principles manifest themselves as models consisting of sequences of deep learning operations (layers). We observe a clear correspondence to optics, where optical systems consist of a sequence of optical elements and propagations. A key difference, however, is that the \u2018hidden state\u2019 of an optical system has a clear physical meaning: it is the complex light field moving through the system. To completely describe this field, and thus the state of the system at any time, additional information, such as the wavelength, polarization and spatial sampling, is required. The core idea behind Chromatix is that all this information can be encoded in a single, fundamental structure. Any optical element can then be written as a transformation of this structured field, and any optical system as a sequence of these elements. This allows Chromatix to model a wide variety of optical systems under a unified interface, which makes extending its capabilities straightforward.<\/p>\n<p>Experiments<\/p>\n<p>We present six computational experiments demonstrating four major features of Chromatix: solving inverse problems to reconstruct samples, accelerating reconstruction and optical design using deep learning, composing modular optical elements and models in arbitrary ways, and scaling optical simulation speed by an order of magnitude. To do this, we showcase both reproductions of existing computational methods in optics that rely on wave models as well as in silico demonstrations of solving inverse problems in underexplored combinations of optical phenomena.<\/p>\n<p>Inverse problems for reconstructing samples<\/p>\n<p>A microscope\u2019s aberrations are usually assumed to be spatially invariant due to the calibration and simulation complexity of simulating and measuring field-varying PSFs, respectively. One research group<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 48\" title=\"Kohli, A. et al. Ring deconvolution microscopy: an exact solution for spatially-varying aberration correction. Nat. Methods 22, 1311&#x2013;1320 (2025).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR48\" id=\"ref-link-section-d181470754e1519\" rel=\"nofollow noopener\" target=\"_blank\">48<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 49\" title=\"Whang, E., McAllister, D., Reddy, A., Kohli, A. &amp; Waller, L. SeidelNet: an aberration-informed deep learning model for spatially varying deblurring. In Proc. AI and Optical Data Sciences IV (eds Kitayama, K.-I. &amp; Jalali, B.) Vol. 12438, 276&#x2013;281 (SPIE, 2023).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR49\" id=\"ref-link-section-d181470754e1522\" rel=\"nofollow noopener\" target=\"_blank\">49<\/a> argued that most imaging systems are rotationally equivariant due to the rotational symmetry of many optical elements, and that many common aberrations therefore vary only along the radius away from the center of the FOV, up to a rotation. Measuring only the variation of aberrations along this radial dependence requires substantially less calibration time and is much more efficient to model (linear versus quadratic scaling with the number of rows of the camera sensor). This efficiency enables tractable deconvolution of spatially varying aberrations. The researchers introduced \u2018ring deconvolution microscopy\u2019<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 48\" title=\"Kohli, A. et al. Ring deconvolution microscopy: an exact solution for spatially-varying aberration correction. Nat. Methods 22, 1311&#x2013;1320 (2025).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR48\" id=\"ref-link-section-d181470754e1526\" rel=\"nofollow noopener\" target=\"_blank\">48<\/a>, which models a spatially varying aberrated PSF efficiently by exploiting the rotational invariance present in many standard microscopes using incoherently illuminated samples or fluorescent samples emitting incoherent light. We implemented this ring deconvolution method in Chromatix (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig2\" rel=\"nofollow noopener\" target=\"_blank\">2b<\/a>) for UCLA (University of California, Los Angeles) Miniscope<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 50\" title=\"Ghosh, K. K. et al. Miniaturized integration of a fluorescence microscope. Nat. Methods 8, 871&#x2013;878 (2011).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR50\" id=\"ref-link-section-d181470754e1533\" rel=\"nofollow noopener\" target=\"_blank\">50<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 51\" title=\"Cai, D. J. et al. A shared neural ensemble links distinct contextual memories encoded close in time. Nature 534, 115&#x2013;118 (2016).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR51\" id=\"ref-link-section-d181470754e1536\" rel=\"nofollow noopener\" target=\"_blank\">51<\/a> data from a miniature widefield microscope. The microscope is modeled as a 4f optical system with rotationally invariant Seidel aberrations in the Fourier plane. After estimating Seidel coefficients from calibration images<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 48\" title=\"Kohli, A. et al. Ring deconvolution microscopy: an exact solution for spatially-varying aberration correction. Nat. Methods 22, 1311&#x2013;1320 (2025).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR48\" id=\"ref-link-section-d181470754e1540\" rel=\"nofollow noopener\" target=\"_blank\">48<\/a>, the measured image of the sample is deconvolved using this rotationally invariant but spatially varying model of the PSF.<\/p>\n<p><b id=\"Fig2\" class=\"c-article-section__figure-caption\" data-test=\"figure-caption-text\">Fig. 2: Chromatix solves inverse problems in multiple types of sample and sample representation.<\/b><img decoding=\"async\" aria-describedby=\"figure-2-desc ai-alt-disclaimer-figure-2-1\" src=\"https:\/\/www.europesays.com\/ie\/wp-content\/uploads\/2026\/06\/41592_2026_3121_Fig2_HTML.png\" alt=\"Fig. 2: Chromatix solves inverse problems in multiple types of sample and sample representation.\" loading=\"lazy\" width=\"685\" height=\"700\"\/>The alternative text for this image may have been generated using AI.<\/p>\n<p><b>a<\/b>, Sample type and representation for ring deconvolution microscopy. <b>b<\/b>, Implementation of ring deconvolution microscopy following ref. <a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 48\" title=\"Kohli, A. et al. Ring deconvolution microscopy: an exact solution for spatially-varying aberration correction. Nat. Methods 22, 1311&#x2013;1320 (2025).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR48\" id=\"ref-link-section-d181470754e1562\" rel=\"nofollow noopener\" target=\"_blank\">48<\/a>. <b>c<\/b>\u2013<b>f<\/b>, Highlighted regions show zoomed in cutouts from the center (red) and edge (blue) of the FOV on the bottom row. These images have been corrected to reduce vignetting for display purposes. Uncorrected images are shown in Extended Data Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig7\" rel=\"nofollow noopener\" target=\"_blank\">2<\/a>. Measured image of incoherently illuminated rabbit liver <b>c<\/b> from a Miniscope with a gradient index lens without correction of spatially varying aberrations across the FOV. <b>d<\/b>, Spatially invariant (standard) deconvolution of the same FOV. <b>e<\/b>,<b>f<\/b>, Chromatix rotationally invariant deconvolution of the same FOV (<b>e<\/b>) and the original PyTorch rotationally invariant deconvolution that does not parallelize and cannot fit the whole FOV on 1 H100 GPU (80\u2009GB of memory) (<b>f<\/b>). <b>g<\/b>, Sample type and representation for computational aberration correction using implicit neural networks. <b>h<\/b>, CoCoA self-supervised framework implementation using coordinate-based implicit neural networks for simultaneous aberration inference and 3D sample reconstruction from a single 3D measurement. <b>i<\/b>\u2013<b>k<\/b>, Visual comparisons showing a maximum projection of a 4-\u00b5m slice from a raw aberrated measurement (<b>i<\/b>), original implementation reconstruction using PyTorch (<b>j<\/b>) and Chromatix reconstruction of the same dendrite (<b>k<\/b>). <b>l<\/b>\u2013<b>n<\/b>, Validation of aberration recovery showing the true measured wavefront using direct wavefront sensing (<b>l<\/b>), inferred aberration from original PyTorch implementation (<b>m<\/b>) and Chromatix inference of the aberration (<b>n<\/b>). <b>o<\/b>, Sample type and representation for 3D refractive index microscopy. <b>p<\/b>, Refractive index microscopy to recover the 3D refractive index distribution of a strongly scattering sample from intensity measurements. <b>q<\/b>\u2013<b>s<\/b>, Raw measurements (<b>q<\/b>) from multiple angles of coherent illumination are used to reconstruct the full 3D refractive index map of the tail of a D. rerio embryo at 24\u2009hpf, demonstrated by the original MATLAB reconstruction of refractive index maximum projection (<b>r<\/b>) and the Chromatix reconstruction maximum projection (<b>s<\/b>). <b>t<\/b>,<b>u<\/b>, Slices through the full volume (colored borders denote slice regions) are shown to highlight the reduced grid artifacts in the Chromatix reconstruction (<b>u<\/b>(i), <b>u<\/b>(ii)) compared with the original MATLAB reconstruction (<b>t<\/b>(ii), <b>t<\/b>(ii)). For all panels, green highlights denote optimized parameters and dashed gray arrows denote propagation of gradients during iterative optimization.<\/p>\n<p>We show, respectively, the measured image of incoherently illuminated rabbit liver, ring deconvolution using Chromatix that recovers detail across the whole FOV, standard deconvolution that only recovers detail in the center of the FOV and ring deconvolution from the original implementation<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 48\" title=\"Kohli, A. et al. Ring deconvolution microscopy: an exact solution for spatially-varying aberration correction. Nat. Methods 22, 1311&#x2013;1320 (2025).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR48\" id=\"ref-link-section-d181470754e1688\" rel=\"nofollow noopener\" target=\"_blank\">48<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 49\" title=\"Whang, E., McAllister, D., Reddy, A., Kohli, A. &amp; Waller, L. SeidelNet: an aberration-informed deep learning model for spatially varying deblurring. In Proc. AI and Optical Data Sciences IV (eds Kitayama, K.-I. &amp; Jalali, B.) Vol. 12438, 276&#x2013;281 (SPIE, 2023).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR49\" id=\"ref-link-section-d181470754e1691\" rel=\"nofollow noopener\" target=\"_blank\">49<\/a> (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig2\" rel=\"nofollow noopener\" target=\"_blank\">2c\u2013f<\/a> and Extended Data Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig7\" rel=\"nofollow noopener\" target=\"_blank\">2<\/a>). Note that, compared with the original implementation, our reconstruction has a substantially larger FOV; our implementation was able to reconstruct a larger image by parallelizing across multiple GPUs. The original implementation fails to reconstruct the entire FOV of the camera (without suffering substantial degradation in reconstruction speed) due to overflowing the memory limitations of a single GPU (48\u2009GB for an RTX 8000 or 80\u2009GB for an H100). Chromatix\u2019s implementation is also substantially faster, showing a 4.5\u00d7 speedup versus the original PyTorch implementation on a single GPU and scaling up to almost 19\u00d7 when using 8 GPUs (below).<\/p>\n<p>In addition to voxel grids, Chromatix also enables INRs that in some cases improve the optimization loss landscape<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 44\" title=\"Feng, B. Y. et al. NeuWS: neural wavefront shaping for guidestar-free imaging through static and dynamic scattering media. Sci. Adv. 9, eadg4671 (2023).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR44\" id=\"ref-link-section-d181470754e1704\" rel=\"nofollow noopener\" target=\"_blank\">44<\/a>. CoCoA (coordinate-based neural representations for computational adaptive optics)<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 43\" title=\"Kang, I., Zhang, Q., Yu, S. X. &amp; Ji, N. Coordinate-based neural representations for computational adaptive optics in widefield microscopy. Nat. Mach. Intell. 6, 714&#x2013;725 (2024).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR43\" id=\"ref-link-section-d181470754e1708\" rel=\"nofollow noopener\" target=\"_blank\">43<\/a> jointly reconstructs the sample (represented as an INR) and the aberrations (represented as Zernike coefficients) in a self-supervised fashion, as shown by the Chromatix implementation of the CoCoA method (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig2\" rel=\"nofollow noopener\" target=\"_blank\">2g,h<\/a>). Contrary to the previous section, the aberrations here are modeled as spatially invariant and the sample emits incoherent fluorescent light, rather than transmitting incoherent illumination. We show a maximum intensity projection of a 4-\u00b5m slice through a measured widefield mouse neuron volume, the reconstruction of the unaberrated sample from the original implementation and finally the reconstruction using Chromatix (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig2\" rel=\"nofollow noopener\" target=\"_blank\">2i\u2013k<\/a>). We note that the Chromatix implementation retains more uniform dendrites that become spotted in the original implementation. Chromatix is also twice as fast at performing the reconstruction when using a single GPU, or almost 9\u00d7 faster when using 8 GPUs (below). Further, on a fluorescent bead dataset with controlled, intentional aberrations provided in ref. <a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 43\" title=\"Kang, I., Zhang, Q., Yu, S. X. &amp; Ji, N. Coordinate-based neural representations for computational adaptive optics in widefield microscopy. Nat. Mach. Intell. 6, 714&#x2013;725 (2024).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR43\" id=\"ref-link-section-d181470754e1718\" rel=\"nofollow noopener\" target=\"_blank\">43<\/a>, the Chromatix implementation recovers the applied Zernike mode coefficients with a root-mean-square (r.m.s.) of 3.56\u2009nm versus an r.m.s. of 6.97\u2009nm for the original implementation<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 43\" title=\"Kang, I., Zhang, Q., Yu, S. X. &amp; Ji, N. Coordinate-based neural representations for computational adaptive optics in widefield microscopy. Nat. Mach. Intell. 6, 714&#x2013;725 (2024).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR43\" id=\"ref-link-section-d181470754e1723\" rel=\"nofollow noopener\" target=\"_blank\">43<\/a> (r.m.s. is computed on the three nonzero Zernike modes that were used to intentionally aberrate the system; Extended Data Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig8\" rel=\"nofollow noopener\" target=\"_blank\">3<\/a>).<\/p>\n<p>The loss of detail in the original implementation may be mitigated by increasing the number of layers of the INR as reported in ref. <a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 43\" title=\"Kang, I., Zhang, Q., Yu, S. X. &amp; Ji, N. Coordinate-based neural representations for computational adaptive optics in widefield microscopy. Nat. Mach. Intell. 6, 714&#x2013;725 (2024).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR43\" id=\"ref-link-section-d181470754e1733\" rel=\"nofollow noopener\" target=\"_blank\">43<\/a>, but here we compare reconstructions using identical network architectures. The Chromatix implementation uses a paraxial approximation for the field at the pupil plane while the original implementation in ref. <a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 43\" title=\"Kang, I., Zhang, Q., Yu, S. X. &amp; Ji, N. Coordinate-based neural representations for computational adaptive optics in widefield microscopy. Nat. Mach. Intell. 6, 714&#x2013;725 (2024).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR43\" id=\"ref-link-section-d181470754e1737\" rel=\"nofollow noopener\" target=\"_blank\">43<\/a> mixes the exact model for the field at the pupil (requiring a higher sampling rate to avoid aliasing the propagation kernel) with a paraxial approximation of the second lens of the 4f system. In this case, the fully paraxial approximation used by Chromatix results in an improved reconstruction of the dendrite (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig2\" rel=\"nofollow noopener\" target=\"_blank\">2i\u2013k<\/a>). This demonstration highlights not only our increased performance but also the utility provided by a standard set of models such as Chromatix when faced with the potential for model mismatch.<\/p>\n<p>The research team in ref. <a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 16\" title=\"Chowdhury, S. et al. High-resolution 3D refractive index microscopy of multiple-scattering samples from intensity images. Optica 6, 1211&#x2013;1219 (2019).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR16\" id=\"ref-link-section-d181470754e1748\" rel=\"nofollow noopener\" target=\"_blank\">16<\/a> showed that computational imaging could also quantitatively recover the 3D refractive index distribution of strongly scattering samples (that is, beyond the first Born approximation) from intensity measurements, a quantity otherwise inaccessible to conventional widefield light microscopy. The sample (the tail of a D. rerio embryo 24\u2009hours postfertilization (hpf)) is coherently illuminated at different angles<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 17\" title=\"Yang, S., Kim, J., Swartz, M. E., Eberhart, J. K. &amp; Chowdhury, S. DMD and microlens array as a switchable module for illumination angle scanning in optical diffraction tomography. Biomed. Opt. Express 15, 5932&#x2013;5946 (2024).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR17\" id=\"ref-link-section-d181470754e1755\" rel=\"nofollow noopener\" target=\"_blank\">17<\/a>, and the refractive index (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig2\" rel=\"nofollow noopener\" target=\"_blank\">2r<\/a>) is recovered by matching the measurements (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig2\" rel=\"nofollow noopener\" target=\"_blank\">2q<\/a>) to a differentiable simulation (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig2\" rel=\"nofollow noopener\" target=\"_blank\">2p<\/a>) of imaging through the scattering sample. Typical samples are beyond the single-scattering regime and are hence modeled using a multislice approach<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 52\" title=\"Paganin, D. M. &amp; Pelliccia, D. Tutorials on X-ray phase contrast imaging: some fundamentals and some conjectures on future developments. Preprint at &#010;                http:\/\/arxiv.org\/abs\/1902.00364&#010;                &#010;               (2019).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR52\" id=\"ref-link-section-d181470754e1769\" rel=\"nofollow noopener\" target=\"_blank\">52<\/a>. While we use exactly the same forward model as the original MATLAB implementation<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 17\" title=\"Yang, S., Kim, J., Swartz, M. E., Eberhart, J. K. &amp; Chowdhury, S. DMD and microlens array as a switchable module for illumination angle scanning in optical diffraction tomography. Biomed. Opt. Express 15, 5932&#x2013;5946 (2024).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR17\" id=\"ref-link-section-d181470754e1773\" rel=\"nofollow noopener\" target=\"_blank\">17<\/a>, our implementation is 3\u201313\u00d7 faster than the original implementation on equivalent volumes (bringing reconstruction time from hours to minutes). Our implementation is also far fewer lines of code (approximately 25 lines for a differentiable simulation in Chromatix versus approximately 107 lines in the original implementation<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 16\" title=\"Chowdhury, S. et al. High-resolution 3D refractive index microscopy of multiple-scattering samples from intensity images. Optica 6, 1211&#x2013;1219 (2019).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR16\" id=\"ref-link-section-d181470754e1777\" rel=\"nofollow noopener\" target=\"_blank\">16<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 17\" title=\"Yang, S., Kim, J., Swartz, M. E., Eberhart, J. K. &amp; Chowdhury, S. DMD and microlens array as a switchable module for illumination angle scanning in optical diffraction tomography. Biomed. Opt. Express 15, 5932&#x2013;5946 (2024).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR17\" id=\"ref-link-section-d181470754e1780\" rel=\"nofollow noopener\" target=\"_blank\">17<\/a>) and more flexible compared with the original implementation with respect to changes in the forward model or optimization parameters due to the use of automatic differentiation. This increase in speed allows us to choose more appropriate reconstruction settings so that the large grid artifacts in the original reconstruction (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig2\" rel=\"nofollow noopener\" target=\"_blank\">2r<\/a>) are removed in the Chromatix reconstruction (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig2\" rel=\"nofollow noopener\" target=\"_blank\">2s<\/a>).<\/p>\n<p>Programmable optics and deep learning<\/p>\n<p>The commercial availability of SLMs has made fine-grained control of light possible through millions of controllable pixels. These degrees of freedom are often used for holography but can also be used to design a PSF for a specific purpose<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 53\" title=\"Shechtman, Y., Sahl, S. J., Backer, A. S. &amp; Moerner, W. E. Optimal point spread function design for 3D imaging. Phys. Rev. Lett. 113, 133902 (2014).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR53\" id=\"ref-link-section-d181470754e1798\" rel=\"nofollow noopener\" target=\"_blank\">53<\/a>, such as volumetric snapshot imaging for fluorescent 3D samples. The dimensionality of this optimization problem requires gradient-based optimization to be effectively solved and is well-suited to GPU acceleration. One research group<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 3\" title=\"Deb, D. et al. FourierNets enable the design of highly non-local optical encoders for computational imaging. Neural Inf. Proc. Syst. 35, 25224&#x2013;25236 (2022).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR3\" id=\"ref-link-section-d181470754e1802\" rel=\"nofollow noopener\" target=\"_blank\">3<\/a> introduced a deep learning method for engineering 3D snapshot PSFs that combined a programmable microscope design (the Holoscope) with a neural network to reconstruct fluorescent 3D volumes from 2D snapshot images taken by the microscope (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig3\" rel=\"nofollow noopener\" target=\"_blank\">3a<\/a>). The parameters of the neural network along with the pixels of the programmable phase mask implemented by an SLM are jointly optimized using a differentiable simulation of the microscope. In this snapshot microscope, the PSF essentially acts as a compression function from the 3D volume to the 2D image. The volume is then reconstructed from this image using a FourierNet neural network, so that structural priors of the sample type can be taken advantage of by both the optics and the computational reconstruction algorithm.<\/p>\n<p><b id=\"Fig3\" class=\"c-article-section__figure-caption\" data-test=\"figure-caption-text\">Fig. 3: Chromatix enables deep learning for optical design and acceleration of inverse problems.<\/b><img decoding=\"async\" aria-describedby=\"figure-3-desc ai-alt-disclaimer-figure-3-1\" src=\"https:\/\/www.europesays.com\/ie\/wp-content\/uploads\/2026\/06\/41592_2026_3121_Fig3_HTML.png\" alt=\"Fig. 3: Chromatix enables deep learning for optical design and acceleration of inverse problems.\" loading=\"lazy\" width=\"685\" height=\"642\"\/>The alternative text for this image may have been generated using AI.<\/p>\n<p><b>a<\/b>, Holoscope3 implementation in Chromatix showing a programmable 3D snapshot microscope, compressing volumetric information into a 2D representation with subsequent FourierNet reconstruction. <b>b<\/b>\u2013<b>e<\/b>, Holoscope demonstration using Chromatix showing the sample-specific PSF (<b>b<\/b>), simulated 2D image of the simulated 3D sample (<b>c<\/b>) (approximately 0.01\u2009s to capture), ground truth 3D volume (<b>d<\/b>) (approximately 7.0\u2009s to capture via confocal microscopy assuming a scan speed of 100\u2009ns per voxel) and Chromatix-enabled 3D reconstruction (<b>e<\/b>) from the single simulated 2D image. <b>f<\/b>, DeepCGH architecture using a UNet and a propagation step to directly generate a hologram in a single feedforward step from target 3D patterns. <b>g<\/b>\u2013<b>l<\/b>, Demonstration of DeepCGH12 using Chromatix showing requested stimulation patterns at three planes spaced 10\u2009mm apart around the focal plane (<b>g<\/b>,<b>i<\/b>,<b>k<\/b>) and their resulting simulated intensity distributions (<b>h<\/b>,<b>j<\/b>,<b>l<\/b>). Colored insets show detail of the 3D patterns at each plane. Intensity values in <b>g<\/b>\u2013<b>l<\/b> are normalized. For all panels, green highlights denote optimized parameters of either neural networks or optical systems.<\/p>\n<p>This microscope design can therefore be programmed to function as a snapshot microscope optimized for various sample types, while using exactly the same hardware. The microscope is modeled using a 4f system with an SLM (phase mask) in the Fourier plane and is optimized for whole-brain imaging of fluorescently labeled D. rerio larvae. The PSF of the 4f system is simulated with coherent propagation, and the image is simulated as the incoherent sum of these PSFs that is efficiently implemented as a convolution of the PSF and the sample intensity. We show the learned PSF (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig3\" rel=\"nofollow noopener\" target=\"_blank\">3b<\/a>), the simulated 2D measurement of a virtual zebrafish volume (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig3\" rel=\"nofollow noopener\" target=\"_blank\">3c<\/a>) and the ground truth volume and simulated reconstruction<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 3\" title=\"Deb, D. et al. FourierNets enable the design of highly non-local optical encoders for computational imaging. Neural Inf. Proc. Syst. 35, 25224&#x2013;25236 (2022).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR3\" id=\"ref-link-section-d181470754e1896\" rel=\"nofollow noopener\" target=\"_blank\">3<\/a> (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig3\" rel=\"nofollow noopener\" target=\"_blank\">3d,e<\/a>). Chromatix reproduces the original results<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 3\" title=\"Deb, D. et al. FourierNets enable the design of highly non-local optical encoders for computational imaging. Neural Inf. Proc. Syst. 35, 25224&#x2013;25236 (2022).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR3\" id=\"ref-link-section-d181470754e1904\" rel=\"nofollow noopener\" target=\"_blank\">3<\/a> nearly exactly: on a test set of 10 volumes and their simulated images, reconstruction networks trained with identical PSFs offer a structure similarity index measure on a test set of 10 volumes of 0.979\u2009\u00b1\u20090.003 (mean\u2009\u00b1\u2009standard error; higher is better) for both Chromatix and the original implementation<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 3\" title=\"Deb, D. et al. FourierNets enable the design of highly non-local optical encoders for computational imaging. Neural Inf. Proc. Syst. 35, 25224&#x2013;25236 (2022).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR3\" id=\"ref-link-section-d181470754e1908\" rel=\"nofollow noopener\" target=\"_blank\">3<\/a> (not significantly different at P\u2009=\u20090.695 via two-sided t-test, Extended Data Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig9\" rel=\"nofollow noopener\" target=\"_blank\">4<\/a>). Chromatix also outperforms the original implementation<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 3\" title=\"Deb, D. et al. FourierNets enable the design of highly non-local optical encoders for computational imaging. Neural Inf. Proc. Syst. 35, 25224&#x2013;25236 (2022).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR3\" id=\"ref-link-section-d181470754e1921\" rel=\"nofollow noopener\" target=\"_blank\">3<\/a> in training speed by a factor of approximately 7\u00d7 (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig5\" rel=\"nofollow noopener\" target=\"_blank\">5<\/a>). Practically, this reduces the optimization time for a single PSF from weeks to days.<\/p>\n<p>SLMs also enable computer-generated holography systems for optogenetics, where 3D holographic stimulation patterns are used to perturb neural activity in the brain. Most holography systems rely on some form of iterative optimization (for example, refs. <a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 33\" title=\"Fienup, J. R. Iterative method applied to image reconstruction and to computer-generated holograms. In Proc. Applications of Digital Image Processing III (ed. Tescher, A. G.) (SPIE, 1979).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR33\" id=\"ref-link-section-d181470754e1932\" rel=\"nofollow noopener\" target=\"_blank\">33<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 34\" title=\"Gerchberg, R. A practical algorithm for the determination of phase from image and diffraction plane pictures. Optik 35, 237&#x2013;246 (1972).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR34\" id=\"ref-link-section-d181470754e1935\" rel=\"nofollow noopener\" target=\"_blank\">34<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 54\" title=\"Gerchberg, R. W. &amp; Saxton, W. O. Comment on &#x2018;A method for the solution of the phase problem in electron microscopy&#x2019;. J. Phys. D 6, L31&#x2013;L32 (1973).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR54\" id=\"ref-link-section-d181470754e1938\" rel=\"nofollow noopener\" target=\"_blank\">54<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 55\" title=\"Chen, C.-Y., Li, W.-C., Chang, H.-T., Chuang, C.-H. &amp; Chang, T.-J. 3-D modified Gerchberg&#x2013;Saxton algorithm developed for panoramic computer-generated phase-only holographic display. J. Opt. Soc. Am. B 34, B42&#x2013;B48 (2017).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR55\" id=\"ref-link-section-d181470754e1941\" rel=\"nofollow noopener\" target=\"_blank\">55<\/a>) to find the phase to display on the SLM. While this produces accurate solutions, iterating does become problematic when speed is paramount. For optogenetics, point cloud holography can be used to stimulate multiple neurons without iterative optimization of phase patterns, but this only allows for placing copies of a single pattern at the desired locations<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 15\" title=\"P&#xE9;gard, N. C. et al. Three-dimensional scanless holographic optogenetics with temporal focusing (3D-SHOT). Nat. Commun. 8, 1228 (2017).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR15\" id=\"ref-link-section-d181470754e1945\" rel=\"nofollow noopener\" target=\"_blank\">15<\/a>. Due to the interest in holography for displays, fast holography algorithms for arbitrary patterns have emerged that use neural networks to quickly generate a hologram given a target pattern<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 42\" title=\"Peng, Y., Choi, S., Padmanaban, N. &amp; Wetzstein, G. Neural holography with camera-in-the-loop training. ACM Trans. Graph. 39, 1&#x2013;14 (2020).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR42\" id=\"ref-link-section-d181470754e1949\" rel=\"nofollow noopener\" target=\"_blank\">42<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 56\" title=\"Peng, Y., Choi, S., Padmanaban, N., Kim, J. &amp; Wetzstein, G. Neural holography. In Proc. ACM SIGGRAPH Emerging Technologies (ACM, 2020).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR56\" id=\"ref-link-section-d181470754e1952\" rel=\"nofollow noopener\" target=\"_blank\">56<\/a>. Applied to optogenetics, DeepCGH<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 12\" title=\"Hossein Eybposh, M., Caira, N. W., Atisa, M., Chakravarthula, P. &amp; P&#xE9;gard, N. C. DeepCGH: 3D computer-generated holography using deep learning. Opt. Express 28, 26636&#x2013;26650 (2020).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR12\" id=\"ref-link-section-d181470754e1956\" rel=\"nofollow noopener\" target=\"_blank\">12<\/a> also demonstrates fast computer-generation of holograms by training a neural network to generate phase patterns from intensity images of arbitrary 3D patterns in a single feedforward inference step. We implemented DeepCGH<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 12\" title=\"Hossein Eybposh, M., Caira, N. W., Atisa, M., Chakravarthula, P. &amp; P&#xE9;gard, N. C. DeepCGH: 3D computer-generated holography using deep learning. Opt. Express 28, 26636&#x2013;26650 (2020).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR12\" id=\"ref-link-section-d181470754e1960\" rel=\"nofollow noopener\" target=\"_blank\">12<\/a> (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig3\" rel=\"nofollow noopener\" target=\"_blank\">3f<\/a>). We show the desired target patterns and resulting simulated pattern at three different depth planes using the phase pattern produced by the DeepCGH method in Chromatix (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig3\" rel=\"nofollow noopener\" target=\"_blank\">3g\u2013l<\/a>). We achieve nearly identical results to the original TensorFlow implementation: on a test set of 16 target patterns, Chromatix achieves a structure similarity index measure of 0.985\u2009\u00b1\u20090.001 (mean\u2009\u00b1\u2009standard error; higher is better) versus 0.982\u2009\u00b1\u20090.001 for the original implementation (significantly different at P\u2009=\u20090.018\u2009&lt;\u20090.05 via two-sided t-test, Extended Data Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig10\" rel=\"nofollow noopener\" target=\"_blank\">5<\/a>) and peak signal to noise ratio of 35.40\u2009\u00b1\u20090.37 (mean\u2009\u00b1\u2009standard error; higher is better) for Chromatix versus 34.95\u2009\u00b1\u20090.16 for the original implementation<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 12\" title=\"Hossein Eybposh, M., Caira, N. W., Atisa, M., Chakravarthula, P. &amp; P&#xE9;gard, N. C. DeepCGH: 3D computer-generated holography using deep learning. Opt. Express 28, 26636&#x2013;26650 (2020).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR12\" id=\"ref-link-section-d181470754e1980\" rel=\"nofollow noopener\" target=\"_blank\">12<\/a> (not significantly different at P\u2009=\u20090.177 via two-sided t-test). Our implementation is approximately 17 lines of code for a differentiable hologram simulation versus 33 lines in the original work<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 12\" title=\"Hossein Eybposh, M., Caira, N. W., Atisa, M., Chakravarthula, P. &amp; P&#xE9;gard, N. C. DeepCGH: 3D computer-generated holography using deep learning. Opt. Express 28, 26636&#x2013;26650 (2020).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR12\" id=\"ref-link-section-d181470754e1991\" rel=\"nofollow noopener\" target=\"_blank\">12<\/a>. While achieving the same quality, Chromatix provides a 2.5\u00d7 performance improvement on a single GPU, which increases to over 10\u00d7 when using 8 GPUs in parallel (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig5\" rel=\"nofollow noopener\" target=\"_blank\">5<\/a>).<\/p>\n<p>Flexible modeling with optical building blocks<\/p>\n<p>Because Chromatix models are constructed from components that can be flexibly combined (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig1\" rel=\"nofollow noopener\" target=\"_blank\">1<\/a>), we can straightforwardly construct complex optical models and also optimize them with arbitrary objective functions. We show another programmable microscope modeled as a 4f system with an SLM in the Fourier plane, followed by a neural network-based reconstruction step (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig4\" rel=\"nofollow noopener\" target=\"_blank\">4a\u2013f<\/a>). The objective in this demonstration is to optimize the PSF of this programmable microscope to perform spectroscopic single-molecule localization<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 57\" title=\"Brenner, B., Sun, C., Raymo, F. M. &amp; Zhang, H. F. Spectroscopic single-molecule localization microscopy: applications and prospective. Nano Converg. 10, 14 (2023).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR57\" id=\"ref-link-section-d181470754e2012\" rel=\"nofollow noopener\" target=\"_blank\">57<\/a> from a single snapshot image: that is, to reconstruct multicolor point sources using only a single-channel image. The simulated samples consist of several point sources incoherently emitting fluorescence at 25 wavelengths from 400\u2009nm to 650\u2009nm that are simulated in parallel using Chromatix. We train the neural network to reconstruct the multicolor sample at the corresponding 10-nm intervals, giving us a hyperspectral cube from a single-channel 2D measurement. The optimized PSF allows visual classification of the color of these point sources on a monochrome simulated camera image (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig4\" rel=\"nofollow noopener\" target=\"_blank\">4c,d<\/a>) by taking advantage of different fringe patterns for different wavelengths. The reconstruction (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig4\" rel=\"nofollow noopener\" target=\"_blank\">4f<\/a>) reasonably matches the true colors of the points in the sample (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig4\" rel=\"nofollow noopener\" target=\"_blank\">4e<\/a>). We highlight that here we are optimizing the same programmable microscope model that was used for snapshot microscopy (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig3\" rel=\"nofollow noopener\" target=\"_blank\">3a<\/a>), but for an entirely new combination of sample type and objective.<\/p>\n<p><b id=\"Fig4\" class=\"c-article-section__figure-caption\" data-test=\"figure-caption-text\">Fig. 4: Chromatix enables arbitrary combinations of optical models.<\/b><img decoding=\"async\" aria-describedby=\"figure-4-desc ai-alt-disclaimer-figure-4-1\" src=\"https:\/\/www.europesays.com\/ie\/wp-content\/uploads\/2026\/06\/41592_2026_3121_Fig4_HTML.png\" alt=\"Fig. 4: Chromatix enables arbitrary combinations of optical models.\" loading=\"lazy\" width=\"685\" height=\"588\"\/>The alternative text for this image may have been generated using AI.<\/p>\n<p><b>a<\/b>, Demonstration of PSF engineering for spectroscopic single-molecule localization microscopy using deep learning, where a neural network reconstructs both the structure and spectrum of a sparse 2D point sample from a single-channel image. <b>b<\/b>, Microscope model for multicolor PSF optimization with a single SLM in the Fourier plane. <b>c<\/b>, Optimized multicolor PSF for spectral imaging using a neural network, with different wavelengths and colors overlaid. <b>d<\/b>, Simulated single-channel image of multicolor fluorescent point sources. <b>e<\/b>, True simulated multicolor point sources, with different wavelengths and colors overlaid. <b>f<\/b>, Reconstructed multicolor point sources, with different wavelengths and colors overlaid. <b>g<\/b>, Iterative optimization workflow generating optimal phase masks for scattering-compensated holography. <b>i<\/b>, Chromatix model of holographic pattern formation through scattering media, which combines the holography model of Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig3\" rel=\"nofollow noopener\" target=\"_blank\">3f<\/a> and the scattering sample model of Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig2\" rel=\"nofollow noopener\" target=\"_blank\">2p<\/a>. <b>h<\/b>, Peak axial intensity distribution (normalized within the range 0\u20131) along the direction of propagation for the target pattern, an uncorrected pattern and the corrected pattern that are visualized below. <b>j<\/b>\u2013<b>m<\/b>, Visual evolution of holographic pattern quality. Target pattern (<b>j<\/b>) is compared to the pattern constructed by an optimized hologram simulated through free space (<b>k<\/b>), the pattern constructed by the same hologram simulated with scattering through a sample with a known 3D refractive index distribution (<b>l<\/b>) and finally the pattern constructed by the Chromatix-corrected hologram simulated through the same scattering volume (<b>m<\/b>). For all panels, green highlights denote optimized parameters and dashed gray arrows denote propagation of gradients during iterative optimization.<\/p>\n<p>Arbitrary combinations of wave-optics models can also open up further applications of differentiable simulations to biological research. Optogenetic experiments rely on complex, 3D patterns of light to selectively control the behavior of neurons, often using holography<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 12\" title=\"Hossein Eybposh, M., Caira, N. W., Atisa, M., Chakravarthula, P. &amp; P&#xE9;gard, N. C. DeepCGH: 3D computer-generated holography using deep learning. Opt. Express 28, 26636&#x2013;26650 (2020).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR12\" id=\"ref-link-section-d181470754e2104\" rel=\"nofollow noopener\" target=\"_blank\">12<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 14\" title=\"Faini, G. et al. Ultrafast light targeting for high-throughput precise control of neuronal networks. Nat. Commun. 14, 1888 (2023).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR14\" id=\"ref-link-section-d181470754e2107\" rel=\"nofollow noopener\" target=\"_blank\">14<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 15\" title=\"P&#xE9;gard, N. C. et al. Three-dimensional scanless holographic optogenetics with temporal focusing (3D-SHOT). Nat. Commun. 8, 1228 (2017).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR15\" id=\"ref-link-section-d181470754e2110\" rel=\"nofollow noopener\" target=\"_blank\">15<\/a>. 3D holography in itself is challenging, but this is compounded in optogenetics by the scattering nature of the biological tissue. As the light propagates through the tissue, it gets scattered, possibly activating the wrong neurons and increasing phototoxicity<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Owen, S. F., Liu, M. H. &amp; Kreitzer, A. C. Thermal constraints on in vivo optogenetic manipulations. Nat. Neurosci. 22, 1061&#x2013;1065 (2019).\" href=\"#ref-CR58\" id=\"ref-link-section-d181470754e2114\">58<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" title=\"Stujenske, J. M., Spellman, T. &amp; Gordon, J. A. Modeling the spatiotemporal dynamics of light and heat propagation for in vivo optogenetics. Cell Rep. 12, 525&#x2013;534 (2015).\" href=\"#ref-CR59\" id=\"ref-link-section-d181470754e2114_1\">59<\/a>,<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 60\" title=\"Picot, A. et al. Temperature rise under two-photon optogenetic brain stimulation. Cell Rep. 24, 1243&#x2013;1253 (2018).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR60\" id=\"ref-link-section-d181470754e2117\" rel=\"nofollow noopener\" target=\"_blank\">60<\/a>. We show how Chromatix can be used to optimize the desired holographic pattern in such a strongly scattering tissue by imaging the scattered pattern (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig4\" rel=\"nofollow noopener\" target=\"_blank\">4g\u2013m<\/a>). We model this scenario as a plane wave incident on a phase mask (SLM), focusing through a thin lens and finally propagating through a scattering volume. The propagation through the volume is modeled using the multislice beam propagation method (using the same code to model the scattering sample as Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig2\" rel=\"nofollow noopener\" target=\"_blank\">2p<\/a>), and we observe in simulation the intensity throughout the entire volume. Without correction, the stimulation is uneven due to the unaccounted-for scattering (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig4\" rel=\"nofollow noopener\" target=\"_blank\">4h<\/a>). Once we include the observed scattered intensity as feedback in the optimization, we obtain a near uniform stimulation (blue line in Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig4\" rel=\"nofollow noopener\" target=\"_blank\">4h<\/a>) across the whole axial range. This serves as an in silico demonstration that Chromatix enables researchers to rapidly implement and iterate on their ideas, transforming intuition into tangible results.<\/p>\n<p>High performance through parallelization<\/p>\n<p>To demonstrate the computational performance and scalability of Chromatix, we benchmark iteration speed for all of training and optimization problems we have presented. Chromatix has superior performance across all reproduced optical methods, ranging from 2 to 6\u00d7 on single GPUs to 22\u00d7 faster on 8 GPUs in the best case (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig5\" rel=\"nofollow noopener\" target=\"_blank\">5<\/a>). Single GPU performance improvements are typically due to less overhead after compilation through JAX compared with other implementations in MATLAB, PyTorch or TensorFlow. In general, order-of-magnitude improvements are possible via parallelization with Chromatix. These parallelization schemes can be implemented on Chromatix models with virtually no changes to the code defining the models due to Chromatix being implemented in JAX<a data-track=\"click\" data-track-action=\"reference anchor\" data-track-label=\"link\" data-test=\"citation-ref\" aria-label=\"Reference 26\" title=\"Bradbury, J. et al. JAX: composable transformations of Python+NumPy programs. GitHub &#010;                http:\/\/github.com\/jax-ml\/jax&#010;                &#010;               (2018).\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#ref-CR26\" id=\"ref-link-section-d181470754e2146\" rel=\"nofollow noopener\" target=\"_blank\">26<\/a>. This acceleration allows Chromatix to scale to solving large problems, and also makes existing inverse problem solutions substantially more tractable as demonstrated by the larger FOV for the Chromatix reconstruction in ring deconvolution microscopy (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig2\" rel=\"nofollow noopener\" target=\"_blank\">2a\u2013f<\/a>) as well as the substantial decrease in optimization time for refractive index microscopy (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig2\" rel=\"nofollow noopener\" target=\"_blank\">2o\u2013u<\/a>) and snapshot PSF optimization with deep learning (Fig. <a data-track=\"click\" data-track-label=\"link\" data-track-action=\"figure anchor\" href=\"http:\/\/www.nature.com\/articles\/s41592-026-03121-x#Fig3\" rel=\"nofollow noopener\" target=\"_blank\">3a\u2013e<\/a>).<\/p>\n<p><b id=\"Fig5\" class=\"c-article-section__figure-caption\" data-test=\"figure-caption-text\">Fig. 5: Chromatix is the fastest implementation of existing computational optics methods.<\/b><img decoding=\"async\" aria-describedby=\"figure-5-desc ai-alt-disclaimer-figure-5-1\" src=\"https:\/\/www.europesays.com\/ie\/wp-content\/uploads\/2026\/06\/41592_2026_3121_Fig5_HTML.png\" alt=\"Fig. 5: Chromatix is the fastest implementation of existing computational optics methods.\" loading=\"lazy\" width=\"685\" height=\"676\"\/>The alternative text for this image may have been generated using AI.<\/p>\n<p>Vertical axis shows relative speedup of Chromatix on 1\u20138 GPUs compared with the original implementations of each method as the baseline (represented via the gray dashed line at 1\u00d7). Points are centered on the mean relative speedup for each method. Error bars show standard error of speedups on individual iterations of the optimization for each method. The distribution for each method is visualized as a violin plot in a lighter shade. For all methods, speedups are relative to the original single GPU implementations. CGH, computer-generated holography.<\/p>\n","protected":false},"excerpt":{"rendered":"Design and implementation The design of Chromatix is strongly inspired by current deep learning frameworks. Here we detail&hellip;\n","protected":false},"author":2,"featured_media":526500,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_share_on_mastodon":"0"},"categories":[271],"tags":[3548,3546,3545,3547,18,910,19,3543,17,3544,610,452,3549,133,864],"class_list":["post-526499","post","type-post","status-publish","format-standard","has-post-thumbnail","category-physics","tag-bioinformatics","tag-biological-microscopy","tag-biological-techniques","tag-biomedical-engineering-biotechnology","tag-eire","tag-general","tag-ie","tag-image-processing","tag-ireland","tag-life-sciences","tag-machine-learning","tag-physics","tag-proteomics","tag-science","tag-software"],"share_on_mastodon":{"url":"https:\/\/pubeurope.com\/@ie\/116721106399962456","error":""},"_links":{"self":[{"href":"https:\/\/www.europesays.com\/ie\/wp-json\/wp\/v2\/posts\/526499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.europesays.com\/ie\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.europesays.com\/ie\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.europesays.com\/ie\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.europesays.com\/ie\/wp-json\/wp\/v2\/comments?post=526499"}],"version-history":[{"count":0,"href":"https:\/\/www.europesays.com\/ie\/wp-json\/wp\/v2\/posts\/526499\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.europesays.com\/ie\/wp-json\/wp\/v2\/media\/526500"}],"wp:attachment":[{"href":"https:\/\/www.europesays.com\/ie\/wp-json\/wp\/v2\/media?parent=526499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.europesays.com\/ie\/wp-json\/wp\/v2\/categories?post=526499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.europesays.com\/ie\/wp-json\/wp\/v2\/tags?post=526499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}