Skip to main content

Numerical computing for Python, powered by Rust.

Project description

RMath

Numerical computing for Python, powered by Rust.

PyPI CI License Python


RMath is a numerical toolkit that runs heavy math in Rust and exposes it to Python via PyO3. Array operations, linear algebra, stats, calculus, and signal processing all execute outside the GIL on a Rayon thread pool.

import rmath as rm

data = rm.Array.randn(1000, 1000)
avg, std = data.mean(), data.std()

b = rm.Array.ones(1000, 1)
x = rm.linalg.solve(data, b)

Install

pip install rmath-py

Pre-built wheels are available for Windows, Linux, and macOS. No Rust toolchain required.

Modules

Module Description
rmath.array N-dimensional array with automatic storage tiering (stack / heap / mmap)
rmath.vector 1-D parallel engine — trig, reductions, sorting, filtering, complex numbers
rmath.scalar Precision f64 math — 80+ functions mirroring Python's math module
rmath.linalg Matrix solvers (LU, QR, Cholesky, SVD) via faer
rmath.stats Descriptive and inferential statistics — Welford's algorithm, distributions, regression
rmath.calculus Automatic differentiation (dual numbers), numerical integration, root-finding
rmath.geometry 3D transforms, quaternions, convex hull
rmath.signal FFT, convolution, spectral analysis
rmath.nn Activation functions (GELU, Softmax), loss, normalization layers
rmath.special Gamma, beta, and error functions
rmath.constants Mathematical and physical constants

Quick examples

Vector operations

import rmath.vector as rv

v = rv.Vector.linspace(0, 10, 1_000_000)
result = v.sin().exp().sum()   # runs on all cores

Statistics

import rmath as rm

data = rm.Array.randn(10_000, 1)
report = rm.stats.describe(data)  # mean, var, skew, kurtosis

Automatic differentiation

import rmath.calculus as rc

# f(x) = x² + 3x at x = 2
val = rc.Dual(2.0, 1.0)
out = val * val + val * 3.0

print(out.value)        # 10.0 (f(x))
print(out.derivative)   # 7.0  (f'(x))

How it works

Python (rmath)  ──PyO3 FFI──▸  Rust core (rayon + faer + ndarray)
                                  │
                      ┌───────────┼───────────┐
                      ▼           ▼           ▼
                   Stack       Heap        Mmap
                  (inline)   (shared)    (lazy I/O)
  • No GIL: Heavy loops release the GIL and fan out across cores via Rayon.
  • Storage tiering: Small arrays live on the stack, large ones on the heap, and huge datasets use memory-mapped files automatically.
  • Type stubs included: Full .pyi stubs ship with the package for IDE autocompletion and type-checking.

Documentation

Full API reference: ay-developerweb.github.io/rmath/portal/

Contributing

