Skip to main content

A Python-native linear algebra library for learning, experimentation, and visual intuition

Project description

panchi

panchi

panchi is a Python-native linear algebra library designed for learning, experimentation, and visual intuition.

The goal is not performance. The goal is clarity.

TestCI PyPI version Python 3.10+ License: MIT Code style: black

Why panchi?

Most linear algebra libraries optimize for speed and abstraction. panchi optimizes for understanding.

panchi is built for students who want to see the math happen, educators who need transparent implementations, and anyone who has ever wondered what linear algebra is actually about.

Think of it as a lab, not a production engine.


Philosophy

  1. Explicit over implicit – Algorithms are implemented directly, not delegated to opaque backends
  2. Readable over clever – Code prioritizes clarity and educational value over terse optimizations and pythonisms
  3. Mathematical over computational – Objects behave like mathematical entities with proper operator overloading
  4. Visual by default – Visualization is a first-class feature, not an afterthought
  5. Informative errors – Error messages guide learning by explaining what went wrong and why

Installation

pip install panchi

Requires Python 3.10+. For optional Manim-powered visualizations:

pip install panchi[manim]

A Taste

import panchi as pan
from panchi.algorithms import rref, solve

# Vectors and matrices behave like their mathematical counterparts
A = pan.Matrix([[1, 2, 3], [2, 5, 7], [0, 1, 2]])
b = pan.Vector([1, 0, 0])

# Solve Ax = b — see the status, not just the answer
result = solve(A, b)
print(result.status)    # 'unique'
print(result.solution)  # the solution vector x

# Row reduction shows every step it takes
reduction = rref(A)
print(reduction)        # full step-by-step walkthrough
print(reduction.rank)   # 3

See what a matrix does to the plane:

from panchi.visualizations import Animator2D

animator = Animator2D()
animator.animate_transform(pan.Matrix([[0, -1], [1, 0]]))  # 90° rotation

Documentation

Full documentation, user guides, and the API reference are available at https://gustavo-galvao-e-silva.github.io/panchi/


Contributing

panchi welcomes contributions that align with its educational mission. See CONTRIBUTING.md for guidelines. Thanks to all of our contributors, whose names can be found in CONTRIBUTORS.md.


License

MIT License – see LICENSE for details.


Acknowledgments

panchi is inspired by Gilbert Strang's Introduction to Linear Algebra and 3Blue1Brown's Essence of Linear Algebra — resources that make the subject visible, not just computable.

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

panchi-1.0.0.tar.gz (40.8 kB view details)

Uploaded Source

Built Distribution

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

panchi-1.0.0-py3-none-any.whl (48.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: panchi-1.0.0.tar.gz
  • Upload date:
  • Size: 40.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for panchi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 07fe27d97d2fcfe6d6a48baf64c36a801a141ad91e417d990df7b0bd4f36fbec
MD5 cd5c33eaf81526e24b8cb6d731785a60
BLAKE2b-256 6ddd1482e05a558c24a0e0e9af8602cdc9d5c7a5aa7ad09e07a3eda3fcdeed7d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: panchi-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 48.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for panchi-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e39afe286190e5ca9ceb3808b4a585e4c667bc0733b89ec4e5d8f5851a07c503
MD5 c1f219f606b92ffb325b43fb99662fd4
BLAKE2b-256 cee02fd37d3d713a831e6d2b04d38c9b546dee3229932904ba3a12c8e5192e21

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