Metadata-Version: 2.4
Name: cyscat-jax
Version: 0.1.0
Summary: Electromagnetic S-matrix computation for periodic arrays of cylinders — differentiable JAX version
Author-email: Thirulok Sundar <thiruloksundar278@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/Thiruloksundar/CyScat
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.24
Requires-Dist: scipy>=1.10
Requires-Dist: matplotlib>=3.7
Requires-Dist: jax>=0.4.20
Requires-Dist: jaxlib>=0.4.20
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"

# CyScat — Python / JAX

Electromagnetic scattering matrix computation for periodic arrays of cylinders, with **full JAX automatic differentiation** support.

Translated from MATLAB (Curtis Jin, Prof. Raj Rao Nadakuditi, Prof. Eric Michielssen, University of Michigan).

## What this version provides

- Exact AD w.r.t. **positions**, **wavelength**, **refractive index**, and **radius** via `jax.grad` / `jax.jvp`
- All examples use `Scattering_Code.jax.smatrix` — the fully differentiable pipeline
- Cross-validation notebook comparing JAX AD against Julia ForwardDiff

## Setup

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```

## Examples

Open any notebook under `CyScat/examples/`:

```bash
cd CyScat
jupyter notebook examples/generate_s_matrix_1layer_pec/generate_s_matrix_1layer_pec.ipynb
jupyter notebook examples/differentiable_s_matrix_demo/differentiable_s_matrix_demo.ipynb
jupyter notebook examples/optimize_refractive_index_and_radius/optimize_refractive_index_and_radius.ipynb
jupyter notebook examples/compare_julia_python_derivatives/compare_julia_python_derivatives.ipynb
```

See [CyScat/README.md](CyScat/README.md) for full documentation.
