1. Introduction
Quaternions have become very valuable in many fields such as computer graphics [1], physics [2], and engineering [3], one of the important motives for increasing quaternions applications is the development of quaternion algebra. The task of computing the power of a quaternion number in the simplest way is the aim of this work.
Applying the Cayley-Dickson construction [4] to two complex numbers
and
gives a convenient way to write any quaternion number q as:
(1)
where
are real numbers and
are imaginary units satisfy Hamilton’s rules [5] [6] [7], and their multiplication is given in Table 1.
![]()
Table 1. Imaginary units
multiplication.
The way of the multiplication operation of these units makes computing the powers of the quaternion number by using the binomial expansion is less used, especially when the quaternion number is raised to large power. De Moivre’s and Euler’s formulas [8] [9] are usually used to compute the power of a quaternion number.
Here, we give the simplest and most direct way to compute the power of a quaternion number raised to a positive integer n.
2. Methodology
Representing a quaternion number in the form of a matrix is very useful, especially in computing the powers of this number, there are 96 distinct real matrices [10] that represent a quaternion number, one of these matrices is a matrix A, which represents the number q.
(2)
And since:
where:
(3)
we will use the matrix
in computing
instead of using the matrix A, the matrix
will play an important role in our computations.
Set:
(4)
Then:
(5)
In general:
(6)
We compute
as:
Now, we can conclude that when n is an even number, then:
(7)
and whenn is an odd number, then:
(8)
Once we get
, then:
(9)
Special cases:
1) For a pure quaternion number
,
(10)
Therefore, if n is an even number, then the formula will be:
(11)
And ifn is an odd number, then the formula will be:
(12)
2) For a complex number
, if n is an even number, then the formula will be:
(13)
And if n is an odd number then the formula will be:
(14)
These suitable formulas give the power of the quaternion number raised to n.
3. Examples
1) For
, let us compute
,
Of course for small values of
, we can manually compute the power of the quaternion, and with helping of a computer program, we can compute the power of the quaternion whenn is a large number.
To compute
, use (8),
To compute
, using the python code (Algorithm 1).
Set
and
, the result will be:
a0 = −509333346214912.0
a1 = 110956955017216.0
a2 = 166435432525824.0
a3 = 221913910034432.0
In the matrix form,

Algorithm 1. Python code for computing qn, n is an even integer.
2) To compute
,
and
Using (12),
In the matrix form,
4. Application
To compute the nth power of a matrix of order two, we will do a little change to our formulas to be compatible with matrices multiplication.
For
, we want to compute
.
Set
,
,
, and
, and:
(15)
where
, and their multiplication is given in Table 2.
Corresponding to the multiplication (Table 2), we can construct the matrix
.
(16)
And since:
We will reduce
to
.
(17)
Notice that:
Therefore, to compute
we use:
![]()
Table 2. Matrices
multiplication.
In general:
(18)
Therefore, to compute
we use:
For computing
we use:
And for computing
we use:
We can conclude that when n is an even number, then:
(19)
and when n is an odd number, then:
(20)
Once we get
then:
(21)
Special case:
When
, if n is an even number, the formula will be:
(22)
And if n is an odd number, the formula will be:
(23)
Therefore, it is easy to compute the power of a matrix of order two raised to n.
5. Examples
1) For
, let us compute
,
To compute
, use (20).
Set
To compute
, Let us use the python code (Algorithm 2).
Set
and
, the result will be:
a11 = 2.6295363507367063e+69
a12 = 2.6295363507367063e+69
a21 = 5.2590727014734134e+69
a22 = 5.2590727014734134e+69
2) For
, let us compute
Set
, and use (21). We will get:

Algorithm 2. Python code for computing An, n is an even integer.
6. Conclusion
Representing the quaternion number q in a matrix form like A and reducing this matrix to the matrix
make multiplying q by itself easier, and this makes creating the formula for computing the nth power of q be very simple. The paper followed this way and created an important formula for computing
and applied a similar formula to compute the power of a matrix of order two.