logo back up home forward   further reading more topics »

Maths - Clifford Algebra - Arithmetic

This page defines the general concepts of mathematical operations that can be applied to any dimensional multivectors.

The specific rules for multivectors based on a given dimension vector is explained on these pages:

The above pages also contain a calculator for these multivectors.

The multivector is made up of elements of different grades (scalar, vector, bivector, etc.) for example:

parameter    
double e; scalar  
double e1,e2,e3 vector e1 = e1,e2 = e2 ,e3 = e3
double e12,e31,e23 bivector e12 = e1 ^ e2 ,e31 = e3 ^ e1 ,e23 = e2 ^ e3
double e123 trivector e123 = e1 ^ e2 ^ e3

Adding multi vectors numbers

Just add each corresponding element independently.

For example if we are adding multivectors a and b, if multivector 'a' contains the element a.e2 and multivector 'b' contains the element b.e2 then the corresponding element in a+b will be:

e2 = a.e2 + b.e2

Subtracting multi vectors numbers

Just subtract each corresponding element independently.

Multiplying multi vectors numbers (geometric product)

There are different types of multiplication defined for multivectors. Here we are discussing the geometric product which is the main type of multiplication and is what is meant when we use the '*' symbol.

To multiply two multivectors (a * b) then we multiply each part of a by each part of b, so that we have multiplied every combination of terms.

The main type of multiplication, which is described here, is geometric multiplication.

Each term can be calculated as follows, for example when working out the 5th term in the first multivector a.e12 e1^ e2 multiplied by the 6th term in the second multivector b.e31 e3^ e1 we get the magnitude a.e12*b.e31 and the type e1^ e2 * e3^ e1 which can be calculated as follows:

The type of each term can be calculated by following these rules:

  1. Write down the indices of both terms, the indices of the left hand multiplicand followed immediately by the indices of the right hand multiplicand without a space. If either of the terms is negative then put a negative sign in front, if both terms are negative then the composite is positive.
  2. We then need to convert this into a valid element for the multivector, to do this we need to remove any duplicate indices and get the indices in the right order for the multivector (the order of indices chosen for a given multivector is not standardised but we must be consistent about it so I have defined what basis I will use here for given multivectors here: 2D, 3D, 4D or 5D). In order to do this we apply the following rules as often as required to get to a valid element.
  3. Adjacent duplicate indices can be removed, in other words if two of the same index like '22' are next to each other they are both removed. If the dimention squares to a negative value then the sign of the term is also changed. If the dimention squares to zero then the whole term is set to zero.
  4. We can swap adjacent indices, every swap of adjacent numbers inverts the sign. The exception to this is if the adjacent numbers are identical, in this case apply the rule for adjacent duplicate indices above.
  5. If we need to swap non-adjacent numbers we can do this by a sequence of adjacent swaps (each one inverting the sign). As a short cut we can also swap any non-adjacent indices, just inverting the sign once, this short cut only works if neither of the two indices being swapped crosses over an index which is the same as itself (because that would be equivalent to swapping adjacent duplicate indices which is not allowed). In this case restrict yourself to adjacent swaps until the duplicate is removed.
  6. If there are no numbers left the result is e (or -e if negative).

The pages listed at the top, containing arithmetic of multivectors based on various dimensional vectors, contain complete tables containing the result of multiplying every permutation of elements so you don't have to learn the above rules unless you are interested.

Other Methods for multiplication

Eddington Basis for aMonad
E Number 1 : 0, 0, 0, *0
E Number 2 : 0, 0, 1, *1
E Number 3 : 0, 0, 2, *2
E Number 4 : 0, 0, 3, *3
E Number 5 : 0, 1, 2, *6
E Number 6 : 0, 1, 3, *7
E Number 7 : 0, 2, 3, *11
E Number 8 : 1, 2, 3, *27


