Skip to content
ALS-RSOXSPublic

About

A blazingly fast 4x4 transfer matrix calculation for stratified media built with pyO3

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

refloxide

DOI

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

10k-slab uniaxial wall time 10k-slab uniaxial wall time

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 --plot

Installation

pip 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).

Quick start

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"
)

Development

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

Citation

If 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.

License

GPL-3.0 — see LICENSE.

About

A blazingly fast 4x4 transfer matrix calculation for stratified media built with pyO3

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages