# A Rapid Numerical Algorithm to Compute Matrix Inversion

Authors: F. Soleymani
Journal: International Journal of Mathematics and Mathematical Sciences
 (2012)

---

## Abstract

The aim of the present work is to suggest and establish a numerical algorithm based on matrix multiplications for computing approximate inverses. It is shown theoretically that the scheme possesses seventh-order convergence, and thus it rapidly converges. Some discussions on the choice of the initial value to preserve the convergence rate are given, and it is also shown in numerical examples that the proposed scheme can easily be taken into account to provide robust preconditioners.


---

## Body

## 1. Introduction

Let us consider the square matrixAN×N with real or complex elements which is nonsingular. It is well known that its inverse is available and could be found by the direct methods such as LU or QR decompositions, see for example [1]. When the matrix inverse is computed, the method of choice should be probably Gaussian elimination with partial pivoting (GEPP). The resulting residual bounds and possible backward errors may be much smaller in this case, see [2] (subsection on the “Use and abuse of the matrix inverse”).An effective tool to compute approximate inverses of the matrixA is to use iteration-type methods for this purpose which are based on matrix multiplications and are of great interest and accuracy when implementing on parallel machines. In fact, one way is to construct iterative methods of high order of convergence to find matrix inversion numerically for all types of matrices (especially for ill-conditioned ones).A clear use of such schemes is that one may apply them to findA-1 and then, by an easy matrix-vector multiplication, compute the solution of the linear system of the equations Ax=b. However another use is in constructing approximate inverse preconditioners; that is, a very robust approximate preconditioner can easily be constructed using one, two, or three steps of such iterative methods, and the resulting left preconditioned systems would be
(1.1)A-x=b-,
wherein A-=P-1A, b-=P-1b, and P-1≈A-1.Such obtained approximate inverse preconditioners could be robust competitors to the classical or modern methods such as AINV or FAPINV; see for example [3, 4]. The approximate inverse (AINV) and the factored approximate inverse (FAPINV) are two known algorithms in the field of preconditioning of linear systems of equations. Both of these algorithms compute a sparse approximate inverse of matrix A in the factored form and are based on computing two sets of vectors which are A biconjugate.In this paper, in order to challenge with very ill-conditioned matrices or to find the preconditionerP-1 in less number of iterations and having high accuracy, we will propose an efficient iterative method for finding A-1 numerically. Theoretical analysis and numerical experiments show that the new method is more effective than the existing ones in the case of constructing approximate inverse preconditioners.The rest of the paper is organized as follows. Section2 is devoted to a brief review of the available literature. The main contribution of this paper is given in Section 3. Subsequently, the method is examined in Section 4. Finally, concluding remarks are presented in Section 5.


## 2. Background

Several methods of various orders were proposed for approximating (rectangular or square) matrix inverses, such as those according to the minimum residual iterations [5] and Hotelling-Bodewig algorithm [6].The Hotelling-Bodewig algorithm [6] is defined as
(2.1)Vn+1=Vn(2I-AVn),n=0,1,2,…,
where I is the identity matrix. Note that throughout this paper we consider matrices of the same dimension unless it is stated obviously.In 2011, Li et al. in [7] presented the following third-order method:
(2.2)Vn+1=Vn(3I-AVn(3I-AVn)),n=0,1,2,…,
and also proposed another third-order iterative method for approximating A-1 as comes next
(2.3)Vn+1=[I+14(I-VnA)(3I-VnA)2]Vn,n=0,1,2,….It is intersecting to mention that the method (2.2) can be found in the Chapter 5 of [8].As an another method from the existing literature, Krishnamurthy and Sen suggested the following sixth-order iteration method [8] for the above purpose:
(2.4)Vn+1=Vn(2I-AVn)(3I-AVn(3I-AVn))(I-AVn(I-AVn))=Vn(I+(I-AVn)(I+(I-AVn)(I+(I-AVn)(I+(I-AVn)(I+(I-AVn)(I+(I-AVn))))))),
where n=0,1,2,…For further reading refer to [9, 10].


## 3. An Accurate Seventh-Order Method

