The Optiland GUI showing a reverse telephoto system.
- Introduction
- Documentation
- Installation
- Core capabilities
- Learning Guide
- Roadmap
- Under development
- Contributing
- License
- Contact and Support
Optiland is an open-source optical design platform built in Python, tailored for both classical lens systems and modern computational optics. It provides a robust and extensible interface for constructing, optimizing and analyzing optical systems, from standard refractive or reflective layouts to advanced freeform assemblies.
Built for professional engineering workflows, Optiland includes full support for tolerancing, high-performance optimization routines, and intelligent material selection through its integrated GlassExpert module. Also, traditional ray-based analysis are complemented by differentiable modeling support through PyTorch.
Whether you're developing prototypes in research or refining production systems, Optiland delivers the flexibility and precision needed to model, simulate, and optimize real-world optical instruments:
- โ๏ธ Build refractive and reflective systems using a clean, object-oriented API
- ๐ Trace rays through multi-surface optical assemblies, including aspherics and freeforms
- ๐ Analyze paraxial properties, wavefront errors, PSFs/MTFs, and scatter behavior
- ๐ง Optimize via traditional merit functions or autograd-enabled differentiable backends
- ๐จ Visualize interactively in 2D (Matplotlib) and 3D (VTK).
Under the hood, Optiland uses NumPy for fast CPU calculations and PyTorch for GPU acceleration and automatic differentiation. Switch between engines depending on your use case with the same interface.
Quickstart
- Quickstart Tutorial โ build your first lens in 5 minutes
- Full Learning Guide โ in-depth guide to mastering Optiland
- Example Gallery โ visual showcase of designs and core features
- Cheat Sheet - an up-to-date cheat sheet to get you started ASAP with your first optical system
Optiland's full documentation is available on Read the Docs.
-
Core only
pip install optiland
-
Core + GUI
pip install optiland[gui]
-
With CPUโonly PyTorch
pip install optiland[torch]
-
GPUโenabled PyTorch
After installing Optiland, install a CUDA build of PyTorch manually:
pip install optiland pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
- This command installs PyTorch with CUDA 11.8. Ensure that your NVIDIA drivers and toolkit are compatible.
- You can find the correct PyTorch + CUDA combo for your system using the official PyTorch installation selector.
- If you're using a non-NVIDIA GPU or running on Apple Silicon, use the CPU-only installation instead.
For more details, see the installation guide in the docs.
Feature | Capabilities |
---|---|
๐ ๏ธ Design & Modeling | Configure fields, wavelengths, apertures. Build systems using spherical, aspheric, conic, and freeform surfaces. |
๐งฎ Differentiable Core | Switch between NumPy (CPU) and PyTorch (GPU/autograd) seamlessly for hybrid physics-ML workflows. |
๐ฌ Ray Tracing | Trace paraxial and real rays through sequential systems with support for polarization, birefringence, and coatings. |
๐ Optical Analysis | Generate spot diagrams, wavefront error maps, ray fans, PSF/MTF plots, Zernike decompositions, distortion plots, etc. |
๐ง Optimization | Local & global optimizers, autograd support, operand-based merit functions, and GlassExpert for categorical variable search. |
๐ Tolerancing | Monte Carlo and parametric sensitivity analysis to evaluate robustness and manufacturability. |
๐ Material Library | Integrated access to refractiveindex.info. Support for custom dispersion models and material creation. |
๐ผ๏ธ Visualization | 2D plots via matplotlib, 3D interactive scenes with VTK, and debugging tools to inspect ray behavior. |
๐งฉ Interoperability | Import Zemax files, save/load systems in JSON, use full Python API for scripting and automation. |
๐ Performance | GPU-accelerated ray tracing (150M+ ray-surfaces/s), Numba-optimized NumPy backend, JIT-compiled computations. |
๐ค ML Integration | Compatible with PyTorch pipelines for deep learning, differentiable modeling, and end-to-end training. |
For a full breakdown of Optilandโs functionalities, see the complete feature list.
Note
The code itself is in constant flux and new functionalities are always being added.
Optiland is continually evolving to provide new functionalities for optical design and analysis. Below are some of the planned features and enhancements we aim to implement in future versions:
- GUI (PySide6-based) - Initial version available, ongoing enhancements.
- Multi-Path Sequential Ray Tracing
- Multiple Configurations (Zoom Lenses)
- Thin Film Design and Optimization
- Jones Pupils
- Additional Freeforms (Superconic, etc.)
- Image Simulation
- Interferogram Analysis
- Additional Tutorials/Examples
- Non-sequential ray tracing
- Insert your idea here...
Welcome, contributors! This section outlines the major features and tasks that are currently in progress. To avoid duplicated effort, please check this table and the GitHub Issues before starting work. If youโd like to work on something, comment on the issue to let others know. You can find more about how to coordinate in our contributing guide.
Feature / Topic | Contributor(s) | Status | Discussion / Issue |
---|---|---|---|
Core | |||
(extended) Sources | @manuelFragata | ๐ง In Progress | #224 |
Multi Sequence Tracing | @HarrisonKramer | ๐ Under Review | #89 |
Image Simulation Analysis | @HarrisonKramer | ๐ง In Progress | #153 |
Diffraction Gratings and DOEs | @Hhsoj @mattemilio | ๐ง In Progress | #161 #188 #225 |
GUI | |||
Code Cleanup | @manuelFragata | ๐ง In Progress | - |
Status
- โจ Help Wanted: We are actively looking for contributors for this task!
- ๐ง In Progress: Actively being worked on.
- ๐ Under Review: A pull request has been submitted and is being reviewed.
- ๐ Blocked: Progress is blocked by another issue.
- โ Done: Completed and merged.
We welcome contributions of all kinds โ features, bugfixes, docs, and discussions! ๐
To get started, please check out the contributing guide for best practices and coordination tips.
Distributed under the MIT License. See LICENSE for more information.
If you have found a bug, have a feature request, or need to report a documentation issue, please open an issue.
If you have a question or would like to start a broader discussion, please use the GitHub Discussions section.
This keeps all project-related communication public, searchable, and helpful for others who may encounter the same problems or questions.
Before opening an issue or discussion, please make sure you have:
- Checked the documentation and API reference
- Searched existing issues and discussions
- Made a reasonable attempt to solve the problem on your own
Well-prepared reports and questions help maintainers and the community respond more effectively. Very low-effort submissions (for example, asking for direct answers without reviewing available resources) are discouraged.
Important: I do not provide support by email.
Questions, bug reports, and feature requests sent directly to my inbox will not receive a reply. Please use GitHub Issues or Discussions instead.
Email is reserved for matters that cannot reasonably go through GitHub, such as collaboration proposals, consulting or contract work, or other professional inquiries.
Kramer Harrison โ kdanielharrison@gmail.com