# Hierarchical matrix

In numerical mathematics, hierarchical matrices (H-matrices) [1][2][3] are used as data-sparse approximations of non-sparse matrices. While a sparse matrix of dimension ${\displaystyle n}$ can be represented efficiently in ${\displaystyle O(n)}$ units of storage by storing only its non-zero entries, a non-sparse matrix would require ${\displaystyle O(n^{2})}$ units of storage, and using this type of matrices for large problems would therefore be prohibitively expensive in terms of storage and computing time. Hierarchical matrices provide an approximation requiring only ${\displaystyle O(nk\,\log(n))}$ units of storage, where ${\displaystyle k}$ is a parameter controlling the accuracy of the approximation. In typical applications, e.g., when discretizing integral equations [4][5][6][7][8] ,[9] preconditioning the resulting systems of linear equations ,[10] or solving elliptic partial differential equations [11][12][13][14] , a rank proportional to ${\displaystyle \log(1/\epsilon )^{\gamma }}$ with a small constant ${\displaystyle \gamma }$ is sufficient to ensure an accuracy of ${\displaystyle \epsilon }$. Compared to many other data-sparse representations of non-sparse matrices, hierarchical matrices offer a major advantage: the results of matrix arithmetic operations like matrix multiplication, factorization or inversion can be approximated in ${\displaystyle O(nk^{\alpha }\,\log(n)^{\beta })}$ operations, where ${\displaystyle \alpha ,\beta \in \{1,2,3\}.}$[2]

## Basic idea

