Solving Quaternion Linear System Based on Semi-Tensor Product of Quaternion Matrices

In this paper, we use semi-tensor product of quaternion matrices, L -representation of quaternion matrices, and GH -representation of special quaternion matrices such as quaternion (anti)-centrosymmetric matrices to solve the special solutions of quaternion matrix equation. Based on semi-tensor product of quaternion matrices and the structure matrix of the multiplication of quaternion, we propose the vector representation operation conclusion of quaternion matrices, and study the different matrix representations of quaternion matrices. Then the problem of the quaternion matrix equation is transformed into the corresponding problem in the real number ﬁelds by using vector representation and L -representation of quaternion matrices, combined with the special structure of (anti)-centrosymmetric matrices, the independent elements are extracted by GH -representation method, so as to reduce the number of variables to be calculated and improve the calculation accuracy. Finally, the effectiveness of the method is veriﬁed by numerical examples, and the time comparison with the two existing algorithms is carried out. The algorithm in this paper is also applied in a centrosymmetric color digital image restoration model.


Introduction
The symbols to be used in this paper are as follows: R/Q represent the set of all the real numbers/quaternions, respectively. R t represents the set of all real column vectors with t-dimension. R m×n /Q m×n represent the set of all m × n real matrices/quaternion matrices, respectively. S n×n /AS n×n /S n×n /AS n×n represent the set of all n × n real centrosymmetric matrices/real anti-centrosymmetric matrices/quaternion centrosymmetric matrices/quaternion anti-centrosymmetric matrices, respectively. In addition, I n represents the unit matrix with n-dimension, δ i n (i = 1, 2, · · · , n) represents the ith column of I n . A/A T /A H /A † represent the conjugate/transpose/conjugate transpose/Moore-Penrose inverse of matrix A. ⊗ represents the Kronecker product of matrices, · represents the Frobenius norm of a matrix or Euclidean norm of a vector.
Currently the numerical computation is not only a tool for scientific calculations, but also one of the ways to discover truths. However, the traditional matrix theory also has some shortages; for example, it has dimensional restriction and noncommutativity. Semitensor product of matrices proposed by Cheng [1] is different from the traditional matrix product. It does not need size matching conditions and can be used for any two matrices. It is designed to deal with higher-dimensional data as well as multilinear mappings. In a computer the higher-dimensional data can easily be treated without arranging the m into a cube or even higher-dimensional cuboid. Semi-tensor product of matrices is designed in such a way that the product rule can automatically search the proper position for each factor of multiplier. At present, semi-tensor product of matrices is widely used in biological system and life science [2,3], game theory [4,5], graph theory and formation control [6,7], fuzzy control [8,9], coding theory, and algorithm implementation [10,11]. In addition, some scholars proposed a new quaternion real vector representation method [12,13] based on semi-tensor product of matrices, and applied this method to the solution of quaternion linear system. In this paper, some new conclusions of semi-tensor product of quaternion matrices are proposed, which will be used to solve quaternion linear systems.
Quaternion is a hypercomplex number composed of a scalar and a vector, which has the dual properties of real number and complex number. Due to the rapid development of computer graphics [14], robot and other fields [15,16], quaternion has been more and more widely used in computer animation, robot trajectory planning [17], modeling [18], rendering and three-dimensional fractal display. The application of quaternion matrix in color digital images is becoming more and more important and extensive [19,20]. Color digital image restoration is usually modeled as the solution of quaternion matrix equation.
Matrix equations have wide applications in many spheres. These real, complex and quaternion matrix equations have attracted extensive attention. As a special matrix equation, quaternion matrix equation has been widely integrated into computer science [21], signals [22], statistics [23], and color image processing [24]. Because quaternion does not satisfy the commutativity of multiplication, the quaternion matrix equation is usually transformed into a familiar problem of real matrix equation or complex matrix equation by real representation or complex representation, so as to simplify the operation of matrix equation. Many scholars have discussed different solutions to different equations with the help of these methods. For example, using the real representation matrix of quaternion matrices, ref. [25] obtained the expressions of the minimal norm least squares solution for the quaternion matrix equation AXB + CXD = E; ref. [26] investigated the minimal norm least squares η-(anti)-Hermitian solution of quaternion matrix equation AXB + CYD = E; ref. [27] discussed the minimal norm least squares (anti)-j-self-conjugate solution on quaternion matrix equation X − AXB = C; in addition, ref. [28] used the complex representation matrix of quaternion matrices to study the η-(anti)-Hermitian solution of quaternion matrix equation AXB + CYD = E; ref. [29] derive the expressions of the least squares solution, pure imaginary solution, real solution with the least norm for the quaternion matrix equation AX = B by using the complex representation matrix of quaternion matrices. Some scholars have also devoted themselves to the study of quaternion matrix equations by using Cramer's rules [30][31][32], iterative algorithms [33][34][35][36] or rank method [37][38][39][40]. Definition 1 ([41]). If X = (x ij ) ∈ Q n×n satisfies: x ij = x n−i+1,n−j+1 , (i, j = 1, · · · , n), then X is called a quaternion centrosymmetric matrix. If X = (x ij ) ∈ Q n×n satisfies: then X is called a quaternion anti-centrosymmetric matrix.
As two special kinds of matrices, (anti)-centrosymmetric matrices are applied broadly in the fields of statistical analysis and matrix countermeasures information theory, linear system theory and numerical analysis, and some matrices with special rules of elements, such as (anti)-centrosymmetric matrices. We want to extract the independent elements of the matrix to remove the redundancy and reduce the complexity of solving the matrix equation. The H-representation [42] method perfectly realizes our idea. This paper presents the (anti)-centrosymmetric solutions of quaternion matrix equation by using semi-tensor product of quaternion matrices, L-representation and GH-representation. Problem 1 Let A i ∈ Q m×n , B i ∈ Q n×p , (i = 1, · · · , k), C ∈ Q m×p , and Find out X S ∈ M S , such that X S is called the minimal norm least squares centrosymmetric solution of quaternion matrix Equation (1). If min = 0, X S is called the minimal norm centrosymmetric solution of quaternion matrix Equation (1).
Find out X A ∈ M A , such that X A is called the minimal norm least squares anti-centrosymmetric solution of quaternion matrix Equation (1). If min = 0, X A is called the minimal norm anti-centrosymmetric solution of quaternion matrix Equation (1). Several new conclusions on semi-tensor product of quaternion matrices are presented in this article. By using semi-tensor product of quaternion matrices, quaternion matrix equations can be analyzed by vector representation directly. Under the structure matrix of the multiplication of quaternion, we establish different matrix representations of quaternion matrices by semi-tensor product of quaternion matrices, in this case, we define the definition of L-representation. Employing vector representation of quaternion matrices and combining L-representation of quaternion matrices with GH-representation, several types of special minimal norm solutions to quaternion equation ∑ k i=1 A i XB i = C are presented, along with the necessary and sufficient conditions of compatibility. Using GH-representation method, we can remove the redundancy and reduce the complexity of the problem by identifying the independent elements of a special matrix. It can be seen that GH-representation simplifies solutions to quaternion matrix equations in a simple and effective manner.
The following are the main sections of this article: In Section 2, the fundamentals of quaternion and semi-tensor product of quaternion matrices are covered. In Section 3, the vector representation conclusion of quaternion matrices is given, and combined with the structure matrix, the definition of L-representation of quaternion matrices is proposed. In Section 4, H-representation of several special matrices are given, and the definition of GH-representation of special quaternion matrices is proposed. In Section 5, the necessary and sufficient conditions for the minimal norm solution and compatibility of the above problems are explored. In Section 6, the corresponding algorithm and numerical examples are shown to verify the effectiveness of the method, and we give the time comparison between the algorithm in this paper and the algorithms in references [43,44]. In Section 7, the research of centrosymmetric color digital image restoration is given. In Section 8, a brief summary is made of the full text.

