Vector Expression Emitter (VEE): Geometric Algebra Code Generator
The goal of this crate is to generate optimized code for geometric algebra flavors.
- Zero non-optional dependencies.
- Uniquely reduce symbolic multivector expressions for algebraic and structural equivalence to coincide.
- Generate text form in Unicode/ASCII/LaTeX mode.
- Generate code form in generic/Rust mode.
- Generate list form (i.e., s-expressions, Scheme, or
egglog) in Unicode/ASCII mode. - Generate tree form (i.e., DOT graphs as in
text/vnd.graphviz) in Unicode/ASCII mode. - Eliminate orthonormalization conditions from expressions using reflection/projection operator by factoring pinned symbols, GCD coefficients, and predominant signs.
- Evaluate symbols as rationals.
- Count operations (i.e., multiplications and additions).
- Define the metric-agnostic basis, i.e., elliptic, hyperbolic, and parabolic (Euclidean) along with the multivector entities for dimensions D = N + 1 <= 8 of the plane-based pistachio flavor, i.e., projective geometric algebra (PGA).
- Simplify emitter by flattening expression tree into token stream and perform defer logic during stream iteration rather than tree traversal.
- Explore
egglogto further optimize expressions to reduce operation count by domain-specific common subexpression elimination (CSE) targeting exterior products. Reduce search space by leveraging applicable geometric decomposition, e.g., Euclidean decomposition for parabolic reflection operator. If promising, import expressions back. - Generate expressions in SIMD mode.
- Define other geometric algebra flavors.
See the release history to keep track of the development.
Build the documentation with cargo-tex. Note that navigating the documentation requires web access as KaTeX is embedded via remote CDN.
cargo tex --openCopyright © 2025-2026 Rouven Spreckels rs@qu1x.dev
Licensed under the terms of the MPL-2.0.
Unless you explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Covered Software by You shall be licensed as above, without any additional terms or conditions.