Skip to main content

Module engine

Module engine 

Source
Expand description

The multivector engine, generic over any Scalar backend.

§Metric data — characteristic-faithful by design

A blade is a u128 bitmask over basis generators e_0..e_127. The product is defined by three pieces of metric data:

  • q[i] = e_i², the quadratic diagonal;
  • b[(i,j)] = e_i e_j + e_j e_i for i < j, the polar form;
  • a[(i,j)] = B(e_i,e_j) for i < j, the in-order contraction of the general bilinear form used by the Chevalley product.

The full bilinear form has B(e_i,e_i) = q[i], B(e_i,e_j) = a[(i,j)], and B(e_j,e_i) = b[(i,j)] - a[(i,j)] for i < j. Ordinary (q, b) metrics leave a empty. In characteristic two, the alternating polar data b remains independent of the possibly nonzero quadratic diagonal q.

A zero q[i] gives a null generator. Setting all q, b, and a entries to zero gives the exterior algebra.

§Product

Ordinary (q, b) products satisfy the reduction rules

  e_i e_i  → q[i]                            (equal adjacent: contract)
  e_i e_j  → b[(j,i)] − e_j e_i   (i>j)      (out of order: swap, emit polar)

The minus sign goes through Scalar::neg, so it becomes addition in characteristic two. General metrics use the equivalent Chevalley contraction determined by q, b, and a.

Structs§

CliffordAlgebra
A Clifford algebra: metric + derived dimension. Produces and combines multivectors.
Metric
The metric of a possibly degenerate Clifford algebra.
Multivector
A multivector: blade-mask → coefficient (zeros never stored).

Constants§

MAX_BASIS_DIM
Blade masks are u128, so the basis has at most 128 named generators.

Functions§

bits
Ascending list of set-bit indices of a blade mask.
grade
The grade (number of generators) of a blade mask.