Galixir.Table (galixir v0.26.0)

Copy Markdown View Source

Provides utilities for generating geometric product lookup tables.

The multiplication table contains the precomputed result of multiplying every pair of basis blades for a given metric signature.

It is used during algebra generation to avoid recomputing the geometric product at runtime. Each entry stores the coefficient and resulting blade produced by multiplying two basis blades.

The number of possible blades for an algebra of dimension n is:

2

where each basis vector can either be present or absent in a blade.

Summary

Functions

Returns the total number of basis blades for a signature.

Returns the range of blade indices for a given signature.

Builds a geometric product multiplication table for a metric signature.

Returns the dimension of an algebra signature.

Functions

blade_count(signature)

Returns the total number of basis blades for a signature.

The number of blades is 2ⁿ, where n is the dimension of the algebra.

Examples

iex> Galixir.Table.blade_count({1, 1, 1})
8

blades(signature)

Returns the range of blade indices for a given signature.

A dimension n algebra has 2ⁿ possible basis blades, including the scalar blade.

Examples

iex> Galixir.Table.blades({1, 1, 1})
0..7

build(signature)

Builds a geometric product multiplication table for a metric signature.

The returned map contains entries only for products that have a non-zero coefficient.

Each key is a pair of blade indices, and the value is the multiplication result:

{
  {left_blade, right_blade},
  {coefficient, result_blade}
}

Examples

iex> Galixir.Table.build({1, 1})
%{
  {0, 0} => {1, 0},
  {1, 1} => {1, 0},
  {0, 1} => {1, 1},
  {0, 2} => {1, 2},
  {0, 3} => {1, 3},
  {1, 0} => {1, 1},
  {1, 2} => {1, 3},
  {1, 3} => {1, 2},
  {2, 0} => {1, 2},
  {2, 1} => {-1, 3},
  {2, 2} => {1, 0},
  {2, 3} => {-1, 1},
  {3, 0} => {1, 3},
  {3, 1} => {-1, 2},
  {3, 2} => {1, 1},
  {3, 3} => {-1, 0}
}

The signature determines the metric used when calculating products:

  • 1 gives eᵢ² = 1
  • -1 gives eᵢ² = -1
  • 0 gives eᵢ² = 0

dimension(signature)

Returns the dimension of an algebra signature.

Examples

iex> Galixir.Table.dimension({1, 1, 1, 0})
4