Metadata-Version: 2.1
Name: gradoptics
Version: 0.0.1
Summary: A small example package
Project-URL: Homepage, https://github.com/magis-slac/gradoptics
Project-URL: Bug Tracker, https://github.com/pypa/magis-slac/gradoptics
Author-email: Maxime Vandegar <maxime.vandegar@slac.stanford.edu>, Michael Kagan <makagan@slac.stanford.edu>
License: MIT License
        
        Copyright (c) 2021 Michael Kagan, Maxime Vandegar
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Description-Content-Type: text/markdown

[![Tests](https://github.com/magis-slac/gradoptics/actions/workflows/main.yml/badge.svg)](https://github.com/magis-slac/gradoptics/actions)
[![Build Status](https://travis-ci.com/magis-slac/gradoptics.svg?token=LBAvFbnCy9PEgexzsTUS&branch=main)](https://travis-ci.com/magis-slac/gradoptics)
[![Documentation Status](https://readthedocs.org/projects/gradoptics/badge/?version=latest)](https://gradoptics.readthedocs.io/en/latest/?badge=latest)
[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/magis-slac/gradoptics/blob/master/README.md)
![version](https://img.shields.io/badge/version-0.0.1-blue)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

# Differentiable Optics via Ray Tracing
[*gradoptics*](https://github.com/magis-slac/gradoptics) is a ray tracing based optical simulator built using PyTorch [[1]](#1) to enable automatic differentiation. 

The API is designed similar to rendering softwares, and has been heavily inspired by *Physically Based Rendering* (Pharr, Jakob, Humphreys) [[2]](#2). 


## Getting Started
[Getting Started](https://github.com/magis-slac/gradoptics/blob/main/docs/tutorials/Quick-Start.ipynb)


## Installation


```commandline
git clone https://github.com/magis-slac/gradoptics.git
cd gradoptics
pip install -r requirements.txt
pip install -e .
```

Then, you should be ready to go!
```python
import gradoptics as optics
```

## Work in progress
- Currently, some optical element normals are aligned with the optical axis -> more general orientations in progress
- Currently, monochromatic -> no chromatic aberrations

## Project History

This project was started in 2020 by Michael Kagan and Maxime Vandegar at SLAC National Accelerator Laboratory.

## Feedback and Contributions

Please use issues on GitHub for reporting bugs and suggesting features (including better documentation).

We appreciate all contributions. In general, we recommend using pull requests to make changes to [*gradoptics*](https://github.com/magis-slac/gradoptics).  

#### Testing

If you modify [*gradoptics*](https://github.com/magis-slac/gradoptics), please use pytest for checking your code.

```commandline
pytest tests/tests.py 
```


## Support

[*gradoptics*](https://github.com/magis-slac/gradoptics) was developed in the context of the MAGIS-100 experiment 

## References
<a id="1">[1]</a> 
A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, et al. PyTorch: An imperative style, high-performance deep learning library. In NeurIPS, 2019.

<a id="1">[2]</a> 
Matt Pharr, Wenzel Jakob, and Greg Humphreys. 2016. Physically Based Rendering: From Theory to Implementation (3rd ed.). Morgan Kaufmann Publishers Inc. 
