katmer
katmer is a powerful library for optimizing the design of optical thin films using automatic differentiation via JAX and Equinox, enabling efficient and accurate inverse design solutions.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.3%) to scientific vocabulary
Keywords
Repository
katmer is a powerful library for optimizing the design of optical thin films using automatic differentiation via JAX and Equinox, enabling efficient and accurate inverse design solutions.
Basic Info
- Host: GitHub
- Owner: bahremsd
- License: mit
- Language: Python
- Default Branch: master
- Homepage: https://katmer.readthedocs.io/en/latest
- Size: 785 KB
Statistics
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
katmer: inverse design of optical thin films & material fitting with jax and equinox
Table of Contents
Introduction
katmer is a high-performance, research-grade python library purpose-built for the inverse design of optical multilayer thin films. Bridging classical optics with modern computational tools, katmer offers a comprehensive suite of features tailored for photonic engineers, researchers, and designers aiming to optimize thin-film structures with precision, speed, and flexibility.
In traditional multilayer thin-film design, achieving desired optical responses—such as reflectance, transmittance, or absorbance—often requires a trial-and-error approach or time-consuming simulations. katmer redefines this workflow by integrating gradient-based optimization into the design loop. This allows users to arrive at precise, physically valid solutions in a fraction of the time, enabling faster iteration and deeper insights.
At its core, katmer is powered by two cutting-edge libraries:
tmmax: A transfer matrix method (TMM) engine implemented with JAX, enabling just-in-time (JIT) compilation, vectorized operations, and XLA (Accelerated Linear Algebra). This dramatically speeds up the evaluation of optical properties across complex multilayer systems.equinox: A lightweight yet powerful neural network library designed to work seamlessly with JAX. Its pytree-based architecture enables flexible model building and efficient parameter management, critical for embedding neural architectures into the optimization process.
Core Capabilities
Optimum Number of Layers Prediction
One of katmer’s key features is the intelligent determination of the optimal number of layers required to achieve a user-defined target response. This is achieved using a pre-trained equinox model, which maps spectral objectives (across wavelength and incidence angles) to an ideal layer count—preventing over-engineering while minimizing fabrication complexity and cost. This forms a robust foundation for downstream optimization.
Thickness Sensitivity-Aware Inverse Design
Once the layer number is established, katmer performs gradient-based inverse design to determine the optimal thickness of each layer. Crucially, this process incorporates deposition uncertainties, modeling real-world experimental errors by simulating the effect of layer thickness deviations. This leads to designs that are not only optimal in simulation but also robust in practice.
Inverse Design with Material Constraints
Real-world thin-film fabrication is governed by material compatibility constraints—not all materials can be deposited on each other. katmer addresses this by constructing a material compatibility graph, currently available for materials supported in tmmax. During inverse design, this graph is used to ensure only physically realizable material stacks are considered. Furthermore, each material comes with its own deposition thickness bounds, which katmer rigorously respects during optimization.
Tickness-only Optimization
If you already have a fixed material distribution and only wish to optimize the layer thicknesses, katmer accommodates this effortlessly. With gradient-based methods, the solver converges rapidly, delivering optimal thickness distributions within the specified physical constraints.
Optical Property Reconstruction from Experimental Data
katmer also enables optical property reconstruction: if your multilayer system contains a material with unknown refractive index (n) or extinction coefficient (k), and you possess experimental spectral data, katmer can infer the n and k values through inverse modeling. This feature is particularly useful for characterizing novel or proprietary materials used in your thin-film designs.
Documentation
The complete documentation for katmer is available in the Example Gallery within the docs directory. This repository provides an extensive set of examples demonstrating the key functionalities of katmer, enabling users to efficiently analyze and manipulate multilayer thin-film stacks.
Usage
Database
Benchmarks
Installation
You can install katmer via PyPI:
bash
pip3 install katmer
License
This project is licensed under the MIT License, which permits free use, modification, and distribution of the software, provided that the original copyright notice and license terms are included in all copies or substantial portions of the software. For a detailed explanation of the terms and conditions, please refer to the LICENSE file.
Credits
Also if you find the katmer library beneficial in your work, we kindly ask that you consider citing us.
bibtex
@software{katmer,
author = {Bahrem Serhat Danis, Esra Zayim},
title = {katmer: inverse design of optical thin films and material fitting with jax and equinox},
version = {1.0.0},
url = {https://github.com/bahremsd/katmer},
year = {2025}
}
Contact and Support
For any questions, suggestions, or issues you encounter, feel free to open an issue on the GitHub repository. This not only ensures that your concern is shared with the community but also allows for collaborative problem-solving and creates a helpful reference for similar challenges in the future. If you would like to collaborate or contribute to the code, you can contact me via email.
Bahrem Serhat Danis - bdanis23@ku.edu.tr
Owner
- Name: Bahrem S. Danis
- Login: bahremsd
- Kind: user
- Location: Istanbul
- Company: Koc University
- Repositories: 1
- Profile: https://github.com/bahremsd
Citation (CITATION.cff)
cff-version: 1.0.0
title: Katmer
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Bahrem Serhat
family-names: Danis
orcid: 'https://orcid.org/0009-0002-9880-0446'
- given-names: Esra
family-names: Zayim
orcid: 'https://orcid.org/0000-0001-5887-0293'
repository-code: 'https://github.com/bahremsd/katmer'
url: 'https://pypi.org/project/katmer/'
license: MIT
version: 1.0.0
date-released: '2025-05-05'
GitHub Events
Total
- Release event: 1
- Watch event: 2
- Push event: 5
- Public event: 1
- Create event: 1
Last Year
- Release event: 1
- Watch event: 2
- Push event: 5
- Public event: 1
- Create event: 1
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 0
- Total pull requests: 8
- Average time to close issues: N/A
- Average time to close pull requests: 6 days
- Total issue authors: 0
- Total pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.63
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 5
Past Year
- Issues: 0
- Pull requests: 8
- Average time to close issues: N/A
- Average time to close pull requests: 6 days
- Issue authors: 0
- Pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.63
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 5
Top Authors
Issue Authors
Pull Request Authors
- dependabot[bot] (4)
- bahremsd (3)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 10 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 2
- Total maintainers: 1
pypi.org: katmer
project_description
- Homepage: https://github.com/bahremsd/katmer/
- Documentation: https://katmer.readthedocs.io/
- License: mit
-
Latest release: 1.0.0
published 9 months ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v4 composite
- actions/setup-python v3 composite
- equinox >=0.11.11
- jax >=0.5.0
- matplotlib >=3.10.0
- numpy >=2.2.2
- optax >=0.2.4
- pandas >=2.2.3
- scipy >=1.15.1