Manuscript Offprint
arXiv:2610.40195New hierarchical matrices for fast kernel matrix-vector products with Applications to Gaussian processes and kernel ridge regression
RITESH KHAN AND SIVARAM AMBIKASARAN
Abstract. This article presents two new multilevel hierarchical matrices to perform fast kernel matrix-vector product in dimensions (), namely , . We introduce a novel hybrid weak admissibility condition to construct these hierarchical matrices. More precisely, at coarser levels of the tree (i.e., larger blocks), we use a weak admissibility condition introduced in [27], wherein far-field and vertex-sharing clusters are considered as admissible, while at the finer levels (i.e., smaller blocks), the adjacent clusters are treated as admissible. The admissible blocks at coarser levels of and are represented using semi-nested and fully nested bases, respectively. In both hierarchical matrices, the finer levels at which adjacent clusters are treated as admissible are constructed in a non-nested fashion. Thus, they can be viewed as a hybrid of and matrices. We use adaptive cross approximation (ACA) and nested cross approximation (NCA) to construct non-nested and nested bases, respectively. The fast matrix-vector products are performed using the proposed hierarchical matrix formats. To evaluate the performance and usefulness of the proposed hierarchical matrices, we conduct some numerical experiments. The numerical results show that they outperform their uniform admissibility counterparts (weak admissibility condition of [27] is applied at all levels) in terms of storage and matrix-vector product cost, demonstrating the effectiveness of the proposed hybrid formats. We also show that the proposed formats are competitive with the standard (or strong) admissibility-based -matrices. Furthermore, we showcase some interesting applications of the proposed hierarchical matrices to (i) fast principal component analysis in Gaussian processes and (ii) fast kernel ridge regression, enabled by fast iterative solver and fast Nyström preconditioner.
Key words. H-matrices, -matrices, weak admissibility, ACA, NCA, kernel matrix, principal component analysis, Nyström approximation, Nyström preconditioner, kernel ridge regression
AMS subject classifications. 65D05, 65F10, 65F55, 65R10, 65R20
- Introduction. Kernel matrices arise in a variety of numerical and statistical applications, such as PDEs [16, 24, 29, 4], inverse problems [23, 2], machine learning [15, 32, 30], etc. Given points , an kernel matrix is defined by
where f is a prescribed kernel function. Such matrices are typically dense, and consequently naive matrix computations, such as matrix-vector product and the solution of linear systems, become prohibitive for large N. However, kernel matrices possess rank-structuredness that can be exploited to accelerate matrix computations. Over the past few decades, substantial research [16, 18, 10, 31, 13, 6] has been devoted to developing fast algorithms that exploit this structure, among which hierarchical matrices are a popular framework. Hierarchical matrices (H-matrices) are data-sparse approximations of dense matrices by partitioning the matrix into blocks and approximating selected off-diagonal blocks by low-rank representations, thereby reducing both storage and arithmetic complexity. Some commonly used hierarchical matrix formats in BEM and kernel methods include H-matrices [18], -matrices [9], HODLR (Hierarchically Off-Diagonal Low-Rank) matrices [3, 5], HSS (Hierarchically Semi-Separable)
*Department of Numerical Mathematics, Faculty of Mathematics and Physics, Charles University, Prague, Czech Republic. ritesh.khan@matfyz.cuni.cz, khanritesh28@gmail.com
Department of Data Science & Artificial Intelligence, Wadhwani School of Data Science & Artificial Intelligence, Department of Mathematics and IIT Madras, Chennai, India. sivaambi@alumni.stanford.edu
RITESH KHAN, SIVARAM AMBIKASARAN
matrices [31, 11], and HBS (Hierarchically Block-Separable) matrices [13]. Hierarchical matrix formats can be distinguished by the admissibility conditions (e.g., standard admissibility [10] and weak admissibility [21]) used to identify low-rank blocks and by the construction of the corresponding bases (e.g., non-nested [20] and nested [9]). It is worth noting that the nested bases construction in -matrices offers better computational efficiency than the non-nested bases construction used in H-matrices.
Most existing hierarchical matrix works for multidimensional/higher-dimensional problems employ the standard (or strong) admissibility condition, in which admissible clusters are well-separated or far-field. In our recent works [27, 26], we developed H and -matrices based on a weak admissibility condition [27] that additionally treats vertex-sharing clusters as admissible. Numerical experiments showed that these formats can achieve better computational efficiency than standard admissibility-based H-matrices while maintaining comparable accuracy. However, one computational downside of these H-matrix formats for multidimensional problems is that the number of admissible blocks (or translation operators) can grow rapidly with the tree depth, while many blocks (diagonal and neighbor blocks) remain dense at the leaf level.
In this article, we introduce a hybrid weak admissibility condition based on a prior switching level , where denotes the tree depth. The weak admissibility condition [27], under which both far-field and vertex-sharing clusters are admissible, is applied up to level (coarser), while at the remaining (finer) levels, adjacent clusters are treated as admissible. This construction reduces the number of admissible blocks at the finer levels, and only diagonal blocks are dense at the leaf level . Thus, lowering the associated computational and storage costs. We develop two different -matrix formats based on our hybrid weak admissibility condition, using nested and non-nested bases constructions. We also provide an explicit condition under which the proposed hybrid -matrix formats are advantageous over their uniform counterparts.
The following are the main contributions of this article.
-
We introduce a novel hybrid weak admissibility condition, under which far-field and vertex-sharing cluster interactions are admissible at coarser levels of the hierarchy, while at finer levels adjacent clusters are treated as admissible.
-
We propose a new hierarchical matrix format, , for fast matrix-vector product based on the hybrid weak admissibility condition. At coarser levels of the hierarchy, nested bases are employed for far-field interactions, while vertex-sharing interactions are represented using non-nested bases. At finer levels, all admissible interactions are represented using non-nested bases.
-
We further enhance the format by employing nested bases for the vertex-sharing interactions at coarser levels, resulting in the improved hierarchical matrix format .
-
Numerical experiments show the advantages of the proposed hybrid hierarchical matrix formats over conventional hierarchical matrix formats based on the (uniform) weak admissibility and standard admissibility conditions. We also apply the proposed hierarchical matrix formats to accelerate principal component analysis in Gaussian process and kernel ridge regression problems. As part of this work, we also make the implementation publicly available at https://github.com/riteshkhan/Hhweak.
The remainder of this article is organized as follows. Section 2 reviews hierarchical matrices under different admissibility conditions and discusses low-rank approximation techniques. In Section 3, we introduce a new hybrid weak admissibility condition and propose two hierarchical matrix formats based on it. Section 4 presents numerical experiments demonstrating the advantages of the proposed hybrid formats over the uniform formats, as well as their application to Gaussian process and kernel ridge regression problems. Finally, Section 5 concludes the article.
- Hierarchical matrices. This section discusses hierarchical matrices based on various admissibility conditions and bases for admissible blocks. It also presents an overview of low-rank approximation techniques, ACA and NCA.
2.1. Tree construction. Let denote a domain containing particles (or points), whose interactions are represented by a dense matrix . We further assume that is contained within a -dimensional hypercube . We subdivide the hypercube using a tree data structure to construct hierarchical representations. Depending upon the particle distribution or requirement, one can use different trees, such as balanced tree [14, 19], unbalanced tree [19], -d tree [5], etc. For simplicity, we consider the balanced tree (e.g., for , it is balanced oct tree) throughout this article. At level 0 (the root level), the hypercube itself. Each hypercube at level is subdivided into finer hypercubes , where , which belong to level of the tree. The former is the parent of the latter, and the latter are its children. The cluster is defined as the collection of the indices corresponding to the particles in the hypercube . Clusters at the same level that share a common parent are called siblings. The set of all siblings of is denoted by siblings(). We stop the subdivision at a level (the leaf level) of the tree when each finest hypercube contains at most particles, where is a user-specified threshold that defines the maximum number of particles at each finest hypercube. The finest hypercubes at level are called the leaves. Let represent the balanced tree with depth . Figure 2.1 illustrates the balanced quad tree at different levels in 2D. It can be noted that .

