<<

Hypercomplex and their 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 table, matrix represen- tation and useful formulas are compiled for eight hypercomplex systems.

1 Contents

1 Introduction 3

2 Hypercomplex numbers 3 2.1 History and basic properties ...... 3 2.2 Matrix representations ...... 4 2.3 ...... 5 2.4 Writing a matrix in a hypercomplex ...... 6 2.5 Interesting formulas ...... 6 2.6 Real Clifford ...... 8 ∼ 2.7 Real numbers Cl0,0(R) = R ...... 10 3 Hypercomplex numbers with 1 generator 10 ∼ 3.1 Bireal numbers Cl1,0(R) = R ⊕ R ...... 10 ∼ 3.2 Complex numbers Cl0,1(R) = C ...... 11 4 Hypercomplex numbers with 2 generators 12 ∼ ∼ 4.1 Cockle Cl2,0(R) = Cl1,1(R) = R(2) ...... 12 ∼ 4.2 Hamilton quaternions Cl0,2(R) = H ...... 13 5 Hypercomplex numbers with 3 generators 15 ∼ ∼ 5.1 Hamilton Cl3,0(R) = Cl1,2(R) = C(2) ...... 15 ∼ 5.2 Anonymous-3 Cl2,1(R) = R(2) ⊕ R(2) ...... 17 ∼ 5.3 Clifford biquaternions Cl0,3 = H ⊕ H ...... 19 6 Hypercomplex numbers with 4 generators 20 ∼ ∼ ∼ 6.1 -Time Cl4,0(R) = Cl1,3(R) = Cl0,4(R) = H(2) ...... 20 ∼ ∼ 6.2 Anonymous-4 Cl3,1(R) = Cl2,2(R) = R(4) ...... 21 References 24

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

2 1 Introduction

