Skip to main content

Crate geoit

Crate geoit 

Source
Expand description

§geoit — Exact Geometric Algebra for Rust

A governed geometric algebra engine with exact arithmetic. Zero floating-point operations. Zero dependencies.

§Where to Start

Easy path: use standard_registry() to get a working CGA, PGA, or VGA governance in one call — no manual class or construction setup.

Custom path: use GovernanceBuilder to define your own geometric classes with polynomial constraints, constructions, and transform rules.

§Quick Start

use geoit::*;
use geoit::governance;

// One call: complete CGA(2) with classes, constructions, constraints
let gov = standard_registry().instantiate_family("CGA", 2).unwrap();
let point = gov.construct(0, &[Scalar::from(3), Scalar::from(4)]).unwrap();
let geoit = governance::govern(&point, &gov, 0).unwrap();
assert!(geoit.is_satisfied());

§Custom Governance

use geoit::*;
use geoit::governance::expr::Expr;

let alg = Algebra::new(Signature::new(0, 0, 3).unwrap());
let class = GeomClassBuilder::new(&alg).grades(&[1]).build();
let body = Expr::Add(
    Expr::add(Expr::mul(Expr::param(0), Expr::gen(0)),
              Expr::mul(Expr::param(1), Expr::gen(1))),
    Expr::mul(Expr::param(2), Expr::gen(2)),
);
let gov = GovernanceBuilder::new(alg)
    .class("Vector", class)
    .construction("Vector", "Vector", 3, body)
    .build();

let p = gov.construct("Vector", &[Scalar::from(3), Scalar::from(4), Scalar::from(5)]).unwrap();
let g = gov.govern(&p, "Vector").unwrap();
assert!(g.is_satisfied());
assert_eq!(g.read_all().unwrap(), vec![Scalar::from(3), Scalar::from(4), Scalar::from(5)]);

§Five-Layer Architecture

  1. Scalar / Rat — exact arithmetic (ℚ → BigRat → radical extensions)
  2. Signature — define the algebra: Signature::new(1, 0, 3)? for CGA(2)
  3. Mv — sparse multivectors with exact coefficients
  4. Governance — polynomial constraints, constructions, transform rules
  5. Geoit — certified multivector with proof, profile, and readings

Re-exports§

pub use algebra::signature::Signature;
pub use governance::field::FieldOp;
pub use governance::governance::Governance;
pub use governance::phase::Phase;
pub use governance::category::GovernanceCategory;
pub use governance::category::GovernedMorphism;
pub use governance::compile::compile_field_eval_from_construction;
pub use governance::compile::partial_eval_expr;
pub use governance::compile::PartialMv;
pub use governance::compile::CompiledFieldEval;
pub use governance::compile::IntPoly;
pub use governance::family::standard_registry;
pub use governance::family::GovernanceFamily;
pub use governance::family::GovernanceRegistry;
pub use governance::pencil::build_full_hierarchy;
pub use governance::pencil::classify_pencil;
pub use governance::pencil::is_pencil_constructible;
pub use governance::pencil::pencil_levels_to_rules;
pub use governance::pencil::PencilType;
pub use governance::profile::GeneratorProfile;
pub use governance::rule::ProofTerm;
pub use governance::rule::TransformOp;
pub use governance::rule::TransformRule;
pub use algebra::blade_new::BladeKey;
pub use algebra::blade_new::BladeMask;
pub use algebra::mv::Mv;
pub use scalar::Coeff;
pub use scalar::Rat;
pub use scalar::Scalar;
pub use governance::geoit::Geoit;
pub use governance::geoit::GeoitSnapshot;
pub use builder::Algebra;
pub use builder::GeomClassBuilder;
pub use builder::GovernanceBuilder;
pub use builder::NamedGovernance;
pub use error::Error;
pub use error::NotFoundError;
pub use error::SignatureError;

Modules§

algebra
Clifford algebra engine.
builder
Builder API for Rust-native geoit usage.
codec
Native binary codec for geoit types.
error
Unified error type for the geoit crate.
governance
Governance system: constrain geometric algebras with equations.
scalar
Exact scalar arithmetic tower.

Macros§

mv
Construct an Mv from literal (mask, coefficient) pairs.