Skip to main content
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

The same tools work in three dimensions via Animator3D — vectors, spans, and 3x3 transformations in R³.


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.

Release files for panchi 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for panchi 2.0.0
File Size Uploaded
panchi-2.0.0.tar.gz 61.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for panchi 2.0.0
File Interpreter ABI Platform
panchi-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 136.3 kB

Release files / panchi-2.0.0.tar.gz

Download URL panchi-2.0.0.tar.gz
Size 61.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a1f514af90f302b836da6cbbb87b89b14c0e7c3aabfcb60f2ab91cab4d997d82
BLAKE2b-256 checksum
How to use checksums
a1e120fc5f00abc0ed4f783018ba3254fd56e298c307518a1ceaed2b0e7a773e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / panchi-2.0.0-py3-none-any.whl

Download URL panchi-2.0.0-py3-none-any.whl
Size 75.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb1e9c214948f8bcb266f7718e8c921fb3ec984c85368845bd3e51b33e2e8c6d
BLAKE2b-256 checksum
How to use checksums
43f2ee089a31222b488ec3c6215cdab6aa08568ad880ed90ab21140128e7dc6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14
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