# RSTSR v0.10: A Native Rust n-Dimensional Tensor Library for Scientific Computing, Fully Compatible with the Python Array API Standard

**URL:** <https://users.rust-lang.org/t/rstsr-v0-10-a-native-rust-n-dimensional-tensor-library-for-scientific-computing-fully-compatible-with-the-python-array-api-standard/143094>\
**Category:** announcements\
**Created:** [October 17, 2026, 7:53am UTC](https://users.rust-lang.org/t/rstsr-v0-10-a-native-rust-n-dimensional-tensor-library-for-scientific-computing-fully-compatible-with-the-python-array-api-standard/143094 "2026-10-17T07:53:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajz34](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/ajz34/32/40972_2.png) [@ajz34](https://users.rust-lang.org/u/ajz34)\
**Post date:** [October 17, 2026, 7:53am UTC](https://users.rust-lang.org/t/rstsr-v0-10-a-native-rust-n-dimensional-tensor-library-for-scientific-computing-fully-compatible-with-the-python-array-api-standard/143094/1 "2026-10-17T07:53:11Z")

</div>

After two years of development, RSTSR has reached a milestone: an efficient-on-CPU, native Rust, _n_-dimensional tensor scientific-computing library that is **highly compatible with the NumPy interface**.

We believe NumPy's interface design for _n_-dimensional tensors is excellent. With RSTSR we show that native Rust scientific computing can be **as easy to write and read as NumPy, while being more efficient, safer, and better suited to parallel computing**.

- Project: [GitHub - RESTGroup/rstsr: An n-dimensional rust tensor toolkit · GitHub](https://github.com/RESTGroup/rstsr)
- API documentation: [rstsr - Rust](https://docs.rs/rstsr/latest/rstsr)

For details, see the RSTSR v0.10 blog post: [RSTSR 3rd Report | RSTSR: An n-Dimensional Rust Tensor Toolkit](https://restgroup.github.io/rstsr-book/blog/rstsr-third-report)

For NumPy users, RSTSR provides a [NumPy-RSTSR Cheatsheet](https://docs.rs/rstsr/latest/rstsr/cheatsheet/index.html) to get you up to speed quickly.

## Fully Compatible with the Python Array API 2025 Standard

As a native Rust library, RSTSR implements almost every interface of the [Python Array API](https://data-apis.org/array-api/latest) 2025 standard. RSTSR is no longer merely "inspired by" the Array API — it is a non-Python library that genuinely implements the Array API standard.

The Python Array API 2025 standard covers nearly all of NumPy's commonly used and important functionality, including:

- **Creation** : zeros, ones, full, arange, linspace, eye, meshgrid, etc.;
- **Indexing** : basic indexing/slicing, advanced/fancy indexing, element indexing;
- **Shape manipulation** : reshape, transpose, swapaxes, moveaxis, expand\_dims, squeeze, etc.;
- **Broadcasting** : broadcast\_to, broadcast\_arrays, etc.; broadcasting also applies to tensor arithmetic and other operations;
- **Arithmetic** : addition, subtraction, multiplication, division, trigonometric functions, etc.;
- **Binary operations** : such as logical and comparison operations;
- **Linear algebra** : matmul, vecdot, eigh, svd, etc.;
- **Statistical operations** : sum, mean, var, std, min, max, etc.;
- **Other tensor operations** : concatenate, stack, split, repeat, tile, etc.

[rstsr-faer-py](https://pypi.org/project/rstsr-faer-py), a thin Python wrapper built on RSTSR v0.10.0 with the Faer backend, is available on PyPI. Against the [Array API 2025 test suite](https://github.com/data-apis/array-api-tests) it scores 1336 Pass / 17 Fail / 33 Skip (NumPy 2.5, for comparison, scores 1339 Pass / 42 Fail / 5 Skip). Of these, 14 failures / 33 skips come from the test suite itself and from the RSTSR Faer backend not implementing FFT; the remaining 3 failures are a floating-point overflow in SVD that is rare in practical situations. This shows that, apart from FFT, RSTSR correctly implements every Array API 2025 interface.

Although we do not literally implement every Array API 2025 interface, that is because a small number are difficult or impossible to implement due to the nature of the Rust language. So even where a solution exists in Python, we do not provide a one-to-one native Rust implementation. The excluded features are:

- The operator overloads ` __ipow__ `, ` __imatmul__ ` that Python permits but Rust lacks (though they can be achieved with functions);
- Dynamic-typed lists, which Python allows but are very hard to express in statically typed Rust. The affected functions are `concat` and `stack` (so long as the tensors share the same dtype, RSTSR can still use `rt::concat` and `rt::stack`).

## Key Features of RSTSR

- **Use `%` as the matrix-multiplication operator** : a distinctive feature of RSTSR. You can write `&a % &b` instead of `a.matmul(&b)`, making matrix multiplication more concise.
- **Excellent parallelism management** : for multithreaded BLAS backends, our rayon-based thread control guarantees that whether RSTSR's general computation or matrix linear algebra is called inside or outside rayon parallel threads, the parallel device is fully utilized without ever exceeding the thread count specified by the user.
- **Support for both row-major and column-major** : RSTSR defaults to row-major memory layout, but also allows column-major layout, which is already used extensively in the real-world REST electronic-structure program.
- **Multiple BLAS backends** : RSTSR can use Faer's default multithreaded backend, or OpenBLAS, Intel MKL, BLIS, KML, and other BLAS backends; CPU performance is on par with NumPy. Matrix linear algebra operations such as solve, svd, and eigh are supported.
- **Extensible backends** : generics support multiple backends. Users need not modify RSTSR's source code, and the data need not reside in memory (GPU, disk, or network storage can hold it) — implementing the new backend trait interfaces is enough to perform mathematical computation with a custom backend.
- **Multiple data types** : RSTSR supports ordinary floating-point types as well as arbitrary data structures (including types such as strings that require `alloc`). In electronic-structure programs, f64 and c64 are the most common dtypes; we support them and provide special optimizations for them.
- **Zero-overhead reshape** : under a reasonable tensor layout (not necessarily fully contiguous in memory), RSTSR can implement reshape as a view, with no extra memory overhead.
- **Einstein summation support** : with the external TBLIS tensor-contraction library, RSTSR can perform tensor contractions using the same Einstein-summation syntax as NumPy. See [`rt::tblis::einsum`](https://docs.rs/rstsr/latest/rstsr/prelude/rstsr_funcs/tblis/fn.einsum.html).
- **Efficient Vecdot support** : in electronic structure — particularly some dense density-functional matrix computations — tensor contractions of the form `"pi, pi -> p"` are very common and are indeed a significant memory-bandwidth bottleneck. Our implementation of [`rt::vecdot`](https://docs.rs/rstsr/latest/rstsr/prelude/rstsr_funcs/fn.vecdot.html) is not naive: its multi-core parallel performance is excellent, it is much faster than a plain elementwise multiply followed by a sum, and it uses less memory.

---

<div class="post-metadata">

**Author:** ![threefold3](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/threefold3/32/32050_2.png) [@threefold3](https://users.rust-lang.org/u/threefold3)\
**Post date:** [October 17, 2026, 11:07am UTC](https://users.rust-lang.org/t/rstsr-v0-10-a-native-rust-n-dimensional-tensor-library-for-scientific-computing-fully-compatible-with-the-python-array-api-standard/143094/2 "2026-10-17T11:07:39Z")

</div>

This is an interesting project for scientific computation.

The main question that comes to mind is, how does your library integrate with the existing tensor or linear algebra rust ecosystem? How does it compare with it in case there is overlap in what the libraries do? In short, why choose your library instead of existing ones?

Minor point, `&a % &b` for matrix multiplication does not look like an improvement to me, but rather a new confusing notation.

---

<div class="post-metadata">

**Author:** ![ajz34](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/ajz34/32/40972_2.png) [@ajz34](https://users.rust-lang.org/u/ajz34)\
**Post date:** [October 18, 2026, 3:47am UTC](https://users.rust-lang.org/t/rstsr-v0-10-a-native-rust-n-dimensional-tensor-library-for-scientific-computing-fully-compatible-with-the-python-array-api-standard/143094/3 "2026-10-18T03:47:29Z")

</div>

Good point.

For the minor point, I think that it is convenient for python to have `a @ b` as matrix multiplication. Rust does not have equilvant operator like this; and as operator `%` to be of the same precedence to `*`, and tensor-elementwise remainder is seldomly used as I guess, so we choose `%`. We still provide the choice of using `a.matmul(&b)` to be matrix multiplication, and `rt::rem(&a, &b)` for remainder, if `%` seems to be confusing. This is a matter of choice for users.

For the major point. More details refer user document (also responds to "overlap in what the libraries do", written at version v0.3.5 last year but most discussion still applies now)

- [Why RSTSR | RSTSR: An n-Dimensional Rust Tensor Toolkit](https://restgroup.github.io/rstsr-book/docs/why-rstsr)
- [Think Before Using RSTSR | RSTSR: An n-Dimensional Rust Tensor Toolkit](https://restgroup.github.io/rstsr-book/docs/warning) (which is an honest discussion on "why not use RSTSR")

For the rust community, it is commonly accepted that `ndarray` is a good n-dimensional tensor library. However, there are some points that short of, to our aim of developing electronic structure program:

- The greatest motivation is how to call BLAS. In many cases, we need both multi-threaded BLAS at main thread, while single-threaded BLAS in spawned parallel threads.

- Electronic structure programs really need very complicated basic indexing and reshape. We may usually allocate hundreds of GB, seldomly up to 1 TB, resources on a single node. Truely zero-copy indexing / reshape / broadcasting can be important. Crate `ndarray` has done good job, but not full support. We need full support on basic indexing and reshape.

- Our team leader comes from Fortran community, and he insists to use column-major. So we now have both row-major and column-major supported, with row-major to be default for common users.

- For the point on existing rust linear algebra ecosystem, we use crate `faer` as default backend, to enable fast linear algebra and fast parallel elementwise operations. In our real electronic structure program, we use OpenBLAS backend.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/system/32/51372_2.png) [@system](https://users.rust-lang.org/u/system)\
**Post date:** [October 18, 2026, 8:13am UTC](https://users.rust-lang.org/t/rstsr-v0-10-a-native-rust-n-dimensional-tensor-library-for-scientific-computing-fully-compatible-with-the-python-array-api-standard/143094/4 "2026-10-18T08:13:24Z")

</div>

Unlisted on October 18, 2026, 8:13am UTC



---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/system/32/51372_2.png) [@system](https://users.rust-lang.org/u/system)\
**Post date:** [October 19, 2026, 12:33am UTC](https://users.rust-lang.org/t/rstsr-v0-10-a-native-rust-n-dimensional-tensor-library-for-scientific-computing-fully-compatible-with-the-python-array-api-standard/143094/5 "2026-10-19T00:33:12Z")

</div>

Listed on October 19, 2026, 12:33am UTC