Hypercomplex numbers are composite numbers that allow to simplify the mathematical description of certain problems. They are used e. g. in , , relativistic , orbital , air and space flight. The author came across hypercomplex numbers in accelerator , where they can be used to describe symplectic transformations. Hypercomplex numbers come along with matrix representations, that reproduce the addition and multiplication law. This article is aimed at engineers and scientists, and presents 8 systems. The , matrix representation, , inverse, Euler formulas, and singular value decomposition are given. Some mathematical background is required. An occasional look at www.wikipedia.org/ (preferably the english version) or mathworld.wolfram.com/ should allow the reader to fill 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, a combination of 2 real numbers X and Y into a new object Z = (X,Y ), the , 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 the moduli” 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, ), and even of 16 real numbers (). The collective term for these new numbers 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 ””. To include hc number systems with non-associative multiplication (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 the moduli holds, with the modulus, or ”euclidean ”, defined as the length of the p 2 2 vector (Z1,...ZN ): |Z| = (Z1) + ... + (ZN ) . 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 hc rings vary. When dealing with a hc ring, it is good to know these attributes. One should determine:

3 • A: Is multiplication associative? • C: Is multiplication commutative? • D: Is 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 A C D E Real 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 matrix representation. Only the real numbers, complex numbers and Hamilton quaternions have the properties A, 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 be used to represent them. While hc numbers are always made up of real numbers, we will admit representative matrices with real, complex or quaternionic elements. (Matrices with complex or quaternionic elements are nested hypercomplex numbers.) is associative, but in general not commutative. Division by a hc number corresponds to multiplication with the inverse of the representative matrix. The norm of a hc number is the of the determinant of the representative matrix.

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

Z = 1Z0 + real part  β1Z1 + ... + βK ZK + bireal  γ1ZK+1 + ... + γLZK+L+ complex imaginary part δ1ZK+L+1 + ... + δM ZK+L+M dual 

4 • 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, : β = β|, Tr(β) = 0, ββ| = 1. Its complex or quaternionic representation is a hermitian, with imaginary trace: β = β∗, < Tr(β) = 0, ββ∗ = 1. • γ is a complex unit and squares to −1: γ2 = −1. Its real representation is a skew-symmetric, orthogonal matrix: γ = −γ|. γγ| = 1. Its complex or quaternionic representation is a skew-hermitian, unitary matrix: γ = −γ∗, γγ∗ = 1 • δ is a dual unit and squares to 0: δ2 = 0. Dual units have their use, but will be omitted in this article. I already mentioned that addition of two hc numbers is defined component-wise as the usual addition of real numbers. The multiplication of two hc numbers is specified with a multiplication table of the units 1, βk, γl. The matrix representation of the units together with matrix multiplication must reproduce this table. For example, take the complex numbers Z = 1X + γY , with X and Y real. The multiplication table is To save space, let’s truncate this to · 1 γ 1 1 γ 1 γ γ γ −1 γ −1 The multiplication of two complex numbers is now the familiar

A · B = (1A0 + γA1)(1B0 + γB1) = 1(A0B0 − A1B1) + γ(A0B1 + A1B0)

The real representation of Z is a 2 × 2 matrix, e. g.  1 0   0 1   XY  1 = γ = ⇒ Z = 1X + γY ∼= 0 1 −1 0 −YX Matrix multiplication now reproduces the abstract multiplication law.

2.3 Scalar product

Let ¯ Z = 1Z0 − β1Z1 ... − βK ZK − γ1ZK+1 ... − γLZK+L

the conjugate of Z, and

∗ Z = 1Z0 + β1Z1 ... + βK ZK − γ1ZK+1 ... − γLZK+L

the of Z. This second definition corresponds to the conjugate matrix (assuming real, complex or elements).

5 Also, let

1 

It is easy to verify that (A|B) ≡ < (A∗B) is a scalar product. What’s more, all the hypercomplex units form an orthogonal basis with respect to this scalar product. Therefore, the remaining coefficients of Z are

∗ Zk = (βk|Z) = < (βkZ) (1 ≤ k ≤ K) ∗ ZK+l = (γl|Z) = < (γl Z) (1 ≤ l ≤ L)

2.4 Writing a matrix in a hypercomplex basis

Instead of doing hypercomplex calculations with matrices, we can also do the inverse: perform matrix calculations with hypercomplex numbers. In fact, a hypercomplex number Z can be considered as a matrix written in a non-standard, highly symmetric basis. What’s the use of doing this? Well, I can think of 4 situations where hc numbers are advantageous.

• When the matrices have some kind of symmetry, some coefficients Zk may become 0. This will simplify the calculation, and save computing time.

• The formulas for det Z = D(Z0,Z1,...ZN ) are compact. To calculate the characteristic polynomial, simply replace Z0 by Z0 − λ in the determinant formula: chp(λ) = det (Z − λ1) = D(Z0 − λ, Z1,...ZN ). • The formulas for the inverse Z−1 of a matrix are compact. • Describing with quaternions avoids the ””.

2.5 Interesting formulas

The interesting things to calculate given a hc number ring are those which you want to calculate when you are given the representative : the determinant (norm), inverse, Euler formula, polar decomposition, and singular value decomposition. Later I will give these formulas for 8 hc number rings.

6 Determinant and Norm

The norm of a hc number Z is the absolute value of the determinant of the representative 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 or logarithm of a hc number. The representation of a complex unit is skew-hermitian, so its exponential is a , i. e an orthogonal or unitary matrix. Euler’s formula eiφ = 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 value decomposition (see below): rotation from the left: exp (γφ)Z ; rotation from the right: Z exp (γφ); or rotation from left and right with opposite : exp (γφ)Z exp (−γφ). The last transformation is a similarity transformation (it leaves the characteristic polynomial of Z invariant). To clarify the action of the rotation (how is Z rotated?) I will later express it by a real matrix acting on the component vector of Z. (Since exp γφ 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 ”matrix times 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. a number without complex part, satisfying P∗ = P:

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

This is the ”polar decomposition” of Z. In matrix language, the general matrix Z is written 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 + ... + βM PM is

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

where

D = 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 the singular values of Z.

2.6 Real Clifford algebras

There are basically two ways to construct (associative) hc numbers, starting with R: the 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 the irreducible matrix representations of ”Clifford algebras” are all known. We have defined hc numbers to consist of real components (the representations may be real, complex or quaternionic), 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. The symmetric part of the multiplication table of these N = p + q ”generator units” is

1 2 { , } 1 βl γl { , } is the anti-: 1 1 β γ l n {A, B} ≡ AB + BA. Any two βk βk δkl1 0 different generators anti-commute! γk γk 0 −δmn1 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 of any composite unit can be chosen arbitrarily. I tried to choose the signs such that the multiplication tables become maximally symmetric, and mutually compatible (quaternions pop up everywhere). The following table is the first quadrant of the ”Clifford chess board” consisting of 8 × 8 entries [3], [4]. It shows the hypercomplex numbers produced by Clifford’s scheme for up to 4 generators:

8 Clp↓,q→ 0 1 2 3 4 0 real complex Clifford BQ Space-Time 1 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 same overall number of generators N = p + q, are isomorphic: the multiplication table of such algebras 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 4 0 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 4 generators. Until here, Clifford ’s scheme produces (I believe) all hc number rings with up to 16 components. A special case are the hc numbers called ”tessarines”: they are not 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 numbers with 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 κ, λ, . . . go from 0 to 3. If an index appears twice in a product, you must sum over it. Examples: ~ ~ βkXlδkl = βkXk = β1X1 + β2X2 + β3X3 = β · X ~ ~ γkXlYmklm = γ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 a field. But you are not reading this article to learn about real numbers, so let’s go on to the 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 β (1A + βA )(1B + βB ) = ⇒ 0 1 0 1 β 1 1(A0B0 + A1B1) + β(A0B1 + A1B0)

General bireal number and its real representation

 X + Y 0  Z = 1X + βY ∼= 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

2 2 D1 = X + YD2 = X − YD1D2 = X − Y = 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 γ (1A + γA )(1B + γB ) = ⇒ 0 1 0 1 γ −1 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 φ:  exp (γφ) Z   X0   cos φ − sin φ   X  Z0 = ⇒ = × Z exp (γφ) Y 0 sin φ cos φ Y

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  XY  Z ∼= −YX The Singular Values and Determinant of the real representation are √ 2 2 2 2 D1 = D2 = X + Y D1D2 = X + Y

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β2

Hypercomplex 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   ∼ X1 + Y1 X2 + Y2 Z = 1X1 + γX2 + β1Y1 + β2Y2 = −X2 + Y2 X1 − Y1

Determinant

¯ 2 2 2 2 det Z ≡ D = ZZ = X1 + X2 − Y1 − Y2

Inverse Cockle quaternion

−1 ¯ ¯ Z = 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 ±φ:  0      X1 cos φ − sin φ 0 0 X1   0 0 exp (γφ) Z  X2   sin φ cos φ 0 0   X2  Z = ⇒  0  =     Z exp (γφ)  Y1   0 0 cos φ ± sin φ   Y1  0 Y2 0 0 ∓ sin φ cos φ Y2

12 The similarity transformation exp(γφ) ... exp(−γφ) leaves (X1,X2) invariant, and rotates (Y1,Y2) cw by 2φ:  0      X1 1 0 0 0 X1 0 0  X2   0 1 0 0   X2  Z = exp (γφ) Z exp (−γφ) ⇒  0  =      Y1   0 0 cos 2φ sin 2φ   Y1  0 Y2 0 0 − sin 2φ cos 2φ Y2

Polar Decomposition

Z = exp (γφ) P where tan φ = X2/X1 + (1 − s0)s3 π/2 with sk = sign(Zk) p 2 2 and P = 1 X1 + X2 + β1P3 + β2P4

Singular Value Decomposition

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

where tan 2ψ = −P2/P1 p 2 2 p 2 2 and D = 1 X1 + X2 + β1 Y1 + Y2

p 2 2 p 2 2 SVs D1,2 = X1 + X2 ± Y1 + Y2 2 2 2 2 with D1D2 = X1 + X2 − Y1 − Y2 = D

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

Hamilton quaternions form a (that’s a field minus commutativity in multiplication); 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 (1A0 + γ~ · A)(1B0 + γ~ · B) = ⇒ ~ ~ ~ ~ ~ ~ γk −δkl1 − klmγm 1(A0B0 − A · B) + γ(A0B + AB0 − A ∧ B)

General Hamilton quaternion

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

Norm √ q ¯ 2 ~ 2 |Z| = ZZ = Z0 + Z

13 Inverse Hamilton quaternion

−1 ¯ ¯ ~ 2 ~ 2 Z = Z/(ZZ) = (1Z0 − γ~ · Z)/(Z0 + Z )

Euler formula

exp (γ~ · ~eφ) = 1 cos φ + γ~ · ~e sin φ ~ ~ Let Zk the 3-vector component parallel to ~e (i. e. Zk ≡ Z · ~e), and Z⊥ the 3-vector ~ ~ projection perpendicular to ~e (i. e. Z⊥ ≡ −~e ∧ ~e ∧ Z). The factor exp (γ~ · ~eφ) rotates ~ (Z0,Zk) ccw by φ, and rotates Z⊥ cw by ±φ around ~e:  exp (γ~ · ~eφ) Z  Z0 = ⇒ Z exp (γ~ · ~eφ)

 0         Z0 1 0 0 0 0 −e1 −e2 −e3 Z0 0  Z1    0 1 0 0   e1 0 ±e3 ∓e2   Z1   0  = cos φ   + sin φ      Z2    0 0 1 0   e2 ∓e3 0 ±e1   Z2  0 Z3 0 0 0 1 e3 ±e2 ∓e1 0 Z3

The similarity transformation exp (γ~ · ~eφ) ... exp (−γ~ · ~eφ) leaves Z0 and Zk invariant, ~ and rotates Z⊥ cw by 2φ around ~e:  0     Z0 1 0 0 0 0 0  Z1    0 1 0 0  Z = exp (γ~ · ~eφ) Z exp (−γ~ · ~eφ) ⇒  0  = cos 2φ   +  Z2    0 0 1 0  0 Z3 0 0 0 1       1 0 0 0 0 0 0 0 Z0 2  0 (e1) e1e2 e1e3   0 0 e3 −e2   Z1  ... (1 − cos 2φ)  2  + sin 2φ      0 e2e1 (e2) e2e3   0 −e3 0 e1   Z2  2 0 e3e1 e3e2 (e3) 0 e2 −e1 0 Z3

Polar Decomposition

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

Addendum

Complex representation (reducible over H):  Z + iZ Z + iZ  Z ∼= 0 3 2 1 −Z2 + iZ1 Z0 − iZ3 Singular Values and Determinant of the complex representation: q 2 ~ 2 2 ~ 2 D1 = D2 = Z0 + Z D1D2 = Z0 + Z

14 Until now, the letters β and γ were sufficient to denote bireal and complex units. In the following hc rings, I will occasionally use α and ζ for an additional bireal and complex unit. 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β3

HC 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 and its complex representation   ~ ~ ~ ~ ∼ X0 + Y3 + i(X3 − Y0) X2 + Y1 + i(X1 − Y2) Z = 1X0 + ζ · X + γY0 + β · Y = −X2 + Y1 + i(Y2 + X1) X0 − Y3 + i(−X3 − Y0)

Determinant

det Z ≡ D = A − iB 2 ~ 2 2 ~ 2 ~ ~ where A = X0 + X − Y0 − Y and B = 2(X0Y0 + X · Y )

Inverse Hamilton biquaternion

1(AX + BY ) − ~ζ · (AX~ + BY~ ) + γ(AY − BX ) − β~ · (AY~ − BX~ ) Z−1 = 0 0 0 0 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 φ:  0 0    X0 Y0 X0 Y0   0 0   0 exp (γφ) Z  X1 Y1   X1 Y1  cos φ sin φ Z = ⇒  0 0  =   Z exp (γφ)  X2 Y2   X2 Y2  − sin φ cos φ 0 0 X3 Y3 X3 Y3 ~ ~ Let Xk, Yk the 3-vector components parallel to ~e, and X⊥,Y⊥ the 3-vector projections ~  perpendicular to ~e. The factor exp ζ · ~eψ rotates (X0,Xk) and (Y0,Yk) ccw by φ, and ~ ~ rotates X⊥ and Y⊥ cw by ±φ around ~e:  0 0      X0 Y0 exp ~ζ · ~eψ Z 0 0 0    X1 Y1  Z =   ⇒  0 0  = Z exp ~ζ · ~eψ  X2 Y2    0 0 X3 Y3        1 0 0 0 0 −e1 −e2 −e3 X0 Y0   0 1 0 0   e1 0 ±e3 ∓e2   X1 Y1  cos φ   + sin φ       0 0 1 0   e2 ∓e3 0 ±e1   X2 Y2  0 0 0 1 e3 ±e2 ∓e1 0 X3 Y3

~   ~  The similarity transformation exp ζ · ~eψ ... exp −ζ · ~eψ leaves X0, Xk and Y0, Yk ~ ~ invariant, and rotates X⊥ and Y⊥ cw by 2φ around ~e:  0 0     X0 Y0 1 0 0 0     0 0 0 ~ ~  X1 Y1    0 1 0 0  Z = exp ζ · ~eψ Z exp −ζ · ~eψ ⇒  0 0  = cos 2ψ   +  X2 Y2    0 0 1 0  0 0 X3 Y3 0 0 0 1       1 0 0 0 0 0 0 0 X0 Y0 2  0 (e1) e1e2 e1e3   0 0 e3 −e2   X1 Y1  ... (1 − cos 2ψ)  2  + sin 2ψ      0 e2e1 (e2) e2e3   0 −e3 0 e1   X2 Y2  2 0 e3e1 e3e2 (e3) 0 e2 −e1 0 X3 Y3

Polar Decomposition   Z = exp ~ζ · ~eψ exp (γφ) P

~ ~ where P = 1P0 + β · P ~ and E~ ≡ ~e tan ψ solves ~a +~bE~ − E~ E~ · ~a = 0 (*)

~ ~ ~ ~ ~ t ~ ~ t 2 2 ~ with ~a ≡ X0X + Y0Y and b ≡ XX + Y Y − (X0 + Y0 ) 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ψ

t ~ where ~e tan ψ = (P2/P3, −P1/P3, 0) and D = 1P0 + β1|P | ~ (How to express P0 and |P | in terms of X and Y ?) ~ ~ SVs D1 = P0 + |P |,D2 = P0 − |P | √ 2 ~ 2 2 2 with D1D2 = P0 − P = ± A + B

∼ 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 0  X2 − X3 − Y2 + Y3 X1 + X4 − Y1 − Y4 0 0     0 0 X1 − X4 + Y1 − Y4 X2 + X3 + Y2 + Y3  0 0 −X2 − X3 + Y2 + Y3 X1 − X4 − Y1 + Y4

Determinant

det Z ≡ D = AB 2 2 2 2 where A = (X1 + X4) + (X2 − X3) − (Y1 + Y4) − (Y2 − Y3) 2 2 2 2 and B = (X1 − X4) + (X2 + X3) − (Y1 − Y4) − (Y2 + Y3)

17 Inverse HC number

1  1 1  Z−1 = + (1X − ζX − γX + αX − β Y − β Y − β Y − β Y ) 2 A B 1 2 3 4 1 1 2 2 3 3 4 4 1  1 1  + − (1X + ζX + γX + αX − β Y + β Y + β Y − β Y ) 2 A B 4 3 2 1 1 4 2 3 3 2 4 1

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 ±φ:    0 0      0 exp (γφ) Z X1 X3 X1 X3 cos φ sin φ Z = ⇒ 0 0 = Z exp (γφ) X2 X4 X2 X4 − sin φ cos φ  0 0      Y1 Y3 Y1 Y3 cos φ ∓ sin φ 0 0 = Y2 Y4 Y2 Y4 ± sin φ cos φ

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

exp(ζψ) rotates (X1,X2) and (X3,X4) ccw by ψ, and (Y1,Y2) and (Y3,Y4) cw by ±ψ:    0 0      0 exp (ζψ) Z X1 X3 cos ψ − sin ψ X1 X3 Z = ⇒ 0 0 = Z exp (ζψ) X2 X4 sin ψ cos ψ X2 X4  0 0      Y1 Y3 cos ψ ± sin ψ Y1 Y3 0 0 = Y2 Y4 ∓ sin ψ cos ψ Y2 Y4

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

18 Polar Decomposition

Z = exp (ζψ) exp (γφ) P where P = 1P1 + αP4 + β1P5 + β2P6 + β3P7 + β4P8

2 (X1X2 + X3X4) and tan 2ψ = 2 2 2 2 X1 − X2 + X3 − X4 X + tan ψX and tan φ = 3 4 X1 + tan ψX2

Singular Value Decomposition

P = exp (ζψ) exp (γφ) D exp (−γφ) exp (−ζψ) where D = 1D1 + αD4 + β1D5 + β4D8

2 (P5P6 + P7P8) and tan 4ψ = − 2 2 2 2 P5 − P6 + P7 − P8 P − tan 2ψP and tan 2φ = − 7 8 P5 − tan 2ψP6

Tessarines

The hc numbers Z = 1X1 + ζX2 + γX3 + αX4 form a commutative sub-ring of Anonymous-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 1 1 βk ζkl = −ζlk = 2 [βk, βl] γk = 6 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, 1 1 ζkl = −ζlk = − 2 [ζk4, ζl4] γk = − 2 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 1 1 γk ζkl = −ζlk = − 2 [γk, γl] βk = − 6 klmnγlγmγn α = γ1γ2γ3γ4

Multiplication table

1 α βm γm ζmn 1 α 1 −γm −βm 2 klmnζkl 1 βk γk δkm1 + ζkm αδkm + 2 klmnζln δkmβn − δknβm

−klmnγl 1 γk βk −αδkm − 2 klmnζln −δkm1 − ζkm δkmγn − δknγm

−klmnβl 1 ζkl − 2 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): 2 1 3 2 1 1 2 2 1 1 2 2 2 2 3 2 1 1 βk, γ βk = βkγ , ζk = 2 klmβl βm βk = ζkγ γ = −β1β2β3 γ = γ γ

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

Multiplication table

n n 1 γ ζl βl m o m o γ −δmn1 − mnoγ βl −δmnζl − mnoβl n n ζk βk −δkl1 − kliζi −δklγn − kliβi m o m βk −δmnζk − mnoβk −δklγm − kliβi δklδmn1 + δklmnoγo o ... + kliδmnζi + klimnoβi

General HC number and its representation

0 0 m m m m 0 ~ ~0 m m ~ m ~ m ∼ Z = 1Z0 + ζkZk + γ Z0 + βk Zk ≡ 1Z0 + ζ · Z + γ Z0 + β · Z =  0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3  Z0 + Z1 + Z2 + Z3 −Z1 + Z0 − Z3 + Z2 −Z2 + Z3 + Z0 − Z1 −Z3 − Z2 + Z1 + Z0 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3  Z1 − Z0 − Z3 + Z2 Z0 + Z1 − Z2 − Z3 Z3 + Z2 + Z1 + Z0 −Z2 + Z3 − Z0 + Z1   0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3   Z2 + Z3 − Z0 − Z1 −Z3 + Z2 + Z1 − Z0 Z0 − Z1 + Z2 − Z3 Z1 + Z0 + Z3 + Z2  0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 Z3 − Z2 + Z1 − Z0 Z2 + Z3 + Z0 + Z1 −Z1 − Z0 + Z3 + Z2 Z0 − Z1 − Z2 + Z3 where summation over equal indices is required. The components of the hc number are arranged as a matrix, not as a vector!  0 1 2 3  Z0 Z0 Z0 Z0 0 1 2 3 λ  Z1 Z1 Z1 Z1  Zκ =  0 1 2 3   Z2 Z2 Z2 Z2  0 1 2 3 Z3 Z3 Z3 Z3

Determinants

0 m m The anti-symmetric 4 × 4 matrix A = ζkAk + γ A0 has the determinant 1 2 2 2 3 2 0 2 0 2 0 2 2 det A = [(A0) + (A0) + (A0) − (A1) − (A2) − (A3) ] 0 ~ m ~ m The symmetric 4 × 4 matrix Σ = 1Σ0 + β · Σ has the determinant √ p 1 1 2 2 2 3 2 ~0 ~0 det Σ = det (Σγ Σ) = det A = (A0) + (A0) + (A0) − A · A 1 0 2 ~ 1 ~ 1 ~ 2 ~ 2 ~ 3 ~ 3 2 ~ 2 ~ 1 3 ~ 3 ~ 1 where A0 = (Σ0) + Σ · Σ − Σ · Σ − Σ · Σ A0 = 2Σ · Σ A0 = 2Σ · Σ   ~0 ~ 2 ~ 3 0~ 1 and A = 2 Σ ∧ Σ − Σ0Σ

21 0 ~ ~0 m m ~ m ~ m The general 4 × 4 matrix 1Z0 + ζ · Z + γ Z0 + β · Z has the determinant √ p 1 | 1 2 2 2 3 2 ~0 ~0 det Z = det (Zγ Z ) = det A = (A0) + (A0) + (A0) − A · A 1 0 0 1 1 2 2 3 3 where A0 = ZµZµ + ZµZµ − ZµZµ − ZµZµ 2 2 1 0 3 3 0 2 3 1 A0 = 2 ZµZµ − ZµZµ A0 = 2 ZµZµ + ZµZµ   ~0 1 ~ 0 0 ~ 1 ~ 0 ~ 1 3 ~ 2 2 ~ 3 ~ 2 ~ 3 and A = 2 Z0 Z − Z0 Z + Z ∧ Z + Z0 Z − Z0 Z + Z ∧ Z

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

Inverse HC number

0 m m The anti-symmetric 4 × 4 matrix A = ζkAk + γ A0 has the inverse m m 0 −1 −γ A0 + ζkAk A = 1 2 2 2 3 2 0 2 0 2 0 2 (A0) + (A0) + (A0) − (A1) − (A2) − (A3) 0 ~ m ~ m The symmetric 4 × 4 matrix Σ = 1Σ0 + β · Σ has the inverse Σ−1 = γ1ΣA−1 where A = Σγ1Σ For the components of A in terms of Σ see the paragraph ”Determinants”.

0 ~ ~0 m m ~ m ~ m The general 4 × 4 matrix 1Z0 + ζ · Z + γ Z0 + β · Z 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   ~ ~ 2 2 2 exp ζ · ~eψ = 1 cos ψ + ζ · ~e sin ψ where (e1) + (e2) + (e3) = 1 The two rotations commute with each other. exp γlf lφ rotates each row of the coefficient matrix like a quaternion:  exp γlf lφ Z   exp −ζ f lφ  Z0 = ⇒ Z0κ = (Zκ) l = Z exp γlf lφ λ λ exp γlf lφ

 0 1 2 3      1 2 3  Z0 Z0 Z0 Z0 1 0 0 0 0 f f f 0 1 2 3 1 3 2  Z1 Z1 Z1 Z1    0 1 0 0   −f 0 ∓f ±f   0 1 2 3  × cos φ   + sin φ  2 3 1   Z2 Z2 Z2 Z2    0 0 1 0   −f ±f 0 ∓f  0 1 2 3 3 2 1 Z3 Z3 Z3 Z3 0 0 0 1 −f ∓f ±f 0

The similarity transformation exp γlf lφ ... exp −γlf lφ acts on each row of the coefficient matrix like on a quaternion:

0 l l  l l  0κ κ l l  Z = exp γ f φ Z exp −γ f φ ⇒ Zλ = (Zλ ) exp −(γ + ζl)f φ =

22  0 1 2 3     Z0 Z0 Z0 Z0 1 0 0 0 0 1 2 3  Z1 Z1 Z1 Z1    0 1 0 0   0 1 2 3  × cos 2φ   +  Z2 Z2 Z2 Z2    0 0 1 0  0 1 2 3 Z3 Z3 Z3 Z3 0 0 0 1  1 0 0 0   0 0 0 0   0 (f 1)2 f 1f 2 f 1f 3   0 0 −f 3 f 2  ... (1 − cos 2φ)   + sin 2φ    0 f 2f 1 (f 2)2 f 2f 3   0 f 3 0 −f 1  0 f 3f 1 f 3f 2 (f 3)2 0 −f 2 f 1 0

  exp ~ζ · ~eψ rotates each column of the coefficient matrix like a quaternion:     exp ~ζ · ~eψ Z   0   0κ exp (ζkekφ) κ Z =   ⇒ Zλ = k  (Zλ ) =  Z exp ~ζ · ~eψ  exp −γ ekφ

      0 1 2 3  1 0 0 0 0 −e1 −e2 −e3 Z0 Z0 Z0 Z0 0 1 2 3   0 1 0 0   e1 0 ±e3 ∓e2   Z1 Z1 Z1 Z1  cos φ   + sin φ   ×  0 1 2 3    0 0 1 0   e2 ∓e3 0 ±e1   Z2 Z2 Z2 Z2  0 1 2 3 0 0 0 1 e3 ±e2 ∓e1 0 Z3 Z3 Z3 Z3

    The similarity transformation exp ~ζ · ~eψ ... exp −~ζ · ~eψ acts on each column of the coefficient matrix like on a quaternion:     0 ~ ~ 0λ k  κ Z = exp ζ · ~eψ Z exp −ζ · ~eψ ⇒ Zκ = exp (ζ + γk)ekφ (Zλ ) =   1 0 0 0   1 0 0 0  2   0 1 0 0   0 (e1) e1e2 e1e3  cos 2ψ   + (1 − cos 2ψ)  2  +   0 0 1 0   0 e2e1 (e2) e2e3  2 0 0 0 1 0 e3e1 e3e2 (e3)

   0 1 2 3  0 0 0 0 Z0 Z0 Z0 Z0 0 1 2 3  0 0 e3 −e2   Z1 Z1 Z1 Z1  ... sin 2ψ   ×  0 1 2 3   0 −e3 0 e1   Z2 Z2 Z2 Z2  0 1 2 3 0 e2 −e1 0 Z3 Z3 Z3 Z3

Polar decomposition   Z = exp ~ζ · ~eψ exp γlf lφ P

~ 1 ~ 1 ~ 2 ~ 2 ~ 3 ~ 3 where P = 1P0 + β · P + β · P + β · P ~ and E~ ≡ ~e tan ψ solves ~a +~bE~ − E~ E~ · ~a = 0 (*)

λ ~ λ ~ ~ λ ~ λ t λ λ~ with ~a ≡ Z0 Z (6= 0) and b ≡ Z (Z ) − Z0 Z0 1 l l l ~ ~ l 0 ~ ~ 0 and (F =)f tan φ = (Z0 + E · Z )/(Z0 + E · Z ) ~   * 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ψ

0 1 1 2 2 3 3 where D = 1D0 + β1D1 + β2D2 + β3D3 is mathematically equivalent to finding the 3D singular value decomposition ~  ~  ~  ~  P = exp Jkek2ψ D exp −Jlfl2φ where  0 0 0   0 0 −1   0 1 0  ~ ~ ~ J1 =  0 0 1  J2 =  0 0 0  J3 =  −1 0 0  0 −1 0 1 0 0 0 0 0 ~ ~ and where P~ and D~ are the lower right submatrices of the coefficient matrices  0   0  P0 0 0 0 D0 0 0 0 1 2 3 1 λ  0 P1 P1 P1  λ  0 D1 0 0  Pκ =  1 2 3  and Dκ =  2   0 P2 P2 P2   0 0 D2 0  1 2 3 3 0 P3 P3 P3 0 0 0 D3 0 0 0 P0 is an invariant of all similarity rotations, i. e. we have D0 = P0 . ~ ~ ~ ~ ~ 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~ .) (U − U ,U − U ,U − U ) Then (e , e , e ) tan ψ = 23 32 31 13 12 21 1 2 3 Tr U + 1 (V − V ,V − V ,V − V ) and (f 1, f 2, f 3) tan φ = 23 32 31 13 12 21 Tr V + 1

