TorchOptics Documentation#

TorchOptics is an open-source Python library for simulating optical systems using Fourier optics, built on PyTorch. It provides GPU-accelerated, fully differentiable wave optics simulations, enabling end-to-end optimization of optical hardware jointly with machine learning models.

Key Features#

🌊 Differentiable Wave Optics

Model, analyze, and optimize optical systems using Fourier optics.

🔥 Built on PyTorch

GPU acceleration, batch processing, and automatic differentiation.

🛠️ End-to-End Optimization

Joint optimization of optical hardware and machine learning models.

🔬 Optical Elements

Lenses, phase/amplitude modulators, detectors, polarizers, and more.

🖼️ Spatial Profiles

Hermite-Gaussian, Laguerre-Gaussian, Zernike modes, gratings, and others.

🔆 Polarization & Coherence

Simulate polarized light and fields with arbitrary spatial coherence.

Installation#

pip install torchoptics

Contributing#

Contributions are welcome! See the Contributing Guide for details.

Citing TorchOptics#

If you use TorchOptics in your research, please cite our paper.

License#

Distributed under the MIT License. See LICENSE for details.