Vecta
A computational maths library for ML, built from scratch in C++ with Python bindings. The long-term goal is to work chapter-by-chapter through Mathematics for Machine Learning (Deisenroth, Faisal, Ong), implementing every concept myself instead of reaching for a library.
Current state
The linear-algebra core is up and running as a header-only C++ template library, exposed to Python through a single pybind11 module:
Matrix<T>— row-major dense matrix with(i, j)accessmatmul,add,scalar_mul— arithmetic (with dimension checking)transpose,identity,is_symmetric
C++ and Python test suites are planned but not written yet.
Stack
- C++17 header-only core (no external maths dependencies — everything implemented from scratch)
- pybind11 for Python bindings (fetched via CMake
FetchContent) - scikit-build-core + CMake for packaging
- uv for the Python venv and all package installs (no pip commands)
Layout
include/vecta/linalg/ C++ headers (header-only core)
matrix.hpp Matrix<T> class
ops.hpp matmul, add, scalar_mul, transpose, identity, is_symmetric
src/bindings.cpp pybind11 binding code (module `_vecta`)
python/vecta/ Python package wrapper (imports `_vecta`)
examples/ scratch space for worked examples from the book
tests/cpp/ Catch2 tests (planned)
tests/python/ pytest tests (planned)
Dev workflow (uv-based, no pip)
Create the venv and install the package in editable mode:
uv venv
source .venv/bin/activate
uv pip install -e . --no-build-isolation
Rebuild + reinstall the Python module after changing C++ code:
uv pip install -e . --no-build-isolation
Try it from Python:
from vecta import _vecta as v
A = v.Matrix(2, 2)
A.set(0, 0, 1); A.set(1, 1, 1)
print(v.matmul(A, v.identity(2)))
print(v.is_symmetric(A))
Roadmap
Follow the book chapter by chapter, folding each topic into include/vecta/<chapter>/,
src/bindings.cpp, and python/vecta/:
| Topic | Book chapter | Status |
|---|---|---|
| Linear Algebra | Ch 2 — Linear Algebra | Matrix + core ops |
| Analytic Geometry | Ch 3 — Analytic Geometry | not started |
| Matrix Decompositions | Ch 4 — Matrix Decompositions | not started |
| Vector Calculus | Ch 5 — Vector Calculus | not started |
| Probability and Distributions | Ch 6 — Probability and Distributions | not started |
| Continuous Optimization | Ch 7 — Continuous Optimization | not started |
| Linear Regression | Ch 9 — Linear Regression | not started |
| Dimensionality Reduction (PCA) | Ch 10 — Dimensionality Reduction | not started |
| Density Estimation (GMM) | Ch 11 — Density Estimation | not started |
| Classification (SVM) | Ch 12 — Classification | not started |
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vecta_math-0.0.2.tar.gz.
File metadata
- Download URL: vecta_math-0.0.2.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b46068280464b4337a9af7debc02a821cbb81490c5fa186435587711bef39847
|
|
| MD5 |
dbd3d564e222aff931f3c44d6491b2ef
|
|
| BLAKE2b-256 |
3ab9d6e7c70cd3d6ed4089f88ce020d41e42a68789b7b8899b1159bd57069ded
|
File details
Details for the file vecta_math-0.0.2-cp314-cp314-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: vecta_math-0.0.2-cp314-cp314-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 80.9 kB
- Tags: CPython 3.14, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2518092007f05ea2dcd645251090c72aa7847fa6ba7045aed8147547ad02124d
|
|
| MD5 |
7f14d787065e5f7d0ec3ce23b8fa6c19
|
|
| BLAKE2b-256 |
8f2817b7eb500ce963b046b4ab3c6c3fa255d7690b539372ebbc24e6035aa14a
|