(a) Level 1

(b) Level 2

(c) Level 3
FIG. 2.1. Hierarchical subdivision of the hypercube C using balanced quad tree at different levels in 2D (d = 2).
2.2. Admissibility conditions. The low-rank block matrices of hierarchical matrices are identified using geometrical information known as admissibility conditions. Let X and Y be two clusters at the same level of a balanced -tree, with corresponding hypercubes and , respectively. For notational convenience, the superscript “l” is occasionally omitted when both clusters are at the same level. If the admissibility condition is satisfied, the block matrix of K corresponding to X and Y, , is approximated by a low-rank matrix with a prescribed tolerance . Two commonly used admissibility conditions in the literature are the standard (or strong) admissibility condition and the weak admissibility condition.
2.2.1. Standard admissibility condition. The block , or the pair of clusters , is said to be admissible under the standard (or strong) admissibility
RITESH KHAN, SIVARAM AMBIKASARAN
condition, if the following condition holds:
(2.1)
where
and
The admissibility parameter controls the separation distance and the number of admissible pairs. From (2.1), it follows that the smaller the , the further apart the admissible clusters; conversely, the larger the , the closer the admissible clusters.
If the admissibility condition is not satisfied, the corresponding cluster pair is inadmissible. The self-cluster and the neighboring clusters are inadmissible clusters.
The interaction list of a cluster X is defined as
The neighbors list of X is given by
Figure 2.2 illustrates the neighbors and interaction lists of a cluster (red cluster) at different levels of the tree in 2D, when we set in (2.1).
The corresponding hierarchical matrix at different levels is shown in Figure 2.4.

(a) Level 1

(b) Level 2

(c) Level 3
Far-field cluster
Neighbor cluster
Cluster considered
FIG. 2.2. The interaction and neighbor lists of a cluster at different levels in 2D.
An upper bound on the cardinalities of the interaction list and the neighbor list of a cluster in a balanced -tree can be derived [21]. The maximum sizes of the interaction list and the neighbor list for a cluster at any level in d dimensions are, respectively, as follows
(2.2)
In particular, in (2.1) yields a structure identical to balanced FMM (analytic counterpart of -matrices) [16], leading to
(2.3)
2.2.2. Weak admissibility condition. The notion of weak admissibility was introduced by Hackbusch et al. [21] for one-dimensional problems, where they compress the sub-matrices corresponding to the adjacent clusters (intervals). The notion of weak admissibility doesn't look at the distance between the clusters; instead, it is defined as non-self or non-overlapping clusters being admissible. To be more precise, in terms of matrix setting, this represents all the off-diagonal sub-matrices as low-rank. Hierarchical matrix classes such as HODLR (non-nested bases) [3, 5] and HSS (nested bases) [31, 11] are based on Hackbusch's weak admissibility condition.
Hackbusch et al. discuss the notion of weak admissibility only for one-dimensional problems. However, the extension of this notion to dimensions (), or more generally to multi-dimensional settings, is not discussed in [21]. A straightforward extension to dimensions, i.e., compressing all the off-diagonal sub-matrices, will not result in a quasi-linear complexity hierarchical matrix algorithm. This is because, in dimensions with , except for the vertex-sharing interaction sub-matrix, the rank of all other adjacent interactions sub-matrices grows with some positive power of [24, 25, 27]. Thus, the notion of weak admissibility introduced by Hackbusch et al. is well-suited to one-dimensional problems but requires modification for multi-dimensional problems.
In our recent article [27], we show that the rank of not just the far-field but also the vertex-sharing interaction sub-matrices does not scale with any positive power of N. Therefore, the admissibility of far-field and vertex-sharing clusters could be considered a way to extend the notion of weak admissibility in higher dimensions. We extend the notion of weak admissibility condition to any dimension d as follows:
Weak admissibility condition in dimensions. The block , or the pair of clusters , is said to be admissible under our weak admissibility condition if the following condition holds:
(2.4)
i.e., the intersection of and is at most a vertex.
The interaction list of a cluster X is defined as
The neighbors list of X is given by
The interaction list and the neighbors list under the weak admissibility condition (2.4) are shown in Figure 2.3.

(a) Level 1

(b) Level 2

(c) Level 3
Far-field cluster
Vertex-sharing cluster
Neighbor (edge-sharing) cluster
Cluster considered
FIG. 2.3. The interaction and neighbor lists of a cluster under our weak admissibility condition at different levels in 2D. The admissible clusters are the green and cyan colored clusters enclosed within a noticeable black border.
RITESH KHAN, SIVARAM AMBIKASARAN
An upper bound on the size of the interaction list and the neighbor list of a cluster under weak admissibility condition (2.4) can be derived as follows [26]
(2.5)
Remark 2.1. The weak admissibility condition (2.4) can not be obtained from the standard admissibility condition (2.1) as the distance between two vertex-sharing clusters is zero (they share a common point). More precisely, let and be two clusters at the same level of the tree with . If the corresponding hypercubes and share a vertex, then . Since , no real value of can make the weak admissibility condition (2.4) follow from (2.1).
2.3. H-matrices. Hierarchical matrices are multilevel block low-rank representations in which admissible blocks are compressed. More precisely, if is an admissible block, then the block matrix is approximated in low-rank form as follows:
We rely on algebraic low-rank approximation techniques in this work, such as adaptive cross approximation (ACA) [7, 8]. In the H-matrices framework, the bases associated with admissible blocks are constructed independently (in a non-nested manner).
The hierarchical matrices under the standard and weak admissibility conditions are illustrated in Figure 2.4 and Figure 2.5, respectively. A level-wise comparison helps in understanding the resulting block structures.

(a) Level 1
(b) Level 2
(c) Level 3
Diagonal block (dense) Neighbor block (dense) Far-field compressed block
FIG. 2.4. Hierarchical matrix based on standard admissibility condition (2.1) with at different levels in 2D (no compression at the level 1).
2.3.1. Adaptive cross approximation. The admissible block matrix can be approximated by ACA [7, 8] as follows:
(2.6)
where and are called the row and column pivots, respectively. The matrix is the update of the original matrix . Here, we employ the

