원시데이터 수집 시스템
선정목록으로

TMMax: High-performance modeling of multilayer thin-film structures using transfer matrix method with JAX

간접 관련 필름·전자재료 · (11) 배리어 필름 (13) 프리즘 필름(15) 디스플레이 패널재료

기본 정보

저자
  1. Bahrem Serhat Danis — Department of Electrical and Electronics Engineering, Koç University, Istanbul, 34450, Turkey
  2. Esra Özkan Zayim — Physics Engineering Department, Istanbul Technical University, Istanbul, 34469, Turkey
DOI
10.21105/joss.09088
저널
The Journal of Open Source Software
발행년도
2025
발행기관
Open Journals
피인용수
1
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.21105/joss.09088
토픽
Optical Coatings and Gratings
OpenAlex ID
W4415591573

평가 내용

관련도
간접 관련
사업분야
필름·전자재료 · (11) 배리어 필름
부 분야
(13) 프리즘 필름, (15) 디스플레이 패널재료
R&D 측면
분석·모델링
확신도
0.90
근거 용어
multilayer thin-film structures, transfer matrix method, optical modeling, dielectric multilayer structures, reflectance/transmittance
판단 근거
이 논문은 다층 박막 구조의 광학적 특성(반사, 투과 등)을 시뮬레이션하는 고성능 모델링 소프트웨어(TMMax)에 관한 연구입니다. 이는 코오롱인더스트리의 배리어 필름, 광학 필름, 디스플레이 패널재료 개발 시 박막 설계 및 광학 성능 예측을 위한 분석 도구로 활용될 수 있습니다.
R&D 활용 포인트
배리어 필름의 다층 코팅 구조 설계나 프리즘 필름의 광학적 특성 최적화 시, 고속 시뮬레이션을 통해 실험 횟수를 줄이고 설계 정밀도를 높이는 데 활용 가능합니다.
평가 입력
본문 11,486자

초록

Danis et al., (2025). TMMax: High-performance modeling of multilayer thin-film structures using transfer matrix method with JAX. Journal of Open Source Software, 10(114), 9088, https://doi.org/10.21105/joss.09088

본문 11,486자

