geomalgebra

Geometric Algebra implementation in Python. Created for Summer of Math Exposition 2 competition.

Overview

The tutorial is organized roughly according to chapters 1 - 3 of Geometric Algebra Primer by Jaap Suter (2003). A copy of the pdf is included in the repository. Suter explains the theory very well, so I wanted these notes to focus more on implementation.

Some topics covered:

  • Subspaces
  • Basis Blades (scalar, vector, bivector)
  • Multivectors
  • Geometric Product

Install

git clone https://github.com/ImAKappa/some2.git

conda create -n some2 python=3.10 --file some2-env.txt

Tested on Windows WSL2 for Python 3.10. The minimum supported Python version is 3.10, but can be adapted to 3.9 by modifying syntax for type hints and some standard library functions.

Learn Geometric Algebra

Beyond this tutorial, I recommend viewing these resources in the following order:

Background

Last year, I came across a kind of math called Geometric Algebra (GA). It was interesting because proponents said it’s like linear algebra but more suitable for geometrical applications. I was a bit skeptical since it was a bit obscure, but figured why not try to learn it.

The theory was not too bad to get the hang of, but it was much harder for me to grok numerical GA. In my head there was a big disconnect between symbolic manipulations of GA and corresponding computer implementations. I found many neat libraries like Ganja.js, Clifford, and Klein. They were nice to use, but their implementations were a bit too complicated for me. I figured if I wanted to understand numerical GA better, I needed to try and implement my own GA library. “But maybe later” I said, not really knowing where to start.

When 3Blue1Brown announced the SoME2, I found the motivation to actually start the project. It was a bit tricky to put together a GA implementation that was understandable, not only to myself, but to other people. Hopefully I succeeded, or at least got a few new people interested in GA. Of course, the repository won’t be abandoned after the competition ends. My next goal is to explain and implement a very interesting flavour of geometric algebra called Plane-Based Geometric Algebra. But that’s a project for future me.