RMath is built in Rust (src/) and exposed to Python via PyO3.

  • Rust source: src/ — core numerical engines
  • Python stubs: rmath/*.pyi — type annotations
  • Docs portal: docs/portal/ — static HTML documentation

License

MIT

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

rmath_py-0.1.3-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

rmath_py-0.1.3-cp314-cp314-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.14Windows x86-64

rmath_py-0.1.3-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

rmath_py-0.1.3-cp314-cp314-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

rmath_py-0.1.3-cp313-cp313-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.13Windows x86-64

rmath_py-0.1.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

rmath_py-0.1.3-cp313-cp313-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rmath_py-0.1.3-cp312-cp312-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.12Windows x86-64

rmath_py-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

rmath_py-0.1.3-cp312-cp312-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rmath_py-0.1.3-cp311-cp311-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.11Windows x86-64

rmath_py-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

rmath_py-0.1.3-cp311-cp311-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rmath_py-0.1.3-cp310-cp310-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.10Windows x86-64

rmath_py-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

rmath_py-0.1.3-cp310-cp310-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

rmath_py-0.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

rmath_py-0.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file rmath_py-0.1.3-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f3c015924992eabedb2eb5581dc2926aeb96fc4c4c3d8a00de2d314244f0ee67
MD5 e35765db0dd3fa73141e4ab7a99d81ef
BLAKE2b-256 b3bc1258c7bbad165716fa78f58403cc511638c22b4e3d810a9172943dd41844

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 47af8a565bb26690d76da19f445fc9c7090a0b6b7a046e62814fcaad99dd01d4
MD5 9aa5a0a8bc937cd8536ff8aede26763d
BLAKE2b-256 94b8caf0c005196625f1574651f4582e528222853190e5f8d60b2fab45cf10aa

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4c62fb34331d0b50d4aa6da5c1f3beb175f17bca8230fbcf50352ea18b819256
MD5 fef778be0456c1996a2f51c0997f6564
BLAKE2b-256 958dcbf974fcc590ed8ed3bf41f3071c2812dba1617bad3eabecb25c013c401d

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 57035def881833a2898ea8bdd98dcfd14f7de6fda83c01367a9687bae370cc8a
MD5 30f92fc0090c48c1b9633e83aa3d48f5
BLAKE2b-256 8e08c6fc434b7ec04ccaea9d7982c42b802dccdad904253dbf602aa80c8a84f2

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a54a8630135833eb12121b77047cb0d3c3980a070559a73fa8d255b03d6f3332
MD5 ba36b2e419ab39dd1e68d9a4d3c30397
BLAKE2b-256 bf1595841b5bd3b8ee8ee23c460e022c29ad6b4cbe75912cfc5b232c63636a1d

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1d91b8a3529ef43ac19fcb2bde8fb32d396fd3939656f5cfc3f11a448188faea
MD5 cbda152648156ecad32bed3943aff3a8
BLAKE2b-256 910051c1927709af9466058080b1b6ff267b7ec149c3536462221b38f4eb90a9

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e5ef48835ea2c6b422514b7ed8493d0acd3cb65891dac96d4ea9fbe57f901a6a
MD5 b02307610111d371e3e5771116a1c5d8
BLAKE2b-256 bafd420d772d9ca3c82c019b4dd15f8bb7450b49fb5525b50b50d2f40ce1a2df

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e4fe61f11b2ef3fa5eb49e32e188453308771e685092a6ba7f4ba6283049ff12
MD5 f7f0e040b01b87723eb1025acf5cab1c
BLAKE2b-256 efde300fb1cc9cdfc47fd1456f75d20c9ac9a4b9542619a950fce491fc1c3b0c

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 16d30d6cc4e5567231e3d7fe80c7120738fb003451e6ee169cf58b31a895a6a3
MD5 2f8f3dbca74ae01573071e4981365b6c
BLAKE2b-256 3626d8ec4b80615ed03071a7e5821e9a9d43881341a2d875c35df834344de0c3

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5157668a32038c3f6ce371a8d7efce57ed551e4ba782f1ce99396ce5b17d4e0a
MD5 3ea4b39fbe3e08027513557fe2a117bd
BLAKE2b-256 ce75912760519d79def137c9638b66053b627addbef96de7ebb6d803270d33ab

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 106e71d6fc1a0341b0f4d13c12554407b7d9c9cb98be571997adb944ac2f7115
MD5 7a151a6a4992e7defb1b30c4aaae82f3
BLAKE2b-256 be2c8e84818015e4c827ce0d4c8d42ec2d6b3ab33b259f9d35486d0fd30ed2e5

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e49df3b48cbd062bef518cd40b48aa2d45bf65ff82e7893b90469195687fb9c4
MD5 24cd013105261835d13a59ac4f3760e4
BLAKE2b-256 3a709b8f12d3a909a32acb47c70484f3678d871f1b29735473e3a4d170e08a63

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 32c1ea7c1579d0a95953e14e0a43f0486c4367dd8e84227d752996437f83926f
MD5 564ccb2a20e1d960a63732d459443198
BLAKE2b-256 13841bff0f47fabc67b0add353ea24a5496451164384752a06c42a670771291d

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9742f47f005ca826d8fe9f2696193577f7eedd97a30813c1d472b71a42120fa1
MD5 bc95c13ea4ea1a18e294a40c63bd896c
BLAKE2b-256 1afa7aa5fbcdb8da16bea68b96d2a941a689ff182d47c936ed9167489a51fac0

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ac551c3cf9d7b89df94a56c4677766d45d3269f533db4b0d479d5bc257afd039
MD5 16f7b055414aa7125b7958165f3abe50
BLAKE2b-256 18ab87663db178738750e2e891b19300cc69476b3ab0f4d4889d2105798c2c24

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dd5675696d851c2756b7bd764b040df1c5a17d235c958b6c6b605332b918620a
MD5 379f68a50170582defbb7f3d67460d8e
BLAKE2b-256 7d7d86cf927ffbb8f56d10c3a9ba8d9223c377f84555d52c28ccf7df58d418ff

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 371319f44912305a2094de57c484907fb91442f9bcf8ed15ed19291fa7c34aa5
MD5 dbe721a12867f2e5f75cec72783289db
BLAKE2b-256 4b2ed0bdaddcf1205d0cb1ce5a651e0b4a61a1b2af05d5f8020adb90fe1e215b

See more details on using hashes here.

File details

Details for the file rmath_py-0.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rmath_py-0.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7f743b9a10f3ee264f79947c0859440ccd9f6ea6676d94543ce5aa640103364a
MD5 780cf5ae2693247da3fb7972c0fd9f1f
BLAKE2b-256 204444bd6cb04ae65b2aae57ddf3618b4d2c5fa5ed7f213b9729ce6d4acf9cc0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page