clifra
Layout-first Clifford algebra tools for PyTorch.
A clifra algebra host owns its layouts, policies, and operation plans. Full-lane tensors and compact grade layouts share that algebra, while planning builds static executors for products, metrics, exponentials, and actions. Layers and other library components reuse the same operations.
Install
uv sync
uv sync --extra dev
Docs:
uv sync --group docs
uv run --group docs mkdocs serve
Minimal Use
import torch
from clifra import make_algebra
algebra = make_algebra(3, 0, device="cpu")
vectors = algebra.layout((1,))
products = algebra.plan_product(
op="gp",
left_layout=vectors,
right_layout=vectors,
output_layout=algebra.layout((0, 2)),
)
left = torch.randn(8, vectors.dim)
right = torch.randn(8, vectors.dim)
out = products(left, right)
Checks
uv run pytest tests/ -m unit -q --tb=short
uv run pytest tests/ -m "not slow" -q --tb=short
uv run ruff check .
uv run --group docs mkdocs build
See the documentation for tutorials, explanations, benchmarks, and the generated API reference.
Research
research/continuum_solver is one repository-local system built on clifra. It
uses clifra charts, bivector fields, and planned algebra operations to study
continuum deformations. It is an example of the library's use as research
infrastructure, not a definition of clifra's scope.
Contribution
Found a problem or want to propose a change? Please open an Issue first, especially before a PR, so the scope is clear.
For direct contact, email: nemonanconcode@gmail.com
License
Apache License 2.0. See LICENSE and NOTICE.
Citation
@software{kim2026clifra,
author = {Kim, Eunkyum},
title = {clifra: Clifford Algebra Layers for PyTorch},
url = {https://github.com/Concode0/clifra},
version = {1.2.0},
year = {2026},
doi = {10.5281/zenodo.18939518},
license = {Apache-2.0}
}
References
RotorGadget Background
The following paper is background reference material for RotorGadget. It is
not maintained as a normative implementation specification, and its inclusion
does not claim strict reproduction or conformance:
- Pence, T., Yamada, D., & Singh, V. (2025). "Composing Linear Layers from Irreducibles." arXiv:2507.11688.
Optimization Background
The tag-aware optimizers in clifra/optimizers/ dispatch spin, sphere, and
euclidean post-update handling. The following books are background references,
not normative specifications for those implementations:
- Absil, P.-A., Mahony, R., & Sepulchre, R. (2008). Optimization Algorithms on Matrix Manifolds. Princeton University Press.
- Boumal, N. (2023). An Introduction to Optimization on Smooth Manifolds. Cambridge University Press.
Metadata
Release files for clifra 1.2.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 | |
|---|---|---|---|
| clifra-1.2.0.tar.gz | 153.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| clifra-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 345.9 kB
Release files / clifra-1.2.0.tar.gz
| Download URL | clifra-1.2.0.tar.gz |
|---|---|
| Size | 153.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62669ab666734b07adced38db279b77f904f84093b98b3ce2b262f58a726f5cf
|
|
BLAKE2b-256 checksum How to use checksums |
c93b246535bc6783937f11c5a108898dc5afe6d1e899714198d245b868f10633
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / clifra-1.2.0-py3-none-any.whl
| Download URL | clifra-1.2.0-py3-none-any.whl |
|---|---|
| Size | 192.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ce2206203490ca6abdcaf5e010fa204ba2c70dffe68de20b1a7057fd4ccccd11
|
|
BLAKE2b-256 checksum How to use checksums |
c7d5bb04cd85506d49584111dd246736b247fe7d17f66884d28908f4c77171f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|