Metadata-Version: 2.4
Name: nrumpy
Version: 0.2.1
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Typing :: Typed
Requires-Dist: numpy>=1.26
Requires-Dist: pytest>=8 ; extra == 'test'
Provides-Extra: test
License-File: LICENSE-MIT
License-File: LICENSE-APACHE
Summary: Strassen matrix multiplication, matrix powers, trace, and Frobenius norm for NumPy arrays and nested lists
Keywords: matrix,linear-algebra,strassen,numpy
Author-email: Jayadithya Dhurwey <jayadithya.dhurwey@gmail.com>
License-Expression: MIT OR Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://github.com/jaysit-gif/rumpy/blob/main/DOCS.md
Project-URL: Homepage, https://github.com/jaysit-gif/rumpy
Project-URL: Repository, https://github.com/jaysit-gif/rumpy

# rumpy

`nrumpy` multiplies matrices with Strassen's algorithm. The compute is the Rust crate `rumpy-core`, which stores row-major `f64` values. Install the package as `nrumpy` and import `nrumpy`.

```python
import nrumpy

nrumpy.matmul([[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [7.0, 8.0]])
# [[19.0, 22.0], [43.0, 50.0]]

nrumpy.matpow([[1.0, 1.0], [1.0, 0.0]], 5)
# [[8.0, 5.0], [5.0, 3.0]]

nrumpy.trace([[1.0, 2.0], [3.0, 4.0]])
# 5.0

nrumpy.norm([[3.0, 4.0]])
# 5.0
```

`matmul` and `matpow` accept nested lists, tuples of rows, and 2-D NumPy arrays. A NumPy left operand returns a `float64` array. A list or tuple returns a nested list. `trace` sums the main diagonal. `norm` is the Frobenius norm. Both return a Python `float`.

Shapes, `leaf_size`, the `out` buffer, errors, and the Strassen recurrence are in [DOCS.md](https://github.com/jaysit-gif/rumpy/blob/main/DOCS.md).

## Install

Python 3.10 or newer. NumPy is the only runtime dependency.

```bash
pip install nrumpy
```

From a clone, with a Rust toolchain and [maturin](https://www.maturin.rs/):

```bash
maturin develop --release
```

`make dev` runs that command.

## License

Licensed under either of

* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)

at your option.

