Metadata-Version: 2.4
Name: refloxide
Version: 0.2.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Rust
Classifier: Typing :: Typed
Requires-Dist: tqdm>=4.68.4
License-File: LICENSE
Summary: A blazingly fast 4x4 transfer matrix method for simulating reflection though stratified media
Keywords: 
Author-email: Harlan D Heilman <73567020+HarlanHeilman@users.noreply.github.com>
License-Expression: GPL-3.0
Requires-Python: >=3.12
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/ALS-RSOXS/refloxide/blob/main/CHANGELOG.md
Project-URL: Documentation, https://ALS-RSOXS.github.io/refloxide
Project-URL: Homepage, https://github.com/ALS-RSOXS/refloxide
Project-URL: Issues, https://github.com/ALS-RSOXS/refloxide/issues
Project-URL: Repository, https://github.com/ALS-RSOXS/refloxide

# refloxide

An extremely fast 4×4 transfer-matrix engine for **polarized** reflectivity
from stratified media — Rust core, optional wgpu GPU, thin Python bindings.

<p align="center">
  <img src="docs/assets/performance/bench_hero_light.png#gh-light-mode-only" alt="10k-slab uniaxial wall time" width="520">
  <img src="docs/assets/performance/bench_hero_dark.png#gh-dark-mode-only" alt="10k-slab uniaxial wall time" width="520">
</p>

<p align="center">
  <sub>10 000 uniaxial film slabs · 256 q · Apple Silicon · vs PyPXR plugin</sub>
</p>

<details>
<summary>More charts</summary>

<br>

<p align="center">
  <img src="docs/assets/performance/bench_time_1slab_light.png#gh-light-mode-only" width="380">
  <img src="docs/assets/performance/bench_time_1slab_dark.png#gh-dark-mode-only" width="380">
</p>
<p align="center"><sub>1 slab · wall time</sub></p>

<p align="center">
  <img src="docs/assets/performance/bench_rss_1slab_light.png#gh-light-mode-only" width="380">
  <img src="docs/assets/performance/bench_rss_1slab_dark.png#gh-dark-mode-only" width="380">
</p>
<p align="center"><sub>1 slab · peak RSS</sub></p>

<p align="center">
  <img src="docs/assets/performance/bench_time_10k_light.png#gh-light-mode-only" width="380">
  <img src="docs/assets/performance/bench_time_10k_dark.png#gh-dark-mode-only" width="380">
</p>
<p align="center"><sub>10k slabs · wall time</sub></p>

<p align="center">
  <img src="docs/assets/performance/bench_rss_10k_light.png#gh-light-mode-only" width="380">
  <img src="docs/assets/performance/bench_rss_10k_dark.png#gh-dark-mode-only" width="380">
</p>
<p align="center"><sub>10k slabs · peak RSS</sub></p>

```bash
uv sync --group dev --group plugin
uv run python examples/gpu_backend_bench.py --plot
```

</details>

## Installation

```bash
pip install refloxide
# or
uv add refloxide
```

## Quick start

```python
from refloxide.tmm import uniaxial_reflectivity

refl, tran = uniaxial_reflectivity(q, layers, tensor, energy_ev, device="gpu")
```

## Development

```bash
git clone https://github.com/ALS-RSOXS/refloxide.git
cd refloxide
make develop
make test && make verify
```

## License

GPL-3.0 — see [LICENSE](LICENSE).