Basis products for aMonad
E Number 1 : 1, 2, 3, 4, 5, 6, 7, 8, *0
E Number 2 : 2, 1, 5, 6, 3, 4, 8, 7, *1
E Number 3 : 3, -5, 1, 7, -2, -8, 4, -6, *2
E Number 4 : 4, -6, -7, 1, 8, -2, -3, 5, *3
E Number 5 : 5, -3, 2, 8, -1, -7, 6, -4, *6
E Number 6 : 6, -4, -8, 2, 7, -1, -5, 3, *7
E Number 7 : 7, 8, -4, 3, -6, 5, -1, -2, *11
E Number 8 : 8, 7, -6, 5, -4, 3, -2, -1, *27


Basis products for aMonad
E Number 1 : 1, 2, 3, 4, 5, 6, 7, 8, *0
E Number 2 : 2, -1, 5, 6, -3, -4, 8, -7, *1
E Number 3 : 3, -5, -1, 7, 2, -8, -4, 6, *2
E Number 4 : 4, -6, -7, -1, 8, 2, 3, -5, *3
E Number 5 : 5, 3, -2, 8, -1, 7, -6, -4, *6
E Number 6 : 6, 4, -8, -2, -7, -1, 5, 3, *7
E Number 7 : 7, 8, 4, -3, 6, -5, -1, -2, *11
E Number 8 : 8, -7, 6, -5, -4, 3, -2, 1, *27

As with matrix and quaternion multiplication the order of the multiplicands is important (multiplication on mutivectors is not commutative). As you can see from the first table some of the terms are symmetric (a*b = b*a) and some are anti-symetric (a*b = - b*a) so overall the multiplication operation is not symmetrical.

Inner and Outer Product

trasitions

In addition to the geometric product there are two more types of multiplication used in Geometric Algebra. These extend and generalise the 'dot' and 'cross' products used in 3D vector algebra.

Inner product by a vector reduces the grade of a multivector. It is related to the dot product.

Outer product by a vector increases the grade of a multivector. It is related to the cross product.

The following identities relate the inner, outer and geometric products of vectors (grade one multivector) :

a•b = ½ (ab + ba) This is symmetrical (a•b = b•a)
a^b = ½ (ab - ba) This is anti-symmetrical (a^b = - b^a)
a * b = a•b + a^b  

Where:

We can extend this to the multipication of a vector by a general multivector as follows:

a•K = ½ (aK + (-1)k+1Ka)

a^K = ½ (aK + (-1)k Ka)

a*K = a•K + a^K

Where k is the grade of K. The (-1)k factor alternates the sign as follows:

grade k (-1)k (-1)k+1 a•K = ½ (aK + (-1)k+1Ka) a^K = ½ (aK + (-1)k Ka)
0 (scalar) 1 -1 a•K = ½ (aK - Ka) = 0 a^K = ½ (aK + Ka) = aK
1 (vector) -1 1 a•K = ½ (aK + Ka) = aK a^K = ½ (aK - Ka) = 0
2 (bivector) 1 -1 a•K = ½ (aK - Ka) = 0 a^K = ½ (aK + Ka) = aK
3 (trivector) -1 1 a•K = ½ (aK + Ka) = aK a^K = ½ (aK - Ka) = 0

However we have not yet created a general expression for any grade of multivector, for instance a bivector times a bivector, which does not follow the above pattern.

A<2> ^ B<2> = 0

Can anyone help with a more general expression.

Other identities for •

(a^b)•(c^d) = a•(b•(c^d))= b•(c^d)•a from Hestenes (New Foundations of Classical Mechanics) pp47 exercise 2.1

The inner product is not associative: a•(b•c) may not equal (a•b)•c

Outer product

We want the outer product to be an extension of the vector cross product:

x = Ay * Bz - By * Az
y = Az * Bx - Bz * Ax
z = Ax * By - Bx * Ay

This gives a bivector which is mutually perpendicular to the vectors being multiplied. But how do we extend this so that we can multiply non-vectors? There are different definitions for the outer product so we need to be careful, if you use other websites or books you may find that they use different definitions.

It is relatively easy to derive using the following rules:

This has the following nice properties:

Inner product.

We want the outer product to be an extension of the vector dot product:

