# A real example of an Octonion product

Goal: find the general Octonion multiplication product like the Quaternion formula given here:

https://en.wikipedia.org/wiki/Quaternion#Multiplication_of_basis_elements

* question modified for clarity

I am having trouble with Octonion multiplications. Can you help?

The equations needed to achieve your goal are provided below. As well as the steps I took for my attempt. BUT my solution does not match secondary online sources.

my solution is incorrect

Let me know if you see the mistake or have a better solution.

I expect the solution to be a set of 8 sums and differences of pairs of products of different combinations of 8 input variables. ie: your solution will look similar to this attempt.

# Define:

Doubling Product (Pt3): $$(A,B)×(C,D) = (AC − D^\star B, DA + BC^\star)$$

Conjugate: $$(A,B)^\star = (A^\star,-B)$$

Octonion notation: $$(A,B,C,D,E,F,G,H)$$ $$= A·e0 + B·e1 + C·e2 + D·e3 + E·e4 + F·e5 + G·e6 + H·e7$$

where :

$$e0 = 1$$

$$e1,e2,e3,e4,e5,e6,e7 ∈ Imaginary Units$$

* imaginary values are implied based on their order within the set and will not be displayed further.

Paired variables are products: $$ab = a×b$$

Variables are Real numbers: a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p ∈ ℝ

To be clear... all variables used (a to p) represent Real number and no imaginary units are shown. The coefficient of imaginary numbers are not shown, because the ordering of the variables in the bracket notation matches the ordering of our imaginary numbers. ex: (1,2) = 1+2e1, (0,5,6,1,0,0,3,0) = 5e1 + 6e2 + 1e3 + 3e6

# Known Quaternion Multiplication

Following the Quaterion equation given here:

https://en.wikipedia.org/wiki/Quaternion#Multiplication_of_basis_elements

...substitute variable names like this:

a1 = A, b1 = B, c1 = C, d1 = D
a2 = E, b2 = F, c2 = G, d2 = H


To obtain {equation 1} as:

(A,B,C,D)×(E,F,G,H) = (
AE - BF - CG - DH,
AF + BE + CH - DG,
AG - BH + CE + DF,
AH + BG - CF + DE,
)


# Octonion Multiplication:

$$(a,b,c,d,e,f,g,h) × (i,j,k,l,m,n,o,p)$$

$$= ((a,b,c,d),(e,f,g,h)) × ((i,j,k,l),(m,n,o,p))$$

using: $$(A,B)×(C,D) = (AC − D^\star B, DA + BC^\star)$$

with: $$A = (a,b,c,d), B = (e,f,g,h), C = (i,j,k,l), D = (m,n,o,p)$$

then:

$$((a,b,c,d),(e,f,g,h)) × ((i,j,k,l),(m,n,o,p))$$

$$=( (a,b,c,d) × (i,j,k,l) - (m, n, o, p) ^\star × (e,f,g,h),$$ $$(m,n,o,p) × (a,b,c,d) + (e,f,g,h) × (i, j, k, l) ^\star )$$

$$= ( (a,b,c,d) × (i,j,k,l) - (m,-n,-o,-p) × (e,f,g,h),$$ $$(m,n,o,p) × (a,b,c,d) + (e,f,g,h) × (i,-j,-k,-l) )$$

Above equation is composed of 4 quaternion products:

 Q1 = ( a, b, c, d) × ( i, j, k, l)

Q2 = ( m,-n,-o,-p) × ( e, f, g, h)

Q3 = ( m, n, o, p) × ( a, b, c, d)

Q4 = ( e, f, g, h) × ( i,-j,-k,-l)


... and our solution will be the ordered set of their difference and sum:

$$(a,b,c,d,e,f,g,h) × (i,j,k,l,m,n,o,p) = ( Q1-Q2, Q3+Q4 )$$

In words the equation says:

"Our solution is the difference and sum of quaternion product pairs which in order produce our Octonion solution."

# Calculate a general Octonion Multiplication equation:

First, calculate the 4 quaternion products...

$$Q1 = ( a, b, c, d) × ( i, j, k, l)$$

recall {equation 1} is:

(A,B,C,D)×(E,F,G,H) = (
AE - BF - CG - DH,
AF + BE + CH - DG,
AG - BH + CE + DF,
AH + BG - CF + DE,
)


using: {equation 1}

let: A=a, B=b, C=c, D=d, E=i, F=j, G=k, H=l

then:

(a,b,c,d)×(i,j,k,l) = (

ai-bj-ck-dl,

aj+bi+cl-dk,

ak-bl+ci+dj,

al+bk-cj+di,

)


$$Q2 = ( m,-n,-o,-p) × ( e, f, g, h)$$

using: {equation 1}

let: A=m, B=-n, C=-o, D=-p, E=e, F=f, G=g, H=h

then:

(m,-n,-o,-p)×(e,f,g,h) = (

me+nf+og+ph,

mf-ne-oh+pg,

mg+nh-oe-pf,

mh-ng+of-pe,

)


$$Q3 = ( m, n, o, p) × ( a, b, c, d)$$

using: {equation 1}

let: A=m, B=n, C=o, D=p, E=a, F=b, G=c, H=d

then:

( m,n,o,p) × (a,b,c,d) = (

ma-nb-oc-pd,

mb+na+od-pc,

mc-nd+oa+pb,

md+nc-ob+pa,

)


$$Q4 = ( e, f, g, h) × ( i,-j,-k,-l)$$

using: {equation 1}

let: A=e, B=f, C=g, D=h, E=i, F=-j, G=-k, H=-l

then:

(e,f,g,h) × (i,-j,-k,-l) = (

ei+fj+gk+hl,

-ej+fi-gl+hk,

-ek+fl+gi-hj,

-el-fk+gj+hi,

)


$$( Q1-Q2, Q3+Q4 )$$

( Q1-Q2, Q3+Q4 )

= (
( ai-bj-ck-dl, aj+bi+cl-dk, ak-bl+ci+dj, al+bk-cj+di )
- ( me+nf+og+ph, mf-ne-oh+pg, mg+nh-oe-pf, mh-ng+of-pe )
,
( ma-nb-oc-pd, mb+na+od-pc, mc-nd+oa+pb, md+nc-ob+pa )
+ ( ei+fj+gk+hl,-ej+fi-gl+hk,-ek+fl+gi-hj,-el-fk+gj+hi )
)


and recall:

(a,b,c,d,e,f,g,h) × (i,j,k,l,m,n,o,p) = ( Q1-Q2, Q3+Q4 )

# Octonion solution is calculated

$$(a,b,c,d,e,f,g,h) × (i,j,k,l,m,n,o,p)$$

(a,b,c,d,e,f,g,h) × (i,j,k,l,m,n,o,p)

= (

ai-bj-ck-dl-me-nf-og-ph,

aj+bi+cl-dk-mf+ne+oh-pg,

ak-bl+ci+dj-mg-nh+oe+pf,

al+bk-cj+di-mh+ng-of+pe,

ma-nb-oc-pd+ei+fj+gk+hl,

mb+na+od-pc-ej+fi-gl+hk,

mc-nd+oa+pb-ek+fl+gi-hj,

md+nc-ob+pa-el-fk+gj+hi,

)


and it has label { Octonion Product Equation }

# Test Octonion Equation

Calculate: $$(1,2,3,4,5,6,7,8) × (8,7,6,5,4,3,2,1)$$

using: { Octonion Product Equation }

let: a=1, b=2, c=3, d=4, e=5, f=6, g=7, h=8, i=8, j=7, k=6, l=5, m=4, n=3, o=2, p=1

then:

$$(1,2,3,4,5,6,7,8) × (8,7,6,5,4,3,2,1)$$

