Skip to main content

ogdoad

CI crates.io PyPI docs.rs License: AGPL v3

Ogdoad is a pure-Rust library for Clifford and Weyl algebras, quadratic forms, and related arithmetic over exact, finite, local, transfinite, and game-adjacent coefficient systems. Optional PyO3 bindings expose selected concrete backends without entering the generic math core.

The library supports degenerate metrics. In characteristic two it keeps the quadratic and polar data independent:

e_i^2             = q_i
e_i e_j + e_j e_i = b_ij

An optional upper-triangular a_ij records ordered contraction for a general bilinear metric. Generic product code obtains signs through Scalar::neg and does not special-case the characteristic.

Scope

A Clifford scalar is a commutative ring. Arbitrary partizan games form only an abelian group under disjunctive sum, so Ogdoad is not a Clifford algebra over all games. The scalar pillar includes field-like game subclasses such as finite nimbers and represented surcomplex numbers; genuinely game-theoretic constructions live in the separate games pillar.

Representation limits are part of the API:

  • Nimber(u128) is F_(2^128), not the algebraic closure of F_2.
  • Surreal stores finite-support Conway-normal-form expressions, not arbitrary surreal series.
  • valued and local models have explicit precision caps and do not silently claim exact field laws outside them.
  • Ordinal::nim_mul, nim_pow, checked_inv, and checked_sqrt preserve the supported Kummer-tower boundary through Option; the Scalar multiplication wrapper panics if that checked boundary is ignored.
  • fixed-width mathematical payloads use u128 or i128; usize is reserved for dimensions, indices, and ABI hooks.

Architecture

path role
src/scalar/ coefficient traits and exact, finite, valued, global, surreal, and ordinal backends
src/clifford/ metrics, blades, multivectors, products, versors, spinors, and geometric-algebra constructions
src/weyl/ alternating commutator forms, sparse PBW elements, Weyl products, filtrations, and the rank-one polynomial action
src/forms/ quadratic-form classification, Clifford centers, Witt/Brauer and low Milnor-symbol theory, Springer and local--global arithmetic
src/forms/integral/ lattices, discriminant forms, codes, theta series, genera, neighbors, and Weyl bridges
src/games/ impartial, partizan, misere, loopy, thermographic, Witt--FIFO/Brown, octal-certificate, Hackenbush, and game-exterior constructions
src/py/ optional per-backend PyO3 bindings; scalar worlds never mix at runtime
src/linalg/ crate-private shared linear algebra
grundy/ unpublished expression-language workspace crate using only Ogdoad's public API
formal/ separately pinned Lean 4 development
writeups/ current mathematical papers and BibTeX sources

Public pillars re-export their children shallowly. Each source pillar has an AGENTS.md with its local invariants; docs/README.md indexes the current project documentation.

The Weyl pillar constructs T(V)/(z_i*z_j - z_j*z_i - omega_ij) from an alternating scalar-valued commutator form. WeylAlgebra::standard(n) uses PBW order x_0,...,x_(n-1),d_0,...,d_(n-1) with [d_i,x_j] = delta_ij. Elements have finite sparse support, while the algebra remains infinite-dimensional. In positive characteristic the enlarged center is retained explicitly; the ordinary polynomial differential action is therefore not claimed faithful.

Use

Rust:

cargo add ogdoad
cargo run --example tour
cargo run --example weyl

Python 3.9 or newer:

python -m maturin build --profile dev -i python
python -m pip install --force-reinstall --no-deps target/wheels/ogdoad-*.whl
import ogdoad as og

# q and b are independent in characteristic two.
A = og.NimberAlgebra(q=[og.Nimber(2), og.Nimber(3)], b={(0, 1): 1})
e0, e1 = A.gen(0), A.gen(1)
assert e0 * e1 + e1 * e0 == A.scalar(og.Nimber(1))

