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

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 1.3.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 1.3.0
File Size Uploaded
panchi-1.3.0.tar.gz 48.6 kB Details

Built distribution (wheel)

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

Total release size: 105.3 kB

Release files / panchi-1.3.0.tar.gz

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

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

Download URL panchi-1.3.0-py3-none-any.whl
Size 56.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b44c67333812e88eceaf837f0b1c94993d2f5e4d042c329279864f0d19c87da2
BLAKE2b-256 checksum
How to use checksums
2275a15e407eaa8a23c054412f2832a643ae812b2c1137a2b72e74d80771b65f
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