(a) Level 1
(b) Level 2
(c) Level 3
Diagonal block (dense)
Neighbor block (dense)
Vertex-sharing compressed block
Far-field compressed block
FIG. 2.5. Hierarchical matrix based on our weak admissibility condition (2.4) at different levels in 2D (no far-field compression at the level 1).
partially pivoted ACA algorithm [7]. The partially pivoted ACA algorithm stops its iterations for a prescribed tolerance when the following condition is satisfied
(2.7)
where and are the column vectors of the matrices U and V, respectively.
2.4. -matrices. The -matrix framework can be further improved by employing nested cluster bases, resulting in the -matrix format. We construct the -matrix representation using nested cross approximation (NCA) [8, 33].
2.4.1. Nested cross approximation. NCA can be viewed as an extension of ACA [7], in which carefully selected matrix indices are used to generate representative bases while preserving their nested structure.
The low-rank approximation of an admissible block/sub-matrix via NCA takes the following form [8, 33]
(2.8)
where , and , . The set represent the union of all the clusters forming the interaction list at the same level and the clusters that form the interaction list with 's ancestors at the lower (coarser) level of the tree.
Although this work focuses on developing new hierarchical matrices, we adopt the FMM terminology for convenience, such as the translation operators (M2M, M2L, and L2L).
The translation operators are obtained from the computed pivots as follows.
• L2P and P2M operators. For a leaf level admissible block , the matrices and are given by
(2.9)
RITESH KHAN, SIVARAM AMBIKASARAN
(2.10)
The matrices and are called L2P (local to particles) and P2M (particles to multipole) operators, respectively.
• L2L and M2M operators. For a non-leaf level admissible block , the matrices and are given by
(2.11)
where with is a child of and
(2.12)
The matrices are called the L2L (local to local) operators.
(2.13)
where with is a child of and
(2.14)
The matrices are called the M2M (multipole to multipole) operators.
• M2L operators. For any admissible block , the M2L (multipole to local) operator is given by
(2.15)
Remark 2.2. If the kernel matrix is symmetric, the P2M or M2M operators can be obtained simply by taking the transpose of L2P or L2L operators, respectively.
The validation of NCA, along with numerical error analysis, is presented in [8]. The efficiency of NCA depends on the strategy employed for selecting the pivots that represent the blocks at a specific level of the tree.
Bebendorf et al. [8] choose indices of points close to the Chebyshev nodes and perform ACA upon them to obtain the pivots. The tree is traversed in a top to bottom manner, resulting in an overall construction complexity of .
Zhao et al. [33] eliminate the geometric dependence by introducing two purely algebraic variants of NCA. They first develop an algorithm for pivot selection that employs a top to bottom tree traversal, analogous to the approach in [8], but does not require geometric information about the clusters. In their second approach, local pivots are identified via a bottom to top tree traversal and subsequently refined through a top to bottom traversal to obtain global pivots. This procedure reduces the overall construction complexity to .
Recently, Gujjula et al. [17] demonstrated that the global pivot selection step of [33] could be omitted without affecting the approximation quality. Their NCA construction relies solely on the local pivots obtained during the bottom to top tree traversal and retains complexity. Their numerical experiments further show that this simplification can provide a computational advantage over the earlier NCA variants [8, 33] without compromising accuracy.
- New hierarchical matrices. This section discusses two new hierarchical matrices to perform fast matrix-vector product: . The proposed hierarchical matrices are based on the following novel hybrid weak admissibility condition.
Hybrid weak admissibility condition. One drawback of H-matrices is the large number of admissible blocks as tree depth increases, along with many dense blocks at the leaf level. In multidimensional problems, the rapidly growing number of admissible blocks can become a computational bottleneck as the tree depth increases. To mitigate this drawback, while keeping the leaf-level block size (or the tree depth L) unchanged, we treat all the adjacent clusters as admissible at finer levels. This is motivated by the observation that admissible blocks at these levels typically have relatively low numerical rank due to their smaller block sizes.
Let and be a pair of clusters at level of the balanced -tree, and let denote an intermediate level of the tree, which we referred to as the switching level. We define the hybrid weak admissibility condition as follows:
(3.1)
The hybrid admissibility condition employs the weak admissibility condition (2.4) at coarser levels, where the block sizes are relatively large. At finer levels, it treats all adjacent sibling clusters as admissible, where the block sizes are comparatively small. This approach reduces the number of admissible clusters at the finer levels, and self-clusters are the only inadmissible clusters at the leaf level. The interaction list under the hybrid admissibility condition is illustrated in Figure 3.1. The corresponding hierarchical matrix is shown in Figure 3.2, where all blocks except the diagonal blocks are represented in compressed form.
We propose new hierarchical matrices under the hybrid weak admissibility condition (3.1), based on different bases associated with the admissible blocks. At coarser levels, we employ both nested and non-nested bases, whereas at finer levels, where adjacent clusters are admissible, we use only non-nested bases.
3.1. -matrix. It is well established that NCA can be applied under the standard (strong) admissibility condition, wherein admissible cluster pairs are either far-field or well-separated [33, 8]. In contrast, the hybrid weak admissibility condition is defined by enforcing our weak admissibility criterion (2.4), i.e., , across levels 1 through ( ). Under this weak admissibility condition, far-field and vertex-sharing clusters are admissible. To apply NCA, we appropriately partition the
RITESH KHAN, SIVARAM AMBIKASARAN

(a) Level 1
(b) Level 2
(c) Level 3
(d) Level 4
Finer adjacent cluster
Finer neighbor cluster
Far-field cluster
Vertex-sharing cluster
Neighbor cluster
Cluster considered
FIG. 3.1. Interaction list under the hybrid weak admissibility condition (3.1) with and L = 4. At level 3, finer neighbor clusters (pink color) are considered admissible. At level 4, adjacent clusters (blue color) are considered admissible.

(a) Level 1

(b) Level 2

(c) Level 3
Dense diagonal block
Dense neighbor block
Compressed finer neighbor block

(d) Level 4
Compressed vertex-sharing block
Compressed far-field block
Compressed finer adjacent block
FIG. 3.2. Hierarchical matrix under the hybrid weak admissibility condition at different levels. A zoomed-in view shows how the hierarchical matrices are constructed when and L = 4.
NEW HIERARCHICAL MATRICES FOR FAST KERNEL MVP WITH APPLICATIONS 11
interaction list. More precisely, from level 1 to of the tree, we partition the interaction list into the far-field interaction list denoted as and the vertex-sharing interaction list denoted as , i.e., with . The visual representation of this partitioning is illustrated in Figure 3.3.

(a)

(b)

(c)
FIG. 3.3. Partitioning of at level 3 in 2D.
Since the far-field clusters are separated, NCA with bottom to top pivot selection (B2T NCA) [33, 17] is applied to , and the corresponding bases are formed in a nested manner. On the other hand, ACA is applied to , with bases constructed in a non-nested manner. Under the hybrid admissibility condition, adjacent clusters are treated as admissible at finer levels, and the corresponding matrix blocks are compressed using ACA.
The -matrix for fast matrix-vector product is discussed in the following steps:
-
Initialization of -matrix representation (Subsection 3.1.1)
-
-matrix-vector product (MVP) (Subsection 3.1.2)
3.1.1. Initialization of -matrix representation. We describe the initialization procedure in detail as follows:
- B2T NCA for far-field interaction. We apply the B2T NCA only to the far-field interactions, i.e., . In the B2T NCA, the global row and column indices of the leaf clusters are considered to apply ACA and extract the pivots. For non-leaf clusters, ACA is applied to the pivots from the children-level clusters. The search spaces of the pivots for a particular cluster are illustrated in Figure 3.4. This process recursively goes from bottom to top of the tree (from level to level 2 of the tree) to generate all the required pivots. The B2T NCA is performed from level to level 2 of the tree. The pseudocode of B2T NCA is given in Algorithm 3.1.
The translation operators corresponding to far-field interactions are constructed as described in Subsection 2.4.1. We get the following sets of operators:
(a) P2M and M2M , .
(b) M2L , .
(c) L2L , and L2P .

