hypercomplex numbers and their matrix...

32
Hypercomplex numbers and their matrix representations A short guide for engineers and scientists Herbert E. M¨ uller http://herbert-mueller.info/ Abstract Hypercomplex numbers are composite numbers that sometimes allow to simplify computations. In this article, the multiplication table, matrix represen- tation and useful formulas are compiled for eight hypercomplex number systems. 1

Upload: others

Post on 30-Jan-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

  • Hypercomplex numbers and their matrixrepresentations

    A short guide for engineers and scientists

    Herbert E. Müllerhttp://herbert-mueller.info/

    Abstract

    Hypercomplex numbers are composite numbers that sometimes allow tosimplify computations. In this article, the multiplication table, matrix represen-tation and useful formulas are compiled for eight hypercomplex number systems.

    1

  • Contents

    1 Introduction 3

    2 Hypercomplex numbers 32.1 History and basic properties . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 Matrix representations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.3 Scalar product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.4 Writing a matrix in a hypercomplex basis . . . . . . . . . . . . . . . . . . 62.5 Interesting formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.6 Real Clifford algebras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.7 Real numbers Cl0,0(R) ∼= R . . . . . . . . . . . . . . . . . . . . . . . . . 10

    3 Hypercomplex numbers with 1 generator 103.1 Bireal numbers Cl1,0(R) ∼= R⊕ R . . . . . . . . . . . . . . . . . . . . . . 103.2 Complex numbers Cl0,1(R) ∼= C . . . . . . . . . . . . . . . . . . . . . . . 11

    4 Hypercomplex numbers with 2 generators 124.1 Cockle quaternions Cl2,0(R) ∼= Cl1,1(R) ∼= R(2) . . . . . . . . . . . . . . . 124.2 Hamilton quaternions Cl0,2(R) ∼= H . . . . . . . . . . . . . . . . . . . . . 13

    5 Hypercomplex numbers with 3 generators 155.1 Hamilton biquaternions Cl3,0(R) ∼= Cl1,2(R) ∼= C(2) . . . . . . . . . . . . 155.2 Anonymous-3 Cl2,1(R) ∼= R(2)⊕ R(2) . . . . . . . . . . . . . . . . . . . . 175.3 Clifford biquaternions Cl0,3 ∼= H⊕H . . . . . . . . . . . . . . . . . . . . 19

    6 Hypercomplex numbers with 4 generators 206.1 Space-Time Algebra Cl4,0(R) ∼= Cl1,3(R) ∼= Cl0,4(R) ∼= H(2) . . . . . . . . 206.2 Anonymous-4 Cl3,1(R) ∼= Cl2,2(R) ∼= R(4) . . . . . . . . . . . . . . . . . . 21

    References 24

    A Octave and Matlab demonstration programs 25A.1 Cockle Quaternions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25A.2 Hamilton Bi-Quaternions . . . . . . . . . . . . . . . . . . . . . . . . . . . 26A.3 Anonymous-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28A.4 Anonymous-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    2

  • 1 Introduction

    Hypercomplex numbers are composite numbers that allow to simplify the mathematicaldescription of certain problems. They are used e. g. in signal processing, computergraphics, relativistic kinematics, orbital mechanics, air and space flight. The authorcame across hypercomplex numbers in accelerator physics, where they can be used todescribe symplectic transformations. Hypercomplex numbers come along with matrixrepresentations, that reproduce the addition and multiplication law.

    This article is aimed at engineers and scientists, and presents 8 hypercomplex numbersystems. The multiplication table, matrix representation, determinant, inverse, Eulerformulas, polar decomposition and singular value decomposition are given. Somemathematical background is required. An occasional look at www.wikipedia.org/(preferably the english version) or mathworld.wolfram.com/ should allow the reader tofill in gaps in comprehension.

    In the appendix, four Octave [1] / Matlab demonstration programs are provided.

    2 Hypercomplex numbers

    2.1 History and basic properties

    [2] A mathematicians basic stock-in-trade are the real numbers. In the 18th century, acombination of 2 real numbers X and Y into a new object Z = (X, Y ), the complexnumber, became popular. Addition of two complex numbers was defined component-wise, but multiplication had to be defined in a different way, such that the ”law of themoduli” was satisfied. The modulus |Z| =

    √X2 + Y 2 is the length of the vector (X, Y ).

    The law of the moduli requires that the modulus of the product of any 2 complex num-bers A and B is equal to the product of their moduli: |AB| = |A||B|.

    In the 19th century, mathematicians made up more composite numbers Z = (Z1, . . . ZN)consisting of N = 4 real numbers (quaternions), of 8 real numbers (bi-quaternions,octonions), and even of 16 real numbers (sedenions). The collective term for these newnumbers was ”hypercomplex numbers”. Like real and complex numbers, hypercomplex(hc) numbers can be added and subtracted, multiplied and (barring accidents) divided,i. e. they form a ”ring”. To include hc number systems with non-associativemultiplication (such as Caley numbers and octonions), mathematicians prefer to talk of”algebras” (which is a much broader term than ring, and too general for our purposes.)

    Addition of two hc numbers A and B is always defined component-wise:A + B = (A1 +B1, . . . AN +BN). Multiplication is defined such that the law of themoduli holds, with the modulus, or ”euclidean norm”, defined as the length of thevector (Z1, . . . ZN): |Z| =

    √(Z1)2 + . . .+ (ZN)2. If this is not possible, then some other

    norm (a real-valued function) |Z| with the property |AB| = |A||B|, must be found.

    Because of the special definition of multiplication, the multiplicative attributes of hcrings vary. When dealing with a hc ring, it is good to know these attributes. Oneshould determine:

    3

  • • A: Is multiplication associative?

    • C: Is multiplication commutative?

    • D: Is division by all numbers other than 0 possible?

    • E: Is the norm of the numbers euclidean ?

    Here is the answer to these questions for the hc rings (or algebras) listed in this article:

    HC ring dimension A C D EReal numbers 1 + + + +Bi-real numbers 2 + + − −Complex numbers 2 + + + +Cockle quaternions 4 + − − −Hamilton quaternions 4 + − + +Hamilton Bi-quaternions 8 + − − −Anonymous-3 8 + − − −Clifford Bi-quaternions 8 + − − −Space-Time algebra 16 + − − −Anonymous-4 16 + − − −Tessarines 4 + + − −

    Rings are associative, and therefore have a square matrix representation.

    Only the real numbers, complex numbers and Hamilton quaternions have the propertiesA, D and E. They are ”euclidean division rings”.

    Only the real and complex numbers have all 4 properties A, C, D, E. They are ”fields”.

    2.2 Matrix representations

    Square matrices share the structural properties of hypercomplex numbers, and can beused to represent them. While hc numbers are always made up of real numbers, we willadmit representative matrices with real, complex or quaternionic elements. (Matriceswith complex or quaternionic elements are nested hypercomplex numbers.)

    Matrix multiplication is associative, but in general not commutative. Division by a hcnumber corresponds to multiplication with the inverse of the representative matrix. Thenorm of a hc number is the absolute value of the determinant of the representativematrix.

    To find a representation, let us first write the hc number Z = (Z1, . . . ZN) in theold-fashioned way as Z = Z0 + iZ1 + jZ2 + kZ3 + . . . This number is composed of a realpart (Z0) and an imaginary part. By definition, the ”imaginary units” i, j, k . . . squareto either +1, 0 or −1. It is helpful to distinguish the three types of imaginary numbersin the notation. I will do this as follows:

    Z = 1Z0 + real part

    β1Z1 + . . .+ βKZK+ birealγ1ZK+1 + . . .+ γLZK+L+ complexδ1ZK+L+1 + . . .+ δMZK+L+M dual

    imaginary part4

  • • 1 is the multiplicative identity, or real unit. Its representation is the unit matrix.

    • β is a bireal unit and squares to +1: β2 = 1.Its real representation is a symmetric, traceless, orthogonal matrix:β = βᵀ, Tr(β) = 0, ββᵀ = 1.Its complex or quaternionic representation is a hermitian, unitary matrix withimaginary trace: β = β∗,

  • Also, let

  • Determinant and Norm

    The norm of a hc number Z is the absolute value of the determinant of therepresentative matrix:

    |Z| = | det Z |

    The determinant and norm of a hc number are multiplicative:

    det AB = det A det B |AB| = |A||B|

    Inverse

    HC numbers with norm 6= 0 have an inverse, which can be written down explicitly.

    Rotations

    By means of Taylor series, it is straightforward to calculate the exponential orlogarithm of a hc number. The representation of a complex unit is skew-hermitian, soits exponential is a rotation, i. e an orthogonal or unitary matrix. Euler’s formulaeiφ = cosφ+ i sinφ applies, and we rewrite it as

    expγφ = 1 cosφ+ γ sinφ

    When there are several complex units γ1, . . .γN , Euler’s formula can be generalized.

    Three kinds of rotations of a hc number Z appear in the polar and singular valuedecomposition (see below): rotation from the left: exp (γφ)Z ; rotation from the right:Z exp (γφ); or rotation from left and right with opposite angles: exp (γφ)Z exp (−γφ).The last transformation is a similarity transformation (it leaves the characteristicpolynomial of Z invariant). To clarify the action of the rotation (how is Z rotated?) Iwill later express it by a real matrix acting on the component vector of Z. (Sinceexpγφ transforms Z, we may say that the two hc numbers are not on an equal footing.The asymmetric way of expressing the product ”rotation times hc number” as ”matrixtimes vector” then makes sense.)

    Polar Decomposition

    Just as the ordinary complex number can be written as a rotation times the modulus:z = eiφ|z|, any hc number can be written as a rotation times a bireal number P, i. e. anumber without complex part, satisfying P∗ = P:

    Z = exp (γ1φ1 + . . .+ γNφN) P where P = 1P0 + β1P1 + . . .+ βMPM

    This is the ”polar decomposition” of Z. In matrix language, the general matrix Z iswritten as a rotation times a hermitian matrix P.

    7

  • Singular Value Decomposition

    Let β1, . . . ,βd−1 denote the bireal units with a diagonal d× d-representation (d ≥ 2).The eigenvalue decomposition of the matrix P = 1P0 + β1P1 + . . .+ βMPM is

    P = exp (γ1φ1 + . . .+ γNφN) D exp (−γ1φ1 − . . .− γNφN)

    whereD = 1D0 + β1D1 + . . .+ βd−1Dd−1

    The polar decomposition of Z followed by the eigenvalue decomposition of P is called”singular value decomposition” of Z. The eigenvalues D0, . . . , Dd−1 of P are thesingular values of Z.

    2.6 Real Clifford algebras

    There are basically two ways to construct (associative) hc numbers, starting with R:the tensor product of two hc numbers, and a scheme due to W. K. Clifford (1845-1879).I will present the latter, since it reproduces most hypercomplex rings, and because theirreducible matrix representations of ”Clifford algebras” are all known. We have definedhc numbers to consist of real components (the representations may be real, complex orquaternionic), and therefore only consider ”real Clifford algebras”, denoted by Clp,q(R).The hypercomplex units and multiplication table are obtained as follows.

    1. Start with the real unit 1, p bireal units β1 . . .βp, and q complex units γ1 . . .γq. Thesymmetric part of the multiplication table of these N = p+ q ”generator units” is

    12{ , } 1 βl γ l

    1 1 βl γnβk βk δkl1 0

    γk γk 0 −δmn1

    { , } is the anti-commutator:{A,B} ≡ AB + BA. Any twodifferent generators anti-commute!

    2. Define N(N − 1)/2 new hc units as product of two different generators:γq+1 ≡ β1β2 = −β2β1,γq+... ≡ −γ1γ2 = γ2γ1, . . . ,βp+1 ≡ β1γ1 = −γ1β1, . . .

    3. Define N(N − 1)(N − 2)/6 new hc units as product of three different generators.

    . . .

    N . Define the last new hc unit ω = β1 . . .βpγ1 . . .γq.

    The full multiplication table of all the 2N hc units now follows from the (much smaller)symmetric multiplication table of the real unit and the N generator units.

    The sign of any composite unit can be chosen arbitrarily. I tried to choose the signssuch that the multiplication tables become maximally symmetric, and mutuallycompatible (quaternions pop up everywhere).

    The following table is the first quadrant of the ”Clifford chess board” consisting of 8× 8entries [3], [4]. It shows the hypercomplex numbers produced by Clifford’s scheme forup to 4 generators:

    8

  • Clp↓,q→ 0 1 2 3 40 real complex quaternion Clifford BQ Space-Time1 bi-real Cockle Q Hamilton BQ Space-Time H(2)⊕H(2)2 Cockle Q Anonymous-3 Anonymous-4 C(4) H(4)3 Hamilton BQ Anonymous-4 R(4)⊕ R(4) R(8) C(8)4 Space-Time C(4) R(8) R(8)⊕ R(8) R(16)

    Clifford’s scheme is redundant: some Clifford algebras with different p, q, but the sameoverall number of generators N = p+ q, are isomorphic: the multiplication table of suchalgebras can be brought to coincide after re-numbering the imaginary units.

    The next table shows the irreducible matrix representations of the Clifford algebras.

    Clp↓,q→ 0 1 2 3 40 R C H H⊕H H(2)1 R⊕ R R(2) C(2) H(2) H(2)⊕H(2)2 R(2) R(2)⊕ R(2) R(4) C(4) H(4)3 C(2) R(4) R(4)⊕ R(4) R(8) C(8)4 H(2) C(4) R(8) R(8)⊕ R(8) R(16)

    It turns out that every Clifford algebra is isomorphic to

    • a full d× d real matrix algebra R(d), or

    • a full d× d complex matrix algebra C(d), or

    • a full d× d quaternionic matrix algebra H(d), or

    • to the direct sum of two such algebras.

    Note that the ring of real 2× 2 matrices R(2) is isomorphic to the Cockle (or split)quaternions, and that the ring of real 4× 4 matrices R(4) is isomorphic to Anonymous-4.

    In the following subsection, I will present all real Clifford algebras with up to 4generators. Until here, Clifford ’s scheme produces (I believe) all hc number rings withup to 16 components. A special case are the hc numbers called ”tessarines”: they arenot a Clifford algebra proper, but appear as a sub-algebra of Anonymous-3.

    Cliffords scheme does not produce non-associative hc numbers. These and hc numberswith dual units are omitted in this article.

    In the following list of hypercomplex units, the generating units are given in red color .In a multiplication table, the anti-commuting products are given in blue color .

    In the multiplication tables, I use the Kronecker-delta δik and the anti-symmetric tensor�ikl. Roman indices like k, l, . . . usually go from 1 to 3, and greek indices like κ, λ, . . . gofrom 0 to 3. If an index appears twice in a product, you must sum over it. Examples:

    βkXlδkl = βkXk = β1X1 + β2X2 + β3X3 = ~β · ~X

    γkXlYm�klm = γ1(X2Y3 −X3Y2) + γ2(X3Y1 −X1Y3) + γ3(X1Y2 −X2Y1) = ~γ · ~X ∧ ~Y

    βκZκ = β0Z0 + β1Z1 + β2Z2 + β3Z3

    9

  • 2.7 Real numbers Cl0,0(R) ∼= R

    The real numbers are the simplest Clifford algebra, with 0 generators. They form afield. But you are not reading this article to learn about real numbers, so let’s go on tothe next stage.

    3 Hypercomplex numbers with 1 generator

    3.1 Bireal numbers Cl1,0(R) ∼= R⊕ R

    (Synonym: split-complex numbers)

    Hypercomplex units: 1,β

    Multiplication table

    1 β

    β 1⇒ (1A0 + βA1)(1B0 + βB1) =

    1(A0B0 + A1B1) + β(A0B1 + A1B0)

    General bireal number and its real representation

    Z = 1X + βY ∼=(X + Y 0

    0 X − Y

    )

    Determinant

    det Z ≡ D = ZZ̄ = X2 − Y 2

    Inverse bireal number

    Z−1 = Z̄/(ZZ̄) = (1X − βY )/D

    Singular Values and Determinant

    D1 = X + Y D2 = X − Y D1D2 = X2 − Y 2 = D

    10

  • 3.2 Complex numbers Cl0,1(R) ∼= C

    The complex numbers form a field; they are their own irreducible representation.

    Hypercomplex units: 1,γ

    Multiplication table

    1 γ

    γ −1⇒ (1A0 + γA1)(1B0 + γB1) =

    1(A0B0 − A1B1) + γ(A0B1 + A1B0)

    General complex number = complex representation

    Z = 1X + γY

    Norm

    |Z| =√

    ZZ̄ =√X2 + Y 2

    Inverse complex number

    Z−1 = Z̄/(ZZ̄) = (1X − γY )/(X2 + Y 2)

    Euler formula

    exp(γφ) = 1 cosφ+ γ sinφ

    exp(γφ) rotates Z counterclockwise (ccw) by φ:

    Z′ =

    {exp (γφ) ZZ exp (γφ)

    }⇒

    (X ′

    Y ′

    )=

    (cosφ − sinφsinφ cosφ

    )×(XY

    )

    Polar Decomposition

    Z = exp(γφ)|Z| where tanφ = Y/X and modulus |Z| =√X2 + Y 2

    Addendum

    A real representation (reducible over C) of the complex numbers is

    Z ∼=(

    X Y−Y X

    )The Singular Values and Determinant of the real representation are

    D1 = D2 =√X2 + Y 2 D1D2 = X

    2 + Y 2

    11

  • 4 Hypercomplex numbers with 2 generators

    4.1 Cockle quaternions Cl2,0(R) ∼= Cl1,1(R) ∼= R(2)

    (Synonyms: split-quaternions, Co-quaternions)

    Hypercomplex units of Cl2,0(R): 1,β1,β2,γ = β1β2Hypercomplex units of Cl1,1(R): 1,β1,γ,β2 = β1γ

    Multiplication table

    1 γ β1 β2γ −1 −β2 β1β1 β2 1 γ

    β2 −β1 −γ 1

    General Cockle quaternion and its real representation

    Z = 1X1 + γX2 + β1Y1 + β2Y2∼=(

    X1 + Y1 X2 + Y2−X2 + Y2 X1 − Y1

    )

    Determinant

    det Z ≡ D = ZZ̄ = X21 +X22 − Y 21 − Y 22

    Inverse Cockle quaternion

    Z−1 = Z̄/(ZZ̄) = (1X1 − γX2 − β1Y1 − β2Y2)/D

    Euler formula

    exp (γφ) = 1 cosφ+ γ sinφ

    exp(γφ) rotates (X1, X2) ccw by φ, and rotates rotates (Y1, Y2) cw by ±φ:

    Z′ =

    {exp (γφ) ZZ exp (γφ)

    }⇒

    X ′1X ′2Y ′1Y ′2

    =

    cosφ − sinφ 0 0sinφ cosφ 0 0

    0 0 cosφ ± sinφ0 0 ∓ sinφ cosφ

    X1X2Y1Y2

    12

  • The similarity transformation exp(γφ) . . . exp(−γφ) leaves (X1, X2) invariant, androtates (Y1, Y2) cw by 2φ:

    Z′ = exp (γφ) Z exp (−γφ) ⇒

    X ′1X ′2Y ′1Y ′2

    =

    1 0 0 00 1 0 00 0 cos 2φ sin 2φ0 0 − sin 2φ cos 2φ

    X1X2Y1Y2

    Polar Decomposition

    Z = exp (γφ) P

    where tanφ = X2/X1 + (1− s0)s3 π/2 with sk = sign(Zk)

    and P = 1√X21 +X

    22 + β1P3 + β2P4

    Singular Value Decomposition

    P = exp(γψ)D exp(−γψ)

    where tan 2ψ = −P2/P1and D = 1

    √X21 +X

    22 + β1

    √Y 21 + Y

    22

    SVs D1,2 =√X21 +X

    22 ±

    √Y 21 + Y

    22

    with D1D2 = X21 +X

    22 − Y 21 − Y 22 = D

    4.2 Hamilton quaternions Cl0,2(R) ∼= H

    Hamilton quaternions form a division ring (that’s a field minus commutativity inmultiplication); they are their own irreducible representation.

    Hypercomplex units: 1,γ1,γ2,γ3 = −γ1γ2 (my choice of sign is non-standard)

    Multiplication table

    1 γ lγk −δkl1− �klmγm

    ⇒ (1A0 + ~γ ·~A)(1B0 + ~γ · ~B) =

    1(A0B0 − ~A · ~B) + γ(A0 ~B + ~AB0 − ~A ∧ ~B)

    General Hamilton quaternion

    Z = 1Z0 + γ1Z1 + γ2Z2 + γ3Z3 ≡ 1Z0 + ~γ · ~Z

    Norm

    |Z| =√

    ZZ̄ =

    √Z20 + ~Z

    2

    13

  • Inverse Hamilton quaternion

    Z−1 = Z̄/(ZZ̄) = (1Z0 − ~γ · ~Z)/(Z20 + ~Z2)

    Euler formula

    exp (~γ · ~eφ) = 1 cosφ+ ~γ · ~e sinφ

    Let Z‖ the 3-vector component parallel to ~e (i. e. Z‖ ≡ ~Z · ~e), and ~Z⊥ the 3-vectorprojection perpendicular to ~e (i. e. ~Z⊥ ≡ −~e ∧ ~e ∧ ~Z). The factor exp (~γ · ~eφ) rotates(Z0, Z‖) ccw by φ, and rotates ~Z⊥ cw by ±φ around ~e:

    Z′ =

    {exp (~γ · ~eφ) ZZ exp (~γ · ~eφ)

    }⇒

    Z ′0Z ′1Z ′2Z ′3

    =cosφ

    1 0 0 00 1 0 00 0 1 00 0 0 1

    + sinφ

    0 −e1 −e2 −e3e1 0 ±e3 ∓e2e2 ∓e3 0 ±e1e3 ±e2 ∓e1 0

    Z0Z1Z2Z3

    The similarity transformation exp (~γ · ~eφ) . . . exp (−~γ · ~eφ) leaves Z0 and Z‖ invariant,and rotates ~Z⊥ cw by 2φ around ~e:

    Z′ = exp (~γ · ~eφ) Z exp (−~γ · ~eφ) ⇒

    Z ′0Z ′1Z ′2Z ′3

    =cos 2φ

    1 0 0 00 1 0 00 0 1 00 0 0 1

    +

    . . . (1− cos 2φ)

    1 0 0 00 (e1)

    2 e1e2 e1e30 e2e1 (e2)

    2 e2e30 e3e1 e3e2 (e3)

    2

    + sin 2φ

    0 0 0 00 0 e3 −e20 −e3 0 e10 e2 −e1 0

    Z0Z1Z2Z3

    Polar Decomposition

    Z = exp (~γ · ~eφ) |Z| where ~e tanφ = ~Z/Z0 and modulus |Z| =√Z20 + ~Z

    2

    Addendum

    Complex representation (reducible over H):

    Z ∼=(

    Z0 + iZ3 Z2 + iZ1−Z2 + iZ1 Z0 − iZ3

    )Singular Values and Determinant of the complex representation:

    D1 = D2 =

    √Z20 + ~Z

    2 D1D2 = Z20 + ~Z

    2

    14

  • Until now, the letters β and γ were sufficient to denote bireal and complex units. In thefollowing hc rings, I will occasionally use α and ζ for an additional bireal and complexunit. This will help to bring out the symmetry of the multiplication table.

    Real unit: 1; bireal units: α, β; complex units: γ, ζ.

    5 Hypercomplex numbers with 3 generators

    5.1 Hamilton biquaternions Cl3,0(R) ∼= Cl1,2(R) ∼= C(2)

    HC units of Cl3,0(R): 1,β1,β2,β3, ζ1 = β2β3, ζ2 = β3β1, ζ3 = β1β2,γ = −β1β2β3HC units of Cl1,2(R): 1, ζ1, ζ2,β3,β1 = β3ζ2,β2 = ζ1β3, ζ3 = ζ2ζ1,γ = ζ1ζ2β3

    Multiplication table

    1 ζl γ βlζk −δkl1− �klmζm βk −δklγ − �klmβmγ βk −1 −ζlβk −δklγ − �klmβm −ζk δkl1 + �klmζm

    General Hamilton biquaternion and its complex representation

    Z = 1X0 + ~ζ · ~X + γY0 + ~β · ~Y ∼=(

    X0 + Y3 + i(X3 − Y0) X2 + Y1 + i(X1 − Y2)−X2 + Y1 + i(Y2 +X1) X0 − Y3 + i(−X3 − Y0)

    )

    Determinant

    det Z ≡ D = A− iB

    where A = X20 + ~X2 − Y 20 − ~Y 2 and B = 2(X0Y0 + ~X · ~Y )

    Inverse Hamilton biquaternion

    Z−1 =1(AX0 +BY0)− ~ζ · (A ~X +B~Y ) + γ(AY0 −BX0)− ~β · (A~Y −B ~X)

    A2 +B2

    Euler formulas

    exp (γφ) = 1 cosφ+ γ sinφ unitary (| det | = 1)

    exp(~ζ · ~eψ

    )= 1 cosψ + ~ζ · ~e sinψ special unitary (det = 1).

    The two rotations commute: exp (γφ) exp(~ζ · ~eψ

    )= exp

    (~ζ · ~eψ

    )exp (γφ)

    15

  • exp(γφ) rotates each vector (Xκ, Yκ) (with κ = 0 . . . 3) clockwise by φ:

    Z′ =

    {exp (γφ) ZZ exp (γφ)

    }⇒

    X ′0 Y

    ′0

    X ′1 Y′1

    X ′2 Y′2

    X ′3 Y′3

    =

    X0 Y0X1 Y1X2 Y2X3 Y3

    ( cosφ sinφ− sinφ cosφ)

    Let X‖, Y‖ the 3-vector components parallel to ~e, and ~X⊥,~Y⊥ the 3-vector projections

    perpendicular to ~e. The factor exp(~ζ · ~eψ

    )rotates (X0, X‖) and (Y0, Y‖) ccw by φ, and

    rotates ~X⊥ and ~Y⊥ cw by ±φ around ~e:

    Z′ =

    exp(~ζ · ~eψ

    )Z

    Z exp(~ζ · ~eψ

    ) ⇒

    X ′0 Y′0

    X ′1 Y′1

    X ′2 Y′2

    X ′3 Y′3

    =cosφ

    1 0 0 00 1 0 00 0 1 00 0 0 1

    + sinφ

    0 −e1 −e2 −e3e1 0 ±e3 ∓e2e2 ∓e3 0 ±e1e3 ±e2 ∓e1 0

    X0 Y0X1 Y1X2 Y2X3 Y3

    The similarity transformation exp

    (~ζ · ~eψ

    ). . . exp

    (−~ζ · ~eψ

    )leaves X0, X‖ and Y0, Y‖

    invariant, and rotates ~X⊥ and ~Y⊥ cw by 2φ around ~e:

    Z′ = exp(~ζ · ~eψ

    )Z exp

    (−~ζ · ~eψ

    )⇒

    X ′0 Y

    ′0

    X ′1 Y′1

    X ′2 Y′2

    X ′3 Y′3

    =cos 2ψ

    1 0 0 00 1 0 00 0 1 00 0 0 1

    +

    . . . (1− cos 2ψ)

    1 0 0 00 (e1)

    2 e1e2 e1e30 e2e1 (e2)

    2 e2e30 e3e1 e3e2 (e3)

    2

    + sin 2ψ

    0 0 0 00 0 e3 −e20 −e3 0 e10 e2 −e1 0

    X0 Y0X1 Y1X2 Y2X3 Y3

    Polar Decomposition

    Z = exp(~ζ · ~eψ

    )exp (γφ) P

    where P = 1P0 + ~β · ~P

    and ~E ≡ ~e tanψ solves ~a+~~b ~E − ~E ~E · ~a = 0 (*)

    with ~a ≡ X0 ~X + Y0~Y and~~b ≡ ~X ~X t + ~Y ~Y t − (X20 + Y 20 )

    ~~1

    and tanφ = (Y0 + ~E · ~Y )/(X0 + ~E · ~X)

    * E. g. iterate ~E =~~b−1

    (~E ~E · ~a− ~a

    ), but it doesn’t always work.

    16

  • Singular Value Decomposition

    P = exp(~ζ · ~eψ

    )D exp

    (−~ζ · ~eψ

    )where ~e tanψ = (P2/P3,−P1/P3, 0)t and D = 1P0 + β1|~P |

    (How to express P0 and |~P | in terms of X and Y ?)

    SVs D1 = P0 + |~P |, D2 = P0 − |~P |

    with D1D2 = P20 − ~P 2 = ±

    √A2 +B2

    5.2 Anonymous-3 Cl2,1(R) ∼= R(2)⊕ R(2)

    HC units: 1,β1,β2,γ, ζ = β1β2,β3 = β1γ,β4 = β2γ,α = β1β2γ

    Multiplication table

    1 ζ γ α β1 β2 β3 β4ζ −1 α −γ −β2 β1 −β4 β3γ α −1 −ζ −β3 −β4 β1 β2α −γ −ζ 1 β4 −β3 −β2 β1β1 β2 β3 β4 1 ζ γ α

    β2 −β1 β4 −β3 −ζ 1 −α γβ3 β4 −β1 −β2 −γ −α 1 ζβ4 −β3 −β2 β1 α −γ −ζ 1

    General HC number and its real representation

    Z = 1X1 + ζX2 + γX3 +αX4 + β1Y1 + β2Y2 + β3Y3 + β4Y4∼=

    X1 +X4 + Y1 + Y4 −X2 +X3 − Y2 + Y3 0 0X2 −X3 − Y2 + Y3 X1 +X4 − Y1 − Y4 0 0

    0 0 X1 −X4 + Y1 − Y4 X2 +X3 + Y2 + Y30 0 −X2 −X3 + Y2 + Y3 X1 −X4 − Y1 + Y4

    Determinant

    det Z ≡ D = AB

    where A = (X1 +X4)2 + (X2 −X3)2 − (Y1 + Y4)2 − (Y2 − Y3)2

    and B = (X1 −X4)2 + (X2 +X3)2 − (Y1 − Y4)2 − (Y2 + Y3)2

    17

  • Inverse HC number

    Z−1 =1

    2

    (1

    A+

    1

    B

    )(1X1 − ζX2 − γX3 +αX4 − β1Y1 − β2Y2 − β3Y3 − β4Y4)

    +1

    2

    (1

    A− 1B

    )(1X4 + ζX3 + γX2 +αX1 − β1Y4 + β2Y3 + β3Y2 − β4Y1)

    Euler formulas

    exp (γφ) = 1 cosφ+ γ sinφ exp (ζψ) = 1 cosψ + ζ sinψ

    The two rotations commute with each other.

    exp(γφ) rotates (X1, X3) and (X2, X4) ccw by φ, and (Y1, Y3) and (Y2, Y4) cw by ±φ:

    Z′ =

    {exp (γφ) ZZ exp (γφ)

    }⇒

    (X ′1 X

    ′3

    X ′2 X′4

    )=

    (X1 X3X2 X4

    )(cosφ sinφ− sinφ cosφ

    )(Y ′1 Y

    ′3

    Y ′2 Y′4

    )=

    (Y1 Y3Y2 Y4

    )(cosφ ∓ sinφ± sinφ cosφ

    )

    The similarity transformation exp(γφ) . . . exp(−γφ) leaves (X1, X3) and (X2, X4)invariant, and rotates (Y1, Y3) and (Y2, Y4) cw by 2φ:

    Z′ =

    {exp (γφ) ZZ exp (γφ)

    }⇒

    (X ′1 X

    ′3

    X ′2 X′4

    )=

    (X1 X3X2 X4

    )(Y ′1 Y

    ′3

    Y ′2 Y′4

    )=

    (Y1 Y3Y2 Y4

    )(cos 2φ − sin 2φsin 2φ cos 2φ

    )

    exp(ζψ) rotates (X1, X2) and (X3, X4) ccw by ψ, and (Y1, Y2) and (Y3, Y4) cw by ±ψ:

    Z′ =

    {exp (ζψ) ZZ exp (ζψ)

    }⇒

    (X ′1 X

    ′3

    X ′2 X′4

    )=

    (cosψ − sinψsinψ cosψ

    )(X1 X3X2 X4

    )(Y ′1 Y

    ′3

    Y ′2 Y′4

    )=

    (cosψ ± sinψ∓ sinψ cosψ

    )(Y1 Y3Y2 Y4

    )

    The similarity transformation exp(ζψ) . . . exp(−ζψ) leaves (X1, X2) and (X3, X4)invariant, and rotates (Y1, Y2) and (Y3, Y4) cw by 2ψ:

    Z′ =

    {exp (ζψ) ZZ exp (ζψ)

    }⇒

    (X ′1 X

    ′3

    X ′2 X′4

    )=

    (X1 X3X2 X4

    )(Y ′1 Y

    ′3

    Y ′2 Y′4

    )=

    (cos 2ψ sin 2ψ− sin 2ψ cos 2ψ

    )(Y1 Y3Y2 Y4

    )

    18

  • Polar Decomposition

    Z = exp (ζψ) exp (γφ) P

    where P = 1P1 +αP4 + β1P5 + β2P6 + β3P7 + β4P8

    and tan 2ψ =2 (X1X2 +X3X4)

    X21 −X22 +X23 −X24

    and tanφ =X3 + tanψX4X1 + tanψX2

    Singular Value Decomposition

    P = exp (ζψ) exp (γφ) D exp (−γφ) exp (−ζψ)

    where D = 1D1 +αD4 + β1D5 + β4D8

    and tan 4ψ = − 2 (P5P6 + P7P8)P 25 − P 26 + P 27 − P 28

    and tan 2φ = −P7 − tan 2ψP8P5 − tan 2ψP6

    Tessarines

    The hc numbers Z = 1X1 + ζX2 + γX3 +αX4 form a commutative sub-ring ofAnonymous-3 known as ”tessarines”.

    5.3 Clifford biquaternions Cl0,3 ∼= H⊕H

    (Synonym: split biquaternions)

    HC units: 1,γ1,γ2,γ3, ζ1 = −γ2γ3, ζ2 = −γ3γ1, ζ3 = −γ1γ2,β = γ1γ2γ3

    Multiplication table

    1 ζl β γ lζk −δkl1− �klmζm γk −δklβ − �klmγmβ γ l 1 ζlγk −δklβ − �klmγm ζk −δkl1− �klmζm

    General Clifford biquaternion and its quaternion representation

    Z = 1X0 + ~ζ · ~X + βY0 + ~γ · ~Y ∼= . . .

    Give me an incentive and I’ll finish this section.

    19

  • 6 Hypercomplex numbers with 4 generators

    6.1 Space-Time Algebra Cl4,0(R) ∼= Cl1,3(R) ∼= Cl0,4(R) ∼= H(2)

    This is the Space-Time algebra, represented by the 16 Dirac matrices.

    HC units of Cl4,0(R) (k, l,m, n = 1 . . . 4):

    1 βk ζkl = −ζlk = 12 [βk,βl] γk =16�klmnβlβmβn α = β1β2β3β4

    HC units of Cl1,3(R) (k, l,m = 1 . . . 3): 1 ζk4,β4 βk = ζk4β4,

    ζkl = −ζlk = −12 [ζk4, ζl4] γk = −12�klmζl4ζm4β4,α = −ζ14ζ24ζ34 γ4 = −ζ14ζ24ζ34β4

    HC units of Cl0,4(R) (k, l,m, n = 1 . . . 4):

    1 γk ζkl = −ζlk = −12 [γk,γ l] βk = −16�klmnγ lγmγn α = γ1γ2γ3γ4

    Multiplication table

    1 α βm γm ζmnα 1 −γm −βm 12�klmnζklβk γk δkm1 + ζkm αδkm +

    12�klmnζln δkmβn − δknβm

    −�klmnγ lγk βk −αδkm − 12�klmnζln −δkm1− ζkm δkmγn − δknγm

    −�klmnβlζkl −12�klmnζmn −δkmβl + δlmβk −δkmγ l + δlmγk −δkmδln1 + �klmnα

    . . . . . .− �klmnγn . . .− �klmnβn . . .− δkmζln − δlnζkm

    General HC number and its quaternion representation

    Z = 1Z0+αZα+~γ · ~Zγ+~β · ~Zβ+ζ12Z12+ζ23Z23+ζ31Z31+ζ14Z14+ζ24Z24+ζ34Z34 ∼= . . .

    Give me an incentive and I’ll finish this section.

    20

  • 6.2 Anonymous-4 Cl3,1(R) ∼= Cl2,2(R) ∼= R(4)

    HC units of Cl3,1(R):

    1 β2k,γ1 β3k = β

    2kγ

    1, ζk =12�klmβ

    2l β

    2m β

    1k = ζkγ

    1 γ2 = −β21β22β23 γ3 = γ2γ1

    HC units of Cl2,2(R):

    1 β12,β13,γ

    2,γ3 β22 = β12γ

    3,β23 = β13γ

    3,β32 = −β12γ2,β33 = −β13γ3, ζ1 = β12β13,γ1 = γ2γ3

    β21 = β12β

    13γ

    2,β31 = β12β

    13γ

    3, ζ2 = β12γ

    2γ3, ζ3 = β13γ

    2γ3 β11 = −β12β13γ2γ3

    Multiplication table

    1 γn ζl βnl

    γm −δmn1− �mnoγo βml −δmnζl − �mnoβolζk β

    nk −δkl1− �kliζi −δklγn − �kliβni

    βmk −δmnζk − �mnoβok −δklγm − �kliβmi δklδmn1 + δkl�mnoγo. . .+ �kliδmnζi + �kli�mnoβ

    oi

    General HC number and its representation

    Z = 1Z00 + ζkZ0k + γ

    mZm0 + βmk Z

    mk ≡ 1Z00 + ~ζ · ~Z0 + γmZm0 + ~βm · ~Zm ∼=

    Z00 + Z11 + Z

    22 + Z

    33 −Z01 + Z10 − Z23 + Z32 −Z02 + Z13 + Z20 − Z31 −Z03 − Z12 + Z21 + Z30

    Z01 − Z10 − Z23 + Z32 Z00 + Z11 − Z22 − Z33 Z03 + Z12 + Z21 + Z30 −Z02 + Z13 − Z20 + Z31Z02 + Z

    13 − Z20 − Z31 −Z03 + Z12 + Z21 − Z30 Z00 − Z11 + Z22 − Z33 Z01 + Z10 + Z23 + Z32

    Z03 − Z12 + Z21 − Z30 Z02 + Z13 + Z20 + Z31 −Z01 − Z10 + Z23 + Z32 Z00 − Z11 − Z22 + Z33

    where summation over equal indices is required.

    The components of the hc number are arranged as a matrix, not as a vector!

    Zλκ =

    Z00 Z

    10 Z

    20 Z

    30

    Z01 Z11 Z

    21 Z

    31

    Z02 Z12 Z

    22 Z

    32

    Z03 Z13 Z

    23 Z

    33

    Determinants

    The anti-symmetric 4× 4 matrix A = ζkA0k + γmAm0 has the determinant

    det A = [(A10)2 + (A20)

    2 + (A30)2 − (A01)2 − (A02)2 − (A03)2]

    2

    The symmetric 4× 4 matrix Σ = 1Σ00 + ~βm · ~Σm has the determinant

    det Σ =√

    det (Σγ1Σ) =√

    det A = (A10)2 + (A20)

    2 + (A30)2 − ~A0 · ~A0

    where A10 = (Σ00)

    2+ ~Σ1 · ~Σ1 − ~Σ2 · ~Σ2 − ~Σ3 · ~Σ3 A20 = 2~Σ2 · ~Σ1 A30 = 2~Σ3 · ~Σ1

    and ~A0 = 2(~Σ2 ∧ ~Σ3 − Σ00~Σ1

    )

    21

  • The general 4× 4 matrix 1Z00 + ~ζ · ~Z0 + γmZm0 + ~βm · ~Zm has the determinant

    det Z =√

    det (Zγ1Zᵀ) =√

    det A = (A10)2 + (A20)

    2 + (A30)2 − ~A0 · ~A0

    where A10 = Z0µZ

    0µ + Z

    1µZ

    1µ − Z2µZ2µ − Z3µZ3µ

    A20 = 2(Z2µZ

    1µ − Z0µZ3µ

    )A30 = 2

    (Z0µZ

    2µ + Z

    3µZ

    )and ~A0 = 2

    (Z10 ~Z

    0 − Z00 ~Z1 + ~Z0 ∧ ~Z1 + Z30 ~Z2 − Z20 ~Z3 + ~Z2 ∧ ~Z3)

    The choice of γ1 (instead of γ2,γ3, ζ1, ζ2 or ζ3) for constructing an anti-symmetricmatrix A out of Σ or Z is arbitrary.

    Inverse HC number

    The anti-symmetric 4× 4 matrix A = ζkA0k + γmAm0 has the inverse

    A−1 =−γmAm0 + ζkA0k

    (A10)2 + (A20)

    2 + (A30)2 − (A01)2 − (A02)2 − (A03)2

    The symmetric 4× 4 matrix Σ = 1Σ00 + ~βm · ~Σm has the inverse

    Σ−1 = γ1ΣA−1 where A = Σγ1Σ

    For the components of A in terms of Σ see the paragraph ”Determinants”.

    The general 4× 4 matrix 1Z00 + ~ζ · ~Z0 + γmZm0 + ~βm · ~Zm has the inverse

    Z−1 = γ1ZᵀA−1 where A = Zγ1Zᵀ

    For the components of A in terms of Z see the paragraph ”Determinants”.

    Euler formulas

    exp(γ lf lφ

    )= 1 cosφ+ γ lf l sinφ where (f 1)2 + (f 2)2 + (f 3)2 = 1

    exp(~ζ · ~eψ

    )= 1 cosψ + ~ζ · ~e sinψ where (e1)2 + (e2)2 + (e3)2 = 1

    The two rotations commute with each other.

    exp(γ lf lφ

    )rotates each row of the coefficient matrix like a quaternion:

    Z′ =

    {exp

    (γ lf lφ

    )Z

    Z exp(γ lf lφ

    ) } ⇒ Z ′κλ = (Zκλ){ exp (−ζlf lφ)exp (γ lf lφ)}

    =Z00 Z

    10 Z

    20 Z

    30

    Z01 Z11 Z

    21 Z

    31

    Z02 Z12 Z

    22 Z

    32

    Z03 Z13 Z

    23 Z

    33

    ×cosφ

    1 0 0 00 1 0 00 0 1 00 0 0 1

    + sinφ

    0 f 1 f 2 f 3

    −f 1 0 ∓f 3 ±f 2−f 2 ±f 3 0 ∓f 1−f 3 ∓f 2 ±f 1 0

    The similarity transformation exp(γ lf lφ

    ). . . exp

    (−γ lf lφ

    )acts on each row of the

    coefficient matrix like on a quaternion:

    Z′ = exp(γ lf lφ

    )Z exp

    (−γ lf lφ

    )⇒ Z ′κλ = (Zκλ) exp

    (−(γ l + ζl)f lφ

    )=

    22

  • Z00 Z

    10 Z

    20 Z

    30

    Z01 Z11 Z

    21 Z

    31

    Z02 Z12 Z

    22 Z

    32

    Z03 Z13 Z

    23 Z

    33

    ×cos 2φ

    1 0 0 00 1 0 00 0 1 00 0 0 1

    +

    . . . (1− cos 2φ)

    1 0 0 00 (f 1)2 f 1f 2 f 1f 3

    0 f 2f 1 (f 2)2 f 2f 3

    0 f 3f 1 f 3f 2 (f 3)2

    + sin 2φ

    0 0 0 00 0 −f 3 f 20 f 3 0 −f 10 −f 2 f 1 0

    exp(~ζ · ~eψ

    )rotates each column of the coefficient matrix like a quaternion:

    Z′ =

    exp(~ζ · ~eψ

    )Z

    Z exp(~ζ · ~eψ

    ) ⇒ Z ′κλ ={

    exp (ζkekφ)exp

    (−γkekφ

    ) } (Zκλ) =cosφ

    1 0 0 00 1 0 00 0 1 00 0 0 1

    + sinφ

    0 −e1 −e2 −e3e1 0 ±e3 ∓e2e2 ∓e3 0 ±e1e3 ±e2 ∓e1 0

    ×

    Z00 Z

    10 Z

    20 Z

    30

    Z01 Z11 Z

    21 Z

    31

    Z02 Z12 Z

    22 Z

    32

    Z03 Z13 Z

    23 Z

    33

    The similarity transformation exp

    (~ζ · ~eψ

    ). . . exp

    (−~ζ · ~eψ

    )acts on each column of the

    coefficient matrix like on a quaternion:

    Z′ = exp(~ζ · ~eψ

    )Z exp

    (−~ζ · ~eψ

    )⇒ Z ′λκ = exp

    ((ζk + γk)ekφ

    )(Zκλ) =cos 2ψ

    1 0 0 00 1 0 00 0 1 00 0 0 1

    + (1− cos 2ψ)

    1 0 0 00 (e1)

    2 e1e2 e1e30 e2e1 (e2)

    2 e2e30 e3e1 e3e2 (e3)

    2

    +

    . . . sin 2ψ

    0 0 0 00 0 e3 −e20 −e3 0 e10 e2 −e1 0

    ×

    Z00 Z

    10 Z

    20 Z

    30

    Z01 Z11 Z

    21 Z

    31

    Z02 Z12 Z

    22 Z

    32

    Z03 Z13 Z

    23 Z

    33

    Polar decomposition

    Z = exp(~ζ · ~eψ

    )exp

    (γ lf lφ

    )P

    where P = 1P0 + ~β1 · ~P 1 + ~β2 · ~P 2 + ~β3 · ~P 3

    and ~E ≡ ~e tanψ solves ~a+~~b ~E − ~E ~E · ~a = 0 (*)

    with ~a ≡ Zλ0 ~Zλ(6= 0) and~~b ≡ ~Zλ(~Zλ)t − Zλ0Zλ0

    ~~1

    and (F l =)f l tanφ = (Z l0 + ~E · ~Z l)/(Z00 + ~E · ~Z0)

    * E. g. iterate ~E =~~b−1

    (~E ~E · ~a− ~a

    ), but it doesn’t always work.

    23

  • Singular Value Decomposition

    The problem of finding the 4D eigenvalue decomposition

    P = exp(~ζ · ~eψ

    )exp

    (γ lf lφ

    )D exp

    (−γ lf lφ

    )exp

    (−~ζ · ~eψ

    )where D = 1D00 + β

    11D

    11 + β

    22D

    22 + β

    33D

    33

    is mathematically equivalent to finding the 3D singular value decomposition

    ~~P = exp(~~Jkek2ψ

    )~~D exp

    (− ~~Jlfl2φ

    )where

    ~~J1 =

    0 0 00 0 10 −1 0

    ~~J2 = 0 0 −10 0 0

    1 0 0

    ~~J3 = 0 1 0−1 0 0

    0 0 0

    and where

    ~~P and~~D are the lower right submatrices of the coefficient matrices

    P λκ =

    P 00 0 0 0

    0 P 11 P21 P

    31

    0 P 12 P22 P

    32

    0 P 13 P23 P

    33

    and Dλκ =

    D00 0 0 00 D11 0 00 0 D22 00 0 0 D33

    P 00 is an invariant of all similarity rotations, i. e. we have D

    00 = P

    00 .

    Let~~P =

    ~~U~~D~~V ᵀ the singular value decomposition of

    ~~P found on the computer.

    (If det~~V = −1, then set ~~V ← −~~V and ~~D ← − ~~D.)

    Then (e1, e2, e3) tanψ =(U23 − U32, U31 − U13, U12 − U21)

    TrU + 1

    and (f 1, f 2, f 3) tanφ =(V23 − V32, V31 − V13, V12 − V21)

    TrV + 1

    References

    [1] GNU Octave, J. W. Eaton, D. Bateman & S. Hauberg, http://www.octave.org.

    [2] van der Waerden, B. L., A History of Algebra From al-Khwärizml to Emmy Noether,Springer-Verlag Berlin, Heidelberg, (1985).

    [3] Lawson, H. Blaine and Michelsohn, Marie-Louise, Spin geometry, PrincetonUniversity Press, 1989.

    [4] Figueroa-O’Farrill, José, Spin Geometry, Lecture notes (2010),http://empg.maths.ed.ac.uk/Activities/Spin/

    24

  • A Octave and Matlab demonstration programs

    A.1 Cockle Quaternions

    %% Cockle quaternions

    clear

    display(’%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%’)

    display(’Cockle Quaternions: check formulas’)

    % hypercomplex units

    uni=eye(2);

    be1=[1,0;0,-1];

    be2=[0,1;1,0];

    gam=be1*be2;

    gamma=zeros(2,2,4);

    gamma(:,:,1)=uni;

    gamma(:,:,2)=be1;

    gamma(:,:,3)=be2;

    gamma(:,:,4)=gam;

    % Random Matrix

    aZ=randn(1,4)

    Z=zeros(2,2);

    for k =1:4

    Z=Z+aZ(k)*gamma(:,:,k);

    end

    Z

    % Determinant

    D=aZ.^2*[1 -1 -1 1]’

    testD=det(Z)

    disp(’ ’);

    % Inverse

    aiZ=aZ.*[1 -1 -1 -1]/D

    iZ=zeros(2,2);

    for k =1:4

    iZ=iZ+aiZ(k)*gamma(:,:,k);

    end

    % Test: should be uni(2)

    testuni=Z*iZ

    % Polar Decomposition

    s0=sign(aZ(1));s3=sign(aZ(4));

    phi=atan(aZ(4)/aZ(1))+(1-s0)*s3*pi/2;

    25

  • R=expm(gam*phi);

    P=R’*Z

    aP=zeros(1,4);

    for k =1:4

    aP(k)=trace(gamma(:,:,k)’*P)/2;

    end

    aP

    % Singular Value decomposition

    psi=-atan(aP(3)/aP(2))/2;

    R=expm(gam*psi);

    D=R’*P*R

    % Compare Singular Values

    SV=[D(1) D(4)]

    testSV=[sqrt(aZ(1)^2+aZ(4)^2)+sqrt(aZ(2)^2+aZ(3)^2) ...

    sqrt(aZ(1)^2+aZ(4)^2)-sqrt(aZ(2)^2+aZ(3)^2)]

    display(’%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%’)

    A.2 Hamilton Bi-Quaternions

    %% Hamilton Bi-Quaternions

    clear;

    display(’%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%’)

    display(’Hamilton BiQuaternions: check formulas’)

    % Hypercomplex units

    uni=eye(2);

    be1=[0,1;1,0];

    be2=[0,-i;i,0];

    be3=[1,0;0,-1];

    gam=-be1*be2*be3;

    ze1=be2*be3;

    ze2=be3*be1;

    ze3=be1*be2;

    gamma=zeros(2,2,8);

    gamma(:,:,1)=uni;

    gamma(:,:,2)=ze1;

    gamma(:,:,3)=ze2;

    gamma(:,:,4)=ze3;

    gamma(:,:,5)=gam;

    gamma(:,:,6)=be1;

    gamma(:,:,7)=be2;

    gamma(:,:,8)=be3;

    % Random Matrix

    aZ=randn(1,8)

    26

  • Z=zeros(2,2);

    for k =1:8

    Z=Z+aZ(k)*gamma(:,:,k);

    end

    Z

    X=aZ(1:4);Y=aZ(5:8);

    % Determinant

    A=X*X’-Y*Y’;

    B=2*X*Y’;

    D=A-i*B

    testD=det(Z)

    disp(’ ’);

    % Inverse

    aiZ=A*[X.*[1 -1 -1 -1] Y.*[1 -1 -1 -1]]+...

    B*[Y.*[1 -1 -1 -1] -X.*[1 -1 -1 -1]];

    aiZ=aiZ/(A^2+B^2)

    iZ=zeros(2,2);

    for k =1:8

    iZ=iZ+aiZ(k)*gamma(:,:,k);

    end

    iZ

    % Test: should be uni(2)

    testuni=Z*iZ

    % Polar Decomposition

    a=X(1)*X(2:4)’+Y(1)*Y(2:4)’;

    b=X(2:4)’*X(2:4)+Y(2:4)’*Y(2:4)-(X(1)^2+Y(1)^2)*eye(3);

    E=0*a;

    for k = 1:5

    E=b\(E*(E’*a)-a);

    end

    if norm(E) < 10

    for k = 1:500

    E1=b\(E*(E’*a)-a);

    E2=b\(E1*(E1’*a)-a);

    E=(E1+E2)/2;

    end

    e=E/norm(E);

    psi=atan(norm(E));

    phi=atan((Y(1)+E’*Y(2:4)’)/(X(1)+E’*X(2:4)’));

    R=expm(gam*phi+(ze1*e(1)+ze2*e(2)+ze3*e(3))*psi);

    P=R’*Z

    aP=zeros(1,8);

    for k =1:8

    27

  • aP(k)=real(trace(gamma(:,:,k)’*P)/2);

    end

    aP

    % Singular Value decomposition

    E=[aP(7)/aP(8) -aP(6)/aP(8) 0]’;

    e=E/norm(E);

    psi=atan(norm(E))/2;

    R=expm((ze1*e(1)+ze2*e(2)+ze3*e(3))*psi);

    D=R’*P*R

    % Compare Singular Values

    SV=real([D(1) D(4)])

    testSV=[aP(1)+norm(aP(6:8)) aP(1)-norm(aP(6:8))]

    else

    display(’Numerical failure: Cannot calculate E’)

    end

    display(’%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%’)

    A.3 Anonymous-3

    %% Anonymous-3

    clear;

    display(’%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%’)

    display(’Anonymous-3: check formulas’)

    % Hypercomplex units

    h=zeros(4);

    uni=eye(4);

    be1=h;be1([1,6,11,16])=[1,-1,1,-1];

    be2=h;be2([2,5,12,15])=[-1,-1,1,1];

    gam=h;gam([2,5,12,15])=[-1,1,-1,1];

    zet=be1*be2;

    be3=be1*gam;

    be4=be2*gam;

    alp=be1*be2*gam;

    gamma=zeros(4,4,8);

    gamma(:,:,1)=uni;

    gamma(:,:,2)=zet;

    gamma(:,:,3)=gam;

    gamma(:,:,4)=alp;

    gamma(:,:,5)=be1;

    gamma(:,:,6)=be2;

    gamma(:,:,7)=be3;

    gamma(:,:,8)=be4;

    28

  • % Random Matrix

    aZ=randn(1,8)

    Z=zeros(4,4);

    for k =1:8

    Z=Z+aZ(k)*gamma(:,:,k);

    end

    Z

    % Determinant

    X=aZ(1:4);Y=aZ(5:8);

    A=(X(1)+X(4))^2+(X(2)-X(3))^2-(Y(1)+Y(4))^2-(Y(2)-Y(3))^2;

    B=(X(1)-X(4))^2+(X(2)+X(3))^2-(Y(1)-Y(4))^2-(Y(2)+Y(3))^2;

    D=A*B

    testD=det(Z)

    disp(’ ’);

    % Inverse

    aiZ=(1/A+1/B)/2*[X.*[1 -1 -1 1] -Y]+...

    (1/A-1/B)/2*[fliplr(X) -fliplr(Y).*[1 -1 -1 1]]

    iZ=zeros(4,4);

    for k =1:8

    iZ=iZ+aiZ(k)*gamma(:,:,k);

    end

    % Test: should be uni(4)

    testuni=Z*iZ

    % Polar Decomposition

    psi=atan( 2*(X(1)*X(2)+X(3)*X(4))/(X(1)^2-X(2)^2+X(3)^2-X(4)^2) )/2;

    phi=atan( (X(3)+tan(psi)*X(4))/(X(1)+tan(psi)*X(2)) );

    R=expm(gam*phi+zet*psi);

    P=R’*Z

    aP=zeros(1,8);

    for k =1:8

    aP(k)=real(trace(gamma(:,:,k)’*P)/2);

    end

    aP

    %Singular Value decomposition

    Q=aP(5:8);

    psi=-atan( 2*(Q(1)*Q(2)+Q(3)*Q(4))/(Q(1)^2-Q(2)^2+Q(3)^2-Q(4)^2) )/4+pi/4;

    phi=-atan( (Q(3)-tan(2*psi)*Q(4))/(Q(1)-tan(2*psi)*Q(2)) )/2;

    R=expm(gam*phi+zet*psi);

    D=R’*P*R

    SV=diag(D)’

    display(’%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%’)

    29

  • A.4 Anonymous-4

    %% Anonymous-4

    clear;

    display(’%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%’)

    display(’Anonymous-4: check formulas’)

    % Hypercomplex units

    h=zeros(4);

    uni=eye(4);

    be12=h;be12([4,7,10,13])=[1,1,1,1];

    be22=h;be22([1,6,11,16])=[1,-1,1,-1];

    be32=h;be32([2,5,12,15])=[-1,-1,1,1];

    ga1=h;ga1([2,5,12,15])=[-1,1,-1,1];

    be13=be12*ga1;

    be23=be22*ga1;

    be33=be32*ga1;

    ze1=be22*be32;

    ze2=be32*be12;

    ze3=be12*be22;

    be11=ze1*ga1;

    be21=ze2*ga1;

    be31=ze3*ga1;

    ga2=-be22*be32*be12;

    ga3=ga2*ga1;

    gamma=zeros(4,4,4,4);

    gamma(:,:,1,1)=uni;

    gamma(:,:,2,1)=ze1;

    gamma(:,:,3,1)=ze2;

    gamma(:,:,4,1)=ze3;

    gamma(:,:,1,2)=ga1;

    gamma(:,:,2,2)=be11;

    gamma(:,:,3,2)=be21;

    gamma(:,:,4,2)=be31;

    gamma(:,:,1,3)=ga2;

    gamma(:,:,2,3)=be12;

    gamma(:,:,3,3)=be22;

    gamma(:,:,4,3)=be32;

    gamma(:,:,1,4)=ga3;

    gamma(:,:,2,4)=be13;

    gamma(:,:,3,4)=be23;

    gamma(:,:,4,4)=be33;

    % Random Matrix

    aZ=randn(4,4);

    Z=zeros(4,4);

    for k =1:4

    for m=1:4

    Z=Z+aZ(k,m)*gamma(:,:,k,m);

    end

    end

    Z

    30

  • % Determinant

    A01=aZ(:,1)’*aZ(:,1)+aZ(:,2)’*aZ(:,2)-aZ(:,3)’*aZ(:,3)-aZ(:,4)’*aZ(:,4);

    A02=2*(aZ(:,3)’*aZ(:,2)-aZ(:,1)’*aZ(:,4));

    A03=2*(aZ(:,1)’*aZ(:,3)+aZ(:,4)’*aZ(:,2));

    A_0=2*( aZ(1,2)*aZ(2:4,1)-aZ(1,1)*aZ(2:4,2)+cross(aZ(2:4,1),aZ(2:4,2))...

    +aZ(1,4)*aZ(2:4,3)-aZ(1,3)*aZ(2:4,4)+cross(aZ(2:4,3),aZ(2:4,4)) );

    D= A01^2+A02^2+A03^2-A_0’*A_0

    testD=det(Z)

    disp(’ ’);

    % Inverse

    iA=(-ga1*A01-ga2*A02-ga3*A03+ze1*A_0(1)+ze2*A_0(2)+ze3*A_0(3))/D;

    iZ=ga1*Z’*iA

    % Test: should be uni(2)

    testuni=Z*iZ

    % Polar decomposition

    a=aZ(1,1)*aZ(2:4,1)+aZ(1,2)*aZ(2:4,2)+aZ(1,3)*aZ(2:4,3)+aZ(1,4)*aZ(2:4,4);

    b=aZ(2:4,1)*aZ(2:4,1)’+aZ(2:4,2)*aZ(2:4,2)’+...

    aZ(2:4,3)*aZ(2:4,3)’+aZ(2:4,4)*aZ(2:4,4)’;

    b=b-(aZ(1,1)*aZ(1,1)+aZ(1,2)*aZ(1,2)+aZ(1,3)*aZ(1,3)+aZ(1,4)*aZ(1,4))*eye(3);

    E=a*0;

    hmax=5;

    for h=1:hmax

    E=b\(E*(E’*a*h/hmax)-a*h/hmax);

    end

    h=(norm(E) < 10);

    if h

    for h=1:500

    E1=b\(E*(E’*a)-a);

    E2=b\(E1*(E1’*a)-a);

    E=(E1+E2)/2;

    end

    chi2=atan(norm(E));

    e=E/norm(E);

    O2=cos(chi2)*eye(4)+sin(chi2)*(e(1)*ze1+e(2)*ze2+e(3)*ze3);

    Zp=O2’*Z;

    aZp=zeros(4,4);

    for k =1:4

    for m=1:4

    aZp(k,m)=trace(gamma(:,:,k,m)’*Zp)/4;

    end

    end

    test0=[aZp(1,1)*aZp(2:4,1)+aZp(1,2)*aZp(2:4,2)+aZp(1,3)*aZp(2:4,3)+aZp(1,4)*aZp(2:4,4)]’;

    h=1-isnan(test0(1));

    if h

    31

  • F=aZp(1,2:4)/aZp(1,1);

    chi1=atan(norm(F));

    f=F/norm(F);

    O1=cos(chi1)*eye(4)+sin(chi1)*(f(1)*ga1+f(2)*ga2+f(3)*ga3);

    P=O1’*Zp

    aP=zeros(4,4);

    for k =1:4

    for m=1:4

    aP(k,m)=trace(gamma(:,:,k,m)’*P)/4;

    end

    end

    aP

    % Singular Value decomposition

    [u, s, v] = svd (aP(2:4,2:4));

    if det(v)