Quaternion and Quaternion Matrices
This part mainly introduces the basic knowledge of quaternion. For more information, please refer to the literature [25][26][27].

Definition 2.
A quaternion x can be uniquely expressed as where x s ∈ R, s = 0, 1, 2, 3, and the three imaginary units i, j, k satisfy i 2 = j 2 = k 2 = −1, ij = −ji = k, jk = −kj = i, ki = −ik = j. The conjugate of x is defined as A quaternion matrix X can be uniquely expressed as X = X 0 + X 1 i + X 2 j + X 3 k ∈ Q m×n , where X s ∈ R m×n , s = 0, 1, 2, 3. The conjugate of X is defined as

Definition 3 ([24]
). The norm of a quaternion x = x 0 + x 1 i + x 2 j + x 3 k ∈ Q is defined as and the Frobenius norm of X = X 0 + X 1 i + X 2 j + X 3 k ∈ Q m×n is defined as

Semi-Tensor Product of Quaternion Matrices
In this section, some basic knowledge about semi-tensor product of quaternion matrices is given. For more details of semi-tensor product of matrices on real number fields, please refer to the literature [1,45,46]. Definition 4. Suppose A ∈ Q m×n , B ∈ Q p×q , the semi-tensor product of A and B is denoted by where t = lcm(n, p) is the least common multiple of n and p. If n = p, the semi-tensor product reduces to the traditional matrix product.

