Skip to main content

refloxide

CI PyPI version codecov Python 3.13+ uv Ruff ty License: GPL-3.0 Renovate

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.

We are basing this library on this paper:

Core philosophy

This library is designed as a pure functional simulation core. A caller defines a structure as fronting medium, backing medium, and a sequence of interior layers with thickness, interfacial roughness, and refractive-index parameterization. The solver then evaluates reflectivity for a requested set of experimental coordinates (for example angle, energy, or wavelength), and returns deterministic numerical arrays with no hidden mutable state.

The design intent is:

  • Explicit physical inputs with validation at construction time.
  • Predictable outputs for scalar and vectorized evaluation paths.
  • Single-threaded execution as the default, so this engine composes cleanly inside larger fitting and orchestration systems that already manage parallelism.
  • Strict separation between geometry (Structure), optical parameterization (n), and propagation numerics (4x4 transfer-matrix kernels).

In short, refloxide should behave like a reliable computational kernel: give it a fully specified layered system and a measurement grid, and it returns reproducible reflectivity without side effects.

Features

  • Fast and modern Python toolchain using Astral's tools (uv, ruff, ty)
  • Type-safe with full type annotations
  • Comprehensive documentation with MkDocs — View Docs

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

refloxide-0.1.5.tar.gz (1.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

refloxide-0.1.5-cp315-cp315t-manylinux_2_28_x86_64.whl (564.1 kB view details)

Uploaded CPython 3.15tmanylinux: glibc 2.28+ x86-64

refloxide-0.1.5-cp315-cp315-manylinux_2_28_x86_64.whl (562.8 kB view details)

Uploaded CPython 3.15manylinux: glibc 2.28+ x86-64

refloxide-0.1.5-cp314-cp314t-manylinux_2_28_x86_64.whl (563.9 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

refloxide-0.1.5-cp314-cp314t-manylinux_2_28_aarch64.whl (555.5 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ ARM64

refloxide-0.1.5-cp314-cp314-manylinux_2_28_x86_64.whl (562.9 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

refloxide-0.1.5-cp314-cp314-manylinux_2_28_aarch64.whl (556.2 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ ARM64

refloxide-0.1.5-cp313-cp313-win_amd64.whl (399.0 kB view details)

Uploaded CPython 3.13Windows x86-64

refloxide-0.1.5-cp313-cp313-manylinux_2_28_x86_64.whl (565.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

refloxide-0.1.5-cp313-cp313-manylinux_2_28_aarch64.whl (559.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

refloxide-0.1.5-cp313-cp313-macosx_11_0_arm64.whl (509.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

refloxide-0.1.5-cp313-cp313-macosx_10_12_x86_64.whl (518.1 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

refloxide-0.1.5-cp312-cp312-win_amd64.whl (399.2 kB view details)

Uploaded CPython 3.12Windows x86-64

refloxide-0.1.5-cp312-cp312-manylinux_2_28_x86_64.whl (566.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

refloxide-0.1.5-cp312-cp312-manylinux_2_28_aarch64.whl (559.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

refloxide-0.1.5-cp312-cp312-macosx_11_0_arm64.whl (510.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

refloxide-0.1.5-cp312-cp312-macosx_10_12_x86_64.whl (519.1 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

Details for the file refloxide-0.1.5.tar.gz.

File metadata

  • Download URL: refloxide-0.1.5.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for refloxide-0.1.5.tar.gz
Algorithm Hash digest
SHA256 fc0236164f11d00a7ea88d4d2c4e7b9e0ebabb0dc9130a9d29c0a22db36da951
MD5 6362e7e4c695e838aca4b29d97082672
BLAKE2b-256 c0aefd0ffd204bf0dbc58a1214e84c757a68d66ffc092097e8482624a1dbc863

See more details on using hashes here.

File details

Details for the file refloxide-0.1.5-cp315-cp315t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for refloxide-0.1.5-cp315-cp315t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d7e4f678c84273368c9a06c7a829afbf7fb88435a864c5caab3c7806de058088
MD5 ac2e67c11935d6de6442e1cdd258c183
BLAKE2b-256 84ff93104e3c996330b4f4c9e145a78fe8f0eef7cedc1d07f774c8029ebaa5b4

See more details on using hashes here.

File details

Details for the file refloxide-0.1.5-cp315-cp315-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for refloxide-0.1.5-cp315-cp315-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8e4d307b33dec2a783196be2084e790df8aeb544eaa2de8fe7d6d5d09268998e
MD5 a7d8286186add39623920a0b4859837a
BLAKE2b-256 b79f3b937f2ca650775197fb7166630bd88bc53d569b7a9e3e3cbba69530f0be

See more details on using hashes here.

File details

Details for the file refloxide-0.1.5-cp314-cp314t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for refloxide-0.1.5-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b974ecc679609acfa2ca6cc43ecace2b81900739d19f6b789bf2efb5d780da33
MD5 e415ea609921d40b4c80c667acc36764
BLAKE2b-256 b8e2a886d6d7da0cb327bba305acc655ec4f6d6fac8b64044aa7e9cb5c3935b4

See more details on using hashes here.

File details

Details for the file refloxide-0.1.5-cp314-cp314t-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for refloxide-0.1.5-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6170fe954da7e874853c8b77467bf757e4b981ec305cbee8715741ef27260050
MD5 e1d45ded48d5930c184d7332ff4ac713
BLAKE2b-256 6e77ff0140139e446f50aa57696414674ae2435579fa53f660d6d4e073c10694

See more details on using hashes here.

File details

Details for the file refloxide-0.1.5-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for refloxide-0.1.5-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c94ce0e5f994a3c39184ee8febd20a2ff207ca066931a345523ca855586a8f67
MD5 b1d212ada4d404dbd579ff53490e560c
BLAKE2b-256 d022e61b84569a49bbd6a10d5bf51800529adb2229bb5d7dfe2777ad05cfe07a

See more details on using hashes here.

File details

Details for the file refloxide-0.1.5-cp314-cp314-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for refloxide-0.1.5-cp314-cp314-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 01f825b37cea5d85a5b484fd7a87eb6d92d09bbe95ba136768d392f2892e6a28
MD5 8280f819cc9ef17871521f08f4081b06
BLAKE2b-256 f119f16cc4a2f1de6cbac72fa4c69e49114f298fa944d76ee368c00afb7c7489

See more details on using hashes here.

File details

Details for the file refloxide-0.1.5-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: refloxide-0.1.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 399.0 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for refloxide-0.1.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4b8b0c4911df90cec581b896021eeadadc394c1bcc523680eb29dcfb52bdb97e
MD5 ae28cf26ee00a60420de73033153b42a
BLAKE2b-256 c3ac669bb711ecd21579023ae84255d01708aec99af1cc9f59502b7fedd4d82e

See more details on using hashes here.

File details

Details for the file refloxide-0.1.5-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for refloxide-0.1.5-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8275a3470237dec236d1ded001c6a51303fe20166b75bc16b6345f4132727ede
MD5 305336bca166aeb4ead3e64f00f3c468
BLAKE2b-256 597bb19bc66d7011f90273ad00e3484a178ee1cd0b52904b3ce009fc40336d74

See more details on using hashes here.

File details

Details for the file refloxide-0.1.5-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for refloxide-0.1.5-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5210eeea693557f0a328b47157db525430dd97b130ce6197e879228eb2aece40
MD5 e7a87c547cc99168d4c22d5e40e4b8bc
BLAKE2b-256 81db745d455d929fded9c67594a9b6c56733fa368ba283c280aadf31e2c3c7e0

See more details on using hashes here.

File details

Details for the file refloxide-0.1.5-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for refloxide-0.1.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a23b4ae53571eae4069fc2649d6c17466b7164d3c3dcff1e0a2663f3022665a5
MD5 12e1c26bafb7a395e4942282ff4f5e66
BLAKE2b-256 3c8fd99907dba074d904d126ca8879095d8d43708ded0a152455474fd896a258

See more details on using hashes here.

File details

Details for the file refloxide-0.1.5-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for refloxide-0.1.5-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ad6f8bf5c1409a17bf61ce4a504eeddbfd828585cf6e33c705de37984b8b5df3
MD5 1ae8d4617e38ee469f1e34b87357af48
BLAKE2b-256 8c020728eea728d1dc39355f3b294df49078150da028447235cc109e8a01ccc1

See more details on using hashes here.

File details

Details for the file refloxide-0.1.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: refloxide-0.1.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 399.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for refloxide-0.1.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 93006e0e789a4c2ccdb00066eb2501e68f3848adcb44cfc54bd45bdc83802cf9
MD5 edd0694ddb0c5733f3e83b55f0775ec9
BLAKE2b-256 5e26989a2700b1d1ec480ef1fa6da4bd9984819576ec5dcfe104d2077d299f93

See more details on using hashes here.

File details

Details for the file refloxide-0.1.5-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for refloxide-0.1.5-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a32e0f160b68392ea3007485aab849c2d3c2763cfd6b42aac81ea78ba9ca7e9e
MD5 733cb65e082a826d1411c11f722ee64d
BLAKE2b-256 cc3e5834dd0688b6c57c0947125a64baa9fa8920352fe813c21f307438feb166

See more details on using hashes here.

File details

Details for the file refloxide-0.1.5-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for refloxide-0.1.5-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c324bff0b5138c743a46880d10f1253ca929e5badfe13e5769bb2f74707542ef
MD5 92b0ee2985f6546f10c99f24dc8821dd
BLAKE2b-256 1377fae00f36848419cd810b64a0227c266dd6a024412a234c900ff612a647d1

See more details on using hashes here.

File details

Details for the file refloxide-0.1.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for refloxide-0.1.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 af5aa728752b278d700f34dcf3110b30a33a445d6f292d4de730ed20d428a032
MD5 7d046395be0d7194c64b5ee9caac5f9e
BLAKE2b-256 7ba66a225d985a5ae9895ba0679b0595a5314eea134e380477f1d23c07db39d3

See more details on using hashes here.

File details

Details for the file refloxide-0.1.5-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for refloxide-0.1.5-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ecf042abb00b00b1c164c647f1d4b0e6b39113dc644d834082f775c4d2996949
MD5 88f077436df90ee3e81f96897979d18f
BLAKE2b-256 4cf341753caba13bfb5c1d8aa335af5e83d63bdd46f252541bd958cf437034b7

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.6

17 files

This release

0.1.5 This release

17 files

0.1.4

4 files

0.1.3

4 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page