# Exact finite-support surreal monomials.
S = og.SurrealAlgebra(q=[og.omega(), og.epsilon()])
assert (S.gen(0) * S.gen(1)) ** 2 == S.scalar(og.Surreal.from_int(-1))

# A Hermitian form restricts to the ordinary quadratic form q(v)=h(v,v)
# over the involution-fixed field; dimension doubles.
H = og.HermitianForm.diagonal([1, -1])
Q = H.restrict_scalars()
assert Q.dim == 4 and og.surreal_signature(Q) == (2, 2, 0)

# Checked game constructors preserve their proof and validation boundaries.
arena = og.WittFifoArena(diagonal=[True], polar=[0], input=1)
assert arena.quadratic_value and arena.grundy(state_budget=100_000) != 0

selector = og.BrownSelector(q4=[3], brown_polar=[0], input=1)
outcome = selector.outcome_class(state_budget_per_follower=100_000)
assert og.BrownSelector.decode_outcome(outcome) == selector.residue

code = og.OctalCode([2])
certificate = og.GuySmithCertificate.compute(code, 1, 2, term_budget=16)
assert certificate.heap_grundy(10**30) == 1

The Python layer monomorphizes a documented slice of the Rust backends. It does not provide a runtime-tagged any-scalar algebra. Its typed report surface includes finite quadratic modules and Nikulin criteria, extraspecial and Heisenberg--Weil objects, function-field Brauer--Wall classes, Niemeier data, finite-field Witt decompositions and numeric-invariant reports, characteristic-two additive spinor norms and symmetry certificates, lexicode turning games, conformal-algebra accessors, represented ordinal finite-subfield degrees, checked Witt--FIFO and Brown constructors, Hermitian restriction to typed ordinary quadratic backends, and sealed Guy--Smith periodicity certificates. Python repr delegates to canonical Rust rendering where the core provides it.

Mathematical status

The papers under writeups/ form one current research suite:

paper result
transfinite_arf.tex classification over perfect Artin--Schreier-surjective characteristic-two fields and its full-nimber specialization
goldarf.tex quadratic-refinement realization in normal play, Gold specialization, Brown selector, and game-exterior obstruction
witt_realization.tex quadratic Witt coordinates over F_2(t), finite impartial realization, explicit ramified naturality, and finite-static and singular no-go theorems
thermo_newton.tex thermic regrading under Norton multiplication and its separation from Newton tropicalization
semiring_stability.tex stable quadratic-pair classification over Hessenberg and supertropical semirings, the universal scalar-extension quotient, and the thermograph wall obstruction
linking_affine.tex proved reductions and exact remaining obstruction for isolated-dummy FIFO linking
excess.tex exact four-arm selected-order reduction, proved arithmetic boundaries, and authoritative open status of the transfinite nim-excess 0/1/4 rule
nim_fast_multiplication.tex quasi-linear canonical-word multiplication via explicit affine transforms to a primitive Artin--Schreier tower
misere_natural_realization.tex exact octal trace calculus, finite-exception heap normal form, realization of every tame finite quotient, and exact misere Grundy quotients through heap 18

The unresolved universal claims and their sharp proof boundaries are in docs/OPEN.md. Lean checks named algebraic components and end-to-end finite constructions including the literal Gold--Arf root; cited bridges and the open propositions remain outside that boundary. See formal/README.md for the theorem map.

Verification

cargo fmt --all --check
cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --workspace
(cd formal && lake build --wfail)
npm ci
python scripts/check_writeups.py

docs/VERIFY.md records the optional Python-binding gates, exactness contracts, certificate boundary, and claim classes. Contributions should identify mathematical claims as standard/cited, implemented and tested, proved here, or open; see CONTRIBUTING.md.

Ogdoad is licensed under AGPL-3.0-or-later.

Metadata

Release files for ogdoad 1.0.7

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

Source distribution (sdist)