This section contains a new high-order algorithm for findingA-1 numerically. In order to deal with very ill-conditioned linear systems, to find efficient preconditioners rapidly, or to find robust approximate inverses, we suggest the following matrix multiplication-based iterative method:
(3.1)Vn+1=116Vn(120I+AVn(-393I+AVn(735I+AVn(-861I+AVn(651I+AVn(-315I+AVn(93I+AVn(-15I+AVn)))))))),
for any n=0,1,2,…, wherein I is the identity matrix, and the sequence of iterates {Vn}n=0n=∞ converges to A-1 for a good initial guess.Theorem 3.1.
Assume thatA=[ai,j]N×N be an invertible matrix with real or complex elements. If the initial guess V0 satisfies
(3.2)∥I-AV0∥<1,
then the iteration (3.1) converges to A-1 with at least seventh convergence order.Proof.
In order to prove the convergence behavior of (3.1), we assume that ∥I-AV0∥<1, E0=I-AV0, and En=I-AVn. We then have
(3.3)En+1=I-AVn+1=I-A[116Vn(120I+AVn(-393I+AVn(735I+AVn(-861I+AVn(651I+AVn(-315I+AVn(93I+AVn(-15I+AVn))))))))]=I-A[116Vn(120I-393AVn+735(AVn)2-861(AVn)3+651(AVn)4-315(AVn)5+93(AVn)6-15(AVn)7+(AVn)8)116]=-116(-4I+AVn)2(-I+AVn)7=116(3I+I-AVn)2(I-AVn)7=116(3I+En)2(En)7=116(9I+6En+En2)(En)7=116(En9+6En8+9En7).
Hence, it is now and according to the above simplifications easily to have
(3.4)∥En+1∥≤116(∥En9+6En8+9En7∥)≤116(∥En∥9+6∥En∥8+9∥En∥7).
Furthermore, since ∥E0∥<1, and ∥E1∥≤∥E0∥7<1, we get that
(3.5)∥En+1∥≤∥En∥7≤∥En-1∥72≤⋯≤∥E0∥7n+1<1,
where (3.5) tends to zero when n→∞. That is to say
(3.6)I-AVn→0,
when n→∞, and thus for (3.6), we obtain
(3.7)Vn→A-1,asn→∞.
We must now illustrate the seventh order of convergence for (3.1) due to the obtained theoretical discussions that (3.1) converges under the assumption made in Theorem 3.1 to A-1. To do this aim, we denote εn=Vn-A-1, as the error matrix in the iterative procedure (3.1). We have (3.8)I-AVn+1=116((I-AVn)9+6(I-AVn)8+9(I-AVn)7).
Equation (3.8) yields in
(3.9)A(A-1-Vn+1)=116(A9(A-1-Vn)9+6A8(A-1-Vn)8+9A7(A-1-Vn)7),(3.10)A-1-Vn+1=116(A8(A-1-Vn)9+6A7(A-1-Vn)8+9A6(A-1-Vn)7).
Using (3.10), we attain
(3.11)εn+1=116(A8(εn)9-6A7(εn)8+9A6(εn)7),
which simplifies by taking norm from both sides (3.12)∥εn+1∥≤116[∥A8εn9∥+∥6A7εn8∥+∥9A6εn7∥],
and consequently
(3.13)∥εn+1∥≤(116[9∥A∥6+6∥A∥7∥εn∥+∥A∥8∥εn∥2])∥εn∥7.
This shows that the method (3.1) converges to A-1 with at least seventh order of convergence. This concludes the proof.Remark 3.2.
For the above Theorem3.1, we can conclude some points as follows. (1)
From (3.4), one knows that the condition (3.2) may be weakened. In fact, we only need that the spectral radius of AV0 be less than one for the convergence of the above new method (3.1). In this case, the choice of V0 may be obtained according to the estimate formulas for the spectral radius ρ(AV0) (see, e.g., [11])(2)
In some experiments and to reduce the computational cost, we may solve the matrix multiplications,  based on the vector and parallel processors.(3)
Finally, for the choice ofV0, there exist many of different forms. We will describe this problem after Theorem 3.3 based on some literatures.
We now give a property about the scheme (3.1). This property shows that {Vn}n=0n=∞ of (3.1) may be applied to not only the left preconditioned linear system VnAx=Vnb but also to the right preconditioned linear system AVny=b, where y=Vnx.Theorem 3.3.
Let againA=[ai,j]N×N be a nonsingular real or complex matrix. If
(3.14)AV0=V0A,
is valid, then, for the sequence of {Vn}n=0n=∞ of (3.1), one has that
(3.15)AVn=VnA,
holds, for all n=1,2,….Proof.
The mathematical induction is taken into account herein. First, sinceAV0=V0A, we have
(3.16)AV1=A(116V0(120I+AV0(-393I+AV0(735I+AV0(-861I+AV0(651I+AV0(-315I+AV0(93I+AV0(-15I+AV0))))))))116)=116V0A(120I+V0A(-393I+V0A(735I+V0A(-861I+V0A(651I+V0A(-315I+V0A(93I+V0A(-15I+V0A))))))))=116V0(120I+V0A(-393I+V0A(735I+V0A(-861I+V0A(651I+V0A(-315I+V0A(93I+V0A(-15I+V0A))))))))A=V1A.
Equation (3.16) shows that when n=1, (3.15) is true. At the moment, suppose that AVn=VnA is true, and then a straightforward calculation using (3.16) shows that, for all n≥1,
(3.17)AVn+1=A[116Vn(120I+AVn(-393I+AVn(735I+AVn(-861I+AVn(651I+AVn(-315I+AVn(93I+AVn(-15I+AVn))))))))116]=116VnA(120I+VnA(-393I+VnA(735I+VnA(-861I+VnA(651I+VnA(-315I+VnA(93I+VnA(-15I+VnA))))))))=Vn+1A.
This concludes the proof.Note that according to the literatures [7, 9, 12, 13] and to find an initial value V0 to preserve the convergence order of such iterative methods, we need to fulfill at least the condition given in Remark 3.2. or Theorem 3.1. We list some ways for this purpose in what follows.  WAY 1
If a matrix is strictly diagonally dominant, then chooseV0 as V0=diag(1/a11,1/a22,…,1/ann), where aii are the diagonal elements of A.WAY 2
For the matrixA, choose V0 as V0=AT/(∥A∥1∥A∥∞), wherein T stands for transpose, ∥A∥1=maxj{Σi=1n|aij|} and ∥A∥∞=maxi{Σj=1n|aij|}.WAY 3
If the ways 1-2 fail, then useV0=αI, where I is the identity matrix, and α∈R should adaptively be determined such that ∥I-αA∥<1.