Vector Representation of Quaternion Matrices
As we know, quaternion multiplication does not satisfy the commutative law, is not tenable on quaternion. Therefore, some scholars [24,26,28,29] mainly study the quaternion matrix equation based on the real representation matrix and complex representation matrix of quaternion matrices. However, we can find a new straightening result on quaternion according to the property of quaternion conjugation. Then some straightening conclusions of semi-tensor product of quaternion matrices are given below, which will be used to solve quaternion matrix equation.
represents the ith row of matrix A, x j (j = 1, · · · , n) represents the jth row of matrix X, c i (i = 1, · · · , m) represents the ith row of matrix C, then the ith block of A V r (X) is By the properties of the swap matrix and V r (AX) = A V r (X), then, , a 2 , · · · , a n ], a i (i = 1, 2, · · · , n) represents the ith column of matrix A, Y = [y 1 , y 2 , · · · , y m ], y j (j = 1, 2, · · · , m) represents the jth column of matrix Y, then by the conjugate properties of quaternions, we have By the properties of the swap matrix and V c (

L-Representation of Quaternion Matrices
Our main work in this section is to study the matrix representation of quaternion matrices by using the structure matrix of the multiplication of quaternion.

Definition 7.
[1] Let V i (i = 1, 2, · · · , k) be n i -dimensional vector spaces with e i 1 , · · · , e i n i as the fixed bases of V i , and φ : V 1 · · · V k → V 0 be a multilinear mapping. Denote Then the matrix is defined as the right structure matrix of φ. The matrix is defined as the left structure matrix of φ. The left and right structure matrices are collectively called structure matrices.

Remark 1.
For a multi-dimensional data, we can sort it by certain indices. The left structure matrix and right structure matrix given in Definition 7 are sorted according to different indexes.
then fix an ordered basis {1, i, j, k}, the basis is normalized to Each quaternion can be represented as a column vector: Then the right structure matrix of the multiplication of quaternions can be obtained as In the case of different basis standardization, the structure matrix of the multiplication of quaternion is also diverse. We systematically define the matrix representation of quaternion matrices by using the structure matrix of the multiplication of quaternion and semi-tensor product of quaternion matrices.
Φ(X) is called the matrix representation of quaternion matrix X. Furthermore, the first column of Φ(X) is defined as Φ c (X) = Φ(X) δ 1 4 .

Remark 2.
It can be seen from the definition that Φ(X) and Φ c (X) are determined by X and M Q , that is, when X and M Q are determined, Φ(X) and Φ c (X) are also unique and certain.
Example 4. Let X = X 0 + X 1 i + X 2 j + X 3 k ∈ Q n×n , by M 1 Q defined in Example 3, the matrix representation of quaternion matrix X can be expressed as The matrix representation method in reference [47] is the matrix representation Φ 2 (X) in Example 4. Furthermore, the matrix representation of quaternion matrices plays an important role in many aspects of quaternion research. Definition 9. Suppose X ∈ Q m×n , Y ∈ Q n×p , Φ(X) is called L-representation of quaternion matrices if and only if Φ(X) satisfies the following equations, It is easy to verify that the two matrix representations given in Example 4, Φ 1 (X) does not satisfy the two conditions of L-representation, but the matrix representation given by Φ 2 (X) does. It is clear that Definition 9 has the following equivalent form.

GH-Representation of Quaternion Matrices
In this section, we will first introduce the definition of H-representation, and then give examples of H-representation of special matrices. ([42]). Consider a q-dimensional real matrix subspace X ⊂ R n×n over the field R.

Definition 11
Assume that e 1 , e 2 , · · · , e q form the basis of X, and define H = [V c (e 1 ), V c (e 2 ), · · · , V c (e q )]. For each X ∈ X, if we express Ψ(X) = V c (X) in the form of Ψ(X) = H X, with a q × 1 vector X = (x 1 , x 2 , · · · , x q ) T and X = ∑ q i=1 x i e i , then H X is called an H-representation of Ψ(X), and H is called an H-representation matrix of Ψ(X).
From the definition of quaternion (anti)-centrosymmetric matrices, we can know that quaternion (anti)-centrosymmetric matrices is closely related to real (anti)-centrosymmetric matrices. In the following, we take real (anti)-centrosymmetric matrices as examples to give their H-representation. Example 5. Let X = S 3×3 , X = (x ij ) ∈ X, and then dim(X) = 5. If we select a basis of X as Then, we select the standard basis for centrosymmetric and anti-centrosymmetric matrices, and give the H-representation matrices, respectively.
1. If X = S n×n , we select a standard basis as (i f n is even) . Based on above standard basis, for any X ∈ X, we have 2. If X = AS n×n , we select a standard basis as (i f n is even) . Based on above standard basis, for any X ∈ X, we have Note that Ψ(X) is a column vector formed by all elements of matrix X. For the sake of clarity, we denote the H-representation matrix corresponding to X = S n×n by H s , the H-representation matrix corresponding to X = AS n×n by H a .
H-representation prompt us to define GH-representation on quaternion matrices.

Definition 12.
Consider a quaternion matrix subspace X ⊂ Q n×n , for each X = X 0 + X 1 i + X 2 j + X 3 k ∈ X, let S = {X 0 , X 1 , X 2 , X 3 }. A permutation σ on S is a one-to-one mapping from S to S, denote X = ±σ(X 0 ) ±σ( , X = V c (X ) represents a permutation of independent elements for each part of V c (X ). Then H G X is called a GH-representation of Ψ(X), and H G is called a GH-representation matrix of Ψ(X).

The Solutions of Problem 1 and Problem 2
In order to obtain the solution of the quaternion matrix Equation (1), we begin with the following Lemmas. Lemma 1 ([48]). The least squares solution of the linear system of equations Ax = b, with A ∈ R m×n and b ∈ R m can be represented as where y ∈ R n is an arbitrary vector. The minimal norm least squares solution of the linear system of equations Ax = b is A † b.

Lemma 2 ([48]
). The linear system of equations Ax = b, with A ∈ R m×n and b ∈ R m , has a solution x ∈ R n if and only if In case that it has the general solution where y ∈ R n is an arbitrary vector. The minimal norm solution of the linear system of equations T for X = X 0 + X 1 i + X 2 j + X 3 k ∈ Q n×n as an example in the following solving process, in this case, the matrix representation we obtain is the form of Φ 2 (X) in Example 4. Based on our earlier discussion, we now turn our attention to Problem 1. We obtain the necessary and sufficient condition of the existence of centrosymmetric solutions of quaternion matrix Equation (1), we obtain the following Theorem.
Theorem 5. Suppose A i ∈ Q m×n , B i ∈ Q n×p , (i = 1, · · · , k), C ∈ Q m×p , then the set M S of Problem 1 can be represented as where y is an arbitrary vector with suitable dimension. Then, the minimal norm least squares centrosymmetric solution X S of quaternion matrix Equation (1) satisfies where Proof. For X = X 0 + X 1 i + X 2 j + X 3 k ∈ S n×n , from Theorem 3, Theorem 4 and the definition of GH-representation, we can obtain For the real matrix equation Using Lemma 1, its least squares solution can be represented as Then we have And then, Equation (3) can be obtained.

Theorem 6.
Suppose A i ∈ Q m×n , B i ∈ Q n×p , (i = 1, · · · , k), C ∈ Q m×p . Hence quaternion matrix Equation (1) has a solution X ∈ S n×n if and only if where R 1 is denoted in Theorem 5. Moreover, if (4) holds, the centrosymmetric solution set of quaternion matrix Equation (1) can be represented as where y is an arbitrary vector suitable for dimension. Then, the minimal norm centrosymmetric solution X S satisfies Proof. Quaternion matrix Equation (1) has a solution X ∈ S n×n if and only if By means of Theorem 5 and the properties of the Moore-Penrose inverse, we obtain In case that quaternion matrix Equation (1) is compatible, its solution X ∈ S n×n satisfies Moreover, by Lemma 2, we can obtain the centrosymmetric solution X satisfies Then we have And the minimal norm centrosymmetric solution X S satisfies For Problem 2, we can also obtain the necessary and sufficient condition for the existence of anti-centrosymmetric solutions of quaternion matrix Equation (1) through vector representation of quaternion matrices, L-representation and GH-representation method. Similar to the analysis procedure of Problem 1, we obtain the following conclusions. Theorem 7. Suppose A i ∈ Q m×n , B i ∈ Q n×p , (i = 1, · · · , k), C ∈ Q m×p , then the set M A of Problem 2 can be represented as where ∀y ∈ R 4β . Then, the minimal norm least squares anti-centrosymmetric solution X A of quaternion matrix Equation (1) satisfies where H a = Theorem 8. Suppose A i ∈ Q m×n , B i ∈ Q n×p , (i = 1, · · · , k), C ∈ Q m×p . Hence quaternion matrix Equation (1) has a solution X ∈ AS n×n if and only if where R 2 is denoted in Theorem 7. Moreover, if (8) holds, the anti-centrosymmetric solution set of quaternion matrix Equation (1) can be represented as And then, the minimal norm anti-centrosymmetric solution X A satisfies

Algorithms and Numerical Examples
Numerical experiments are used to verify the effectiveness of the above algorithms.
Example 7. Suppose m = n = p, A i , B i ∈ Q n×n be generated randomly for n = 5K, K = 1 : 11. Randomly generate centrosymmetric matrix X S or anti-centrosymmetric matrix X A , respectively. Then for the left side of quaternion matrix Equation (1), replace X with X S or X A , let k = 2, For the quaternion matrix Equation (1) with A i , B i and C above, its computational solutions can be obtained by using Algorithms 1 and 2 and denoted asX S ,X A , respectively. Denote As the dimension changes, ε t (t = 1, 2) is shown in Figure 1. It can be seen from Figure 1 that the order of magnitude of error between the exact solution and the numerical solution in Problem 1 and 2 increases with the increase in dimension. However, for Problem 1, the order of magnitude of error of the centrosymmetric solution is always less than −11; for Problem 2, the order of magnitude of error of the anti-centrosymmetric solution is always less than −12, which indicates that the order of magnitude of error between the numerical solution and the exact solution is very small, that is, the algorithm in this paper is effective. Input: Quaternion matrix A i ∈ Q m×n , B i ∈ Q n×p , (i = 1, 2, · · · , k), C ∈ Q m×p ; Output: Output the minimal norm centrosymmetric solutionX S of quaternion matrix Equation (1) according to (5) Input: Quaternion matrix A i ∈ Q m×n , B i ∈ Q n×p , (i = 1, 2, · · · , k), C ∈ Q m×p ; Output: Output the minimal norm centrosymmetric solutionX A of quaternion matrix Equation (1) according to (9) Calculate the minimal norm solution of quaternion matrix equation according to (9); 6: end if Next, taking the centrosymmetry solution as an example, we compare the method of solving the special solution of quaternion matrix equation in this paper with the method of in references [43,44].
The method in reference [43] used the real representation of quaternion matrices to process quaternion matrix equation firstly, the transformation from quaternion matrix equation to real matrix equation is realized, then the straighten operator is used to transform the real matrix equation into real vector matrix equation.

Remark 3.
The symbols appearing in Algorithm 3 follow the symbol representation in reference [43], J and K are defined in reference [43]. H s is the H-representation matrix of the centrosymmetric matrix in this paper, and H s is also defined in Theorem 4.

Algorithm 3
Calculate the minimal norm centrosymmetric solution of quaternion matrix Equation (1) according to the method of reference [43].
Input: Quaternion matrix A i ∈ Q m×n , B i ∈ Q n×p , (i = 1, 2, · · · , k), C ∈ Q m×p ; Output: Output the minimal norm centrosymmetric solutionX s of quaternion matrix Equation (1); The real vector representation method in reference [44] is to represent a quaternion as a 4 × 1 dimension vector, and then establish the relationship between quaternion matrix real vector representation operations through semi-tensor product of matrices.

Remark 4.
The symbols appearing in Algorithm 4 follow the symbol representation in reference [44], (i f n is even)  (1) according to the method of reference [44].
Randomly generate centrosymmetric matrix X S . Then for the left side of quaternion matrix Equation (1), let k = 1, calculate C = A 1 X S B 1 . For the quaternion matrix Equation (1) with A i , B i and C above, its computational solutions can be obtained by using Algorithms 1, 3 and 4. As the dimension changes, time consumed by the algorithms is shown in Figure 2. For the method in reference [44], because the matrix dimension is too large, we only choose K = 1 : 4. If the form of the solution obtained by the algorithm in reference [43] wants to be consistent with the form of the solution obtained by the algorithm in this paper, it needs to be transformed with the help of a large matrix. The method of expressing quaternion as real vector in reference [44] makes the calculation process of quaternion matrix equation have a large dimension, which is not conducive to the improvement of calculation efficiency. As can be seen from Figure 2, the algorithm in this paper takes less time than the algorithm in references [43,44].

Application in Color Digital Image Restoration
We know that a color digital image consists of three primary colors: red, green and blue, and these three primary colors can correspond to the three imaginary parts of quaternion, respectively. That is, a color digital image can be represented by a pure imaginary quaternion matrix. One of the most basic applications in color digital image is color digital image restoration, and the process of color digital image restoration is the solution process of the minimal norm least squares solution of quaternion matrix equation. For an n × n pixel observation image g = g r i + g g j + g b k, we know its blurring phenomena K, where K is a real matrix, then the color digital image restoration model is established as But in general, the noise N is unknown. In this section, we will work with the centrosymmetric color digital image restoration model. The centrosymmetric color image restoration problem is transformed into the least squares pure imaginary centrosymmetric solution problem of quaternion matrix equation K f = g. Example 9. Given two ideal centrosymmetric color digital image (see Figures 3a and 4a), f = ( f r , f g , f b ) is the image matrix, f can be represented as f = f r i + f g j + f b k. By using LEN = 15; THETA = 30; PSF = f special( motion , LEN, THETA) disturb the image f g , and obtain the disturb image g g . Obviously, K = g g f † g is a singular matrix. By using the matrix K, we can obtain the disturb image g = (g r , g g , g b ) (see Figures 3b and 4b). The minimal norm least squares pure imaginary centrosymmetric solution − → F can be obtained by Algorithm 5. Through the "reshape" command of MATLAB, we obtain the corresponding color digital restored image F = (F r , F g , F b ) (see Figures 3c and 4c).
Finally, we give the mean-square error of each channel which is defined as The mean-square error of each channel is represented by ε r , ε g , ε b , respectively, and the results are shown in Table 1.

Conclusions
The new conclusions of vector representation and L-representation of quaternion matrices makes semi-tensor product of quaternion matrices have a new application in solving quaternion matrix equation. Starting from these new conclusions of semi-tensor product of quaternion matrices, combined L-representation with H-representation method, the special solution of quaternion matrix equation ∑ k i=1 A i XB i = C are solved. Furthermore, numerical examples show that the method is effective. Through a time comparison, it is found that the algorithm in this paper is relatively efficient compared with the algorithm in references [43,44]. The application of centrosymmetric color digital image restoration is also considered. Notes:

•
The images used are from the MATLAB image processing toolbox or USC-SIPI image database image library of the University of Southern California (http://sipi.usc.edu/ database/, accessed on 1 June 2022). • All computations are performed on an Intel(R) core(TM) i9-10940U @3.30 GHz/64 GB computer using MATLAB R2019b software.