Cluster considered
Far-field cluster
• Pivot
FIG. 3.4. Illustration of search spaces of the pivots in B2T NCA.
RITESH KHAN, SIVARAM AMBIKASARAN
Algorithm 3.1 B2T NCA for far-field interactions.
1: for do 2: for do 3: cluster at level of tree. 4: I.clear() 5: J.clear() 6: if then 7: I.insert( ) 8: for do 9: J.insert( ) 10: end for 11: else 12: 13: for do 14: J.insert(Y) 15: end for 16: end if 17: 18: end for 19: end for
- ACA for vertex-sharing interaction. The vertex-sharing interaction is compressed using partially pivoted ACA [7]. For each admissible block , , the vertex-sharing interaction block matrix is compressed by partially pivoted ACA with user-given tolerance as follows:
.
Algorithm 3.2 outlines the vertex-sharing compression routine.
Algorithm 3.2 ACA for vertex-sharing interactions.
1: for do 2: for do 3: cluster at level of tree. 4: for do 5: 6: end for 7: end for 8: end for
- ACA at the switching level. At the switching level , the block matrix is compressed using partially pivoted ACA, where and . The detailed algorithm is presented in Algorithm 3.3.
Algorithm 3.3 ACA at the switching level ().
1: for do 2: cluster at the level of tree. 3: for do 4: 5: end for 6: end for
▷ At switching level
▷ Perform ACA to with tolerance .
NEW HIERARCHICAL MATRICES FOR FAST KERNEL MVP WITH APPLICATIONS 13
- ACA at finer levels. The finer level block matrices from level to level L, which are relatively smaller in size, are compressed using ACA as described in Algorithm 3.4.
Algorithm 3.4 ACA at level to level .
1: for do 2: for do 3: cluster at level of tree. 4: for do 5: 6: end for 7: end for 8: end for
3.1.2. -matrix-vector product (MVP). Once we have the -matrix representation, it can be applied to a column vector to compute fast MVP or potential, i.e., . Both nested and non-nested approaches are used to compute MVP. The detailed procedure is given below.
- Far-field MVP. We compute the MVP associated with far-field interaction using upward, transverse and downward tree traversal, similar to the -MVP algorithm.
(a) Upward traversal
• Particles to multipole (P2M) at level :
For all clusters , calculate
.
• Multipole to multipole (M2M) at levels :
For all clusters , calculate
.
(b) Transverse traversal
• Multipole to local (M2L) at levels :
For all cluster , calculate
.
(c) Downward traversal
• Local to local (L2L) at levels :
For all clusters , calculate
• Local to particles (L2P) at level :
For all leaf clusters , calculate
.
- Vertex-sharing MVP. The MVP associated with the vertex-sharing interaction is calculated through a single tree traversal in a non-nested manner, analogous to the H-MVP. The details are presented in Algorithm 3.5.
RITESH KHAN, SIVARAM AMBIKASARAN
Algorithm 3.5 Vertex-sharing matrix-vector product
1: 2: for do 3: for do 4: cluster at level of tree. 5: for do. 6: 7: end for 8: end for 9: end for
- Switching level MVP. At switching level ( ), the MVP is computed in a non-nested manner as described in Algorithm 3.6.
Algorithm 3.6 Switching level matrix-vector product
1: 2: for do 3: cluster at the level of tree. 4: for do 5: 6: end for 7: end for
- Finer levels MVP. At the finer levels, from to , the MVP is computed in a non-nested manner, following the procedure outlined in Algorithm 3.7.
Algorithm 3.7 Finer levels matrix-vector product
1: for do 2: for do 3: cluster at level of tree. 4: for do 5: 6: end for 7: end for 8: end for
Final computed MVP. For every leaf cluster , we add the MVP associated with self-interaction, which is a direct computation . Hence, the final computed MVP of the leaf cluster is given by
(Nested)
(Non-nested)
(Non-nested)
(Direct)
Since denotes the MVP corresponding to the leaf cluster , the computed MVP can be expressed in MATLAB notation as .
Remark 3.1. For -matrix format, we consider . If , the neighboring blocks are not compressed and are instead treated as usual dense blocks. In this case, the resulting matrix structure reduces to the format of [26]. On the other hand, yields the HODLR matrix format ( -tree-based), since in this case only Algorithm 3.4 and Algorithm 3.7 remain active.
NEW HIERARCHICAL MATRICES FOR FAST KERNEL MVP WITH APPLICATIONS 15
3.1.3. Complexity analysis of -matrix. The cost of B2T NCA is [33], while the cost of ACA . Therefore, the overall initialization cost scales quasi-linearly.
The cost of far-field MVP is and all other steps scale quasi-linearly.
3.2. -matrix. The -matrix algorithm can be further improved by employing nested bases for vertex-sharing interactions, resulting in the -matrix algorithm. In -matrix representation, vertex-sharing interactions are compressed using NCA with top to bottom pivot selection (T2B NCA) [33], leading to improved memory requirements and MVP computations. The difference between the and the representations is the vertex-sharing interactions compression routine.
The -matrix for fast matrix-vector product is discussed in the following steps:
-
Initialization of -matrix representation (Subsection 3.2.1)
-
-matrix-vector product (MVP) (Subsection 3.2.2)
3.2.1. Initialization of -matrix representation. The initialization procedure differs from that of the -matrix only in Step 2 and is detailed as follows:
-
B2T NCA for far-field interaction. Analogous to Algorithm 3.1.
-
T2B NCA for vertex-sharing interaction. The T2B NCA is applied only to the vertex-sharing interactions, i.e., . The parent-level pivots are added to the child clusters, and the tree is traversed in a top to bottom manner (from level 1 to level of the tree), as detailed in Algorithm 3.8. The search spaces of the pivots for a particular cluster are illustrated in Figure 3.5.

