
An Introduction to Geometric Algebra - ingve
https://bitworking.org/news/ga/2d
======
macawfish
I LOVE Clifford algebra. It has been a gateway for me into multilinear algebra
and abstract algebra, among other topics.

If a computer were able to do Clifford multiplication in a single process,
it'd be able to do some NP tasks in polynomial time. Clifford algebras are a
sweet intersection of combinatoric and geometric thinking.

Edit: didn't even read the article, just upvoted because of the topic.

~~~
petters
Which NP tasks? ("Some" NP tasks are already possible in polynomial time)

~~~
trashtoss
Seconding the question because I want to see the encodings.

Intuitively this makes sense: in the GA formalism a "single" term requires 2^n
fields (where n is the spatial dimension), and "simple" operations like
addition and multiplication thus require 2^n (or more) operations to evaluate.

If you could instead somehow do those operations in O(1) time you would
clearly pick up a rather nice speedup, but again I'm curious what the problems
and encodings (as GA) actually look like.

~~~
trashtoss
Actually easy to find, for example here:
[https://members.loria.fr/RSchott/staceyredujanv08.pdf](https://members.loria.fr/RSchott/staceyredujanv08.pdf)
.

~~~
macawfish
Yup, that's what I was thinking of.

------
pizza
There's a library called versor that might be handy for folks that want to use
geometric algebra in programs.

[https://github.com/wolftype/versor](https://github.com/wolftype/versor)

[https://github.com/weshoke/versor.js/](https://github.com/weshoke/versor.js/)

~~~
grondilu
Perl 6 users should also check out my library inspired from versor.

[https://github.com/grondilu/clifford](https://github.com/grondilu/clifford)

It's not as well optimized but it's much easier to use.

------
ajamesm
> Similarly, to rotate vectors you have to create matrices, which don't exist
> in ℝ2, and apply them to vectors through matrix multiplication.

You don't "need" matrices, they're just one way to represent linear functions
that map vectors, and the complex field is another (for R^2).

Coincidentally, most of the concrete implementation described for operations
in G^2 here are applications of Euler's formula.

This article drops off in extending the lessons from R^2 to R^3.
Comparatively, matrices excel for comprehensibility in this regard -- if you
know how to apply matrices in R^N, you can apply the same knowledge to R^N+1.

~~~
Koshkin
> _You don 't "need" matrices, they're just one way to represent linear
> functions_

Is there another way?

~~~
ianai
As vectors, as algebraic formulae, as a graph, etc

------
contravariant
Please don't conflate sets with algebras. Strictly speaking the tuple (R^2, +,
·) (where · is multiplication by a scalar) is a linear algebra over R, R^2 is
just a set.

Now I know mathematicians often refer to spaces by their underlying set, but
the notation G^2 doesn't really make sense (for starters R^2 = R x R, what is
G?). Calling it the Geometric Algebra over R^2 would be fine. You can even
refer to it as just R^2, as long it's clear that you're using the geometric
product (and what metric you're using).

~~~
ajamesm
You're right, it's not really the product of some set "G" with itself but
hooooo boy a programming/hacker forum is probably the wrong place to be
defending the syntax of mathematical notation

~~~
catnaroek
If anything, programmers should (and often do!) complain that mathematical
notation and terminology _isn 't_ defined rigorously enough, and that the main
justification for many design decisions is “hysterical raisins”. By
comparison, even the wackiest programming languages are the parangon of
consistency - after all, they have to be interpreted by machines that can only
follow rules.

~~~
ajamesm
I'm reading a disagreement in your phrasing, but I think we're saying the same
thing: Math notation is the wild west, dressed in the veneer of consistency
but indignant at any untoward implication.

Programming languages are praised by their elegance and economy, even when
they're wacky. Any theory (programmatic, mathematical, scientific) benefits
from those qualities, because theories like to be axiomatic and terse. But any
primer or intro or lesson is made MUCH better through repetition and
redundancy. Computers don't need the rule of three, people do, and there's an
mismatch.

~~~
catnaroek
Yes, there's a disagreement. contravariant's complaint about the notation G^2
is completely justified.

~~~
ajamesm
I would object too, but I don't see how that could be confusing moreso than
any whiteboard "you get what I mean" pseudocode.

The reader's walking in with knowledge of the product-based construction of
N-dimensional space, and we readily admit that "R^2" is (a set literally, but)
taken to mean the space equipped with whatever operations appropriate for
whatever algebra.

I'm being kinda sophist on this. "G^2" isn't meaningful. I agree. But given
the convention of naming a set with the implication of whatever
topology/metric/norm, the notation is already under harsh torture, right..?

~~~
catnaroek
In my reply to contravariant, I explain why I don't think R^2 constitutes
abuse of notation:
[https://news.ycombinator.com/item?id=13241874](https://news.ycombinator.com/item?id=13241874)
.

------
yk
Read it first as algebraic geometry, was confused that I understood some of
the words.

------
yequalsx
It's hard to understand why he complains about vector operations that require
stepping outside of R^2 but then introduces a 4 dimensional vector space. The
justification needs to be reworded in my opinion.

~~~
dpwm
It really doesn't help that in 2D you can't do much that you can't do with
complex numbers.

I'm not a mathematician and I really struggle with just accepting the
mathematical definition. I've found it helpful to think of the geometric
algebra as an extension of the R^2 to contain scalars and geometrically well-
defined imaginary numbers. In R^2, the dot product maps to R. You can't store
this in R^2. You can store this in the corresponding geometric algebra.

For R^3, the corresponding geometric algebra forms an 8-dimensional space: 1
for the scalars, 3 for the vectors, 3 for the bi-vectors (planes formed by the
3 basis vectors) and 1 as the geometrically meaningful imaginary part. And yet
in 3D and beyond, geometric algebra provides a really elegant framework for
rotations in a way that is consistent, self-contained, and readily extends to
higher dimensions.

------
divyekapoor
Thanks for the clear and concise exposition. It was quite useful.

