A JAX-based efficient transfer-matrix method framework for optical simulations
Project description
JaxLayerLumos: A JAX-based Efficient Transfer-Matrix Method Framework for Optical Simulations
Overview
JaxLayerLumos is open-source transfer-matrix method (TMM) software designed for scientists, engineers, and researchers in optics and photonics. It provides a powerful yet intuitive interface for calculating the reflection and transmission (RT) of light through multi-layer optical structures. By inputting the refractive index, thickness of each layer, and the frequency vector, users can analyze how light interacts with layered materials, including the option to adjust for incidence angles.
Our mission is to offer a lightweight, flexible, and fast alternative to commercial software, enabling users to perform complex optical simulations with ease. JaxLayerLumos is built with performance and usability in mind, facilitating the exploration of optical phenomena in research and development settings.
Features
- Lightweight and Efficient: Optimized for performance, JaxLayerLumos ensures rapid calculations without the overhead of large-scale commercial software.
- Gradient Calculation: Calculates the gradients over any variables involved in RT, powered by JAX.
- Flexibility: Accommodates a wide range of materials and structures by allowing users to specify complex refractive indices, layer thicknesses, and frequency vectors.
- Angle of Incidence Support: Expands simulation capabilities to include angled light incidence, providing more detailed analysis for advanced optical designs.
- Open Source and Community-Driven: Encourages contributions and feedback from the community, ensuring continuous improvement and innovation.
- Comprehensive Material Database: Includes a growing database of materials with their optical properties, streamlining the simulation setup process.
Installation
JaxLayerLumos can be easily installed by the following command using the PyPI repository.
pip install jaxlayerlumos
Alternatively, JaxLayerLumos can be installed from source.
pip install .
In addition, we support three installation modes, dev, benchmarking, and examples, where dev is defined for installing the packages required for development, benchmarking is for installing the packages required for benchmarking against differnt TMM software programs, and examples is needed for running the examples included in the examples directory.
One of these modes can be used by commanding pip install .[dev], pip install .[benchmarking], or pip install .[examples].
Examples
A collection of examples in the examples directory exhibits various use cases and capabilities of our software.
We provide the following examples:
- Reflection Spectra over Wavelengths Varying Incidence Angles
- Color Conversion
- Color Exploration with Thin-Film Structures
- Gradient Computation
- Visualization of Light Sources
- Plotting of Optical Constants
- Thin-Film Structure Optimization with Bayesian Optimization
- Thin-Film Structure Optimization with DoG Optimizer
- Reflection Spectra over Frequencies for Radar Design
- Analysis of Solar Cells
- Transmission Spectra over Wavelengths Varying Thicknesses
- Triple Junction Solar Cells
Comparison of TMM Packages
We compare Ansys Optics, TMM-Fast, and tmm to our software.
| Feature | Ansys Optics (stackrt) | TMM-Fast | tmm (sbyrnes) | JaxLayerLumos |
|---|---|---|---|---|
| Lightweight | ❌ (Commercial, bulky) | ✅ (PyTorch/NumPy) | ✅ (Pure Python) | ✅ (JAX) |
| Speed | Moderate | ✅ Fast (PyTorch) | Slow (CPU-bound) | ✅ Fast (JAX) |
| Gradient Support | ❌ | ✅ (PyTorch) | ❌ | ✅ (JAX) |
| GPU Support | ❌ | ✅ (PyTorch) | ❌ | ✅ (JAX) |
| TPU Support | ❌ | ❌ | ❌ | ✅ (JAX) |
| Position-Dependent Poynting | ❌ | ❌ | ❌ | ✅ |
| Optical Simulation | ✅ Full-spectrum | ✅ Optimized | ✅ Basic | ✅ User-defined |
| Infrared Simulation | ❌ Limited | ✅ Limited | ❌ | ✅ User-defined |
| Radar (HF) Simulation | ❌ Limited | ❌ | ❌ | ✅ Magnetic materials covered |
| Material Database | ✅ Extensive (Commercial) | ❌ User-defined | ❌ User-defined | ✅ Growing library |
| Open Source | ❌ | ✅ MIT | ✅ BSD-3-Clause | ✅ MIT |
Benchmarking against Other Software
We benchmark JaxLayerLumos against other software. Detailed benchmarking results can be found in this file. These comparisons include the results of Ansys Optics, TMM-Fast, and tmm.
To obtain these results, you should install additional required packages. Before installing the packages, you should install PyTorch first. In particular, if you need the CPU version of PyTorch, you can install it using the following command.
pip install torch --index-url https://download.pytorch.org/whl/cpu
For details, you can refer to the official instruction of PyTorch. Then, the required packages can be installed by the following command.
pip install .[benchmarking]
Finally, you can run the benchmarking code compare_methods.py in the benchmarking directory.
Supported Materials
Materials supported by our software are described in this file.
License
JaxLayerLumos is released under the MIT License, promoting open and unrestricted access to software for academic and commercial use.
Acknowledgments
- We sincerely thank all contributors and users for your support and feedback.
- This work is supported by the Center for Materials Data Science for Reliability and Degradation (MDS-Rely), which is the Industry-University Cooperative Research Center (IUCRC) of National Science Foundation.
- The University of Pittsburgh, Case Western Reserve University, and Carnegie Mellon University are participating institutions in MDS-Rely.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jaxlayerlumos-0.3.3.tar.gz.
File metadata
- Download URL: jaxlayerlumos-0.3.3.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46f59ef2328fe08645f07cb79fa9c81fddcca9a49ee86701a261cf5bfd15a78b
|
|
| MD5 |
871baae97853bdcaa5b701e960560d72
|
|
| BLAKE2b-256 |
1daad29cfa3ac9498919cafa98572edfeee5267520188b0a5504da66de2fa024
|
File details
Details for the file jaxlayerlumos-0.3.3-py3-none-any.whl.
File metadata
- Download URL: jaxlayerlumos-0.3.3-py3-none-any.whl
- Upload date:
- Size: 276.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fabcac19c5adeb74e8f2e0d1dd4d163471170460641d71547deb4f3c8ff0d25
|
|
| MD5 |
a3b3e476b34ec03b6afe24887f2f50f1
|
|
| BLAKE2b-256 |
7242f265c7b1cdf1c740c0fa838d60841d78fd70ab28a054d5af5373c0157843
|