References

[1] GNU Octave, J. W. Eaton, D. Bateman & S. Hauberg, http://www.octave.org. [2] van der Waerden, B. L., A From al-Khw¨arizmlto , Springer-Verlag Berlin, Heidelberg, (1985). [3] Lawson, H. Blaine and Michelsohn, Marie-Louise, , Princeton University Press, 1989. [4] Figueroa-O’Farrill, Jos´e,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;

% 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)<0 s=-s; v=-v; end testaD=[[aP(1,1); 0; 0; 0] [0 0 0; s]]; testD=aP(1,1)*uni+s(1,1)*be11+s(2,2)*be22+s(3,3)*be33;

E=[u(2,3)-u(3,2) u(3,1)-u(1,3) u(1,2)-u(2,1) ]/(trace(u)+1); psi=atan(norm(E));e=E/norm(E); F=[v(2,3)-v(3,2) v(3,1)-v(1,3) v(1,2)-v(2,1) ]/(trace(v)+1); phi=atan(norm(F));f=F/norm(F);

R=expm( (ze1*e(1)+ze2*e(2)+ze3*e(3))*psi + (ga1*f(1)+ga2*f(2)+ga3*f(3))*phi ); D=R’*P*R

% Compare Singular Values

SV=diag(D)’ testSV=diag(testD)’ end end if 1-h display(’Numerical failure: Cannot calculate E’) end display(’%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%’)

32