본문 펼치기
DOI: [10.21105/joss.09088](https://doi.org/10.21105/joss.09088) Software - [Review](https://github.com/openjournals/joss-reviews/issues/9088) - [Repository](https://github.com/bahremsd/tmmax) - [Archive](https://doi.org/10.5281/zenodo.17361547) Editor: Owen [Lockwood](https://lockwo.github.io) Reviewers: - [@HectorMozo3110](https://github.com/HectorMozo3110) - [@CrazeXD](https://github.com/CrazeXD) Submitted: 15 July 2025 Published: 27 October 2025 License Authors of papers retain copyright and release the work under a Creative Commons Attribution 4.0 International License (CC [BY](https://creativecommons.org/licenses/by/4.0/) 4.0). # TMMax: High-performance modeling of multilayer thin-film structures using transfer matrix method with JAX Bahrem Serhat Danis 1 and Esra Zayim 2 1 Department of Electrical and Electronics Engineering, Koç University, Istanbul, 34450, Turkey 2 Physics Engineering Department, Istanbul Technical University, Istanbul, 34469, Turkey ## Summary Optical multilayer thin-films are fundamental components that enable the precise control of reflectance, transmittance, and phase shift in the design of photonic systems. Rapid and accessible simulation of these structures holds critical importance for designing and analyzing complex coatings. While researchers commonly use the traditional transfer matrix method for designing these structures, its scalar approach to wavelength and angle of incidence causes redundant recalculations and inefficiencies in large-scale simulations. Furthermore, traditional method implementations do not support automatic differentiation, which limits their applicability in gradient-based inverse design approaches. Here, we present TMMax, a Python library that fully vectorizes and accelerates transfer matrix method using the high-performance machine learning library JAX. TMMax supports CPU, GPU, and TPU hardware, and includes a publicly available material database. Our approach, demonstrated through benchmarking, allows us to model thin-film stacks with hundreds of layers within seconds. This illustrates that our method speeds up simulations by two orders of magnitude over a baseline NumPy implementation, enabling optical engineers and thin-film researchers in optics and photonics to efficiently design complex dielectric multilayer structures through rapid and scalable simulations. ## Statement of need The Transfer Matrix Method (TMM) models multilayer optical thin films by applying Snell’s law for light propagation and Fresnel equations to compute interface transmittance and reflectance. M = ?−2 ∏ ?=0 M ? (1) In TMM, the optical behavior of an N-layer multilayer structure composed of dielectric materials is obtained by computing the system matrix M, as shown in Equation (1). This matrix calculation, commonly referred to as the Abeles TMM (Abelès, Florin, 1950), results from the successive multiplication of the transfer matrices of each layer ( M ?) (Katsidis & Siapkas, 2002). Danis, & Zayim. (2025). TMMax: High-performance modeling of multilayer thin-film structures using transfer matrix method with JAX. _Journal_ _of_ _Open_ _Source_ _Software_, _10_ (114), 9088. [https://doi.org/10.21105/joss.09088.](https://doi.org/10.21105/joss.09088) 1 Figure 1: Schematic of two strategies for calculating transmission, reflection, and absorption in multilayer thin-film simulations. The system (a) is modeled either by sequentially multiplying 2×2 transfer matrices for each wavelength and incidence angle (b) or by vectorizing these operations across both axes (c). In traditional TMM implementations, the stack of layers in Figure 1a is simulated using a single wavelength and angle of incidence, as shown in Figure 1b, and nested loops over wavelengths and angles lead to redundant calculations (Byrnes, 2020). TMMax removes these redundancies by vectorizing wavelengths and angles and all intermediate TMM operations via JAX (Bradbury et al., 2018). As seen in the schematic of the vectorized implementation in Figure 1c, we vectorize all intermediate operations in TMM and subsequently apply JAX’s just-in-time (JIT) decorator. Instead of running the mapped TMM code sequentially over each batch element of wavelength and angle of incidence, jax.jit fuses all operations across the batch into a single XLA-compiled (OpenXLA Team, 2023) kernel. This reduces function call overhead and provides a faster TMM implementation. TMMax replaces the conventional for-loop system-matrix calculation (Nishida et al., 2011) with JAX’s lax.scan, enabling JIT compilation and eliminating interpreter bottlenecks, while running efficiently on CPUs, GPUs, and TPUs without code changes. TMMax supports deep learning–based inverse design by keeping all computations on the GPU, avoiding costly CPU–GPU data transfers (Hegde, 2019). Whereas NumPy-based (Harris et al., 2020) TMM packages that lack native gradients and require Autograd (Maclaurin et al., 2015), TMMax natively computes gradients. Additionally, TMMax integrates a curated database of 30 extensively used dielectric materials, sourced from refractiveindex.info (Polyanskiy, 2024), thereby enabling optical engineers and thin-film researchers in optics and photonics to efficiently simulate complex multilayer structures through a scalable, JAX-accelerated implementation. ## Benchmarks Runtime in TMM scales naturally with the number of layers, as well as the lengths of the wavelength and incidence-angle arrays, due to the increased number of transfer matrix multiplications. To benchmark TMMax, we used tmm library (Byrnes, 2020) as a reference. Danis, & Zayim. (2025). TMMax: High-performance modeling of multilayer thin-film structures using transfer matrix method with JAX. _Journal_ _of_ _Open_ _Source_ _Software_, _10_ (114), 9088. [https://doi.org/10.21105/joss.09088.](https://doi.org/10.21105/joss.09088) 2 Figure 2: Run time vs. layer count comparing ‘tmm‘ (orange) and TMMax (blue). To assess how layer count affects computational performance, we sampled 20 multilayer structures ranging from 2 to 400 layers, with each layer randomly assigned one of seven materials and thicknesses between 100–500 nm. Spectral and angular domains were fixed at 20 points each, spanning 500–1000 nm and 0–π/2 radians, respectively. Figure 2 shows that while tmm runtime grows rapidly, TMMax scales efficiently, remaining nearly constant (~1.0–1.2 s) for low-layer structures and achieving speedups from 18× (2 layers) to 700× (400 layers). Figure 3: The colormaps show the runtime performance of ‘tmm‘ and TMMax across varying simulation grid sizes, comparing 8- and 80-layer stacks in (a) and (b), respectively. Danis, & Zayim. (2025). TMMax: High-performance modeling of multilayer thin-film structures using transfer matrix method with JAX. _Journal_ _of_ _Open_ _Source_ _Software_, _10_ (114), 9088. [https://doi.org/10.21105/joss.09088.](https://doi.org/10.21105/joss.09088) 3 We benchmarked the effects of wavelength and incident angle array sizes by sampling 20 values from 2 to 100, generating simulation grids from 2×2 to 100×100 for an 8-layer structure (Figure 3a). tmm runtime rises sharply with grid size, reaching ~138 s for 100×100, whereas TMMax remains below 3 s. For the smallest 2×2 grid, tmm is faster (~0.1 s vs. ~0.6 s) due to NumPy’s low overhead, while JAX incurs higher initialization costs. As layers increase to 80 (Figure 3b), tmm exceeds 760 s, but TMMax stays under 8 s, demonstrating superior efficiency and stability against both problem size and structural complexity. We used Python’s timeit module to benchmark each simulation 50 times, with all comparisons run on a single Intel Core i9 core without GPU or multicore use for fairness. ## Installation TMMax can be readily installed from the Python Package Index using pip install tmmax, which automatically handles all dependencies. For detailed installation instructions and platform compatibility, please refer to the TMMax [Documentation.](https://tmmax.readthedocs.io/en/latest/index.html) ## Acknowledgements This work was supported by the Scientific and Technological Research Council of Türkiye (TUBITAK) under the 2209-A Research Project Support Programme for Undergraduate Students, 2022 First-Term Call. ## References Abelès, Florin. (1950). Recherches sur la propagation des ondes électromagnétiques sinusoïdales dans les milieux stratifiés - application aux couches minces. _Ann._ _Phys._, _12_ (5), 596–640. [https://doi.org/10.1051/anphys/195012050596](https://doi.org/10.1051/anphys/195012050596) Bradbury, J., Frostig, R., Hawkins, P., Johnson, M. J., Leary, C., Maclaurin, D., Necula, G., Paszke, A., VanderPlas, J., Wanderman-Milne, S., & Zhang, Q. (2018). _JAX:_ _Composable_ _transformations_ _of_ _Python+NumPy_ _programs_ (Version 0.3.13). [http://github.com/jax-ml/](http://github.com/jax-ml/jax) [jax](http://github.com/jax-ml/jax) Byrnes, S. J. (2020). _Multilayer_ _optical_ _calculations_ . [https://doi.org/10.48550/arXiv.1603.](https://doi.org/10.48550/arXiv.1603.02720) [02720](https://doi.org/10.48550/arXiv.1603.02720) Harris, C. R., Millman, K. J., Walt, S. J. van der, Gommers, R., Virtanen, P., Cournapeau, D., Wieser, E., Taylor, J., Berg, S., Smith, N. J., Kern, R., Picus, M., Hoyer, S., Kerkwijk, M. H. van, Brett, M., Haldane, A., Fernández del Río, J., Wiebe, M., Peterson, P., … Oliphant, T. E. (2020). Array programming with NumPy. _Nature_, _585_, 357–362. [https://doi.org/10.1038/s41586-020-2649-2](https://doi.org/10.1038/s41586-020-2649-2) Hegde, R. S. (2019). Accelerating optics design optimizations with deep learning. _Optical_ _Engineering_, _58_ (6), 065103. [https://doi.org/10.1117/1.OE.58.6.065103](https://doi.org/10.1117/1.OE.58.6.065103) Katsidis, C. C., & Siapkas, D. I. (2002). General transfer-matrix method for optical multilayer systems with coherent, partially coherent, and incoherent interference. _Applied_ _Optics_, _41_ (19), 3978–3987. [https://doi.org/10.1364/AO.41.003978](https://doi.org/10.1364/AO.41.003978) Maclaurin, D., Duvenaud, D., & Adams, R. P. (2015). Autograd: Effortless gradients in numpy. _ICML_ _2015_ _AutoML_ _Workshop_, _238_ . Nishida, K., Ito, Y., & Nakano, K. (2011). Accelerating the dynamic programming for the matrix chain product on the GPU. _2011_ _Second_ _International_ _Conference_ _on_ _Networking_ _and_ _Computing_, 320–326. [https://doi.org/10.1109/ICNC.2011.62](https://doi.org/10.1109/ICNC.2011.62) Danis, & Zayim. (2025). TMMax: High-performance modeling of multilayer thin-film structures using transfer matrix method with JAX. _Journal_ _of_ _Open_ _Source_ _Software_, _10_ (114), 9088. [https://doi.org/10.21105/joss.09088.](https://doi.org/10.21105/joss.09088) 4 OpenXLA Team. (2023). _XLA:_ _Accelerated_ _Linear_ _Algebra_ _Compiler_ _for_ _Machine_ _Learning_ . [https://github.com/openxla/xla.](https://github.com/openxla/xla) [https://github.com/openxla/xla](https://github.com/openxla/xla) Polyanskiy, M. N. (2024). Refractiveindex.info database of optical constants. _Scientific_ _Data_, _11_ (1), 94. [https://doi.org/10.1038/s41597-023-02898-2](https://doi.org/10.1038/s41597-023-02898-2) Danis, & Zayim. (2025). TMMax: High-performance modeling of multilayer thin-film structures using transfer matrix method with JAX. _Journal_ _of_ _Open_ _Source_ _Software_, _10_ (114), 9088. [https://doi.org/10.21105/joss.09088.](https://doi.org/10.21105/joss.09088) 5

섹션 본문 9문단 · 4,893자

(제목 없음)

1Optical multilayer thin-films are fundamental components that enable the precise control of reflectance, transmittance, and phase shift in the design of photonic systems.Rapid and accessible simulation of these structures holds critical importance for designing and analyzing complex coatings.While researchers commonly use the traditional transfer matrix method for designing these structures, its scalar approach to wavelength and angle of incidence causes redundant recalculations and inefficiencies in large-scale simulations.Furthermore, traditional method implementations do not support automatic differentiation, which limits their applicability in gradient-based inverse design approaches.Here, we present TMMax, a Python library that fully vectorizes and accelerates transfer matrix method using the high-performance machine learning library JAX.TMMax supports CPU, GPU, and TPU hardware, and includes a publicly available material database.Our approach, demonstrated through benchmarking, allows us to model thin-film stacks with hundreds of layers within seconds.This illustrates that our method achieves a simulation speedup of x100s over a baseline NumPy implementation, enabling optical engineers and thin-film researchers in optics and photonics to efficiently design complex dielectric multilayer structures through rapid and scalable simulations.

Statemement of need

2The Transfer Matrix Method (TMM) models multilayer optical thin films by applying Snell's law for light propagation and Fresnel equations to compute interface transmittance and reflectance.

3In TMM, the optical behavior of an N-layer multilayer structure composed of dielectric materials is obtained by computing the system matrix M, as shown in Equation ( 1).This matrix calculation, commonly referred to as the Abeles TMM [1], results from the successive multiplication of the transfer matrices of each layer (M i ) [2].

4arXiv:2507.11341v2 [physics.comp-ph]24 Oct 2025 In traditional TMM implementations, the stack of layers in Figure 1a is simulated using a single wavelength and angle of incidence, as shown in Figure 1b, and nested loops over wavelengths and angles lead to redundant calculations [3].TMMax removes these redundancies by vectorizing wavelengths and angles and all intermediate TMM operations via JAX [4].As seen in the schematic of the vectorized implementation in Figure 1c, we vectorize all intermediate operations in TMM and subsequently apply JAX's just-in-time (JIT) decorator.Instead of running the mapped TMM code sequentially over each batch element of wavelength and angle of incidence, jax.jit fuses all operations across the batch into a single XLA-compiled [5] kernel.This reduces function call overhead and provides a faster TMM implementation.TMMax replaces the conventional for-loop system-matrix calculation [6] with JAX's lax.scan, enabling JIT compilation and eliminating interpreter bottlenecks, while running efficiently on CPUs, GPUs, and TPUs without code changes.

5TMMax supports deep learning-based inverse design by keeping all computations on the GPU, avoiding costly CPU-GPU data transfers [7].Whereas NumPy-based [8] TMM packages that lack native gradients and require Autograd [9], TMMax natively computes gradients.Additionally, TMMax integrates a curated database of 30 extensively used dielectric materials, sourced from refractiveindex.info[10], thereby enabling optical engineers and thin-film researchers in optics and photonics to efficiently simulate complex multilayer structures through a scalable, JAX-accelerated implementation.

Benchmarks

6Runtime in TMM scales naturally with the number of layers, as well as the lengths of the wavelength and incidenceangle arrays, due to the increased number of transfer matrix multiplications.To benchmark TMMax, we used tmm library [3] as a reference.To assess how layer count affects computational performance, we sampled 20 multilayer structures ranging from 2 to 400 layers, with each layer randomly assigned one of seven materials and thicknesses between 100-500 nm.Spectral and angular domains were fixed at 20 points each, spanning 500-1000 nm and 0-π/2 radians, respectively.Figure 2 shows that while tmm runtime grows rapidly, TMMax scales efficiently, remaining nearly constant (∼1.0-1.2 s) for low-layer structures and achieving speedups from 18× (2 layers) to 700× (400 layers).

Figure 1 :

7Figure 1: Schematic of two strategies for calculating transmission, reflection, and absorption in multilayer thin-film simulations.The system (a) is modeled either by sequentially multiplying 2×2 transfer matrices for each wavelength and incidence angle (b) or by vectorizing these operations across both axes (c).

Figure 2 :

8Figure 2: Run time vs. layer count comparing tmm (orange) and TMMax (blue).

Figure 3 :

9Figure 3: The colormaps show the runtime performance of tmm and TMMax across varying simulation grid sizes, comparing 8-and 80-layer stacks in (a) and (b), respectively.

참고문헌 7건

  1. Accelerating the Dynamic Programming for the Matrix Chain Product on the GPU 2011 10.1109/icnc.2011.62
  2. General transfer-matrix method for optical multilayer systems with coherent, partially coherent, and incoherent interference Applied Optics · Optica Publishing Group · 2002 10.1364/ao.41.003978
  3. Multilayer optical calculations arXiv (Cornell University) · Cornell University · 2016 10.48550/arxiv.1603.02720
  4. Recherches sur la propagation des ondes électromagnétiques sinusoïdales dans les milieux stratifiés Annales de Physique · EDP Sciences · 1950 10.1051/anphys/195012050596
  5. Accelerating optics design optimizations with deep learning Optical Engineering · SPIE · 2019 10.1117/1.oe.58.6.065103
  6. Array programming with NumPy Nature · Nature Portfolio · 2020 10.1038/s41586-020-2649-2
  7. Refractiveindex.info database of optical constants Scientific Data · Nature Portfolio · 2024 10.1038/s41597-023-02898-2