Geometric Algebra (GA) Werner Benger, 2007 CCT@LSU SciViz 1 Abstract • Geometric Algebra (GA) denotes the re-discovery and geometrical interpretation of the Clifford algebra applied to real fields. Hereby the so-called „geometrical product“ allows to expand linear algebra (as used in vector calculus in 3D) by an invertible operation to multiply and divide vectors. In two dimenions, the geometric algebra can be interpreted as the algebra of complex numbers. In extends in a natural way into three dimensions and corresponds to the well-known quaternions there, which are widely used to describe rotations in 3D as an alternative superior to matrix calculus. However, in contrast to quaternions, GA comes with a direct geometrical interpretation of the respective operations and allows a much finer differentation among the involved objects than is achieveable via quaternions. Moreover, the formalism of GA is independent from the dimension of space. For instance, rotations and reflections of objects of arbitrary dimensions can be easily described intuitively and generic in spaces of arbitrary higher dimensions. • Due to the elegance of the GA and its wide applicabililty it is sometimes denoted as a new „fundamental language of mathematics“. Its unified formalism covers domains such as differential geometry (relativity theory), quantum mechanics, robotics and last but not least computer graphics in a natural way. • This talk will present the basics of Geometric Algebra and specifically emphasizes on the visualization of its elementary operations. Furthermore, the potential of GA will be demonstrated via usage in various application domains. 2 Motivation of GA • Unification of many domains: quantum mechanics, computer graphics, general relativity, robotics… • Completing algebraic operations on vectors • Unified concept for geometry and algebra • Superior formalism for rotations in arbitrary dimensions • Explicit geometrical interpretation of the involved objects and operations on them 3 Definition: “Algebra” • Vector space V over field K with multiplication “” • Null-element, One-element, Inverse • Commutative? ab = ba • Associative? (ab)c = a(bc) • Division algebra? • a≠0 a-1 such that a a-1 = 1 = a-1 a • Alternatively: ab=0 a=0 or b=0 4 Historical Roots • Complex Plane (Gauss ~1800) • • • • Real/Imaginary part: a+ib where i2= -1 Associative, commutative division-algebra Polar representation: r ei = r ( cos + i sin ) Multiplication corresponds to rotation in the plane i sin cos 5 Historical Roots, II William Rowan Hamilton (1805-65) invents Quaternions (1844): – Generalization of complex numbers: • 4 components, non commutative: ab ba (in general) • Basic idea: ii=jj=kk= ijk = -1 • Alternative to younger vector- and matrix algebra (Josiah Willard Gibbs, 1839-1903) • p=(p,p), q=(q,q), pq=(pq - p q , pq + pq + pq) • rotation in R3 are around axis of the vector component: v’ = q v q-1 6 Historical Roots, III • Construction by Cayley-Dickson (a,b)(c,d) = (ac-d *b, *a d+cb) – hypercomplex numbers: • octaves/octonions (8 components) • sedenions/hexadekanions (16 components) • … – incremental loss of • commutativity (quaternions,…) • associativity (octonions,…) • division algebra (sedenions,…) 7 Renaissance of the GA 1878: Clifford introduces “geometric algebra”, but dies at age 34 superseded by Gibb’s vector calculus 1920er: Renaissance in quantum mechanics (Pauli, Dirac) algebra on complex fields no geometrical interpretation 1966-2005 David Hestenes (Arizona State University) revives the geometrical interpretation 1997: Gravitation theory using GA (Lasenby, Doran, Gull; Cambridge) 2001: Geometric Algebra at SIGGRAPH (L. Dorst, S. Mann) 8 9 Geometry and Vectors • Geometric interpretation of a vector – Directed line segment or tangent • Vector-algebra in Euclidean Geometry or Tp(M) • Addition / subtraction of vectors a+b • Multiplication / division by scalars a • Multiplication / Division of vectors?? Multiplication of vectors 10 Complete Vector-algebra? • Invertible product of vectors? • What means vector-division “a/b” ? • ab=C b=a-1C • Note: C not necessarily a vector! • Inner product (not associative): ab Skalar – Not invertible e.g. ab =0 with a≠0, b≠0 but orthogonal • Outer product (associative): ab Bivektor – Generalized cross-product from 3D: ab – Not invertible e.g. ab =0 with a≠0, b≠0 but parallel Multiplikation von Vectoren 11 Bivector ab Describes the plane spun by a and b, sign is orientation ab ba = -ab Defined in arbitrary dimensions, anti-symmetric ( not commutative), associative, distributive, spans a vector space, does not require additional structures Multiplikation von Vektoren 12 Constructing Bivectors No unique determination of the generating vectors possible = ab = (a+λb)b bb =0 = Basis-element |a| |b| sin Multiplikation von Vektoren b a+λb 13 Bivectors in R3 • 3 Basis-elements exey, eyez, ezex • Generalization: exeyez is a volume Multiplikation von Vektoren 14 Vectorspace of Bivectors Linear combinations possible e.g.: exey, Multiplikation von Vektoren ezex 15 Coordinate representation of “”-product in R3 • Generic Bivector: A = Axy exey + Ayz eyez + Azx ezex • (axex + ayey + azez)(bxex + byey + bzez)= axexbxex + axexbyey + axexbzez + ayeybxex + ayeybyey + ayeybzez + azezbxex + azezbyey + azezbzez = (axby - aybx)exy+(aybz-azby)eyz+(axbzazbx)exz Multiplikation von Vektoren 16 Inner product ab • Describes projections ab = |a| |b| cos = ba Symmetric (commutative), requires quadratic form (Metric) as additional structure, not associative (ab)c a(bc) Multiplikation von Vektoren 17 Comparing the products • Inner product – Not associative • (ab)c ≠ a(bc) – Commutative • ab = ba – Not invertible – Yields a scalar • Outer product – Associative • (ab)c= a(bc) – Not commutative • ab ≠ ba – Not invertible – Yields a bivector 18 Geometric Product 1. Requirements and definition 2. Structure of the operands 3. Calculus using GP 4. Rotations using GP Das Geometrische Produkt 19 Requirements to GP • For elements A,B,C of a vector space with quadratic form Q(v) [i.e. a metric g(u,v) = Q(u+v) - Q(u) – Q(v)] we require: 1. 2. 3. 4. Associative: (AB)C = A(BC) Left-distributive: A(B+C) = AB+AC Right-distributive: (B+C)A= BA+CA Scalar product: A2 = Q(A) = |A|2 Das Geometrische Produkt 20 Properties of the GP • Right-angled triangle |a+b|2 = |a|2+|b|2 (A+B)(A+B) = AA+BA+AB+BB = A2 + B2 AB = -BA for AB = 0 anti-symm if orthogonal • However: not purely anti-symmetric |AB|2 =|A|2 |B|2 for AB = 0 (i.e. A,B parallel: B=A) Das Geometrische Produkt 21 Geometric Product • William Kingdon Clifford (1845-79): • Combine inner and outer product to defined the geometric product AB (1878): AB := AB AB • Result is not a vector, but the sum of a scalar + bivector! • Operates on “multivectors” • Subset of the tensoralgebra • Geometric Product is invertible! Das Geometrische Produkt 22 Multi-vector components • R 2: A = A0 + A1 e0 + A2 e1 + A3 e0e1 2.7819… • R 3: + A= A0 + A1 e0 + A2 e1 + A3 e2 + A4 e0 e1+A5 e1 e2+A6 e0 e2 + A7 e0 e1 e2 + + + + + + Struktur von Multivektoren 23 Structure of Multi-vectors Linear combination of anti-symmetric basis elements 2n components 0D 1 Scalar 1D 1 Scalar, 1 Vector 2D 1 Scalar, 2 Vectors, 1 Bivector 3D 1 Scalar, 3 Vectors, 3 Bivectors, 1 Volume 4D 1 Scalar, 4 Vectors, 6 Bivectors, 4 Volume, 1 Hyper-volume 5D … Struktur von Multivektoren 24 Inversion • Given vectors a,b: ab = ½ (ab + ba) symmetric part ab = ½ (ab - ba) anti-symmetric part ab = -(ab) (exeyez) Dual in 3D Rechnen mit Multivektoren 25 Reflection at a Vector • Unit vector n, arbitrary vector v Vector v projected to n: v║=(v n) n Reflected vector w = v┴ – v║ = v – 2v║ thus w = v – 2(v n) n with GP w = v – 2[½(vn+nv) ] n = v – vnn – nvn w = -nvn Rechnen mit Multivektoren 26 Rotations 1. 2. 3. 4. Identification with Quaternions Rotation in 2D Rotation in nD Rotation of arbitrary Multivectors in nD Rotation 27 Geometrical Quadrate Consider (AB)2 of Bivector-basis element where |A|=1, |B|=1, AB = 0 Basiselement AB=AB=-BA (AB)2 = (AB) (AB) = -(AB) (BA)=-A(BB) A= -1 Rotation 28 Quaternion Algebra • 2D: complex numbers • i:= exey, i2 = -1 • 3D: quaternions • i:= exey= exey, j:= eyez = eyez, k:=exez=exez • i2 = -1, j2 = -1 , k2 = -1 • ijk = (exey)(eyez)(exez) = -1 • 4D: Biquaternions (complex quaternions, spacetime algebra) Rotation 29 Rotation and GA Right-multiplication of Vectors by Bivectors ex i = ex (exey) = (exex ) ey= ey = ey i = ey(exey)=-ey(eyex)= -ex = Rotation 30 Generic Rotation in 2D • Multiple Rotation ex i i = (ex i) i = ey i = -ex = -1 ex • Arbitrary vector A = Ax ex + Ay ey A i = Ax ex i + Ay ey i = Ax ey - Ay ex • Rotation by arbitrary angle: A cos + A i sin ≡ “A e i” rotates vector A by angle in plane i Inverse rotation: Ai = -iA : - A ei = e-i A Rotation 31 Rotor in 2D • Rotor R := ei = cos + i sin mit i² = -1 A ei = e-i A = e-i/2 A ei/2 = R A R-1 With R=e-i/2 “Rotor” R-1=ei/2 “inverse Rotor” A R-2 = R2 A = R A R-1 • Product of rotors is multiple rotation R=ABCD, R-1=DCBA is “reverse” R Rotation 32 Rotor in nD • Rotor in plane U, Vektor v: R = cos + sin U U² = -1 Expect: Rv or vR-1 or R v R-1 • Problem: With arbitrary vector v there would be a tri-vector component: Rv = v cos + sin (U v + U v ) iff Uv ≠ 0 ( v not coplanar with U) Rotation 33 Rotation in nD Consider: R v R-1 mit v =v┴ + v║ : – We have: Uv┴ = 0 d.h. Uv┴ =Uv┴ =u1u2v┴= - u1v┴u2= v┴ u1 u2= v┴U =v┴U i.e. v┴ commutes with U, thus also R R v R-1 = R v┴ R-1 + R v║ R-1 R v┴ R-1 =(cos + sin U) v┴ (cos - sin U) = v┴(cos² - sin² U²) = v┴ R v R-1 = v┴ + eU v║ e-U = v┴ + v║ e-2U Rotation 34 Rotation as multiple reflection • Alternative Interpretation: – Reflect vector v by vector n, then by vector m: • v - nvn m nvn m = mn v nm • Operation mn is Scalar+Bivector (Rotor!) • Rotor: R = mn • Inverse Rotor: R-1 = nm • Theorem: Rotation is consecutive reflection on two corresponding vectors with the rotation angle equal to twice the angle between these vectors Rotation 35 Applications Crystallography Differential Geometry Maxwell Equations Quantum Mechanics Relativity 36 Describing Symmetries • Multiple reflections by r1,r2,r3, … are consecutive products of vectors: – r 3 r 2 r 1 v r1 r 2 r 3 (not possible w. quaternions) • Symmetry groups in molecules and crystals can be characterized by – three unit vectors a,b,c – Integer triple {p,q,r} – where (ab)p = (bc)q = (ca)r = -1 e.g.: Methane (Tetrahedron) {3,3,3}, Benzene {6,2,2} 37 Differential Geometry Derivative operator: := eμ μ with μ=/xμ, eμe=μ Applicable to arbitrary multi-vectors E.G.: with v a vector field: v = v + v where v Gradient (Scalar) and v Curl (Bivector) 38 Maxwell in 3D – Faraday-Field: F = E + B :=exeyez – Current density: J = - j – Maxwell-Equation: F/ t + F = J F = E + B = E + E + B + B Scalar : E = Vector : E / t + B = -j Bivector: B / t + E = 0 Pseudoscalar: B = 0 39 Cl3(R) & Spinors • GA in 3D can be represented via Pauli-matrices: 0 1 x = ( ) 1 0 1 0 0 -i y = ( ) +i 0 z = ( ) 0 -1 • 4 complex numbers 8 components = 23 • Basis-vectors {ex,ey,ez} with GP provide same algebraic properties as Pauli-matrices {x,y,z} • Pauli-Spinor (2 complex numbers, 4 components), due to *= real, can be written as = ½ eB thus is a Rotor (even multi-vector: 1 Scalar, 3 bivector-component), i.e. is the “operation” to stretch and rotate describes interaction (of an elementary particle) with a magnetic field 40 Spacetime Algebra (STA) • GA in 4D with Minkowski-Metric (+,-,-,-) • Chose orthogonal Basis {0, 1, 2, 3} – where 2μν = μν+ νμ= 2ημν i.e. 02 = -k2 = 1 • Structure: 1,4,6,4,1 ( n4 , 16-dimensional ) – Bivector-Basis: k := k 0 – Pseudo-scalar: 0 1 2 3 = 123 1 {μ} {k, k} {μ} 1 Scalar 4 Vector 6 Bivectors 4 Pseudo-vectors 1 Pseudo-scalar 41 Basis-Bivectors in STA k: 3 timelike bi-vectors k : 3 spacelike bivectors z x y x yz 42 Structure of Bivectors Any bi-vector can be written as – – – – B = Bkk = ak k + bkk = a + b a,b: 3-Vectors (relative 0) a timelike component b spacelike component Classification in – “complex” Bivector: No common axes, spans the full 4D space – “simple” Bivector: One common axis, can be reduced to a single “Blade” 43 Spacetime-Rotor • Spacetime-rotor: R = eB =ea+b e|B| B/|B| R = ea+b= eaeb = [cosh a + sinh a ] [ cos b + sin b ] = [cosh |a| + a/|a| sinh |a| ] [cos |b| + b/|b| sin|b| ] • Interpretation: rotation in spacelike plane b by angle |b| hyperbolic rotation in timelike plane a=a 0 with “boost-factor” (velocity) tanh|a| Lorentz-transformation in a , 0 ! 44 Maxwell Equations in 4D • Four-dimensional gradient := μμ • Elektro-magnetic 4-potential A: – F = A = A - A with A=0 is Lorentz-gauge condition – Faraday-Field: F = (E + B) 0 Pure Bivector (3D:vector + bi-vector), but complex: E timelike component, B spacelike • Maxwell-Equation: F = J 45 Dirac-Equation • Relativistic Momentum in Schrödingereqn: – E=p2/2m E2 = m2 – p2 (α0mc² + ∑ αj pj c) = i ħ / t where αj Dirac-matrices (44) in Dirac-basis: 0 = α0, i = α0 αi mit [μ,ν] = 2 ημν covariant formulation ∑ μ μ = mc² • In GA basis vectors {0, 1, 2, 3} provide same algebraic properties as Dirac matrices: = mc² 0 46 GA in Computergraphics • Homogeneous Coordinates (4D): • Additional coordinate e, 3-vector: Ai / A • Allows unified handling of directions and locations, standard in OpenGL • conform, homogeneous coordinates (5D): • Additional coordinates e0, e • Signature (+,+,+,+,-) , e0e=-1, |e0| = |e| =0 • Allows describing geometric objekts (sphere, line, plane …) as vectors in 5D • Unions and intersections of objects are algebraic operations (“meet”, “join”) 47 Objects in conform 5D GA Punkt Paar von Punkten x + e0 + |x|2/2 e ab Linie abe Kreis abc Ebene ab c e Kugel abcd 48 Implementations • Runtime evaluation – geoma (2001-2005), GABLE (symbolic GA) • Matrix-based – CLU (2003) • Code-Generation – Gaigen (-2005) • Template Meta Programming – GLuCat, BOOST (~2003) • Extending programming languages (proposed) 49 Literatur http://modelingnts.la.asu.edu/ http://www.mrao.cam.ac.uk/˜clifford • David Hestenes: New Foundations for Classical Mechanics (Second Edition). ISBN 0792355148, Kluwer Academic Publishers (1999) • Oersted Medal Lecture 2002: Reforming the Mathematical Language of Physics (David Hestenes) • Geometric (Clifford) Algebra: a practical tool for efficient geometrical representation (Leo Dorst, University of Amsterdam) • An Introduction to the Mathematics of the Space-Time Algebra (Richard E. Harke, University of Texas) • EUROGRAPHICS 2004 Tutorial: Geometric Algebra and its Application to Computer Graphics (D. Hildenbrand, D. Fontijne, C. Perwass and L. Dorst) • Rotating Astrophysical Systems and a Gauge Theory Approach to Gravity (A.N. Lasenby, C.J.L. Doran, Y. Dabrowski, A.D. Challinor, Cavendish Laboratory, Cambridge), astro-ph/9707165 50