Hierarchical matrices rely on local low-rank approximations: let ${\displaystyle I,J}$  be index sets, and let ${\displaystyle G\in {\mathbb {R} }^{I\times J}}$  denote the matrix we have to approximate. In many applications (see above), we can find subsets ${\displaystyle t\subseteq I,s\subseteq J}$  such that ${\displaystyle G|_{t\times s}}$  can be approximated by a rank-${\displaystyle k}$  matrix. This approximation can be represented in factorized form ${\displaystyle G|_{t\times s}\approx AB^{*}}$  with factors ${\displaystyle A\in {\mathbb {R} }^{t\times k},B\in {\mathbb {R} }^{s\times k}}$ . While the standard representation of the matrix ${\displaystyle G|_{t\times s}}$  requires ${\displaystyle O((\#t)(\#s))}$  units of storage, the factorized representation requires only ${\displaystyle O(k(\#t+\#s))}$  units. If ${\displaystyle k}$  is not too large, the storage requirements are reduced significantly.

In order to approximate the entire matrix ${\displaystyle G}$ , it is split into a family of submatrices. Large submatrices are stored in factorized representation, while small submatrices are stored in standard representation in order to improve efficiency.

Low-rank matrices are closely related to degenerate expansions used in panel clustering and the fast multipole method to approximate integral operators. In this sense, hierarchical matrices can be considered the algebraic counterparts of these techniques.

## Application to integral operators

Hierarchical matrices are successfully used to treat integral equations, e.g., the single and double layer potential operators appearing in the boundary element method. A typical operator has the form

${\displaystyle {\mathcal {G}}[u](x)=\int _{\Omega }\kappa (x,y)u(y)\,dy.}$

The Galerkin method leads to matrix entries of the form

${\displaystyle g_{ij}=\int _{\Omega }\int _{\Omega }\kappa (x,y)\varphi _{i}(x)\psi _{j}(y)\,dy\,dx,}$

where ${\displaystyle (\varphi _{i})_{i\in I}}$  and ${\displaystyle (\psi _{j})_{j\in J}}$  are families of finite element basis functions. If the kernel function ${\displaystyle \kappa }$  is sufficiently smooth, we can approximate it by polynomial interpolation to obtain

${\displaystyle {\tilde {\kappa }}(x,y)=\sum _{\nu =1}^{k}\kappa (x,\xi _{\nu })\ell _{\nu }(y),}$

where ${\displaystyle (\xi _{\nu })_{\nu =1}^{k}}$  is the family of interpolation points and ${\displaystyle (\ell _{\nu })_{\nu =1}^{k}}$  is the corresponding family of Lagrange polynomials. Replacing ${\displaystyle \kappa }$  by ${\displaystyle {\tilde {\kappa }}}$  yields an approximation

${\displaystyle {\tilde {g}}_{ij}=\int _{\Omega }\int _{\Omega }{\tilde {\kappa }}(x,y)\varphi _{i}(x)\psi _{j}(y)\,dy\,dx=\sum _{\nu =1}^{k}\int _{\Omega }\kappa (x,\xi _{\nu })\varphi _{i}(x)\,dx\int _{\Omega }\ell _{\nu }(y)\psi _{j}(y)\,dy=\sum _{\nu =1}^{k}a_{i\nu }b_{j\nu }}$

with the coefficients

${\displaystyle a_{i\nu }=\int _{\Omega }\kappa (x,\xi _{\nu })\varphi _{i}(x)\,dx,}$
${\displaystyle b_{j\nu }=\int _{\Omega }\ell _{\nu }(y)\psi _{j}(y)\,dy.}$

If we choose ${\displaystyle t\subseteq I,s\subseteq J}$  and use the same interpolation points for all ${\displaystyle i\in t,j\in s}$ , we obtain ${\displaystyle G|_{t\times s}\approx AB^{*}}$ .

Obviously, any other approximation separating the variables ${\displaystyle x}$  and ${\displaystyle y}$ , e.g., the multipole expansion, would also allow us to split the double integral into two single integrals and thus arrive at a similar factorized low-rank matrix.

Of particular interest are cross approximation techniques [6][7][15] that use only the entries of the original matrix ${\displaystyle G}$  to construct a low-rank approximation.

## Application to elliptic partial differential equations

Since the solution operator of an elliptic partial differential equation can be expressed as an integral operator involving Green's function, it is not surprising that the inverse of the stiffness matrix arising from the finite element method and spectral method can be approximated by a hierarchical matrix.

Green's function depends on the shape of the computational domain, therefore it is usually not known. Nevertheless, approximate arithmetic operations can be employed to compute an approximate inverse without knowing the function explicitly.

Surprisingly, it is possible to prove[11][12][13][14] that the inverse can be approximated even if the differential operator involves non-smooth coefficients and Green's function is therefore not smooth.

## Arithmetic operations

The most important innovation of the hierarchical matrix method is the development of efficient algorithms for performing (approximate) matrix arithmetic operations on non-sparse matrices, e.g., to compute approximate inverses, LU decompositions and solutions to matrix equations.

The central algorithm is the efficient matrix-matrix multiplication, i.e., the computation of ${\displaystyle Z=Z+\alpha XY}$  for hierarchical matrices ${\displaystyle X,Y,Z}$  and a scalar factor ${\displaystyle \alpha }$ . The algorithm requires the submatrices of the hierarchical matrices to be organized in a block tree structure and takes advantage of the properties of factorized low-rank matrices to compute the updated ${\displaystyle Z}$  in ${\displaystyle O(nk^{2}\,\log(n)^{2})}$  operations.

Taking advantage of the block structure, the inverse can be computed by using recursion to compute inverses and Schur complements of diagonal blocks and combining both using the matrix-matrix multiplication. In a similar way, the LU decomposition [16][17] can be constructed using only recursion and multiplication. Both operations also require ${\displaystyle O(nk^{2}\,\log(n)^{2})}$  operations.

## H2-matrices

In order to treat very large problems, the structure of hierarchical matrices can be improved: H2-matrices [18][19] replace the general low-rank structure of the blocks by a hierarchical representation closely related to the fast multipole method in order to reduce the storage complexity to ${\displaystyle O(nk)}$ .

In the context of boundary integral operators, replacing the fixed rank ${\displaystyle k}$  by block-dependent ranks leads to approximations that preserve the rate of convergence of the underlying boundary element method at a complexity of ${\displaystyle O(n).}$ [20][21]

Arithmetic operations like multiplication, inversion, and Cholesky or LR factorization of H2-matrices can be implemented based on two fundamental operations: the matrix-vector multiplication with submatrices and the low-rank update of submatrices. While the matrix-vector multiplication is straightforward, implementing efficient low-rank updates with adaptively optimized cluster bases poses a significant challenge.[22]

## Literature

1. ^ Hackbusch, Wolfgang (1999). "A sparse matrix arithmetic based on H-matrices. Part I: Introduction to H-matrices". Computing. 62 (2): 89–108. doi:10.1007/s006070050015.
2. ^ a b Grasedyck, Lars; Hackbusch, Wolfgang (2003). "Construction and arithmetics of H-matrices". Computing. 70 (4): 295–334. doi:10.1007/s00607-003-0019-1.
3. ^ Hackbusch, Wolfgang (2015). Hierarchical matrices: Algorithms and Analysis. Springer Series in Computational Mathematics. 49. Springer. doi:10.1007/978-3-662-47324-5. ISBN 978-3-662-47323-8.
4. ^ Bebendorf, Mario (2008). Hierarchical matrices: A means to efficiently solve elliptic boundary value problems. Springer.
5. ^ Hackbusch, Wolfgang; Khoromskij, Boris N. (2000). "A sparse H-Matrix Arithmetic. Part II: Application to Multi-Dimensional Problems". Computing. 64: 21–47.
6. ^ a b Bebendorf, Mario (2000). "Approximation of boundary element matrices". Numer. Math. 86 (4): 565–589. doi:10.1007/pl00005410.
7. ^ a b Bebendorf, Mario; Rjasanow, Sergej (2003). "Adaptive low-rank approximation of collocation matrices". Computing. 70: 1–24. CiteSeerX 10.1.1.133.182. doi:10.1007/s00607-002-1469-6.
8. ^ Börm, Steffen; Grasedyck, Lars (2005). "Hybrid cross approximation of integral operators". Numer. Math. 101 (2): 221–249. CiteSeerX 10.1.1.330.8950. doi:10.1007/s00211-005-0618-1.
9. ^ Börm, Steffen; Christophersen, Sven (2016). "Approximation of integral operators by Green quadrature and nested cross approximation". Numer. Math. 133 (3): 409–442. arXiv:1404.2234. doi:10.1007/s00211-015-0757-y.
10. ^ Faustmann, Markus; Melenk, J. Markus; Praetorius, Dirk (2016). "Existence of H-matrix approximants to the inverses of BEM matrices: The simple-layer operator". Math. Comp. 85 (297): 119–152. arXiv:1311.5028. doi:10.1090/mcom/2990.
11. ^ a b Bebendorf, Mario; Hackbusch, Wolfgang (2003). "Existence of H-matrix approximants to the inverse FE-matrix of elliptic operators with ${\displaystyle L^{\infty }}$ -coefficients". Numer. Math. 95: 1–28. doi:10.1007/s00211-002-0445-6.
12. ^ a b Börm, Steffen (2010). "Approximation of solution operators of elliptic partial differential equations by H- and H2-matrices". Numer. Math. 115 (2): 165–193. doi:10.1007/s00211-009-0278-7.
13. ^ a b Faustmann, Markus; Melenk, J. Markus; Praetorius, Dirk (2015). "H-matrix approximability of the inverses of FEM matrices". Numer. Math. 131 (4): 615–642. arXiv:1308.0499. doi:10.1007/s00211-015-0706-9.
14. ^ a b Shen, Jie; Wang, Yingwei; Xia, Jianlin (2016). "Fast structured direct spectral methods for differential equations with variable coefficients". SIAM Journal on Scientific Computing. 38 (1): A28–A54. doi:10.1137/140986815.
15. ^ Tyrtyshnikov, Eugene (2000). "Incomplete cross approximation in the mosaic-skeleton method". Computing. 64 (4): 367–380. CiteSeerX 10.1.1.100.6153. doi:10.1007/s006070070031.
16. ^ Bebendorf, Mario (2007). "Why finite element discretizations can be factored by triangular hierarchical matrices". SIAM J. Numer. Anal. 45 (4): 1472–1494. doi:10.1137/060669747.
17. ^ Grasedyck, Lars; Kriemann, Ronald; Le Borne, Sabine (2009). "Domain decomposition based H-LU preconditioning". Numer. Math. 112 (4): 565–600. doi:10.1007/s00211-009-0218-6.CS1 maint: multiple names: authors list (link)
18. ^ Hackbusch, Wolfgang; Khoromskij, Boris N.; Sauter, Stefan (2002). On H2-matrices. Lectures on Applied Mathematics. pp. 9–29. doi:10.1007/978-3-642-59709-1_2. ISBN 978-3-642-64094-0.
19. ^ Börm, Steffen (2010). Efficient Numerical Methods for Non-local Operators: H2-Matrix Compression, Algorithms and Analysis. EMS Tracts in Mathematics. ISBN 9783037190913.
20. ^ Sauter, Stefan (2000). "Variable order panel clustering". Computing. 64 (3): 223–261. doi:10.1007/s006070050045.
21. ^ Börm, Steffen; Sauter, Stefan (2005). "BEM with linear complexity for the classical boundary integral operators". Math. Comp. 74 (251): 1139–1177. doi:10.1090/s0025-5718-04-01733-8.
22. ^ Börm, Steffen; Reimer, Knut (2015). "Efficient arithmetic operations for rank-structured matrices based on hierarchical low-rank updates". Comp. Vis. Sci. 16 (6): 247–258. arXiv:1402.5056. doi:10.1007/s00791-015-0233-3.

## Software

HLib is a C software library implementing the most important algorithms for hierarchical and ${\displaystyle {\mathcal {H}}^{2}}$ -matrices.

AHMED is a C++ software library that can be downloaded for educational purposes.

HLIBpro is an implementation of the core hierarchical matrix algorithms for commercial applications.

H2Lib is an open source implementation of hierarchical matrix algorithms intended for research and teaching.

awesome-hierarchical-matrices is a repository containing a list of other H-Matrices implementations.

HierarchicalMatrices.jl is a Julia package implementing hierarchical matrices.