Cluster considered
Parent-level vertex-sharing cluster
Vertex-sharing cluster
• Pivot
FIG. 3.5. Illustration of search spaces of the pivots in T2B NCA for -matrix.
Algorithm 3.8 T2B NCA for vertex-sharing interactions.
1: for do ▷ Traverse the tree from top to bottom direction
2: for do
3: cluster at level of tree.
4:
5: for do
6:
7: if then
8: ▷ Add parent-level pivots
9: end if
10: end for
11: ▷ Perform ACA with tolerance
12: end for
13: end for
The translation operators corresponding to vertex-sharing interactions are constructed as described in Subsection 2.4.1. We get the following sets of operators:
RITESH KHAN, SIVARAM AMBIKASARAN
(a) P2M and M2M , .
(b) M2L , .
(c) L2L , and L2P .
-
ACA at the switching level. Analogous to Algorithm 3.3.
-
ACA at finer levels. Analogous to Algorithm 3.4.
3.2.2. -matrix-vector product (MVP). We apply -matrix representation to a column vector to compute fast MVP, i.e., . The MVPs associated with the far-field and vertex-sharing are evaluated in a nested manner, while MVPs at the finer levels are obtained in a non-nested manner, as follows:
-
Far-field MVP. Analogous to the corresponding step of -matrix.
-
Vertex-sharing MVP The MVP corresponding to the vertex-sharing interactions is computed using upward, transverse and downward tree traversal, as given below.
(a) Upward traversal
• Particles to multipole (P2M) at level :
For all clusters , calculate
• Multipole to multipole (M2M) at levels :
For all clusters , calculate
(b) Transverse traversal
• Multipole to local (M2L) at levels :
For all cluster , calculate
(c) Downward traversal
• Local to local (L2L) at levels :
For all clusters , calculate
• Local to particles (L2P) at level :
For all leaf clusters , calculate
-
Switching level MVP. Analogous to Algorithm 3.6.
-
Finer levels MVP. Analogous to Algorithm 3.7.
Final computed MVP. For every leaf cluster , we add the MVP associated with self-interaction, which is a direct computation. Hence, the final computed MVP of the leaf cluster X is given by
(Nested)
(Nested)
(Non-nested)
(Direct)
The computed MVP can be expressed as .
Remark 3.2. The B2T NCA is not suitable for vertex-sharing interactions because the rank associated with these interactions increases, as demonstrated in [26]. Although the T2B NCA can be applied to the entire interaction list , doing so incurs a high initialization cost (see [26]). Thus, a more efficient strategy is to partition the interaction list, applying the B2T NCA to far-field interactions and the T2B NCA to vertex-sharing interactions.
Remark 3.3. For -matrix format, we consider . If , the neighboring blocks are not compressed and are instead treated as usual dense blocks. In this case, the resulting matrix structure reduces to the -matrix format of [26]. On the other hand, yields the HODLR matrix format ( -tree-based).
3.2.3. Complexity analysis of -matrix. The cost of T2B NCA (step 2) is [33], resulting in an overall quasi-linear complexity. Although the initialization of and exhibits the same asymptotic complexity, is observed to be slightly more computationally expensive because T2B NCA incurs a higher computational cost than ACA. However, the -MVP is faster than -MVP due to the use of nested bases for vertex-sharing interactions. This is shown in Section 4.
3.3. Advantages of the proposed algorithms. We investigate the condition under which the proposed hybrid weak admissibility-based algorithms offer advantages over the uniform weak admissibility-based (weak admissibility condition (2.4) is applied at all levels) algorithms proposed in [26].
Let , and denote the admissible, neighbor, and dense blocks, respectively. The subscript represents the admissibility condition, while the superscript indicates the number of blocks across levels of the tree. The front symbols LR and D represent the low-rank (cost: ) and dense matrix (cost: ) formats, respectively. More precisely, represents the storage cost of all admissible blocks stored in low-rank format under the weak admissibility condition (2.4) across the hierarchical levels 1 through .
The total storage cost of the proposed hybrid weak admissibility-based algorithms is given by
(3.2)
The total storage cost of the (uniform) weak admissibility-based algorithms [26] is given by
(3.3)
The proposed hybrid algorithms avoid constructing translation operators at the finer levels of the tree, where the block sizes are relatively small. Instead, the corresponding matrix blocks are compressed in a non-nested manner, thereby reducing the computational overhead of constructing and applying translation operators. Furthermore, the proposed algorithms do not involve neighbor blocks, and the diagonal blocks are only dense blocks. This significantly reduces the number of dense matrix operations, resulting in improved computational efficiency and faster overall execution. Hence, the efficiency of the hybrid hierarchical matrix algorithms is determined by the cost incurred at the finer levels of the hierarchy.
We establish the following condition that guarantees the computational advantage of the proposed hybrid algorithm. From (3.2) and (3.3), we obtain
(3.4)
Therefore, the proposed algorithms are advantageous in terms of storage requirements and MVP execution costs if . We compare proposed hybrid algorithms with their counterparts based on (uniform) weak admissibility in Subsection 4.1.
RITESH KHAN, SIVARAM AMBIKASARAN
A natural question that arises is how to identify an optimal switching level , which maximizes the performance gains over the uniformly weak admissibility-based counterparts, i.e.,
In practice, one may evaluate for to identify the optimal switching level. However, this can be computationally expensive. Therefore, in all numerical experiments reported in Section 4, we heuristically fix for simplicity.
- Numerical results. In this section, we present numerical experiments to assess the performance of the proposed hybrid weak admissibility-based hierarchical matrices compared with their uniformly weak admissible counterparts. Furthermore, we demonstrate the applicability of the proposed algorithms to real-world problems, including fast principal component analysis in Gaussian processes and fast kernel ridge regression. In Table 4.1, we summarize some notations used in this section.
| Maximum number of particles at leaf-clusters. We set . | |
|---|---|
| represent the hierarchical matrix representation of the original kernel matrix . | |
| Mem. | Total memory (in GB) needed to store the hierarchical low-rank representation (). |
| Time taken (in s) to initialize the hierarchical representation | |
| Time taken (in s) to compute the fast MVP (). | |
| The time taken (in s) to compute the direct MVP. | |
| The 2-norm relative error in the MVP. | |
| #iter | The number of iterations of the CG to reach the stopping condition. |
TABLE 4.1
Notations used in this section for various numerical experiments.
All the algorithms are implemented in C++, and the experiments are performed on an Intel Xeon(R) 2.30GHz processor with 4 OpenMP threads.
4.1. Fast MVP in 3D. We consider uniformly distributed particles located at in the cube . The kernel function is chosen as the single-layer Laplacian in 3D, and the entry of the kernel matrix is given by
We compare the proposed hybrid weak admissibility-based and formats with their (uniform) weak admissibility-based counterparts, and , respectively, where the weak admissibility condition (2.4) is applied to all the levels. Additionally, we compare these formats with the standard admissibility-based -matrix format (the interaction list is analogous to that in FMM when ). It is worth noting that the leaf-level block size and the depth of the tree are kept the same for all -matrix formats. A summary of the different -matrix formats is provided in Table 4.2 for ease of comparison.
We randomly select 5 different column vectors and perform the -matrix-vector products using different -matrix formats. The memory to store the -matrix format (Mem), average initialization time , -MVP time , the
| H-matrix | Short description | Admissibility condition/Admissible clusters | Compression technique(s) | Type of bases |
|---|---|---|---|---|
| This work, see Subsection 3.1. | Hybrid weak admissibility (3.1)/Coarser levels: far-field, vertex-sharingFiner levels: adjacent | B2T NCA and ACA | Semi-nested and non-nested | |
| This work, see Subsection 3.2. | Hybrid weak admissibility (3.1)/Coarser levels: far-field, vertex-sharingFiner levels: adjacent | B2T NCA, T2B NCA, and ACA | Nested and non-nested | |
| See -matrix of [26]. | Weak admissibility condition (2.4)/far-field and vertex-sharing | B2T NCA and ACA | Semi-nested | |
| See -matrix of [26]. | Weak admissibility condition (2.4)/far-field and vertex-sharing | B2T NCA (far-field) and T2B NCA (vertex-sharing) | Nested | |
| Standard admissibility-based -matrix.We set in (2.1). | Standard admissibility condition (2.1)/far-field | B2T NCA | Nested |
TABLE 4.2
Different -matrix formats and their descriptions.
| N | -matrix | Mem (GB) | (s) | (s) | MFLOP | (s) | |
|---|---|---|---|---|---|---|---|
| 64000 | 0.67 | 2.04 | 0.04 | 156.22 | 8.24 | 2.39E-03 | |
| 0.63 | 2.36 | 0.03 | 150.55 | 8.24 | 2.36E-03 | ||
| 0.75 | 1.77 | 0.06 | 175.02 | 8.24 | 1.53E-03 | ||
| 0.72 | 2.55 | 0.05 | 171.43 | 8.24 | 1.59E-03 | ||
| 0.84 | 2.19 | 0.08 | 202.73 | 8.24 | 1.42E-03 | ||
| 512000 | 6.07 | 27.26 | 0.33 | 1415.69 | 527.61 | 2.24E-03 | |
| 5.36 | 35.46 | 0.28 | 1277.87 | 527.61 | 2.27E-03 | ||
| 7.41 | 21.15 | 0.52 | 1749.71 | 527.61 | 2.17E-03 | ||
| 6.73 | 34.93 | 0.48 | 1618.54 | 527.61 | 2.28E-03 | ||
| 8.32 | 32.53 | 0.72 | 2015.33 | 527.61 | 2.56E-03 | ||
| 1000000 | 8.82 | 46.29 | 0.62 | 2072.14 | 2038.87 | 5.68E-03 | |
| 6.59 | 128.24 | 0.57 | 1617.63 | 2038.87 | 5.67E-03 | ||
| 14.66 | 64.18 | 1.12 | 3535.83 | 2038.87 | 1.19E-03 | ||
| 12.82 | 154.17 | 1.05 | 3173.41 | 2038.87 | 1.22E-03 | ||
| 15.46 | 90.06 | 1.27 | 3834.68 | 2038.87 | 1.21E-03 | ||
| 2197000 | 21.10 | 130.22 | 1.24 | 4975.42 | 10062.11 | 1.72E-03 | |
| 16.84 | 196.17 | 1.08 | 4061.68 | 10062.11 | 2.31E-03 | ||
| 28.84 | 121.06 | 2.12 | 6911.54 | 10062.11 | 1.08E-03 | ||
| 25.75 | 317.42 | 2.12 | 6288.31 | 10062.11 | 1.78E-03 | ||
| 30.77 | 166.23 | 2.52 | 7544.71 | 10062.11 | 1.55E-03 |
TABLE 4.3
Comparison between different -matrix formats when .
mega FLOP count for -MVP (MFLOP), and the relative error in MVP () for different tolerances () are tabulated in Tables 4.3 to 4.5. We also report the direct MVP time ().
From the above tables, we can conclude the following.
-
and outperform their (uniform) weak-admissibility-based counterparts, and , respectively in both memory and MVP time, as in all cases (see (3.4)). Figure 4.1 illustrates the dense and low-rank MFLOP of the and matrices for different tolerances (). It can be seen that, despite employing nested bases at all levels, can be improved in terms of memory requirements and MVP time by using non-nested bases and avoiding the computational overhead of many translation operators at the finer levels.
-
At finer levels, the construction of and is similar. However, achieves better memory efficiency and MVP performance due to the use of
RITESH KHAN, SIVARAM AMBIKASARAN
| N | -matrix | Mem (GB) | (s) | (s) | MFLOP | (s) | |
|---|---|---|---|---|---|---|---|
| 64000 | 1.32 | 7.22 | 0.09 | 312.28 | 8.24 | 8.82E-06 | |
| 1.25 | 15.15 | 0.08 | 302.22 | 8.24 | 8.78E-06 | ||
| 1.61 | 8.52 | 0.13 | 383.94 | 8.24 | 1.07E-05 | ||
| 1.55 | 19.72 | 0.16 | 381.14 | 8.24 | 1.05E-05 | ||
| 1.77 | 19.75 | 0.18 | 435.81 | 8.24 | 8.13E-06 | ||
| 512000 | 13.50 | 116.07 | 1.17 | 3195.32 | 527.61 | 9.03E-06 | |
| 12.03 | 321.77 | 0.95 | 2942.5 | 527.61 | 8.52E-06 | ||
| 17.91 | 136.68 | 1.48 | 4306.96 | 527.61 | 9.99E-06 | ||
| 16.82 | 371.25 | 1.72 | 4140.91 | 527.61 | 1.02E-05 | ||
| 20.64 | 346.29 | 2.42 | 5095.75 | 527.61 | 1.03E-05 | ||
| 1000000 | 28.17 | 280.27 | 2.17 | 6799.32 | 2038.87 | 1.33E-05 | |
| 25.04 | 756.33 | 2.02 | 6228.76 | 2038.87 | 1.44E-05 | ||
| 35.98 | 334.58 | 3.87 | 8745.57 | 2038.87 | 9.76E-06 | ||
| 32.64 | 851.42 | 3.03 | 8129.67 | 2038.87 | 1.21E-05 | ||
| 38.02 | 752.54 | 5.26 | 9473.99 | 2038.87 | 8.93E-06 | ||
| 2197000 | 61.02 | 670.82 | 5.21 | 14598.01 | 10062.11 | 9.22E-06 | |
| 51.30 | 1960.85 | 5.02 | 12675.9 | 10062.11 | 9.45E-06 | ||
| 92.22 | 810.27 | 8.28 | 22385.3 | 10062.11 | 7.34E-06 | ||
| 83.15 | 2217.74 | 7.25 | 20637.3 | 10062.11 | 8.09E-06 | ||
| 99.22 | 1956.33 | 12.52 | 24656.4 | 10062.11 | 1.21E-05 |
TABLE 4.4
Comparison between different -matrix formats when .
| N | -matrix | Mem (GB) | (s) | (s) | MFLOP | (s) | |
|---|---|---|---|---|---|---|---|
| 64000 | 1.99 | 31.02 | 0.17 | 469.93 | 8.24 | 6.23E-08 | |
| 1.87 | 37.68 | 0.16 | 458.75 | 8.24 | 6.25E-08 | ||
| 2.74 | 38.82 | 0.26 | 658.194 | 8.24 | 8.41E-08 | ||
| 2.66 | 47.69 | 0.25 | 656.56 | 8.24 | 8.40E-08 | ||
| 2.97 | 28.64 | 0.26 | 734.94 | 8.24 | 8.88E-08 | ||
| 512000 | 23.34 | 673.86 | 2.20 | 5580.93 | 527.61 | 1.06E-07 | |
| 21.44 | 970.29 | 1.92 | 5294.2 | 527.61 | 1.09E-07 | ||
| 32.21 | 738.83 | 3.06 | 7796.51 | 527.61 | 1.48E-07 | ||
| 30.66 | 1061.46 | 3.05 | 7599.96 | 527.61 | 1.45E-07 | ||
| 35.33 | 542.03 | 3.12 | 8770.46 | 527.61 | 9.98E-08 | ||
| 1000000 | 66.94 | 1711.56 | 6.64 | 16322.1 | 2038.87 | 1.63E-07 | |
| 62.24 | 2523.31 | 6.18 | 15525.8 | 2038.87 | 1.65E-07 | ||
| 70.77 | 1834.98 | 7.29 | 17278.6 | 2038.87 | 1.02E-07 | ||
| 65.61 | 2660.71 | 6.98 | 16365.9 | 2038.87 | 6.40E-07 | ||
| 77.98 | 1534.66 | 7.42 | 19465.5 | 2038.87 | 2.34E-07 | ||
| 2197000 | 131.78 | 4191.8 | 14.51 | 31838.8 | 10062.11 | 2.35E-07 | |
| 116.71 | 6682.92 | 12.73 | 29025.5 | 10062.11 | 2.23E-07 | ||
| 156.17 | 4324.74 | 15.62 | 37877.4 | 10062.11 | 1.13E-07 | ||
| 140.92 | 7012.1 | 15.02 | 35076.3 | 10062.11 | 1.15E-07 | ||
| 164.58 | 3244.51 | 16.32 | 40996.1 | 10062.11 | 2.05E-07 |
TABLE 4.5
Comparison between different -matrix formats when .
NEW HIERARCHICAL MATRICES FOR FAST KERNEL MVP WITH APPLICATIONS 21