A • B = Ax * Bx + Ay * By + Az * Bz

This gives a scalar which depends on the angle between the vectors being multiplied, it is zero if the vectors are perpendicular and zero if the vectors are parallel. But how do we extend this so that we can multiply non-vectors? There are different definitions for the inner product so we need to be careful, if you use other websites or books you may find that they use different definitions. Here we will use the 'semi-commutative inner product'

This has the following nice properties:

By starting with the vector cross product terms we can derive the remaining terms in the table as follows:

As with vector cross product vectors anticommute, we can also derive this because the vectors will cancel out when a general vector is squared: (a e1 + b e2+ c e3)2 =a2 + b2+ c2

The result of inner multiplying a vector base by a bivector base depends on weather they contain a common base,

if they do, make the bases adjacent then the common base cancels out: e1 • e12 =e2

if they don't the result is zero: e1•(e2^e3)=0

Same thing for inner multiplying by a tri-vector.

When multiplying two bivectors, if the bivectors have the same bases then we need to reverse one of them to get adjacent terms together, then we can cancel out terms, so we always get -e.

If the bivectors are different the result will always be zero.

When multiplying a bivector by a trivector we reverse as necesarily to cancel out two of the terms to leave a vector.

 

The inner product is similar to the vector dot product, for the vector part of the multivector the type is given by the following table:

b.e1 b.e2 b.e3
a.e1 e 0 0
a.e2 0 e 0
a.e3 0 0 e

This is symmetrical (a•b = b•a)

So the inner product produces a scalar as follows:

e = + a.e1 * b.e1 + a.e2 * b.e2 + a.e3 * b.e3

This can be defined from the geometric product as follows:

a•b = ½ (ab + ba)

The outer product is similar to the vector cross product except that it produces a bivector as output, for the vector part of the multivector the type is given by the following table:

^ a.e1 a.e2 a.e3
b.e1 0 e12 -e31
b.e2 -e12 0 e23
b.e3 e31 -e23 0

This is anti-symetrical (a^b = - b^a)

So the outer product produces a bivector as follows:

e12 = a.e2 * b.e1 - a.e1 * b.e2
e31 = a.e1 * b.e3 - a.e3 * b.e1
e23 = a.e3 * b.e2 - a.e2 * b.e3

This can be defined from the geometric product as follows:

a^b = ½ (ab - ba)

So for vectors the inner product reduces the grade from 1 to 0, in other words from vectors to scalars. The outer product increases the grade from 1 to 2, in other words from vectors to bivectors.

The geometric product is given by adding the inner and outer products:

a * b = a•b + a^b

 

Division

We dont tend to use the notation for division, since multivector multiplication is not commutative we need to be able to distinguish between [a][b]-1 and [b]-1[a]. So instead of a divide operation we tend to multiply by the inverse.

So the problem is, how to calculate the inverse of a multivector, this is discussed here.


metadata block
see also:

 

Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover Clifford Algebra to Geometric Calculus: A Unified Language for Mathematics and Physics (Fundamental Theories of Physics). This book is intended for mathematicians and physicists rather than programmers, it is very theoretical. It covers the algebra and calculus of multivectors of any dimension and is not specific to 3D modelling.

cover New Foundations for Classical Mechanics (Fundamental Theories of Physics). This is very good on the geometric interpretation of this algebra. It has lots of insights into the mechanics of solid bodies. I still cant work out if the position, velocity, etc. of solid bodies can be represented by a 3D multivector or if 4 or 5D multivectors are required to represent translation and rotation.

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to the software project, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

cover Mathmatica

Can you help?

Please send me any improvements to here. I would appreciate ideas to make the pages more useful including error correction, ideas for new pages, improvements to wording. It helps if you quote the full URL of the page.

 

Terminology and Notation

Specific to this page here:

 

program

I am working on a project which uses these principles, if you would like to help me with this you are welcome to join in, here:

http://sourceforge.net/projects/mjbworld/

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2008 Martin John Baker - All rights reserved - privacy policy.