Metadata-Version: 2.5
Name: bamsolve
Version: 0.1.1
Summary: Predict photonic circuits with AI: fields, S-parameters and n_eff from a GDS in about a second.
Project-URL: Homepage, https://bamsolve.com
License-Expression: MIT
Requires-Python: >=3.9
Requires-Dist: numpy>=1.22
Description-Content-Type: text/markdown

# bamsolve

Predict photonic circuits with AI. The API is free during the public alpha. Get a key at https://bamsolve.com/#get-key.

```bash
pip install bamsolve
```

```python
from bamsolve import Layer, Stack, bamsolve, pred

bamsolve(api_key="bsk_...")

stack = Stack(clad=1.444, layers={(1, 0): Layer(n=3.48, z=(0.0, 0.22), angle=5.0)})
dev = stack("ebeam_y_1550.gds")
res = pred(dev, inputs={((1, 10), "TE", 1.55)})

res.S, res.n_eff, res.E        # S-matrix [wavelength, out, in], effective index, complex field
res.export_s("ebeam_y_1550.s3p")
```

The default API address is https://api.bamsolve.com.

To use a custom server, set its URL before you call `pred`:

```python
bamsolve(api_key="bsk_...", url="https://YOUR_API_HOST")
```

You can also set the `BAMSOLVE_URL` environment variable before you import the module.
