Morphis
A unified mathematical framework for geometric computation, providing elegant tools for working with geometric algebra, manifolds, and their applications across mathematics and physics. The name derives from Greek morphe (form) — embodying the transformation and adaptation of geometric structures across different contexts while preserving their essential nature.
A 4D orthonormal frame rotating through bivector planes, projected to 3D. The view switches between e₁e₂e₃ and e₂e₃e₄ projections mid-animation.
Features
- Geometric Algebra Core: Vectors (k-vectors), multivectors, and operations (wedge, geometric product, duality)
- Metric-Aware: Objects carry their metric context (Euclidean, projective, etc.)
- Linear Operators: Structured linear maps between vector spaces with SVD, pseudoinverse, least squares
- Visualization: 3D rendering of vectors with PyVista, timeline-based animation, 4D projection
- Motor Transforms: Rotors and translations via sandwich product
Documentation
- Project Overview — Vision and scope
- Concepts — Mathematical foundations (vectors, products, duality, transforms)
- Examples — Worked examples, their mathematics and visualization styles
- API Reference — Public interface
- Architecture — Design philosophy and decisions
Quick Start
from morphis.elements import Frame, basis_vectors, euclidean_metric
from morphis.operations import normalize
from morphis.transforms import rotor
from numpy import pi
# Create a 3D Euclidean metric and basis vectors
g = euclidean_metric(3)
e1, e2, e3 = basis_vectors(g)
# Bivector: oriented plane of rotation
b = (e1 ^ e2).normalize()
# Frame: ordered collection of vectors
F = Frame(e1, e2, e3)
# Rotor: multivector that performs rotation
R = rotor(b, pi / 4)
# Transform vector and frame via sandwich product
e1_rotated = e1.transform(R)
F_rotated = F.transform(R)
Installation
Requires Python 3.12+.
pip install morphis
From Source
git clone https://github.com/ctl-alt-leist/morphis.git
cd morphis
make install
Project Structure
morphis/
├── src/morphis/
│ ├── elements/ # Core GA objects: Vector, MultiVector, Frame, Metric
│ │ └── tests/
│ ├── algebra/ # Linear algebra: VectorSpec, einsum patterns, solvers
│ │ └── tests/
│ ├── operations/ # GA operations: wedge, geometric product, duality, norms
│ │ └── tests/
│ ├── transforms/ # Rotors, translators, PGA, motor constructors
│ │ └── tests/
│ ├── visuals/ # PyVista rendering and recording, ink sketches, themes
│ │ └── drawing/ # Vector mesh generation
│ ├── examples/ # Runnable demos
│ └── utils/ # Easing functions, pretty printing
├── docs/ # Design documents
├── pyproject.toml # Project configuration
├── Makefile # Development commands
└── ruff.toml # Linting configuration
Development
This project uses uv for Python project management.
Setup
make install # Create venv, install dependencies, setup pre-commit hooks
Or step by step:
make setup # Create venv and sync dependencies
uv run pre-commit install # Install git hooks
Common Commands
| Command | Description |
|---|---|
make lint |
Format and lint code with ruff |
make test |
Run tests with pytest |
make build |
Build distribution packages |
make clean |
Remove generated files and caches |
make reset |
Clean and reinstall from scratch |
Testing
Tests are co-located with source in tests/ subdirectories:
make test # Run all tests
uv run pytest src/morphis/elements -v # Run specific module tests
Code Style
- Python 3.12+ with type hints
- Ruff for formatting and linting
- Pre-commit hooks run automatically on commit
Release Workflow
Releases are triggered by git tags. When a tag matching v* is pushed, GitHub Actions automatically builds and publishes to PyPI.
To Release a New Version
- Update version in
pyproject.toml - Commit the change
- Run
make publish
# Example: releasing version 0.2.0
# Edit pyproject.toml: version = "0.2.0"
git add pyproject.toml
git commit -m "Bump version to 0.2.0"
make publish
The make publish command will:
- Read the version from
pyproject.toml - Create a git tag
v{version} - Push the tag to trigger the release workflow
License
MIT License - see LICENSE file for details.
Claude Code was used in the development of this project.
Metadata
Release files for morphis 0.18.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| morphis-0.18.0.tar.gz | 285.5 kB | Without provenance | Details for morphis-0.18.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| morphis-0.18.0-py3-none-any.whl | Python 3 | none | any | Details for morphis-0.18.0-py3-none-any.whl |
Total release size: 627.7 kB
Release files / morphis-0.18.0.tar.gz
| Download URL | morphis-0.18.0.tar.gz |
|---|---|
| Size | 285.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
936be5038a48826d9d391535e681acbcfde66c08894ce75637f12ebb7b74967a
|
|
BLAKE2b-256 checksum How to use checksums |
50c84dd0f107706ed37fdd1bdf13973b3dce4d4f6687070ae5ed2a197e39d542
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / morphis-0.18.0-py3-none-any.whl
| Download URL | morphis-0.18.0-py3-none-any.whl |
|---|---|
| Size | 342.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49eeb269e7566ba835961a5921a48a8b590bd89786a45e3b18764ceb0d237394
|
|
BLAKE2b-256 checksum How to use checksums |
a59825eb83b25bf341fe8fae47b12a55c4e15665e8443f7d7b97ac8a6f0208ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for morphis 0.18.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.