Skip to main content

Linear algebra on Python — вектора, матрицы, разложения

Project description

Algebrix


Algebrix is a simple and powerful library for working with vectors and matrices. Supports basic linear algebra operations, including:

  • Addition, subtraction, scalar and matrix multiplication

  • Normalization of vectors, calculation of angle, projections

  • Transpose, inverse matrix, reshape

  • And much more

Installing

pip install algebrix

Usage examples

from algebrix import Matrix, Vector

# Векторы
v1 = Vector([1, 2, 3])
v2 = Vector([4, 5, 6])

print(v1 + v2)             # Vector([5, 7, 9])
print(v1.dot(v2))          # 32
print(v1.norm())           # 3.741...
print(v1.project_onto(v2)) # Проекция v1 на v2

# Матрицы
m1 = Matrix([[1, 2], [3, 4]])
m2 = Matrix([[5, 6], [7, 8]])

print(m1 + m2)             # Matrix([[6, 8], [10, 12]])
print(m1 * m2)             # Matrix([[19, 22], [43, 50]])
print(m1.T())              # Matrix([[1, 3], [2, 4]])
print(m1.inverse())        # Matrix([[-2.0, 1.0], [1.5, -0.5]])

🧠 Features

🟦 Vector Class

Implements:

  • add, sub, mul, rmul

  • dot(other): dot product

  • norm(): Euclidean norm

  • normalize(): unit vector

  • project_onto(other): vector projection

  • angle_with(other): angle between vectors (in radians)

🟩 Matrix Class

Implements:

  • add, sub, mul, rmul

  • T(): transpose

  • inverse(): matrix inverse

  • shape(): returns (rows, cols)

  • reshape((new_rows, new_cols)): reshapes the matrix

🛠️ Requirements

  • Python 3.10+

  • Only depends on the built-in math module (no third-party dependencies)

Project details


Download files

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

Source Distribution

algebrix-1.0.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

algebrix-1.0.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file algebrix-1.0.0.tar.gz.

File metadata

  • Download URL: algebrix-1.0.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for algebrix-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e82fe0d735aa3fbc8e167cf6ce854a6bedb4a10ee6793659bc288eb42242fa84
MD5 40b7bbeb382d4024eb9a4d47f56921d9
BLAKE2b-256 d385f17f94c6088cb48dd2f1a8d351d1ab4147abe819d2136336e0ad755d0f29

See more details on using hashes here.

File details

Details for the file algebrix-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: algebrix-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for algebrix-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 165442d3e6f64731b5c1f5eebdbf556cff667b1ffb91dbf30eed7866b0da4cc7
MD5 35ecd5ba2bcb69feadd066da99935e23
BLAKE2b-256 e57026c54371f05504bcaf07cc95ea3fc8335c0f7a0cd615eaab6e6c87e97ba9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page