geoit — Exact Geometric Algebra for Rust
A governed geometric algebra engine with exact arithmetic.
Zero floating-point operations. Zero dependencies. Every answer is exact.
What is geoit?
geoit is a Clifford algebra computation library that enforces mathematical
correctness through a governance system. You declare what geometric objects look
like (grade constraints, polynomial equations, inequalities), and geoit verifies
every multivector against those declarations before allowing parameter extraction.
The pipeline: Construct → Govern → Read
Parameters → Construction → Mv → Governance → Geoit → ReadingRules → Parameters
(x, y) formula ↓ verify ↓ extract (x, y)
└── exact Mv ───────└── proof + phase
The circuit must close: what you put in is what you get out.
Scalar Tower
All arithmetic is exact. No floats anywhere.
| Type | Range | When |
|---|---|---|
Rat |
i128/u128 rational | Default. Fastest. |
BigRat |
Arbitrary precision | Automatic on i128 overflow |
QuadraticSurd |
a + b√d, a,b ∈ ℚ | Square roots of rationals |
AlgebraicNumber |
Root of polynomial over ℚ | Resultant-based arithmetic |
Promotion is automatic. Demotion is attempted after every operation.
Quick Start
use *;
use ;
use Signature;
use Expr;
// 1. Define the algebra
let alg = new; // VGA3
// 2. Build governance
let class = new.grades.build;
let body = Add;
let gov = new
.class
.construction
.build;
// 3. Use it
let params = vec!;
let mv = gov.construct.unwrap;
let geoit = gov.govern.unwrap;
assert!;
let extracted = geoit.read_all.unwrap;
assert_eq!; // circuit closes
The mv! Macro
use mv;
let v = mv!; // 3e₀ + 4e₁ + 5e₂
let p = mv!; // ½e₀ + ½e₁
Supported Algebras
Tested across 10 algebra families:
| Algebra | Signature | Generators | Use |
|---|---|---|---|
| VGA(2) | Cl(0,0,2) | 2 | 2D Euclidean |
| VGA(3) | Cl(0,0,3) | 3 | 3D Euclidean |
| PGA(2) | Cl(0,1,2) | 3 | 2D projective |
| PGA(3) | Cl(0,1,3) | 4 | 3D projective |
| CGA(2) | Cl(1,0,3) | 4 | 2D conformal |
| CGA(3) | Cl(1,0,4) | 5 | 3D conformal |
| STA-WC | Cl(3,0,1) | 4 | Spacetime (west coast) |
| STA-EC | Cl(1,0,3) | 4 | Spacetime (east coast) |
| QGA(3) | Cl(3,0,6) | 9 | Quadric |
| VGA(5) | Cl(0,0,5) | 5 | 5D Euclidean |
Any signature up to 64 generators is supported.
Operations
Products: geometric, outer (wedge), inner (Hestenes), left/right contraction, scalar product, commutator, regressive (meet).
Unary: reverse, grade involution, Clifford conjugate, dual, undual, grade projection.
Derived: sandwich product, norm², inverse (blade/versor/general), normalized sandwich.
Field ops: scalar product (IPNS), outer product (OPNS), left contraction, inner product, geometric product, grade-k projection — all returning full Mv results.
Known Limitations
-
Surd radicand mismatch: Adding √2 + √3 panics at the QuadraticSurd level. Promote both to AlgebraicNumber first. (Will be addressed when Compass Ruler Algebra work lands.)
-
Algebraic degree cap: AlgebraicNumber operations cap result polynomial degree at 32. Operations exceeding this return
AlgebraicError::DegreeCap. The cap is a runtime policy — honest precision loss, not silent truncation.
License
[Your license here]