= (

1×8-2×7-3×6-4×5-4×5-3×6-2×7-1×8,

1×7+2×8+3×5-4×6-4×6+3×5+2×8-1×7,

1×6-2×5+3×8+4×7-4×7-3×8+2×5+1×6,

1×5+2×6-3×7+4×8-4×8+3×7-2×6+1×5,

4×1-3×2-2×3-1×4+5×8+6×7+7×6+8×5,

4×2+3×1+2×4-1×3-5×7+6×8-7×5+8×6,

4×3-3×4+2×1+1×2-5×6+6×5+7×8-8×7,

4×4+3×3-2×2+1×1-5×5-6×6+7×7+8×8,

)


= (-104, 14, 12, 10, 152, 42, 4, 74)

Comparing with: http://jwbales.us/rpnSedenion.html (using Pt3 setting)

= ( -104, -4, 48, 64, 80, -48, 112, 56 )

WARNING: the list of 8 numbers above DO NOT MATCH. They should. Can you solve the puzzle?

The formula I show must be incorrect. What am I missing?

# Update:

I think this calculator is broken? http://jwbales.us/rpnSedenion.html

Because I modified code found here: https://www.johndcook.com/blog/2018/07/10/cayley-dickson/

And found: (1,2,3,4,5,6,7,8) × (8,7,6,5,4,3,2,1) = [-104. 14. 12. 10. 152. 42. 4. 74.]

... which match previous results, results mentioned by J.G and the result of the calculated Octonion equation above.

perhaps the generic Octonion equation above is correct

If so... I don't know how these calculators are operating:

http://jwbales.us/rpnSedenion.html

http://jwbales.us/rpnOctonion.html

http://jwbales.us/sedenion.html

I am unsure what is true. Do you think the formula I provided is correct?

modified python code for reference:

#!/usr/bin/python
# reference: https://www.johndcook.com/blog/2018/07/10/cayley-dickson/
import numpy as np
from numpy.linalg import norm

def conj(x):
xstar = -x
xstar[0] *= -1
return xstar

def CayleyDickson(x, y):
n = len(x)

if n == 1:
return x*y

m = n // 2

a, b = x[:m], x[m:]
c, d = y[:m], y[m:]
z = np.zeros(n)
z[:m] = CayleyDickson(a, c) - CayleyDickson(conj(d), b)
z[m:] = CayleyDickson(d, a) + CayleyDickson(b, conj(c))
return z

a = np.array([1,2,3,4,5,6,7,8])
b = np.array([8,7,6,5,4,3,2,1])
c = CayleyDickson(a, b)
print "{} * {} = {}".format(a, b, c)



beginner tip: I needed to "pip install numpy" before it would run.

• I'm not sure which stack exchange can best help with this, but wherever this question ends up, it'll be easiest to help you if we can also see your code. In the mean time, double-check whether you correctly used$$(p,\,q)^\ast=(p^\ast,\,-q),\,(p,\,q)(r,\,s)=(pr-s^\ast q,\,sp+qr^\ast).$$A mnemonic based on this is left as an exercise to the reader.
– J.G.
Commented Oct 15, 2019 at 10:21
• Code location: github.com/peawormsworth/Tangle/blob/master/Tangle-0.04/lib/… But I don't want code review. I want someone to show the long form steps of multiplying a pair of simple integer quaternions, so I may observe the steps described. Because I know my code is doing what I want. So obviously I don't understand the steps. I am searching the Internet for one written example of someone showing Octonion multiplication but there is no more than algebra. There should be an example. Please do it or point where it is done. Commented Oct 15, 2019 at 11:54
• Wikipedia gives $(ac-d^\ast b,\,da+bc^\ast)$, but you use $(ac-db^\ast,\,a^\ast d+cb)$, as does that site. Worse still, some Python I wrote gives $-104+14i+12j+10k+152l+42m+4n+74o$.
– J.G.
Commented Oct 15, 2019 at 12:31
• I have modified the question to show the steps to obtain the formula of last post. The question has been modified from a specific example into a generic solution... which should be useful to solve. I hope this inspires answers. Commented Oct 16, 2019 at 4:34
• Any chance you could improve the formatting too? I also strongly recommend you write octonions as $a_0e_0+\cdots+a_7e_7$ with $e_0=1$ etc., since multiplying two octonions otherwise requires $24$ letters. As it stands, your question repeats letters in a confusing way.
– J.G.
Commented Oct 16, 2019 at 5:58

