An extremely fast 4×4 transfer-matrix engine for polarized reflectivity from stratified media — Rust core, optional wgpu GPU, thin Python bindings.
10 000 uniaxial film slabs · 256 q · Apple Silicon · vs PyPXR plugin
More charts
1 slab · wall time
1 slab · peak RSS
10k slabs · wall time
10k slabs · peak RSS
uv sync --group dev --extra plugin
uv run python examples/gpu_backend_bench.py --plotpip install refloxide # core TMM (CPU + GPU feature)
pip install 'refloxide[plugin]' # plus refnx modeling / fitting
# or
uv add refloxide
uv add 'refloxide[plugin]'refloxide[core] is an empty alias of the bare install. refloxide[all]
aliases [plugin]. Wheels build with Maturin features python and gpu;
use device="gpu" when a wgpu adapter is available (see GPU guide).
from refloxide.tmm import uniaxial_reflectivity
refl, tran = uniaxial_reflectivity(q, layers, tensor, energy_ev, parallel=False)
refl, tran = uniaxial_reflectivity(
q, layers, tensor, energy_ev, parallel=False, device="gpu"
)git clone https://github.com/ALS-RSOXS/refloxide.git
cd refloxide
make develop
make test && make verifyIf you use refloxide in published work, please cite the Zenodo archive:
Heilman, H. D. (2026). ALS-RSOXS/refloxide (v0.2.1). Zenodo. https://doi.org/10.5281/zenodo.22759134
@software{heilman_refloxide_2026,
author = {Heilman, Harlan D},
title = {{ALS-RSOXS/refloxide}},
version = {v0.2.1},
year = {2026},
publisher = {Zenodo},
doi = {10.5281/zenodo.22759134},
url = {https://doi.org/10.5281/zenodo.22759134}
}GitHub’s “Cite this repository” button uses CITATION.cff.
GPL-3.0 — see LICENSE.









