# How can I define $i^2=j^2=k^2=-1$ in Mathematica?

First, I want to define the identities as

$i^2=j^2=k^2=-1$,

$ij=k=-ji$,

$jk=i=-kj$,

$ki=j=-ik$.

And then I want to use these identities in my sequence

$Q_n = F_n + iF_{n+1} + j F_{n+2} + k F_{n+3}$,

where $F_n$ is the Fibonacci sequence and $n \geq 0$.

For example I want to calculate and simplify all results for $Q_{11} Q_{9} - Q_{10}^2 = ?$.

With my best.

• Look at the Quaternions package. – Szabolcs Feb 19 '18 at 21:01
• Could just use the matrix representation from here or here – Daniel Lichtblau Feb 19 '18 at 22:18

You can use the Quaternions package. Load:

<<Quaternions


Q[n_] := Fibonacci[n] + I Fibonacci[n+1] + J Fibonacci[n+2] + K Fibonacci[n+3]

Q[11]**Q[9] - Q[10]**Q[10]
`