The calculators online at my jwbales.us site are not broken.

/NOTE In order to make my octonion calculator more generally useful I have modified it so that it may be used with any of the 480 isomorphic versions of the octonions. The calculator is initialized with the set of seven triads determining whichever version of the octonions the user prefers. In addition , when the calculator is initialized a Fano plane is generated with a center chosen by the user and a product table is generated. The triad set entered by the user is vetted to make sure it is actually an octonion triad system. END NOTE/

There is no such thing as a 16 square formula, so the sedenion calculator is based solely on Cayley-Dickson doubling products.

At the time you used the octonion calculator it only used the four Cayley-Dickson doubling products, not the Eight-square product, so you were right to be confused and that is my fault. Since then I have added the Eight-square product as an option. That should give the result you were expecting.

Note that the Cayley-Dickson products use a specific scheme for numbering the basis vectors which is different from the numbering for the Eight-square product. But it is a basis numbering scheme which is designed to make sense for viewing basis elements as ordered pairs encorporating previous basis vectors.

Each real number $$x$$ is identified with the ordered pair $$(x,0)$$, so

$$e_0=(1,0)=1,\,e_1=(0,1)=i$$

When the dimension is doubled for the quaternions we have two new basis elements defined in terms of $$e_1$$.

$$e_2=(e_1,0)=j,\,e_3=(0,e_1)=k$$

Whichever of the four Cayley-Dickson doubling products is used, for example,

$$(a,b)\cdot(c,d)=(ac-d^*b,da+bc^*)$$

you will get the standard product for quaternions.

If you continue to use this method of numbering the basis elements, then when you double the dimension to get the octonions you will get the four additional basis vectors

$$e_4=(e_2,0),\,e_5=(0,e_2),\,e_6=(e_3,0),\,e_7=(0,e_3)$$

This scheme can be continued to produce the sedenions and the higher dimensional Cayley-Dickson algebras. At each doubling, the new basis elements consist of the ordered pairs of the form $$(e_k,0),\,(0,e_k)$$ where $$e_k$$ was a new basis element first created at the previous doubling.

Note that researchers interested primarily in studying octonions do not actually use a Cayley-Dickson product when defining their basis elements.

The basis numbering system used here can be defined recursively as

$$e_0=(1,0),\,e_{2k}=(e_k,0),\,e_{2k+1}=(0,e_k)$$

This numbering system has certain nice features. For example,

$$e_p\cdot e_q=\pm e_{p\oplus q}$$ where $$p\oplus q$$ is the bitwise 'exclusive or' of the binary representations of integers $$p,\,q$$.

Products of the basis vectors satisfy the following

(1) $$e_0\cdot e_p=e_p\cdot e_0=e_p$$

(2) For $$p\ne0,\,e_p^2=-e_0$$

(3) For $$0\ne p\ne q\ne0$$, $$e_p\cdot e_q=-e_q\cdot e_p$$

(4) For $$0\ne p\ne q\ne0$$ the quaternion property holds, namely

if $$e_p\cdot e_q=+e_{p\oplus q}$$ then $$e_q\cdot e_{p\oplus q}=+e_p$$ and $$e_{p\oplus q}\cdot e_p=+e_q$$.

