5 unstable releases
0.4.1 | Oct 26, 2024 |
---|---|
0.4.0 | Oct 25, 2024 |
0.3.0 |
|
0.2.0 | May 24, 2024 |
0.1.1 | May 20, 2024 |
#593 in Data structures
67 downloads per month
2.5MB
20K
SLoC
Spenso
Spenso is a rust library for working with arbitrary dimensional arrays, commonly called tensors. It provides both sparse (spensors) and dense (densors) tensors.
It supports any type as element, and provides iterators along specified dimensions (called fibers)
lib.rs
:
Contains all the tooling for working with arbitrary rank tensors, symbolically, numerically, and parametrically.
It includes special support for a minkowski metric, and a way to add any custom diagonal (sign based) metric.
All tensor types make use of a tensor structure type, either the minimum Vec
of Slot
s or a more complete (but slightly more computationally heavy) HistoryStructure
.
Data is then added, to make parametric, or fully numeric tensors.
If no data is added, some TensorStructure
s behave like symbolic tensors: namely HistoryStructure
and SymbolicTensor
There are two main types of data tensors, DenseTensor
and SparseTensor
.
They each implement a different type of storage for data.
All types of tensors can be contracted together using the Contract
trait.
This can be done manually, or using a TensorNetwork
and specifying a contraction algorithm.
Several Enums are defined to be able to store heterogenous tensors. Namely
Dependencies
~10–22MB
~348K SLoC