clifra
clifra is a differentiable Clifford algebra computation layer for PyTorch. Signatures and grade layouts describe ordinary coefficient tensors; operations can be planned once and reused.
uv add clifra
import torch
from clifra import make_algebra
algebra = make_algebra(3, 0)
vectors = algebra.layout((1,))
product = algebra.plan_product(
left=vectors,
right=vectors,
output=algebra.layout((0, 2)),
)
left = torch.randn(8, vectors.dim, requires_grad=True)
right = torch.randn(vectors.dim)
out = product(left, right) # [8, 4]: scalar, e12, e13, e23
out.square().mean().backward()
The inputs store three vector coefficients each. The product broadcasts over the leading dimension and returns four scalar-and-bivector coefficients.
A signature defines basis products. A layout selects coefficient lanes, and a tensor contract declares compact or canonical storage. Planned operations fix these declarations while coefficient values and leading tensor dimensions remain ordinary PyTorch inputs.
Tutorials · How-to guides · Explanations · Research · API reference
Development
uv sync --group dev
uv run --group dev ruff check .
uv run --group dev pytest tests/ -n12 -q --tb=short
uv run --group docs mkdocs build
Please open an issue before proposing a substantial change. Contact: nemonanconcode@gmail.com.
Citation
@software{kim2026clifra,
author = {Kim, Eunkyum},
title = {clifra: Layout-first Clifford algebra tools for PyTorch},
url = {https://github.com/Concode0/clifra},
version = {2.0.3},
year = {2026},
doi = {10.5281/zenodo.18939518},
license = {Apache-2.0}
}
License
Metadata
Release files for clifra 2.0.3
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-2.0.3.tar.gz | 87.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| clifra-2.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 196.3 kB
Release files / clifra-2.0.3.tar.gz
| Download URL | clifra-2.0.3.tar.gz |
|---|---|
| Size | 87.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9665c18389dd487ed92ae75c218c04c037655ea9b041b81275436d073b790d87
|
|
BLAKE2b-256 checksum How to use checksums |
fad6fdef78ee3de734af3e90d6dc415afb675d906c91695d73cd8a6924923167
|
| 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-2.0.3-py3-none-any.whl
| Download URL | clifra-2.0.3-py3-none-any.whl |
|---|---|
| Size | 109.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c23d609970b06a571fc0fb015940d4c7f865a1f14bc59ee49de7560f2a78ad51
|
|
BLAKE2b-256 checksum How to use checksums |
09c34aa3cc64167bce2673aac4c9774d9b5e5b730bc397d4469a7b9f16f740fa
|
| 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}
|