(a) .
(b) .
FIG. 4.1. Comparison of the MFLOP of and . For , only the diagonal blocks are dense, whereas both neighboring and diagonal blocks are dense for .
nested bases for vertex-sharing interactions at coarser levels. This can also be observed in other experiments.
- As shown in [26], and outperform the standard admissibility based in terms of memory and MVP time. Arranging the five -matrix formats (Table 4.2) in ascending order of memory usage and MVP time yields
This demonstrates the superior efficiency of the proposed hybrid weak admissibility condition ((3.1)) compared with both (uniform) weak admissibility ((2.4)) and standard admissibility conditions ((2.1)).
4.2. Fast principal component analysis. Gaussian process (GP) is a probabilistic model used in machine learning and statistics to predict outcomes. However, when working with high-dimensional data, GP can become computationally expensive because matrix operations scale poorly with the size and dimensionality of the data. To address this issue, dimension reduction techniques such as principal component analysis are essential. Principal component analysis (PCA) helps by projecting the input data onto a lower-dimensional subspace, retaining the most important information while reducing the number of dimensions. In GP, the covariance matrix is a key component representing the relationships between data points based on the kernel.
We use randomized Nyström approximation [28] to obtain truncated eigenvalue decomposition of the covariance matrix. In the naive randomized Nyström algorithm, computing the top-k eigenvalues and their corresponding eigenvectors requires a computational cost of , where the covariance matrix . The most computationally expensive part of the algorithm is performing matrix-matrix products, such as or . In the fast PCA (see Appendix A), we replace with its hierarchical representations ( ), enabling fast hierarchical matrix-vector products (refer to lines 4 and 5 in Algorithm A.1 and Algorithm A.2, respectively). Hence, it reduces the computational cost to , where .
In this experiment, we consider the Matérn-3/2 covariance kernel and the Gaussian kernel with N randomly generated points in the cube . We set
RITESH KHAN, SIVARAM AMBIKASARAN
and in Algorithm A.2 and compute top-100 eigenpairs of the covariance matrices. In total, 220 MVPs are performed. For the fast PCA method, we set the tolerance to construct . In the direct PCA algorithm, MVPs are carried out using the Eigen library.
We present the performance of the fast PCA over direct PCA in Table 4.6. In addition, we report the memory and relative error , where and represent the eigenvalues computed using fast PCA and direct PCA, respectively. As observed from Table 4.6, the memory and time of fast PCA scales quasi-linearly with , whereas the direct PCA demonstrates quadratic scaling.
| -matrix | Mem(GB) | Time (s) | |||||
|---|---|---|---|---|---|---|---|
| 1000 | |||||||
| 8000 | |||||||
| 64000 | |||||||
| 512000 | |||||||
TABLE 4.6
Comparison between -matrix accelerated PCA (FPCA) and direct PCA (DPCA) for Matérn-3/2 covariance kernel. scales as .
| -matrix | Mem(GB) | Time (s) | |||||
|---|---|---|---|---|---|---|---|
| 1000 | |||||||
| 8000 | |||||||
| 64000 | |||||||
| 512000 | |||||||
TABLE 4.7
Comparison between -matrix accelerated PCA (FPCA) and direct PCA (DPCA) for Gaussian kernel. scales as .
4.3. Fast kernel ridge regression. We discuss a fast iterative solution for regularized linear systems (4.2), which frequently arise in many applications, such as kernel ridge regression (a supervised learning technique) [1].
where is a symmetric positive definite (SPD) kernel matrix and regularization parameter .
(B.1) is typically ill-conditioned, leading to slow convergence for the iterative solver. Hence, a preconditioner for the iterative solver is essential. We use randomized Nyström preconditioner [12] here. Thus, (4.2) is solved in the following steps.
-
We construct the fast randomized Nyström preconditioner as described in Appendix B.1.
-
Once we have the preconditioner , we use it in the fast preconditioned conjugate gradient (PCG) method. This is outlined in Appendix B.2.
In both steps, we employ the hierarchical representation of , i.e., , to accelerate the associated MVPs.
For a numerical experiment, we consider the Matérn-1/2 kernel (exp ) with . Synthetic datasets are generated by randomly distributing points, , in the cube . We use points for training and additional points for testing. The corresponding output values are denoted by . The hierarchical representation is formed by setting tolerance . is used to construct the fast randomized Nyström preconditioner and to accelerate the MVP in CG. While constructing the fast randomized Nyström preconditioner, we set rank . For CG, the maximum number of iterations is 500 with stopping tolerance .
The performance of fast Nyström PCG is presented in Table 4.8. We report the root mean squared error (RMSE) between the predicted and true values. represents the time taken to construct the fast Nyström preconditioner and perform the fast PCG. We also benchmark the solution of (4.2) using the diagonal preconditioned conjugate gradient (DPCG) and unpreconditioned conjugate gradient (CG) methods and report the number of iterations for each. It can be noted from Table 4.8 that for , both DPCG and CG fail to converge within 500 iterations, whereas the fast Nyström PCG (FNPCG) method converges.
| N | H-matrix | RMSE | Time (s) | # Iter | ||||
|---|---|---|---|---|---|---|---|---|
| FNPCG | DPCG | CG | ||||||
| 1000 | 0.2 % | 0.008 | 0.15 | 0.158 | 9 | 112 | 156 | |
| 0.2 % | 0.008 | 0.13 | 0.138 | 10 | 112 | 156 | ||
| 8000 | 0.9 % | 0.28 | 2.78 | 3.06 | 65 | - | - | |
| 0.9 % | 0.28 | 2.36 | 2.64 | 67 | - | - | ||
| 64000 | 0.8 % | 7.48 | 56.31 | 63.79 | 312 | - | - | |
| 0.8 % | 8.08 | 52.71 | 60.79 | 316 | - | - | ||
TABLE 4.8
Numerical results for the synthetic dataset with Matérn-1/2 kernel. We report the number of iterations for fast Nyström PCG (FNPCG), diagonal PCG (DPCG), and unpreconditioned CG (CG). The symbol “-” indicates that the iterative solver fails to converge within 500 iterations.
- Conclusion. We have presented a new hybrid weak admissibility condition, under which far-field and vertex-sharing clusters are admissible at coarser levels, and adjacent clusters are considered admissible at finer levels. Based on this admissibility condition, we have proposed two new hierarchical matrix formats, and . For the format, we have employed nested bases for far-field interactions and non-nested bases for vertex-sharing interactions. In contrast, for the format, we have employed nested bases for both far-field and vertex-sharing interactions. In both formats, we have used non-nested bases at the finer levels. Numerical experiments have demonstrated that the proposed hybrid hierarchical matrix formats outperform
RITESH KHAN, SIVARAM AMBIKASARAN
their counterparts based on uniform weak admissibility, as well as the standard -matrix format, thereby illustrating the effectiveness of the proposed hybrid weak admissibility condition. We have further applied the proposed hierarchical matrix formats to the acceleration of principal component analysis in Gaussian processes and kernel ridge regression problems. The C++ implementation of the proposed hierarchical matrix algorithms is publicly available at https://github.com/riteshkhan/Hhweak.
Acknowledgment. R.K. acknowledges support from the European Union (ERC, inEXASCALE, Grant No. 101075632) and the Charles University Research Centre program (No. UNCE/24/SCI/005).
REFERENCES
[1] A. ALAOUI AND M. W. MAHONEY, Fast randomized kernel ridge regression with statistical guarantees, Advances in neural information processing systems, 28 (2015).
[2] I. AMBARTSUMYAN, W. BOUKARAM, T. BUI-THANH, O. GHATTAS, D. KEYES, G. STADLER, G. TURKIYYAH, AND S. ZAMPINI, Hierarchical matrix approximations of hessians arising in inverse problems governed by pdes, SIAM Journal on Scientific Computing, 42 (2020), pp. A3397–A3426.
[3] S. AMBIKASARAN AND E. DARVE, An fast direct solver for partial hierarchically semi-separable matrices, Journal of Scientific Computing, 57 (2013), pp. 477–501.
[4] S. AMBIKASARAN, R. KHAN, J. TAUSCH, AND S. WANG, A hybrid interpolation aca accelerated method for parabolic boundary integral operators, SIAM Journal on Scientific Computing, 47 (2025), pp. A1507–A1526.
[5] S. AMBIKASARAN, K. R. SINGH, AND S. S. SANKARAN, HODLRlib: A library for hierarchical matrices, Journal of Open Source Software, 4 (2019), p. 1167.
[6] P. AMESTOY, A. BUTTARI, J.-Y. L'EXCELLENT, AND T. MARY, On the complexity of the block low-rank multifrontal factorization, SIAM Journal on Scientific Computing, 39 (2017), pp. A1710–A1740.
[7] M. BEBENDORF AND S. RJASANOW, Adaptive low-rank approximation of collocation matrices, Computing, 70 (2003), pp. 1–24.
[8] M. BEBENDORF AND R. VENN, Constructing nested bases approximations from the entries of non-local operators, Numerische Mathematik, 121 (2012), pp. 609–635.
[9] S. BÖRM, Construction of data-sparse -matrices by hierarchical compression, SIAM Journal on Scientific Computing, 31 (2009), pp. 1820–1839.
[10] S. BÖRM, L. GRASEDYCK, AND W. HACKBUSCH, Hierarchical matrices, Lecture notes, 21 (2003), p. 2003.
[11] S. CHANDRASEKARAN, P. DEWILDE, M. GU, W. LYONS, AND T. PALS, A fast solver for HSS representations via sparse matrices, SIAM Journal on Matrix Analysis and Applications, 29 (2007), pp. 67–81.
[12] Z. FRANGELLA, J. A. TROPP, AND M. UDELL, Randomized nyström preconditioning, SIAM Journal on Matrix Analysis and Applications, 44 (2023), pp. 718–752.
[13] A. GILLMAN, P. M. YOUNG, AND P.-G. MARTINSSON, A direct solver with complexity for integral equations on one-dimensional domains, Frontiers of Mathematics in China, 7 (2012), pp. 217–247.
[14] L. GRASEDYCK AND W. HACKBUSCH, Construction and arithmetics of h-matrices, Computing, 70 (2003), pp. 295–334.
[15] A. GRAY AND A. MOORE, N-body'problems in statistical learning, Advances in neural information processing systems, 13 (2000).
[16] L. GREENGARD AND V. ROKHLIN, A fast algorithm for particle simulations, Journal of computational physics, 73 (1987), pp. 325–348.
[17] V. GUJJULA AND S. AMBIKASARAN, A new nested cross approximation, arXiv preprint arXiv:2203.14832, (2022).
[18] W. HACKBUSCH, A sparse matrix arithmetic based on H-matrices. part i: Introduction to H-matrices, Computing, 62 (1999), pp. 89–108.
[19] W. HACKBUSCH, Hierarchical Matrices: Algorithms and Analysis, vol. 49, Springer, 12 2015, https://doi.org/10.1007/978-3-662-47324-5.
[20] W. HACKBUSCH AND B. N. Khoromskij, A sparse H-matrix arithmetic. part ii: Application to multi-dimensional problems, Computing, 64 (2000), pp. 21–47.
[21] W. HACKBUSCH, B. N. Khoromskij, AND R. Kriemann, Hierarchical matrices based on a
NEW HIERARCHICAL MATRICES FOR FAST KERNEL MVP WITH APPLICATIONS 25
weak admissibility criterion, Computing, 73 (2004), pp. 207–243.
[22] N. HALKO, P. G. MARTINSSON, AND J. A. TROPP, Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions, SIAM review, 53 (2011), pp. 217–288.
[23] J. HARLIM, D. SANZ-ALONSO, AND R. YANG, Kernel methods for bayesian elliptic inverse problems on manifolds, SIAM/ASA Journal on Uncertainty Quantification, 8 (2020), pp. 1414–1445.
[24] K. L. HO AND L. YING, Hierarchical interpolative factorization for elliptic operators: integral equations, arXiv preprint arXiv:1307.2666, (2013).
[25] V. A. KANDAPPAN, V. GUJJULA, AND S. AMBIKASARAN, HODLR2D: A new class of hierarchical matrices, arXiv preprint arXiv:2204.05536, (2022).
[26] R. KHAN AND S. AMBIKASARAN, New algebraic fast algorithms for N-body problems in two and three dimensions, Communications in Computational Physics, 37 (2025), pp. 1157–1226.
[27] R. KHAN, V. A. KANDAPPAN, AND S. AMBIKASARAN, HODLRdD: A new black-box fast algorithm for N-body problems in d-dimensions with guaranteed error bounds: Applications to integral equations and support vector machines, Journal of Computational Physics, 501 (2024), p. 112786, https://doi.org/10.1016/j.jcp.2024.112786.
[28] P.-G. MARTINSSON AND J. A. TROPP, Randomized numerical linear algebra: Foundations and algorithms, Acta Numerica, 29 (2020), pp. 403–572.
[29] S. MASSEI, L. ROBOL, AND D. KRESSNER, Hierarchical adaptive low-rank format with applications to discretized partial differential equations, Numerical Linear Algebra with Applications, 29 (2022), p. e2448.
[30] C. E. RASMUSSEN, Gaussian Processes in Machine Learning, Springer Berlin Heidelberg, Berlin, Heidelberg, 2004, pp. 63–71, https://doi.org/10.1007/978-3-540-28650-9_4, https://doi.org/10.1007/978-3-540-28650-9_4.
[31] J. XIA, S. CHANDRASEKARAN, M. GU, AND X. S. LI, Fast algorithms for hierarchically semiseparable matrices, Numerical Linear Algebra with Applications, 17 (2010), pp. 953–976.
[32] C. YANG, R. DURAISWAMI, N. A. GUMEROV, AND L. DAVIS, Improved fast gauss transform and efficient kernel density estimation, in Computer Vision, IEEE International Conference on, vol. 2, IEEE Computer Society, 2003, pp. 464–464.
[33] Y. ZHAO, D. JIAO, AND J. MAO, Fast nested cross approximation algorithm for solving large-scale electromagnetic problems, IEEE Transactions on Microwave Theory and Techniques, 67 (2019), pp. 3271–3283.
RITESH KHAN, SIVARAM AMBIKASARAN
Appendix A. Fast principal component analysis. The randomized Nyström approximation algorithm can be found in [22, 28]. In the original algorithm, the most computationally expensive part is matrix-matrix products, such as or . We accelerate these operations by replacing the covariance matrix with its hierarchical representations , leading to fast principal component analysis (see Algorithm A.1 and Algorithm A.2).
Algorithm A.1 Fast randomized range finder
1: Input: Hierarchical representation of , denoted as and 2: Output: 3: function FAST RANDOMIZED RANGE FINDER() 4: 5: 6: 7: end function
We perform fast MVPs Thin QR factorization
Algorithm A.2 Fast Nyström approximation of , i.e.,
1: Input: Hierarchical representation of SPD matrix , and rank 2: Output: Rank- approximation , where , 3: function FAST NYSTRÖM APPROXIMATION() 4: From Algorithm A.1 5: 6: 7: 8: 9: 10: 11: 12: . 13: and 14: end function
Appendix B. Fast kernel ridge regression. Regularized linear systems, like (B.1), arise in many applications, including kernel ridge regression.
(B.1)
where is a symmetric positive definite (SPD) kernel matrix and regularization parameter .
We leverage the hierarchical representation of , i.e., , to construct the Nyström preconditioner (see Appendix B.1) and accelerate MVPs in the conjugate gradient algorithm (see Appendix B.2).
B.1. Fast randomized Nyström preconditioner. The randomized Nyström preconditioner and its inverse are given as follows:
(B.2)
NEW HIERARCHICAL MATRICES FOR FAST KERNEL MVP WITH APPLICATIONS 27
(B.3)
where and is the eigenvalue.
The naive cost to construct the Nyström preconditioner scales as . However, the factors associated with the Nyström preconditioner, and , are obtained using the fast Nyström Approximation (see Algorithm A.2), leading to computational cost .
B.2. Fast PCG. The fast randomized Nyström preconditioner is used as a left-preconditioner in the CG algorithm. The MVPs in PCG are accelerated using the hierarchical representation (see Algorithm B.1), resulting in fast PCG.
Algorithm B.1 Fast PCG
1: Input: Hierarchical representation of the matrix K, denoted as , regularization parameter , right hand side b, initial guess , CG tolerance and .
2: Output: Approximate solution
3: function PCG( , , b, , , )
4:
5:
6:
7: while do
8:
9:
10:
11:
12:
13:
14:
15: end while
16: end function
The overall computational cost for constructing the fast Nyström preconditioner (Appendix B.1) and executing the fast PCG (Appendix B.2) scales quasi-linearly with N.