Skip to main content

Stratax

Stratax is a modern scientific computing library built around modern C++20 containers, shape metadata, and element-wise array operations. The core library is header-first, with Python bindings powered by pybind11.

The project is still young: vectors, matrices, tensors, shape/stride metadata, indexing, slicing, reshaping, conversions, creation helpers, printing, comparison, and arithmetic are active. Linear algebra, calculus, random, and statistics modules are currently reserved API areas.

Current Features

  • C++20 Vector, Matrix, and Tensor containers
  • Contiguous Buffer storage with shape and stride metadata
  • Bounds-checked at(...) and multidimensional operator(...) access
  • Element-wise arithmetic and comparison operators
  • Reshape, flatten, slicing, and container conversion helpers
  • Tensor creation helpers such as zeros, ones, full, and identity
  • Stream printing for vectors, matrices, tensors, shapes, and strides
  • Python bindings for Shape, Vector, Matrix, and Tensor
  • Doxygen API documentation

Requirements

  • C++20 compiler
  • CMake 3.20 or newer
  • Python 3.10 or newer for bindings
  • pybind11 2.12 or newer
  • scikit-build-core 0.10 or newer
  • pytest 8 or newer for Python tests
  • Doxygen 1.17 or newer for API docs

Quick C++ Example

#include <stratax.h>
#include <iostream>

int main()
{
    stratax::container::Vector<double> a{1.0, 2.0, 3.0};
    stratax::container::Vector<double> b{4.0, 5.0, 6.0};

    auto c = a + b;

    std::cout << c << '\n'; // [5, 7, 9]
}

Quick Python Example

from stratax import Matrix, Shape, Tensor, Vector, to_matrix, to_tensor, to_vector

shape = Shape([2, 2])
vector = Vector([1.0, 2.0, 3.0])
matrix = Matrix([[1.0, 2.0], [3.0, 4.0]])
tensor = Tensor([2, 2], 1.0)

vector_as_tensor = to_tensor(vector)
tensor_as_vector = to_vector(tensor)
tensor_as_matrix = to_matrix(Tensor([2, 2], 5.0))

tensor[1, 1] = 9.0

print(shape.elements)
print(vector.tolist())
print(matrix.tolist())
print(tensor.tolist())
print(vector_as_tensor.tolist())
print(tensor_as_vector.tolist())
print(tensor_as_matrix.tolist())

Python bindings currently expose double-based Shape, Vector, Matrix, and Tensor wrappers plus free-function conversions (to_vector, to_matrix, to_tensor). The C++ API remains the primary interface while the binding surface grows.

Build From Source

Configure and build with CMake:

cmake -S . -B build
cmake --build build

For editable Python installation, use pip from an environment with the build dependencies available:

python -m pip install -e .

Run Tests

The C++ tests live under tests/cpp/ and are registered with CTest through GoogleTest:

cmake -S . -B build
cmake --build build
ctest --test-dir build --output-on-failure

The Python tests live under tests/python/ and use pytest:

python -m pytest tests/python

Generate Documentation

Generate API documentation with Doxygen:

doxygen Doxyfile

The generated HTML entry point is:

docs/cpp/html/index.html

If you configure through CMake and Doxygen is available, you can also run:

cmake --build build --target docs

Repository Layout

include/stratax/      Public C++ headers
bindings/             pybind11 binding sources
python/stratax/       Python package
tests/cpp/            C++ tests
tests/python/         Python tests
examples/cpp/         C++ examples
examples/python/      Python examples
docs/cpp/             C++ API documentation
docs/python/          Python documentation

Installation

Python

pip install stratax

C++

Stratax is header-first for C++. Include the repository include/ directory in your build and include the umbrella header:

#include <stratax.h>

License

Stratax is licensed under the MIT License.

Contributing

Contributions, bug reports, and feature requests are welcome through GitHub Issues and Pull Requests.

Project Status

Implemented:

  • Core storage and metadata: Buffer, Shape, Strides, Slice
  • Containers: Vector, Matrix, Tensor
  • Operations: arithmetic, comparison, indexing, reshape, slicing
  • Container helpers: creation and conversions
  • I/O: stream printing
  • Python bindings: Shape, Vector, Matrix, Tensor, conversion free functions

Roadmap

  • Broadcasting
  • Logical operations
  • Linear algebra algorithms
  • Calculus helpers
  • Random sampling and distributions
  • Statistics routines
  • CSV and binary I/O

Download files

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

Source Distribution

stratax-0.2.0.tar.gz (670.7 kB view details)

Uploaded Source

Built Distribution

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

stratax-0.2.0-cp313-cp313-win_amd64.whl (198.3 kB view details)

Uploaded CPython 3.13Windows x86-64

File details

Details for the file stratax-0.2.0.tar.gz.

File metadata

  • Download URL: stratax-0.2.0.tar.gz
  • Upload date:
  • Size: 670.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for stratax-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cfae16db4a6a0f172422937f289ef742608bbf8214f16e7ca4bf00b26cc1586e
MD5 5aabe39596e8984b814c66edca314c63
BLAKE2b-256 27520d04a7280269f8ff91008c834c57bb784d8bec410251b6e33c384c75c566

See more details on using hashes here.

File details

Details for the file stratax-0.2.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: stratax-0.2.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 198.3 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for stratax-0.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 96b66494c41e672af89c970d17dd7dfb9fac24979868d34f94e63290eb7649f8
MD5 b7523a91432ae69bb1216baac093ddab
BLAKE2b-256 075a7a88f5d7f43de2a0f77c422d81122064c76332f5f164e99fafdda5e46e94

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.1

41 files

This release

0.2.0 This release

2 files

0.1.0

2 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