Designing Lenses with PyTorch: A Differentiable Optics Library

2025-03-21

Torch Lens Maker is an open-source Python library for differentiable geometric optics built on PyTorch. Its ambitious goal is to design complex real-world optical systems (lenses, mirrors) using modern computing and cutting-edge numerical optimization. The core is differentiable geometric optics: 3D collision detection and optical laws implemented in PyTorch. By cleverly treating optical elements as layers in a neural network, and leveraging PyTorch's auto-differentiation and optimization algorithms, designing lenses becomes surprisingly similar to training a neural network, unlocking the power of modern machine learning tools. The project is early-stage and the author is seeking funding to continue development.

Development optical design