Tuesday, October 13, 2015

A Quick Start Guide to the Geometric Product - A Beginner's Perspective Part I

I am just learning about a phenomenal way of manipulating vectors and transforms called Clifford Algebra (or Geometric Algebra).  To give you an idea of how cool this, I first encountered this in reading a paper by David Hestenes on the Dirac Equation found here: (http://aflb.ensmp.fr/AFLB-283/aflb283p367.pdf), a paper I found by searching for the phrase "Dirac equation insight".  You see, the Dirac Equation is one of the closest things to black magic you will ever find in all of physics literature.  Now, as I am aware that some of the imaginary people who read this blog probably aren't well versed in Quantum Mechanics, I won't get into it, but I'll just say that he took an equation that uses bewildering abstract concepts, (which, in turn came from a formalism, that, though, esoteric, starts making sense once you strike your head forcefully, and in a disciplined manner, against hard surfaces enough) and reformulated it in a more concrete geometrical way.  In fact, one thing he was able to derive from his new reformulation was an interesting kinematic interpretation of electron Spin.  Now, don't be fooled by it being it being concrete and geometrical.  Indeed, to work his magic, Hestenes decided to rederive the equation using Geometric Algebra, which I will briefly describe in a little while.  As a caveat, I am a (possibly perpetual) theoretical math n00b (as you probably already realized), so if you are looking for a rigorous formulation of Geometric Algebra replete with axioms, and whatever the hell things like
 Gr_F C\ell(V,Q) = \bigoplus_k F^k/F^{k-1}
are, you'll have to look elsewhere.

Cramer's Rule: An Example to Whet Your Appetite

Now, unlike mathematicians, who almost universally seem to subscribe to the idea that gavaging students with definitions and theorems as an acceptable form of pedagogy, I will introduce you to example of how one might start thinking in a way that naturally leads to geometric calculus.  This section is actually quite long (as I need to account for deficits in understanding from my imaginary readership) so if you want to get to the actual quick start guide, skip it.

Let's start with a 2D system of equations.

$a_{00}x_0 + a_{01}x_1 = b_0\\
a_{10}x_0+a_{11}x_1=b_1$

Those of you familiar with linear algebra will think "no sweat", and and do something like treat the $a_{ij}$s as a matrix, M, treat this as a matrix equation, and then multiply both sides by the matrix inverse $M^{-1}$, which, of course, requires knowing what its components are.  Note, however, the similarity with the 1D case.  Ultimately, you end up multiplying both sides by an inverse.  This is a very consistent way to think about things, and with all linear equations, we can always do this, as long as we actually know how to find the inverse, but therein lies the rub.  It can be calculated, but doing so is laborious, and the end result makes little sense if you don't understand geometrically what's going on.

Now, there are other ways of solving  this system that are more geometrical.  I am going to use cross products.

First, we'll express this equation as 3D vectors:
$\begin{pmatrix}
a_{00}
\\
a_{10}
\\
0
\end{pmatrix}x_0 +
\begin{pmatrix}
a_{01}
\\
a_{11}
\\
0
\end{pmatrix}x_1 =
\begin{pmatrix}
b_0
\\
b_1
\\
0
\end{pmatrix}
$

Then, we'll just dispense with components, by writing

$\mathbf{A_0}x_0 + \mathbf{A_1}x_1 = \mathbf{B}$

Now, cross both sides by $A_1$ to solve for $x_0$

$\mathbf{A_1}\times\mathbf{A_0}x_0 = \mathbf{A_1}\times\mathbf{B}$

Then, we recognize that both sides point along the z axis, and so, we can dot with $\hat{z}$, and then divide by $x_0$'s coefficient on the LHS to get

$x_0 = \frac{(\mathbf{A_1}\times\mathbf{B} )\cdot \mathbf{\hat{z}}}{(\mathbf{A_1}\times\mathbf{A_0} )\cdot \mathbf{\hat{z}}}$

Likewise,

$x_0 = \frac{(\mathbf{A_0}\times\mathbf{B} )\cdot \mathbf{\hat{z}}}{(\mathbf{A_0}\times\mathbf{A_1} )\cdot \mathbf{\hat{z}}}$

Writing them out explicitly,

$x_0 = \frac{-a_{01}b_0 + a_{11}b_1}{-a_{01}a_{10} + a_{11}a_{00}}$
$x_1 = \frac{-a_{10}b_0 + a_{00}b_1}{-a_{10}a_{01} + a_{00}a_{11}}$

Now, if you know linear algebra, you will see that the denominators of $x_0$ and $x_1$ are just the determinant of the matrix

$\begin{pmatrix}
a_{00} & a_{01} \\
a_{10} & a_{11}
\end{pmatrix}$

Moreover, if you replace the first column of this matrix with the "b" vector,
$\begin{pmatrix}
b_0
\\
b_1
\end{pmatrix}$

You get the numerator of $x_0$.

Likewise, if you replace the second column of this matrix with the "b" vector, you get $x_1$'s numerator.

This is called Cramer's Rule, and is one of those things you can't believe nobody told you before.  It actually applies to linear systems of any dimension, and makes I (and many others) prefer it to the more laborious, and less illuminating, process of Gaussian Elimination, which is basically just the high school method of solving linear equations in slightly more respectable mathematical clothing.  Furthermore, Cramer's Rule has a geometric interpretation we can see, here.  Remember that the determinant is just a signed volume.  Therefore, Cramer's rule tells us that the solution to a linearly independent N degree linear equation is just the ratio of two different signed volumes.

The Geometric Product Between 2 Vectors


It turns out that the methods we have been using are precisely the methods that inspired the development of Geometric Algebra.  Now, dot and exterior products are both forms of multiplication, in that they distribute over addition, but they have some undesirable algebraic properties.  For example, the dot product takes two things (vectors), and returns an entirely different thing (a scalar).  In other words, it isn't closed.  Cross Product, while closed, is neither associative, nor commutative.  Neither operation has a useful concept of inverse.

William Kingdon Clifford had the brilliant idea to take the cross product and the dot product and combine them into one product that, in a sense, behaves better than either of them.  What I mean by this is that theoretically, it is more well behaved than either dot or cross product.  It is closed, unlike the dot product, and it is associative.  Furthermore, it allows for many elements to have inverses, and those inverses make geometric sense.  The price for this unification, is that the elements are no longer the familiar vectors and scalars of linear algebra, but are a collection of elements known as "multivectors", or "cliffs", depending on the author, but have no fear.  These elements can be represented as linear combinations of geometrically meaningful elements called blades.

Unfortunately, the Geometric Product is not that simple to present all at once, at least not if you don't want to assault the student with a barrage of new concepts, so we will start small.  So, without further ado, here is the geometric product between two vectors:

$UV = U\cdot V + U\wedge V$

It contains the $\wedge$ operator, which we have not defined, so let's do so.

As I said, the idea is to combine the dot product, and the cross product into a single multiplication.  However, there is are problems with doing that, the largest of which is that the cross-product is not associative.  In order for UV to be associative, $U\wedge V$ whatever it is, also must be associative.

To account for this, we introduce an entirely new operation that is both associative, and encodes the cross-product (or exterior product, for higher dimensions).

$U\wedge V$ is known as the wedge product, and its result is neither a vector, nor a scalar, but something entirely different.  There are two ways to think about it.  First, you can think about it as the parallelogram formed by U and V, with what's called an orientation.  An orientation can be clockwise or counter-clockwise.  Intuitively, imagine drawing out the parallelogram without lifting your pencil from the paper, using U as the starting edge, and V, as the edge.  This forces you to draw clockwise, or counter-clockwise.  If you draw counter-clockwise, your orientation is positive, and if you draw clockwise, your orientation is negative.  This is actually just the right hand rule.  It also means that the wedge product between two vectors encodes the cross product.

There is another way of speaking about this orientation, alegbraically, and that is that the wedge product between two vectors is anti-commutative.

Thus,

$U\wedge V = -(V \wedge U)$

The second way to think about the wedge product is as the subspace spanned by U and V.

The wedge product between two vectors is known as a 2-blade.

Now, some of you might be puzzled by the presence of this wedge, which is not a real number, and the dot, which is a real number, so we are adding un-like objects.  In fact, in geometric algebra, a general object can contain vectors, too!  However, we've added un-like objects to each other for years with complex numbers, so as long as this sum is irreducible to a real or bivector, there is no reason to complain.

So, what happens when we wedge $U\wedge V$ with a third vector, W?  Unsurprisingly, you can think of

$U\wedge V \wedge W$

as the parellelpiped formed by U, V, and W, again with an orientation, which is either -1, or 1, depending on orientations of the faces of the parallelogram.  The way to envision this orientation geometrically, this time, by drawing the outline of the parallelpiped, by drawing U as the first edge, V as the second edge, and W as the third edge, as shown in Fig. 1 (set U = P, V = Q, and W = R).  Unsurprisingly, this is called a 3-blade.  Likewise, wedging 4 times creates a 4-blade, and wedging k times, creates a k-blade.  Not everyone uses this terminology.  It is very common, also, to refer to a k-blade as a multivector, with a 2-blade known as a bivector, and a 3-blade known as a trivector.  I prefer the former terminology because it is less ambiguous, as using "vector" might suggest that the elements in question are types of vectors, which, they aren't at least not in a pedagogical sense.  Again, the other way to think about a k-blade is as the subspace formed by the k-wedged vectors.  The dimension of a k-blade is known as its grade.

Figure 1.  Source: https://slehar.wordpress.com/2014/03/18/clifford-algebra-a-visual-introduction/
Now, in introducing the concept of a k-blade, I lied a little.  It isn't always true that wedging with a vector with a k-blade produces a (k+1)-blade.  Geometrically, this is easy to see.  If the vector is a member of the subspace spanned by k former vectors, then you won't increase the dimension.  Another way to think about this is that the new parellelpiped will have a k-dimensional volume of zero--in other words, it vanishes!  Furthermore, we want to relate this to the cross-product, which we definitely want to associate with the 2-blade.  Therefore, if $U_0$, $U_1$, ..., $U_{k-1}$ are a set of linearly dependent vectors,

$U_0 \wedge U_1 \wedge \text{...} \wedge U_{k-1} = 0$

Let's return to the geometric product.

Now, one cool thing about this definition is that we can then recast dot and wedge in terms of this new multiplication.  Namely, dot product is

$\mathbf{U}\cdot\mathbf{V} = \frac{\mathbf{U}\mathbf{V} + \mathbf{V}\mathbf{U}}{2}$

and wedge is

$\mathbf{U}\wedge\mathbf{V} = \frac{\mathbf{U}\mathbf{V} - \mathbf{V}\mathbf{U}}{2}$

The geometric product encodes a lot of operations we perform with matrices.  As such, it simplifies thinking about things in several dimensions.  If you know it, it makes things like deriving Cramer's Rule trival.

I will give you a taste of this, now.  Take each side of your 2D system of equations and wedge it with $A_1$, to get,
$(\mathbf{A_1} \wedge \mathbf{A_0})x_0 = \mathbf{A_1} \wedge \mathbf{B}$

It turns out that  $(\mathbf{A_1} \wedge \mathbf{A_0})$ has a multiplicative inverse, which we will see in my next posting, so, we get

$x_0 = \frac{\mathbf{A_1} \wedge \mathbf{B}}{\mathbf{A_1} \wedge \mathbf{A_0}}$

Once you know how to find the multiplicative inverse, then all you need to do is plug it in, and you will arrive at your answer.

What's the *%@!!#!!! Definition of Geometric Product Already?

[Update: I think I now have a short definition of the Geometric Product, though, it requires knowing about, and understanding the extension of the inner product to multiple vectors.  Watch for the next posting for this definition.  I must say that after working with Geometric Algebra more intensely over the last week or so, I am strongly suspecting that, contrary to what I have been reading, the geometric product is a fairly simple concept to understand, and does not require lists and lists of definitions and theorems just to establish the key concepts.  On the contrary, I am almost certain that, as usual, the requisite key concepts are few, and easy to understand.]  


Unfortunately, there are several short answers, each with its own advantages and disadvantages.


  1. The geometric product is the associative multiplication you must get when you have a vector space, and your only further assumption (plus some minor technical assumptions for consistency's sake) is that a vector times itself is its squared magnitude.
  2. The geometric product is a product between linear combinations of blades and returns another linear combination of blades.  If you multiply two blades, the the resulting linear combination can be organized into geometrically meaningful groups, all sharing the same grade.
  3. The geometric product is the multiplicative operation of the ring generated by scalars and vectors, where a vector times itself is its magnitude squared.
  4. The geometric product is given by the following formula:
Source: http://arxiv.org/pdf/1205.5935v1.pdf
These are probably not very enlightening.  In fact, definition 1 was downright shocking to me.  I actually spent a few days convinced that it was an incomplete definition, and that you needed one other axiom concerning the definition of wedge products to have a complete, theory--but nope! [Update: I had said that you don't need an axiom concerning the definition of wedge products, and depending on your pedagogical needs, this isn't necessarily correct.  Personally, I do think that this axiom is required.  I made my initial claim based on a mistake I made in deriving the general wedge product ] Definition 2 is not really a fundamental definition, but it is at least descriptive, and prepares us for how to start thinking about the geometric product.  Definition 3 is the closest that I will come to giving a formal definition of the geometric product.  As for definition 4...no...just...no.

...

Ok, fine, but don't say I didn't warn you.  Definition 4 is the geometric product between two blades in all all its glory. You can understand it this way: Definition 4 gives a precise equation describing Definition 2.  It introduces the unfamiliar angle-bracket notation, where

$<A_rB_s>_k$ refers to generalizations of the wedge and dot product with grade k.  Specifically,

$<A_rB_s>_0 = A_r \cdot B_s$, and yes you can take the dot product between general blades.

and

$<A_rB_s>_2 = A_r \wedge B_s$

However, at this point, it would be silly to say more about them, and I only included it to show that there is a formula for the geometric product in terms of geometrically meaningful operations.

Unfortunately, none of these definitions are clear enough for my tastes.  It wish I had something as precise and illuminating as "multiplication between two numbers, M and N, is M added to itself N times", but alas, at this point of my understanding, I cannot.  At some point, in the future, when I have a fuller understanding of this subject, I hope that I can, despite Alan Macdonald's frustrating insistence to the contrary.  However, that doesn't mean I can't give a straightforward, albeit, long, description of it by building up concepts.

In fact, whether you realize it, or not, we have already defined the geometric product.  No other geometric product is possible, given the rules we have already established.  It naturally falls out.  The reason for this is our requirement of associativity of the product.  However, I won't leave you high and dry, or this wouldn't be called a "quick start guide."

The Geometric Product for Vectors

Now, I remarked that the geometric product relates two blades to each other in geometrically meaningful ways.  Superficially, you should already have seen this with my definition of the geometric product between two vectors being the sum of the dot and wedge product between them.  But to show you that I am not out of my gourd, and there really is computational power to this product, we'll explore it in more detail.  Let's consider a really concrete example: vectors in 3D space.

The unit vectors are $e_0$, $e_1$, and $e_2$.

Then, the geometric product for two vectors is pretty easy to see.
Namely,
$e_ie_i = {e_i}^2 = 1$

and

$e_0e_1 = -e_1e_0 = e_0\wedge e_1 = -e_1\wedge e_0$
$e_1e_2 = -e_2e_1 = e_1\wedge e_2 = -e_2\wedge e_1$
$e_2e_0 = -e_0e_2 = e_2\wedge e_0 = -e_0\wedge e_2$

In fact, if any two vectors, U, and V are orthogonal, then $UV = U\wedge V$.  This is easy to see, since we have already defined what the geometric product is for two vectors.

So, immediately, from this, we can see that the geometric product of two vectors
$a_0\mathbf{e_0} + a_1\mathbf{e_1} + a_2\mathbf{e_2}$

and

$b_0\mathbf{e_0} + b_1\mathbf{e_1} + b_2\mathbf{e_2}$

is
$a_0b_0 + a_1b_1 + a_2b_2 + (a_0b_1-a_1b_0)\mathbf{e_0\wedge e_1} +  (a_2b_0-a_0b_2)\mathbf{e_2\wedge e_0} + (a_1b_2-a_2b_1)\mathbf{e_1\wedge e_2}$

One important thing to realize about this expression is that the wedges are interchangeable with the geometric product, as long as we are wedging orthogonal vectors.  So, we can replace this expression with,

$a_0b_0 + a_1b_1 + a_2b_2 + (a_0b_1-a_1b_0)\mathbf{e_0e_1} +  (a_2b_0-a_0b_2)\mathbf{e_2e_0} + (a_1b_2-a_2b_1)\mathbf{e_1e_2}$

The coefficients of the $e_ie_j, i \neq j$ blades should look familiar.  They are precisely the components of the cross-product!  In other words, the cross product is actually encoded in the geometric product between two vectors.  This is no accident; it is a result of how we have defined the wedge product. [Update: Holy ^!%#%! and I just figured out how to recover the cross product (and the generalization of this, the exterior product) from this--and it is exceedingly simple.  I will cover this in  a blog posting, or two]

Breaking vectors into orthogonal components sheds light on what the product is, and is the first strategy I used in attempting to understand this algebra.  However, there is another way to understand it, using permutations, that is remarkably more effective for establishing all of its identities.  However, let's just stick to orthogonal vectors for now.  Sets of orthogonal vectors hold a privileged position in geometric algebra, as proven in our first theorem:

Anticommutivity Theorem:

Suppose we have n distinct, orthogonal, vectors, and you multiply them: $v_0v_1v_2...v_{n-1}$.
Well, it turns out that this product must be anti-commutative.

Proof:

To see this, we use associativity, which shouldn't be controversial, since we are assuming our product is a form of multiplication.

Now, without loss of generality, pick $v_0$ and $v_1$ and swap them.
This yields
$(v_1v_0)v_2...v_{n-1}$


Furthermore, we know that the geometric product of two orthogonal vectors is interchangeable with the wedge product, so, we get
$(v_1\wedge v_0)v_2...v_{n-1} = -(v_0\wedge v_1)v_2...v_{n-1} = -v_0v_1v_2...v_{n-1}$

In fact, the geometric product of orthogonal vectors takes a particularly simple form--a k-blade.  Now, initially, when I wrote this posting, I had thought to make this an axiom, and then, I made a mistake, and reneged on it.  However, I see, now, that my initial suspicion seems to be correct--in a sense.  You see, there are two ways of defining the wedge product in association with the geometric product.  The first is to define it explicitly in terms of the geometric product, which, despite being an awful pedagogical approach, is favored by pretty much everyone.  The second is the way I use, which is to define it, and then base the geometric product off of it.    Admittedly, the first approach is more elegant, in that you need fewer axioms, but I don't know why mathematicians (and many physicists) think that elegance is a good substitute for understanding.  It doesn't matter a whit how concise and direct your argument is if you can't get your point across to all but a subset of people who enjoy the gavage method of learning concepts${}^{\text{TM}}$.  Seriously, dudes, I know I harp on this a lot, but guys, how about you tone down the rigor when presenting new concepts?  You might get more people to like your subject, if you do.

Anyway, I keep meaning to make a blog post about my love/hate relationship with theoreticians, but that's for another day.  For now, let's just add an axiom, which I will call the

Fundamental Axiom

If $v_0$, $v_1$, ..., $v_{k-1}$ are all orthogonal vectors, then,

$v_0v_1...v_{k-1} = v_0 \wedge v1 \wedge ... \wedge v_{k-1} $

The motivation for this is consistency (as far as I can tell.  I am not certain what the original motivation was).  For two orthogonal vectors, this is true, so why not have it be true for more than two?  Indeed, there is a more formal reason why, based off of redundancy, but that is too complicated to get into, now.

Anyway, once we have this axiom, the geometric product can be completely defined.  By that, I mean you could write a straightforward, albeit, inefficient algorithm for calculating the geometric product using wedge products and scalars.

To see this, first, I need to show that if you have a product of multiple vectors, its value will depend fundamentally on how we define the product of orthogonal vectors.
Let's say you have a set of orthogonal vectors, O of size m, and you have a product that contains N vectors from this set O, where n > m.  Then, by the pigeonhole principle, this product contains at least one copy.

Let's construct two sets: $C_{odd}$ and $C_{even}$.

$C_{odd}$ is the set of all vectors that occur an odd number of times in the product.
$C_{even}$, likewise, is the set of all vectors that occur an even number of times in the product.

Furthermore, let $k = |C_{odd}|$

Orthogonal Product Theorem

Let $v_0$, $v_1$, ..., $v_{k - 1}$ be the set of vectors in $C_{odd}$.  Then, this product will be equivalent to $s\mathbf{v_0v_1}...\mathbf{v_{k-1}}$, where s is a scalar.

Proof:

I will start with an example.  Let O be {A,B,C,D}.  Suppose you have the product, $AAABBBCD$.
Rearrange this so you have $ABCD$ on the far right:

$AAABBBCD = AABBABCD$.

Now, $AA = A^2 = a$ and $BB = B^2 = b$, where a and b are scalars.

So, the result is:
$abABCD$

So, for the general proof, just as we did for the  we are going to reorganize the product in the following manner, multiplying it by the appropriate sign:
Let the right-most k terms be $v_0v_1...v_{k-1}$.
In the remaining product, there will be vectors in $C_{even}$, and vectors in $C_{odd}$.  Take each set of copies and place them to the left of $v_0v_1...v_{k-1}$ so that all copies of the same vector are adjacent to each other.  Now, the adjacent "runs" of $C_{even}$ will each yield scalars.  Likewise, the remaining adjacent "runs" in $C_{odd}$ will also produce scalars, since they will be even in length.  Then s is the sign multiplied by all the scalars to the left of $v_0v_1...v_{k-1}$.  We have thus proven our theorem.

Therefore, if we are only using orthogonal vectors, the result will simply be a scaled version of whatever the geometric product is for a set of distinct orthogonal vectors.''

Before I go on, let me introduce an abuse of terminology to make my life easier.  Call, a scalar, a single vector, or a product of multiple, distinct, orthogonal vectors a blade.  If it has k elements, then, we can also call it a k-blade. Furthermore, call a product of orthogonal vectors, which might include copies an orthogonal product.

Now, let's use Theorem 2 to prove its general version:

Geometric Product Theorem

Every geometric product of vectors is a linear combination of distinct blades.

Proof:

The proof for this is straightforward, but tedious if you write it out with actual algebra.  For the sake of brevity, I will merely give a prescription for how to do this.  Every vector is a linear combination of basis vectors.  Now, distribute the product over all linear combinations.  Then, you will get a sum of orthogonal products.  By theorem 2, each of these orthogonal products are then simply a blade multiplied by some scalar.