(5) If $$0\ne p$$ then for the doubling product above, $$e_1\cdot e_{2p}=+e_{2p+1}$$

(6) Also for the doubling product given above, if $$0\ne p\ne q\ne0$$ and if $$e_p\cdot e_q=+e_r$$ in the algebra of dimension $$2^N$$, then in the algebra of dimension $$2^{N+1}$$ each of the following are true:

(6a) $$e_{2p}\cdot e_{2q}=+e_{2r}$$

(6b) $$e_{2p}\cdot e_{2r+1}=+e_{2q+1}$$

(6c) $$e_{2p+1}\cdot e_{2r}=+e_{2q+1}$$

(6d) $$e_{2p+1}\cdot e_{2r+1}=+e_{2q}$$

Each of the four Cayley-Dickson doubling products has a different variation on rules (5) and (6).

This graphic summarizes rule (6), where $$pq=p\oplus q$$ is $$r$$:

One last observation: I call this numbering of the basis elements the 'shuffle' basis. Let me explain.

Identify each real number $$x$$ with the sequence $$x,0,0,0,\cdots$$

For two real number sequences $$a=a_0,a_1,a_2,\cdots$$ and $$b=b_0,b_1,b_2,\cdots$$ identify the ordered pair $$(a,b)$$ with the shuffled sequence

$$(a,b)=a_0,b_0,a_1,b_1,a_2,b_2,\cdots$$

and define the conjugate of a sequence $$a$$ as

$$a^*=a_0,-a_1,-a_2,\cdots$$.

Then it follows that $$(a,b)^*=(a^*,-b)$$ and that

$$e_0=1,0,0,0\cdots,\,e_1=0,1,0,0,0\cdots,\,e_2=0,0,1,0,0,0\cdots$$, etc.

• More information may be found at jwbales.us. Commented Oct 7, 2020 at 18:11

To test with python.

a = (1,2,3,4,5,6,7,8)
b = (8,7,6,5,4,3,2,1)

t0 = a[0]*b[0] - a[1]*b[1] - a[2]*b[2] - a[3]*b[3] - a[4]*b[4] - a[5]*b[5] - a[6]*b[6] - a[7]*b[7]
t1 = a[0]*b[1] + a[1]*b[0] + a[2]*b[3] - a[3]*b[2] + a[4]*b[5] - a[5]*b[4] - a[6]*b[7] + a[7]*b[6]
t2 = a[0]*b[2] - a[1]*b[3] + a[2]*b[0] + a[3]*b[1] + a[4]*b[6] + a[5]*b[7] - a[6]*b[4] - a[7]*b[5]
t3 = a[0]*b[3] + a[1]*b[2] - a[2]*b[1] + a[3]*b[0] + a[4]*b[7] - a[5]*b[6] + a[6]*b[5] - a[7]*b[4]
t4 = a[0]*b[4] - a[1]*b[5] - a[2]*b[6] - a[3]*b[7] + a[4]*b[0] + a[5]*b[1] + a[6]*b[2] + a[7]*b[3]

t5 = a[0]*b[5] + a[1]*b[4] - a[2]*b[7] + a[3]*b[6] - a[4]*b[1] + a[5]*b[0] - a[6]*b[3] + a[7]*b[2]
t6 = a[0]*b[6] + a[1]*b[7] + a[2]*b[4] - a[3]*b[5] - a[4]*b[2] + a[5]*b[3] + a[6]*b[0] - a[7]*b[1]
t7 = a[0]*b[7] - a[1]*b[6] + a[2]*b[5] + a[3]*b[4] - a[4]*b[3] - a[5]*b[2] + a[6]*b[1] + a[7]*b[0]

result = (t0, t1, t2, t3, t4, t5, t6, t7)

print (result)


Answer: (-104, 14, 12, 10, 152, 42, 4, 74)

Degen's Eight-Square Identity:

https://en.wikipedia.org/wiki/Degen%27s_eight-square_identity