## 4. Numerical Testing

In this section, experiments are presented to demonstrate the capability of the suggested method. For solving a square linear system of equations of the general formAx=b, wherein A∈ℂN×N, we can now propose the following efficient algorithm: xn+1=Vn+1bwhilen=0,1,2,….The programming package   MATHEMATICA 8, [14, 15], has been used in this section. For numerical comparisons, we have used the methods (2.1), (2.2), the sixth-order method of Krishnamurthy and Sen (2.4), and the new algorithm (3.1).As noted in Section1, such high order schemes are so much fruitful in providing robust preconditioners to the linear systems. In fact, we believe that only one full iteration of the scheme (3.1) for even large sparse systems and by defining SparseArray[mat] to reduce the computational load of matrix multiplications is enough to find acceptable preconditioners to the linear systems. Anyhow, using parallel computations with simple commands for this purpose in   MATHEMATICA 8 may reduce the computational burden much more.Test Problem 1
Consider the linear systemAx=b, wherein A is the large sparse complex matrix defined byn= 1000;A = SparseArray[{Band[{1, 120}] -> -2., Band[{950, 1}] -> 2. -I,Band[{-700, 18}] -> 1., Band[{1, 1}] -> 23.,Band[{1, 100}] -> 0.2, Band[{214, -124}] -> 1.,Band[{6, 800}] -> 1.1},{n, n}, 0.].
The dimension of this matrix is 1000 with complex elements in its structure. The right hand side vector is considered to beb=(1,1,…,1)T. Although page limitations do not allow us to provide the full form of such matrices, the structure of such matrices can easily be drawn. Figure 1 illustrates the plot and also the array plot of this matrix.The matrix plot (a) and the array plot (b) of the coefficient complex matrix in test problem 1.
(a)
(b)Now, we expect to find robust approximate inverses forA in less iterations by the high-order iterative methods. Furthermore, as we described in the previous sections, the approximate inverses could be considered for left or right preconditioned systems.Table1 clearly shows the efficiency of the proposed iterative method (3.1) in finding approximate inverses by manifesting the number of iterations and the obtained residual norm. When working with sparse matrices, an important factor which affects clearly on the computational cost of the iterative method is the number of nonzeros elements. The considered sparse complex matrix A, in test problem 1, has 3858 nonzero elements at the beginning. We list the number of nonzero elements for different iteration matrix multiplication-based schemes in Table 1. It is obvious that the new scheme is much better than (2.1) and (2.2), but when comparing to (2.4) its number of nonzero elements are higher; however, this is completely satisfactory due to the better numerical results we have obtained for the residual norm. In fact, if one let the (2.4) to cycle more in order to reach the residual norm which is correct up to seven decimal places, then the obtained nonzero elements will be more than the corresponding one of (3.1).Table 1
Results of comparisons for the test problem 1.
Iterative methods
(2.1)
(2.2)
(2.4)
(3.1)
Number of iterations
3
2
1
1
Number of nonzero elements
126035
137616
65818
119792
Residual norm
3.006
×
10
-
7
2.628
×
10
-
7
1.428
×
10
-
5
9.077
×
10
-
7At this time, if the user is satisfied of the obtained residual norm for solving the large sparse linear system then can be stopped, else, one can use the attained approximate inverse as a left or right preconditioner and solve the resulting preconditioned linear system with low condition number using theLinearSolve command. Note that the written code in order to implement the test problem 1 for the method (3.1) is given as follows:b = SparseArray[Table[1,{k, n}]];DA = Diagonal[A];B = SparseArray[Table[(1/DA[[i]]),{i, 1, n}]];Id = SparseArray[{{i_, i_}-> 1},{n, n}];X = SparseArray[DiagonalMatrix[B]];Do[X1 = SparseArray[X];AV = Chop[SparseArray[A.X1]];X = Chop[(1/16) X1.SparseArray[(120 Id +AV.(-393 Id+AV.(735 Id +AV.(-861 Id +AV.(651 Id +AV.(-315 Id+AV.(93 Id + AV.(-15 Id + AV))))))))]];Print[X];L[i] = Norm[b - SparseArray[A.(X.b)]];Print["The residual norm of the linear system solution is:"Column[{i}, Frame -> All, FrameStyle -> Directive[Blue]]Column[{L[i]}, Frame -> All, FrameStyle -> Directive[Blue]]];,{i, 1}].In what follows, we try to examine the matrix inverse-finding iterative methods of this paper on a dense matrix which is of importance in applications.Test Problem 2
Consider the linear systemAx=b, wherein A is the dense matrix defined by n = 40;A = Table[Sin[(x*y)]/(x + y) - 1.,{x, n},{y, n}].
The right hand side vector is again considered to beb=(1,1,…,1)T. Figure 2 illustrates the plot and array plot of this matrix. Due to the fact that, for dense matrices, such plots will not be illustrative, we have drawn the 3-D plots of the coefficient dense matrix using the zero-order interpolation in test problem 2, alongside its approximate inverse obtained from the method (3.1) after 11 iterations in Figure 3. We further expect to have a similar identity-like behavior for the multiplication of A to its approximate inverse, and this is clear in part (c) of Figure 3.The matrix plot (a) and the array plot (b) of the coefficient complex matrix in test problem 2.
(a)
(b)The 3D plot of the structure of the coefficient matrix (a) in the Test Problem 2, its approximate inverse (b) by the method (3.1) and their multiplication to obtain a similar output to the identity matrix (c).
(a)
(b)
(c)Table2 shows the number of iterations and the obtained residual norm for different methods in order to reveal the efficiency of the proposed iteration. There is a clear reduction in computational steps for the proposed method (3.1) in contrast to the other existing well-known methods of various orders in the literature. Table 2 further confirms the use of such iterative inverse finders in order to find robust approximate inverse preconditioners again. Since, the condition number of the coefficient matrix in Test Problem 2 is 18137.2, which is quite high for a 40×40 matrix. But as can be furnished in Table 2, the obtained condition number of the preconditioned matrix after the specified number of iterations is very small.Table 2
Results of comparisons for the test problem 2 with condition number 18137.2.
Iterative methods
(2.1)
(2.2)
(2.4)
(3.1)
Number of iterations
29
18
11
10
The condition number ofVnA
1.00135
1.01234
1.01780
1.00114
Residual norm
6.477
×
10
-
7
5.916
×
10
-
6
8.517
×
10
-
6
5.482
×
10
-
7We should here note that the computational time requiring for implementing all the methods in Tables1 and 2 for the Test Problems 1 and 2 is less than one second, and due to this we have not listed them herein. For the second test proplem, we have used V0=AT/(∥A∥1∥A∥∞)


## 5. Concluding Remarks

In the present paper, the author along with the helpful suggestions of the reviewers has developed an iterative method in inverse finding of matrices. Note that such high order-iterative methods are so efficient for very ill-conditioned linear systems or to find robust approximate inverse preconditioners. We have shown analytically that the suggested method (3.1), reaches the seventh order of convergence. Moreover, the efficacy of the new scheme was illustrated numerically in Section 4 by applying to a sparse matrix and an ill-conditioned dense matrix. All the numerical results confirm the theoretical aspects and show the efficiency of (3.1).



---

*Source: 134653-2012-09-03.xml*