Source distribution for ogdoad 1.0.7
File Size Uploaded
ogdoad-1.0.7.tar.gz 971.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for ogdoad 1.0.7
File
ogdoad-1.0.7-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
ogdoad-1.0.7-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details
ogdoad-1.0.7-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details
ogdoad-1.0.7-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
ogdoad-1.0.7-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
ogdoad-1.0.7-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
ogdoad-1.0.7-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 115.8 MB

Release files / ogdoad-1.0.7.tar.gz

Download URL ogdoad-1.0.7.tar.gz
Size 971.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4bcfa899703714ede487ffcc960af06f2cf512bf7ae748e6dc468a27d96961a3
BLAKE2b-256 checksum
How to use checksums
20709c2a3be04d79cc77bd5a33e284085309e4e8db11a68420c65ba57c600d44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release files / ogdoad-1.0.7-cp39-abi3-win_amd64.whl

Download URL ogdoad-1.0.7-cp39-abi3-win_amd64.whl
Size 18.0 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
9c9403b581938fc4efff2c8694fee14569a4289c2fe0844cdf577ffd86804bb9
BLAKE2b-256 checksum
How to use checksums
44184070f165a69dc175f8a2980b2436ed2f127143109be362d1a31dadc37919
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release files / ogdoad-1.0.7-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL ogdoad-1.0.7-cp39-abi3-musllinux_1_2_x86_64.whl
Size 17.6 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
5448cdcee9bd7d350eb9be6cd4b2b20e5725ffa168bb2dae72b4d06227ad288f
BLAKE2b-256 checksum
How to use checksums
59c37b3250be94314d6240d184064522c971557470d825802a723a529b78037f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release files / ogdoad-1.0.7-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL ogdoad-1.0.7-cp39-abi3-musllinux_1_2_aarch64.whl
Size 16.2 MB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
769085d61fbb695277dc3d950599502d0a380c8f70ba478f462750fcf6b48a62
BLAKE2b-256 checksum
How to use checksums
9a3d085c4f5182de0486f44faf298ae63ac78ab52ed5570e3a940454e396af31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release files / ogdoad-1.0.7-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ogdoad-1.0.7-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 15.9 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
b27ca6a8e66271f0f4f9b6ef0c721f6fff3e17fce65266bec213d5080b55c943
BLAKE2b-256 checksum
How to use checksums
48eda5f733379bba65711a98533885f39d28c97fadb04414b1e5abf820e4070b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release files / ogdoad-1.0.7-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL ogdoad-1.0.7-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 16.0 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
a601b561e8eef4660f0bbaa0ff53a600ebbb10d02172730ae04732a25a5da761
BLAKE2b-256 checksum
How to use checksums
60de00d3fe6c1cccb1001345d262940397ed7a5fbad661b47443783d19dd08da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release files / ogdoad-1.0.7-cp39-abi3-macosx_11_0_arm64.whl

Download URL ogdoad-1.0.7-cp39-abi3-macosx_11_0_arm64.whl
Size 15.0 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b524e522cd294427af72d8f8c23505ba02eb45589c5467b77a16311777801115
BLAKE2b-256 checksum
How to use checksums
3063bf6d39efc0da35d47979617126948310d2d3a2743e6768ebd5afe875ce56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release files / ogdoad-1.0.7-cp39-abi3-macosx_10_12_x86_64.whl

Download URL ogdoad-1.0.7-cp39-abi3-macosx_10_12_x86_64.whl
Size 16.1 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
3ef86818f1a3b3db0d941ea8494be231d807c2469844d61aab72b30d328d0c10
BLAKE2b-256 checksum
How to use checksums
94ded887d72a246a8e919c7b5bc2442deda244461dfc34822eca943ba88483a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.7 This release

8 release files

1.0.6

8 release files

1.0.5

8 release files

1.0.4

8 release files

1.0.3

8 release files

1.0.2

8 release files

1.0.1

8 release files

1.0.0

8 release files

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