Skip to main content

Matrix operations and methods

Project description

matrixceax

matrixceax is a simple Python library for performing matrix operations.
It supports basic linear algebra operations, including addition, subtraction, multiplication, determinant, transpose, reshaping, and even negative powers (using matrix inverse).


##Download From:

https://pypi.org/project/matrixceax/0.1.0/

Features

  • Create matrices from lists of lists or single row.
  • Matrix addition, subtraction, scalar multiplication, and matrix multiplication.
  • Transpose, flatten, and reshape matrices.
  • Determinant calculation for square matrices.
  • Check for square, identity, symmetric, or zero matrices.
  • Raise a matrix to a positive or negative integer power.
  • Compute matrix inverse (for square, non-singular matrices).
  • Element-wise division by a scalar.
  • Operator overloading for Pythonic syntax:
    A + B
    A - B
    A @ B      # matrix multiplication
    A * 3      # scalar multiplication
    3 * A      # scalar multiplication
    A ** -1    # matrix inverse
    A ** 3     # matrix power
    

Create matrices

A = matrix([[1, 2], [3, 4]])
B = matrix([[5, 6], [7, 8]])

Arithmetic operations

C = A + B
D = A - B
E = A @ B
F = A * 2
G = 2 * A
H = A / 2

Properties

print(A.is_square())    # True
print(A.is_identity())  # False
print(A.is_symmetric()) # False
print(A.is_zero())      # False

Advanced

det = A.determinant()
A_inv = A.inverse()
A_pow = A ** 3
A_neg = A ** -1
A_T = A.transpose()
flat = A.flatten()
reshaped = A.reshape(1, 4)

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

matrixceax-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

File details

Details for the file matrixceax-0.1.0.tar.gz.

File metadata

  • Download URL: matrixceax-0.1.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for matrixceax-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eeeddb5eb5642b8a4a77b9f347acb3d2968f193e41c1ed67c4c943c0b8055390
MD5 4244cc1c6dbee6066cd210a40c8c3e73
BLAKE2b-256 b77acad026fe932dceca141626375750fea53d0dd52881a75efe7c4e593f4f55

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