Skip to content

Repository files navigation

refloxide

A blazingly fast 4x4 transfer matrix method for simulating reflection though stratified media.

This project is designed to be a fast core backend for simulating reflectivity using the 4x4 transfer matrix method. We are basing the code on the following pre existing codebases, but this is a ground up rewrite.

  • refnx - this library is great for simulation reflectivity though scalar media, but fails at tensor indeces.
  • refl1d - again, this works great for scal indeces, but is hard to work with in tensor materials, and with buidling complex structures.

What is refloxide?

This library started as just the pure transfer matrix simulation core but has grown to a full-featured optimized library for polarized energy dependent reflectivity simulation and optimization. We maintain a set of low memory footprint structures used to describe stratified media that are optimized for fast simulation and memory efficiency.

Installation

pip install refloxide

Or using uv (recommended):

uv add refloxide

Quick Start

import refloxide

print(refloxide.__version__)

Development

Prerequisites

  • Python 3.13+
  • uv for package management

Setup

git clone https://github.com/HarlanHeilman/refloxide.git
cd refloxide
make install

Running Tests

make test

# With coverage
make test-cov

# Across all Python versions
make test-matrix

Code Quality

# Run all checks (lint, format, type-check)
make verify

# Auto-fix lint and format issues
make fix

Prek

prek install
prek run --all-files

Documentation

make docs-serve

Dependency Updates

This project uses Renovate to keep dependencies up to date automatically. Renovate will open pull requests when new versions of dependencies are available.

To enable it, install the Renovate GitHub App and grant it access to this repository.

License

This project is licensed under the GPL-3.0 License - see the LICENSE file for details.

About

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

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages