arXiv:2610.40195math.NAOct 2026

Manuscript Offprint

arXiv:2610.40195

New hierarchical matrices for fast kernel matrix-vector products with Applications to Gaussian processes and kernel ridge regression

Ritesh Khan, Sivaram Ambikasaran

RITESH KHAN ∗^{*} AND SIVARAM AMBIKASARAN †^{\dagger}

Abstract. This article presents two new multilevel hierarchical matrices to perform fast kernel matrix-vector product in dd dimensions (d>1d > 1), namely Hhw′\mathcal{H}_{hw}^{\prime}, Hhw′′\mathcal{H}_{hw}^{\prime\prime}. 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 Hhw′\mathcal{H}_{hw}^{\prime} and Hhw′′\mathcal{H}_{hw}^{\prime\prime} 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 H\mathcal{H} and H2\mathcal{H}^{2} 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 H2\mathcal{H}^{2}-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, H2H^{2}-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

  1. 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 NN points {xi}i=1N\{x_i\}_{i=1}^N, an N×NN \times N kernel matrix is defined by
K(i,j)=f(xi,xj),1≤i,j≤N,K\left(i,j\right)=f\left(\boldsymbol{x}_{i},\boldsymbol{x}_{j}\right),\qquad1\leq i,j\leq N,

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], H2H^{2}-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

†^{\dagger} 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 H2H^{2}-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 H2H^{2}-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 ℓ<L\ell < L, where LL 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 ℓ\ell (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 LL. Thus, lowering the associated computational and storage costs. We develop two different H\mathcal{H}-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 H\mathcal{H}-matrix formats are advantageous over their uniform counterparts.

The following are the main contributions of this article.

  1. 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.

  2. We propose a new hierarchical matrix format, Hhw′\mathcal{H}_{hw}^{\prime}, 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.

  3. We further enhance the Hhw′\mathcal{H}_{hw}^{\prime} format by employing nested bases for the vertex-sharing interactions at coarser levels, resulting in the improved hierarchical matrix format Hhw′′\mathcal{H}_{hw}^{\prime\prime}.

  4. 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.

  1. 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 Ω⊂Rd\Omega \subset \mathbb{R}^d denote a domain containing NN particles (or points), whose interactions are represented by a dense matrix K∈RN×NK \in \mathbb{R}^{N \times N}. We further assume that Ω\Omega is contained within a dd-dimensional hypercube CC. We subdivide the hypercube CC 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], kk-d tree [5], etc. For simplicity, we consider the 2d2^d balanced tree (e.g., for d=3d = 3, it is balanced oct tree) throughout this article. At level 0 (the root level), the hypercube CC itself. Each hypercube Ci(l)C_i^{(l)} at level ll is subdivided into 2d2^d finer hypercubes Cα(l+1)C_\alpha^{(l+1)}, where α=1,2,…,2d\alpha = 1, 2, \ldots, 2^d, which belong to level l+1l+1 of the tree. The former is the parent of the latter, and the latter are its children. The cluster Ci(l)\mathcal{C}_i^{(l)} is defined as the collection of the indices corresponding to the particles in the hypercube Ci(l)C_i^{(l)}. Clusters at the same level that share a common parent are called siblings. The set of all siblings of Ci(l)C_i^{(l)} is denoted by siblings(Ci(l)C_i^{(l)}). We stop the subdivision at a level LL (the leaf level) of the tree when each finest hypercube contains at most nmaxn_{max} particles, where nmaxn_{max} is a user-specified threshold that defines the maximum number of particles at each finest hypercube. The finest hypercubes at level LL are called the leaves. Let TL\mathcal{T}^L represent the balanced 2d2^d tree with depth LL. Figure 2.1 illustrates the balanced quad tree at different levels in 2D. It can be noted that N≤nmax2dL  ⟹  L=⌈log⁡2d(N/nmax)⌉N \leq n_{max} 2^{dL} \implies L = \lceil \log_{2^d} (N/n_{max}) \rceil.

Figure

(a) Level 1

Figure

(b) Level 2

Figure

(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 2d2^d-tree, with corresponding hypercubes CiC_i and CjC_j, 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, KX,Y∈C∣I∣×∣J∣K_{X,Y} \in \mathbb{C}^{|I| \times |J|}, is approximated by a low-rank matrix with a prescribed tolerance ϵ\epsilon. 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 X×YX \times Y, or the pair of clusters (X,Y)(X, Y), is said to be admissible under the standard (or strong) admissibility

RITESH KHAN, SIVARAM AMBIKASARAN

condition, if the following condition holds:

(2.1)

admη(X,Y)=true  ⟺  min⁡(diam(Ci),diam(Cj))dist(Ci,Cj)≤η,\mathrm{a d m}_{\eta}\left(X,Y\right)=\mathrm{t r u e}\iff\frac{\min(\mathrm{d i a m}(C_{i}),\mathrm{d i a m}(C_{j}))}{\mathrm{d i s t}(C_{i},C_{j})}\leq\eta,

where

diam(U)=sup⁡{∥α−β∥2:α,β∈U}\mathrm{diam}(U)=\sup\{\|\alpha-\beta\|_{2}:\alpha,\beta\in U\}

and

dist(U,V)=inf⁡{∥u−v∥2:u∈U,v∈V}.\mathrm{dist}(U,V)=\inf\{\|u-v\|_{2}:u\in U,v\in V\}.

The admissibility parameter η>0\eta > 0 controls the separation distance and the number of admissible pairs. From (2.1), it follows that the smaller the η\eta, the further apart the admissible clusters; conversely, the larger the η\eta, 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

ILη(X):={Y:admη(X,Y)=trueandadmη(parent(X),parent(Y))=false}.\mathcal{I L}_{\eta}\left(X\right):=\left\{Y:\mathrm{a d m}_{\eta}\left(X,Y\right)=\mathrm{t r u e}\mathrm{a n d}\mathrm{a d m}_{\eta}\left(\mathrm{p a r e n t}\left(X\right),\mathrm{p a r e n t}\left(Y\right)\right)=\mathrm{f a l s e}\right\}.

The neighbors list of X is given by

Nη(X):={Y:admη(X,Y)=falseandY≠X}.\mathcal{N}_{\eta}\left(X\right):=\left\{Y:\mathrm{a d m}_{\eta}\left(X,Y\right)=\mathrm{f a l s e}\mathrm{a n d}Y\neq X\right\}.

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 η=2\eta = \sqrt{2} in (2.1).

The corresponding hierarchical matrix at different levels is shown in Figure 2.4.

Figure

(a) Level 1

Figure

(b) Level 2

Figure

(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 2d2^{d}-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)

∣ILη(X)∣≤(2d−1)(1+2d/η)d,∣Nη(X)∣≤(1+2d/η)d−1.|\mathcal{I L}_{\eta}(X)|\leq\left(2^{d}-1\right)\left(1+2\sqrt{d}/\eta\right)^{d},\qquad|\mathcal{N}_{\eta}(X)|\leq\left(1+2\sqrt{d}/\eta\right)^{d}-1.

In particular, η=d\eta = \sqrt{d} in (2.1) yields a structure identical to balanced FMM (analytic counterpart of H2\mathcal{H}^2-matrices) [16], leading to

(2.3)

∣ILd(X)∣≤(2d−1)3d,∣Nd(X)∣≤(3d−1).\left|\mathcal{I L}_{\sqrt{d}}(X)\right|\leq\left(2^{d}-1\right)3^{d},\qquad\left|\mathcal{N}_{\sqrt{d}}(X)\right|\leq\left(3^{d}-1\right).

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 dd dimensions (d>1d > 1), or more generally to multi-dimensional settings, is not discussed in [21]. A straightforward extension to dd 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 dd dimensions with d>1d > 1, except for the vertex-sharing interaction sub-matrix, the rank of all other adjacent interactions sub-matrices grows with some positive power of NN [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 dd dimensions. The block X×YX \times Y, or the pair of clusters (X,Y)(X, Y), is said to be admissible under our weak admissibility condition if the following condition holds:

(2.4)

adm∗(X,Y)=true  ⟺  dim⁡(Ci∩Cj)=0,\mathrm{a d m}_{*}\left(X,Y\right)=\mathrm{t r u e}\iff\dim\left(C_{i}\cap C_{j}\right)=0,

i.e., the intersection of CiC_{i} and CjC_{j} is at most a vertex.

The interaction list of a cluster X is defined as

IL∗(X):={Y:adm∗(X,Y)=true and adm∗(parent(X),parent(Y))=false}.\mathcal{IL}_*(X):=\{Y:\mathrm{adm}_*(X,Y)=\mathrm{true}\text{ and }\mathrm{adm}_*(parent(X),parent(Y))=\mathrm{false}\}.

The neighbors list of X is given by

N∗(X):={Y:adm∗(X,Y)=falseandY≠X}.\mathcal{N}_{*}\left(X\right):=\left\{Y:\mathrm{a d m}_{*}\left(X,Y\right)=\mathrm{f a l s e}\mathrm{a n d}Y\neq X\right\}.

The interaction list and the neighbors list under the weak admissibility condition (2.4) are shown in Figure 2.3.

Figure

(a) Level 1

Figure

(b) Level 2

Figure

(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)

∣IL∗(X)∣≤(2d−1)(3d−2d),∣N∗(X)∣≤(3d−2d−1).|\mathcal{I L}_{*}(X)|\leq\left(2^{d}-1\right)\left(3^{d}-2^{d}\right),\qquad|\mathcal{N}_{*}(X)|\leq\left(3^{d}-2^{d}-1\right).

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 XX and YY be two clusters at the same level of the tree with Y∈IL∗(X)Y \in \mathcal{IL}_*(X). If the corresponding hypercubes CiC_i and CjC_j share a vertex, then dist(Ci,Cj)=0\text{dist}(C_i, C_j) = 0. Since dist(Ci,Cj)=0\text{dist}(C_i, C_j) = 0, no real value of η\eta 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 X×YX \times Y is an admissible block, then the block matrix KX,Y∈Cm×nK_{X,Y} \in \mathbb{C}^{m \times n} is approximated in low-rank form as follows:

KX,Y≈UV∗,where ∣X∣=m,∣Y∣=n and U,V∈Cm×r.K_{X,Y}\approx U V^{*},\qquad\mathrm{w h e r e~}|X|=m,|Y|=n\mathrm{~a n d~}U,V\in\mathbb{C}^{m\times r}.

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 (2.1)(2.1) and weak admissibility (2.4)(2.4) conditions are illustrated in Figure 2.4 and Figure 2.5, respectively. A level-wise comparison helps in understanding the resulting block structures.

Figure

(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 η=d\eta = \sqrt{d} at different levels in 2D (no compression at the level 1).

2.3.1. Adaptive cross approximation. The admissible block matrix KX,YK_{X,Y} can be approximated by ACA [7, 8] as follows:

(2.6)

KX,Y≈KX,Y(r)=UV∗=KX,σY(KτX,σY)−1KτX,YK_{X,Y}\approx K_{X,Y}^{(r)}=U V^{*}=K_{X,\sigma_{Y}}\left(K_{\tau_{X},\sigma_{Y}}\right)^{-1}K_{\tau_{X},Y}

where τX⊂X\tau_X \subset X and σY⊂Y\sigma_Y \subset Y are called the row and column pivots, respectively. The matrix KX,Y(r)K_{X,Y}^{(r)} is the rthr^{th} update of the original matrix KX,YK_{X,Y}. Here, we employ the

Figure

(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 ϵ\epsilon when the following condition is satisfied

(2.7)

∥ur∥2∥vr∥2≤ϵ∥KX,Y(r)∥F\left\|u_{r}\right\|_{2}\left\|v_{r}\right\|_{2}\leq\epsilon\left\|K_{X,Y}^{(r)}\right\|_{F}

where uru_{r} and vrv_{r} are the rthr^{th} column vectors of the matrices U and V, respectively.

2.4. H2\mathcal{H}^{2}-matrices. The H\mathcal{H}-matrix framework can be further improved by employing nested cluster bases, resulting in the H2\mathcal{H}^{2}-matrix format. We construct the H2\mathcal{H}^{2}-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)

KX,Y≈KX,σX(KτX,σX)−1⏟UXKτX,σY⏟KX,Y(KτY,σY)−1KτY,Y⏟VY∗,K_{X,Y}\approx\underbrace{K_{X,\sigma_{X}}\left(K_{\tau_{X},\sigma_{X}}\right)^{-1}}_{\mathcal{U}_{X}}\underbrace{K_{\tau_{X},\sigma_{Y}}}_{\mathcal{K}_{X,Y}}\underbrace{\left(K_{\tau_{Y},\sigma_{Y}}\right)^{-1}K_{\tau_{Y},Y}}_{\mathcal{V}_{Y}^{*}},

where τX⊂X\tau_X \subset X, σX⊂A(X)\sigma_X \subset \mathcal{A}(X) and τY⊂A(Y)\tau_Y \subset \mathcal{A}(Y), σY⊂Y\sigma_Y \subset Y. The set A(C)\mathcal{A}(\mathcal{C}) represent the union of all the clusters forming the interaction list at the same level and the clusters that form the interaction list with C\mathcal{C}'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 X×YX \times Y, the matrices UXU_X and VY∗V_Y^* are given by

(2.9)

UX=KX,σX(KτX,σX)−1\mathcal{U}_{X}=K_{X,\sigma_{X}}\left(K_{\tau_{X},\sigma_{X}}\right)^{-1}

RITESH KHAN, SIVARAM AMBIKASARAN

(2.10)

VY∗=(KτY,σY)−1KτY,Y\mathcal{V}_{Y}^{*}=\left(K_{\tau_{Y},\sigma_{Y}}\right)^{-1}K_{\tau_{Y},Y}

The matrices UX\mathcal{U}_X and VY∗\mathcal{V}_Y^* are called L2P (local to particles) and P2M (particles to multipole) operators, respectively.

• L2L and M2M operators. For a non-leaf level admissible block X×YX \times Y, the matrices UX\mathcal{U}_X and VY∗\mathcal{V}_Y^* are given by

(2.11)

UX=[UX10⋯00UX2⋯0⋮⋮⋱⋮00⋯UX2d][U~X1XU~X2X⋮U~X2dX]\mathcal{U}_{X}=\begin{bmatrix}{{{\mathcal{U}_{X_{1}}}}}&{{{0}}}&{{{\cdots}}}&{{{0}}} \\{{{0}}}&{{{\mathcal{U}_{X_{2}}}}}&{{{\cdots}}}&{{{0}}} \\{{{\vdots}}}&{{{\vdots}}}&{{{\ddots}}}&{{{\vdots}}} \\{{{0}}}&{{{0}}}&{{{\cdots}}}&{{{\mathcal{U}_{X_{2^{d}}}}}}\end{bmatrix}\begin{bmatrix}{{{\tilde{\mathcal{U}}_{X_{1}X}}}} \\{{{\tilde{\mathcal{U}}_{X_{2}X}}}} \\{{{\vdots}}} \\{{{\tilde{\mathcal{U}}_{X_{2^{d}}X}}}}\end{bmatrix}

where X=⋃c=12dXcX = \bigcup_{c=1}^{2^d} X_c with XcX_c is a child of XX and

(2.12)

U~XcX=KτXc,σX(KτX,σX)−1,1≤c≤2d.\tilde{\mathcal{U}}_{X_{c}X}=K_{\tau_{X_{c}},\sigma_{X}}\left(K_{\tau_{X},\sigma_{X}}\right)^{-1},\qquad1\leq c\leq2^{d}.

The matrices U~XcX\tilde{U}_{X_cX} are called the L2L (local to local) operators.

(2.13)

VY=[VY10⋯00VY2⋯0⋮⋮⋱⋮00⋯VY2d][V~YY1∗V~YY2∗⋮V~YY2d∗]\mathcal{V}_{Y}=\begin{bmatrix}{{{\mathcal{V}_{Y_{1}}}}}&{{{0}}}&{{{\cdots}}}&{{{0}}} \\{{{0}}}&{{{\mathcal{V}_{Y_{2}}}}}&{{{\cdots}}}&{{{0}}} \\{{{\vdots}}}&{{{\vdots}}}&{{{\ddots}}}&{{{\vdots}}} \\{{{0}}}&{{{0}}}&{{{\cdots}}}&{{{\mathcal{V}_{Y_{2^{d}}}}}}\end{bmatrix}\begin{bmatrix}{{{\tilde{\mathcal{V}}_{Y Y_{1}^{*}}}}} \\{{{\tilde{\mathcal{V}}_{Y Y_{2}^{*}}}}} \\{{{\vdots}}} \\{{{\tilde{\mathcal{V}}_{Y Y_{2^{d}}^{*}}}}}\end{bmatrix}

where Y=⋃c=12dYcY = \bigcup_{c=1}^{2^d} Y_c with YcY_c is a child of YY and

(2.14)

V~YYc∗=(KτY,σY)−1KτY,σYc,1≤c≤2d.\tilde{\mathcal{V}}_{Y Y_{c}^{*}}=(K_{\tau_{Y},\sigma_{Y}})^{-1}K_{\tau_{Y},\sigma_{Y_{c}}},\qquad1\leq c\leq2^{d}.

The matrices V~YYc∗\tilde{V}_{YY_c^*} are called the M2M (multipole to multipole) operators.

• M2L operators. For any admissible block X×YX \times Y, the M2L (multipole to local) operator is given by

(2.15)

KX,Y=KτX,σY,Y∈IL(X).\mathcal{K}_{X,Y}=K_{\tau_{X},\sigma_{Y}},\quad Y\in\mathcal{I L}\left(X\right).

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 O(Nlog⁡N)\mathcal{O}(N \log N).

Zhao et al. [33] eliminate the geometric dependence by introducing two purely algebraic variants of NCA. They first develop an O(Nlog⁡N)\mathcal{O}(N \log N) 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 O(N)\mathcal{O}(N).

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 O(N)\mathcal{O}(N) complexity. Their numerical experiments further show that this simplification can provide a computational advantage over the earlier NCA variants [8, 33] without compromising accuracy.

  1. New hierarchical matrices. This section discusses two new hierarchical matrices to perform fast matrix-vector product: Hhw′,Hhw′′\mathcal{H}_{hw}^{\prime}, \mathcal{H}_{hw}^{\prime\prime}. 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 CiC_i and CjC_j be a pair of clusters at level ll of the balanced 2d2^d-tree, and let ℓ<L\ell < L 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)

admhw(Ci,Cj)=true  ⟺  {adm∗(Ci,Cj)=true,if1≤l≤ℓadm∗(Ci,Cj)=falseandi≠j,ifl=ℓ<LCi∈siblings(Cj)andi≠j,ifℓ+1≤l≤L.\mathrm{adm}_{hw}\left(\mathcal{C}_{i},\mathcal{C}_{j}\right)=\mathrm{true}\iff\begin{cases}\mathrm{adm}_{*}\left(\mathcal{C}_{i},\mathcal{C}_{j}\right)=\mathrm{true},&\text{if}1\leq l\leq\ell\\\mathrm{adm}_{*}\left(\mathcal{C}_{i},\mathcal{C}_{j}\right)=\mathrm{false}\text{and}i\neq j,&\text{if}l=\ell<L\\\mathcal{C}_{i}\in siblings(\mathcal{C}_{j})\text{and}i\neq j,&\text{if}\ell+1\leq l\leq L.\end{cases}

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. Hhw′\mathcal{H}_{hw}^{\prime}-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., adm∗(X,Y)=true\text{adm}_*(X, Y) = \text{true}, across levels 1 through ℓ\ell ( ℓ<L\ell < L). Under this weak admissibility condition, far-field and vertex-sharing clusters are admissible. To apply NCA, we appropriately partition the

RITESH KHAN, SIVARAM AMBIKASARAN

Figure

(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 ℓ=3\ell = 3 and L = 4. At level 3, finer neighbor clusters (pink color) are considered admissible. At level 4, adjacent clusters (blue color) are considered admissible.

Figure

(a) Level 1

Figure

(b) Level 2

Figure

(c) Level 3

Dense diagonal block

Dense neighbor block

Compressed finer neighbor block

Figure

(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 ℓ=3\ell = 3 and L = 4.

NEW HIERARCHICAL MATRICES FOR FAST KERNEL MVP WITH APPLICATIONS 11

interaction list. More precisely, from level 1 to ℓ\ell of the tree, we partition the interaction list IL∗(X)\mathcal{IL}_*(X) into the far-field interaction list denoted as IL∗(X)\mathcal{IL}_*(X) and the vertex-sharing interaction list denoted as IL∗(X)\mathcal{IL}_*(X), i.e., IL∗(X)=IL∗(X)⋃IL∗(X)\mathcal{IL}_*(X) = \mathcal{IL}_*(X) \bigcup \mathcal{IL}_*(X) with IL∗(X)⋂IL∗(X)=ϕ\mathcal{IL}_*(X) \bigcap \mathcal{IL}_*(X) = \phi. The visual representation of this partitioning is illustrated in Figure 3.3.

Figure

(a) IL∗(X)\mathcal{IL}_{*}(X)

Figure

(b) IL∗far(X)\mathcal{IL}_{*}^{far}(X)

Figure

(c) IL∗ver(X)\mathcal{IL}_{*}^{ver}(X)

FIG. 3.3. Partitioning of IL∗(X)\mathcal{IL}_{*}(X) 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 IL∗far(X)\mathcal{IL}_{*}^{far}(X), and the corresponding bases are formed in a nested manner. On the other hand, ACA is applied to IL∗ver(X)\mathcal{IL}_{*}^{ver}(X), 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 Hhw′\mathcal{H}_{hw}^{\prime}-matrix for fast matrix-vector product is discussed in the following steps:

  1. Initialization of Hhw′\mathcal{H}_{hw}^{\prime}-matrix representation (Subsection 3.1.1)

  2. Hhw′\mathcal{H}_{hw}^{\prime}-matrix-vector product (MVP) (Subsection 3.1.2)

3.1.1. Initialization of Hhw′\mathcal{H}_{hw}^{\prime}-matrix representation. We describe the initialization procedure in detail as follows:

  1. B2T NCA for far-field interaction. We apply the B2T NCA only to the far-field interactions, i.e., ILfar(X)\mathcal{IL}_{far}(X). 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 2d2^{d} tree (from level ℓ\ell to level 2 of the tree) to generate all the required pivots. The B2T NCA is performed from level ℓ\ell 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 (VfarX)\left(\mathcal{V}_{far}^{X}\right) and M2M (V~farXXc)\left(\tilde{\mathcal{V}}_{far}^{XX_{c}}\right), Xc∈child(X)X_{c} \in child(X).

(b) M2L (KfarX,Y)\left(\mathcal{K}_{far}^{X,Y}\right), Y∈IL∗far(X)Y \in \mathcal{IL}_{*}^{far}(X).

(c) L2L (U~farXcX)\left(\tilde{\mathcal{U}}_{far}^{X_{c}X}\right), X∈parent(Xc)X \in parent(X_{c}) and L2P (UfarX)\left(\mathcal{U}_{far}^{X}\right).

Figure

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 l=ℓ:−1:2l = \ell : -1 : 2 do 2: for i=1:2dli = 1 : 2^{dl} do 3: X←ithX \leftarrow i^{th} cluster at level ll of tree. 4: I.clear() 5: J.clear() 6: if l≠ℓl \neq \ell then 7: I.insert( ⋃τXc\bigcup \tau_{X_c}) 8: for Y∈IL∗far(X)Y \in \mathcal{IL}_{*}^{far}(X) do 9: J.insert( ⋃τYc\bigcup \tau_{Y_c}) 10: end for 11: else 12: I=XI = X 13: for Y∈IL∗far(X)Y \in \mathcal{IL}_{*}^{far}(X) do 14: J.insert(Y) 15: end for 16: end if 17: [τX,σX]=ACA(I,J,ϵ)[\tau_X, \sigma_X] = \text{ACA}(I, J, \epsilon) 18: end for 19: end for

  1. ACA for vertex-sharing interaction. The vertex-sharing interaction is compressed using partially pivoted ACA [7]. For each admissible block X×YX \times Y, Y∈IL∗ver(X)Y \in \mathcal{IL}_{*}^{ver}(X), the vertex-sharing interaction block matrix KX,YK_{X,Y} is compressed by partially pivoted ACA with user-given tolerance ϵ\epsilon as follows:

KX,Y≈UV∗K_{X,Y} \approx UV^*.

Algorithm 3.2 outlines the vertex-sharing compression routine.

Algorithm 3.2 ACA for vertex-sharing interactions.

1: for l=1:ℓl = 1 : \ell do 2: for i=1:2dli = 1 : 2^{dl} do 3: X←ithX \leftarrow i^{th} cluster at level ll of tree. 4: for Y∈IL∗ver(X)Y \in \mathcal{IL}_{*}^{ver}(X) do 5: [U,V]=ACA(X,Y,ϵ)[U, V] = \text{ACA}(X, Y, \epsilon) 6: end for 7: end for 8: end for

  1. ACA at the switching level. At the switching level ℓ\ell, the block matrix KX,YK_{X,Y} is compressed using partially pivoted ACA, where X∈TℓX \in \mathcal{T}^\ell and Y∈N∗(X)Y \in \mathcal{N}_*(X). The detailed algorithm is presented in Algorithm 3.3.

Algorithm 3.3 ACA at the switching level ℓ\ell (ℓ<L\ell < L).

1: for i=1:2dℓi = 1 : 2^{d\ell} do 2: X←ithX \leftarrow i^{th} cluster at the level ℓ\ell of tree. 3: for Y∈N∗(X)Y \in \mathcal{N}_*(X) do 4: [U,V]=ACA(X,Y,ϵ)[U, V] = \text{ACA}(X, Y, \epsilon) 5: end for 6: end for

▷ At switching level ℓ\ell

▷ Perform ACA to KX,YK_{X,Y} with tolerance ϵ\epsilon.

NEW HIERARCHICAL MATRICES FOR FAST KERNEL MVP WITH APPLICATIONS 13

  1. ACA at finer levels. The finer level block matrices from level ℓ+1\ell+1 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 ℓ+1\ell+1 to level LL.

1: for l=ℓ+1:Ll=\ell+1:L do 2: for i=1:2dli=1:2^{dl} do 3: X←ithX\leftarrow i^{th} cluster at level ll of tree. 4: for Y∈siblings(X)Y\in siblings(X) do 5: [U,V]=ACA(X,Y,ϵ)[U,V]=ACA(X,Y,\epsilon) 6: end for 7: end for 8: end for

3.1.2. Hhw′\mathcal{H}_{hw}^{\prime}-matrix-vector product (MVP). Once we have the Hhw′\mathcal{H}_{hw}^{\prime}-matrix representation, it can be applied to a column vector q\boldsymbol{q} to compute fast MVP or potential, i.e., ϕ~=K~q\tilde{\phi} = \tilde{K}\boldsymbol{q}. Both nested and non-nested approaches are used to compute MVP. The detailed procedure is given below.

  1. Far-field MVP. We compute the MVP associated with far-field interaction using upward, transverse and downward tree traversal, similar to the H2\mathcal{H}^{2}-MVP algorithm.

(a) Upward traversal

• Particles to multipole (P2M) at level ℓ\ell:

For all clusters X∈TℓX \in \mathcal{T}^{\ell}, calculate

vXfar=VXfar∗qXv_{X}^{far} = \mathcal{V}_{X}^{far^{*}} q_{X}.

• Multipole to multipole (M2M) at levels ℓ−1≥l≥2\ell - 1 \geq l \geq 2:

For all clusters X∈TlX \in \mathcal{T}^l, calculate

vXfar=∑Xc∈child(X)V~XXcfar∗vXcfarv_{X}^{far} = \sum_{X_c \in child(X)} \tilde{\mathcal{V}}_{XX_c}^{far^*} v_{X_c}^{far}.

(b) Transverse traversal

• Multipole to local (M2L) at levels 2≤l≤ℓ2 \leq l \leq \ell:

For all cluster X∈TlX \in \mathcal{T}^l, calculate

uXfar=∑Y∈IL∗far(X)KX,YfarvYfaru_{X}^{far} = \sum_{Y \in \mathcal{I} \mathcal{L}_{*}^{far}(X)} \mathcal{K}_{X,Y}^{far} v_{Y}^{far}.

(c) Downward traversal

• Local to local (L2L) at levels 2≤l≤ℓ−12 \leq l \leq \ell - 1:

For all clusters X∈TlX \in \mathcal{T}^l, calculate

uXcfar←uXcfar+U~XcXfaruXfar,X∈parent(Xc).u_{X_c}^{far} \leftarrow u_{X_c}^{far} + \tilde{\mathcal{U}}_{X_c X}^{far} u_X^{far}, \quad X \in parent(X_c).

• Local to particles (L2P) at level ℓ\ell:

For all leaf clusters X∈TℓX \in \mathcal{T}^{\ell}, calculate

ϕXfar=UXfaruXfar\phi_{X}^{far} = \mathcal{U}_{X}^{far} u_{X}^{far}.

  1. 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: ϕver←0∈RN×1\phi^{ver} \leftarrow 0 \in \mathbb{R}^{N \times 1} 2: for l=1:ℓl = 1 : \ell do 3: for i=1:2dli = 1 : 2^{dl} do 4: X←ithX \leftarrow i^{th} cluster at level ll of tree. 5: for Y∈IL∗ver(X)Y \in \mathcal{IL}_{*}^{ver}(X) do. 6: ϕXver←ϕXver+U(V∗qY)\phi_{X}^{ver} \leftarrow \phi_{X}^{ver} + U(V^{*}q_{Y}) 7: end for 8: end for 9: end for

  1. Switching level MVP. At switching level ℓ\ell ( ℓ<L\ell < L), the MVP is computed in a non-nested manner as described in Algorithm 3.6.

Algorithm 3.6 Switching level matrix-vector product

1: ϕX′←0∈RN×1\phi_X' \leftarrow 0 \in \mathbb{R}^{N \times 1} 2: for i=1:2dℓi = 1 : 2^{d\ell} do 3: X←ithX \leftarrow i^{th} cluster at the level ℓ\ell of tree. 4: for Y∈N∗(X)Y \in \mathcal{N}_*(X) do 5: ϕX′←ϕX′+U(V∗qY)\phi_X' \leftarrow \phi_X' + U(V^*q_Y) 6: end for 7: end for

  1. Finer levels MVP. At the finer levels, from ℓ+1\ell+1 to LL, 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 l=ℓ+1:Ll = \ell + 1 : L do 2: for i=1:2dli = 1 : 2^{dl} do 3: X←ithX \leftarrow i^{th} cluster at level ll of tree. 4: for Y∈siblings(X)Y \in siblings(X) do 5: ϕX′←ϕX′+U(V∗qY)\phi_X' \leftarrow \phi_X' + U(V^*q_Y) 6: end for 7: end for 8: end for

Final computed MVP. For every leaf cluster X∈TLX \in \mathcal{T}^L, we add the MVP associated with self-interaction, which is a direct computation (KX,XqX)(K_{X,X}q_X). Hence, the final computed MVP of the leaf cluster XX is given by

ϕ~X=ϕXfar⏟Far−fieldMVP+ϕXver⏟Vertex−sharingMVP+ϕX′⏟FinerlevelsMVP+KX,XqX⏟SelfinteractionMVP.\tilde{\phi}_{X}=\underbrace{\phi_{X}^{far}}_{Far-field MVP}+\underbrace{\phi_{X}^{ver}}_{Vertex-sharing MVP}+\underbrace{\phi_{X}^{\prime}}_{Finer levels MVP}+\underbrace{K_{X,X}q_{X}}_{Self interaction MVP}.

(Nested)

(Non-nested)

(Non-nested)

(Direct)

Since ϕ~Xi\tilde{\phi}_{X_i} denotes the MVP corresponding to the leaf cluster XiX_i, the computed MVP can be expressed in MATLAB notation as ϕ~=[ϕ~X1;ϕ~X2;⋯ ;ϕ~X2dL]\tilde{\phi} = [\tilde{\phi}_{X_1}; \tilde{\phi}_{X_2}; \cdots; \tilde{\phi}_{X_{2dL}}].

Remark 3.1. For Hhw′\mathcal{H}_{hw}^{\prime}-matrix format, we consider ℓ<L\ell < L. If ℓ=L\ell = L, the neighboring blocks are not compressed and are instead treated as usual dense blocks. In this case, the resulting matrix structure reduces to the (H2+H)∗−matrix(\mathcal{H}^2 + \mathcal{H})_*-matrix format of [26]. On the other hand, ℓ=0\ell = 0 yields the HODLR matrix format ( 2d2^d-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 Hhw′\mathcal{H}_{hw}^{\prime}-matrix. The cost of B2T NCA is O(N)\mathcal{O}(N) [33], while the cost of ACA O(Nlog⁡(N))\mathcal{O}(N\log(N)). Therefore, the overall initialization cost scales quasi-linearly.

The cost of far-field MVP is O(N)\mathcal{O}(N) and all other steps scale quasi-linearly.

3.2. Hhw′′\mathcal{H}_{hw}^{\prime\prime}-matrix. The Hhw′\mathcal{H}_{hw}^{\prime}-matrix algorithm can be further improved by employing nested bases for vertex-sharing interactions, resulting in the Hhw′′\mathcal{H}_{hw}^{\prime\prime}-matrix algorithm. In Hhw′′\mathcal{H}_{hw}^{\prime\prime}-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 Hhw′\mathcal{H}_{hw}^{\prime} and the Hhw′′\mathcal{H}_{hw}^{\prime\prime} representations is the vertex-sharing interactions compression routine.

The Hhw′′\mathcal{H}_{hw}^{\prime\prime}-matrix for fast matrix-vector product is discussed in the following steps:

  1. Initialization of Hhw′′\mathcal{H}_{hw}^{\prime\prime}-matrix representation (Subsection 3.2.1)

  2. Hhw′′\mathcal{H}_{hw}^{\prime\prime}-matrix-vector product (MVP) (Subsection 3.2.2)

3.2.1. Initialization of Hhw′′\mathcal{H}_{hw}^{\prime\prime}-matrix representation. The initialization procedure differs from that of the Hhw′\mathcal{H}_{hw}^{\prime}-matrix only in Step 2 and is detailed as follows:

  1. B2T NCA for far-field interaction. Analogous to Algorithm 3.1.

  2. T2B NCA for vertex-sharing interaction. The T2B NCA is applied only to the vertex-sharing interactions, i.e., ILver(X)\mathcal{IL}_{ver}(X). 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 ℓ\ell 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.

Figure

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 Hhw′′\mathcal{H}_{hw}^{\prime\prime}-matrix.

Algorithm 3.8 T2B NCA for vertex-sharing interactions.

1: for l=1:ℓl = 1 : \ell do ▷ Traverse the tree from top to bottom direction

2: for i=1:2dli = 1 : 2^{dl} do

3: X←ithX \leftarrow i^{th} cluster at level ll of tree.

4: I=XI = X

5: for Y∈ILver(X)Y \in \mathcal{IL}_{ver}(X) do

6: J=YJ = Y

7: if l>1l > 1 then

8: J.insert(σparent(X))J.\text{insert}(\sigma_{parent(X)}) ▷ Add parent-level pivots

9: end if

10: end for

11: [τX,σX]=ACA(I,J,ϵ)[\tau_X, \sigma_X] = \text{ACA}(I, J, \epsilon) ▷ Perform ACA with tolerance ϵ\epsilon

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 (VXver)(\mathcal{V}_{X}^{ver}) and M2M (V~XXcver)\left(\tilde{\mathcal{V}}_{XX_{c}}^{ver}\right), Xc∈child(X)X_{c} \in child(X).

(b) M2L (KX,Yver)\left(\mathcal{K}_{X,Y}^{ver}\right), Y∈IL∗ver(X)Y \in \mathcal{IL}_{*}^{ver}(X).

(c) L2L (U~XcXver)\left(\tilde{\mathcal{U}}_{X_c X}^{ver}\right), X∈parent(Xc)X \in parent(X_c) and L2P (UXver)(\mathcal{U}_X^{ver}).

  1. ACA at the switching level. Analogous to Algorithm 3.3.

  2. ACA at finer levels. Analogous to Algorithm 3.4.

3.2.2. Hhw′′\mathcal{H}_{hw}^{\prime\prime}-matrix-vector product (MVP). We apply Hhw′′\mathcal{H}_{hw}^{\prime\prime}-matrix representation to a column vector q\boldsymbol{q} to compute fast MVP, i.e., ϕ~=K~q\tilde{\boldsymbol{\phi}} = \tilde{K}\boldsymbol{q}. 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:

  1. Far-field MVP. Analogous to the corresponding step of Hhw′\mathcal{H}_{hw}^{\prime}-matrix.

  2. 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 ℓ\ell:

For all clusters X∈TℓX \in \mathcal{T}^{\ell}, calculate

vXver=VXver∗qX.v_{X}^{ver} = \mathcal{V}_{X}^{ver^*} q_{X}.

• Multipole to multipole (M2M) at levels ℓ−1≥l≥1\ell - 1 \geq l \geq 1:

For all clusters X∈TlX \in \mathcal{T}^l, calculate

vXver=∑Xc∈child(X)V~XXcver∗vXcver.v_{X}^{ver} = \sum_{X_c \in child(X)} \tilde{\mathcal{V}}_{XX_c}^{ver^*} v_{X_c}^{ver}.

(b) Transverse traversal

• Multipole to local (M2L) at levels 1≤l≤ℓ1 \leq l \leq \ell:

For all cluster X∈TlX \in \mathcal{T}^l, calculate

uXver=∑Y∈IL∗ver(X)KX,YvervYver.u_{X}^{ver} = \sum_{Y \in \mathcal{IL}_{*}^{ver}(X)} \mathcal{K}_{X,Y}^{ver} v_{Y}^{ver}.

(c) Downward traversal

• Local to local (L2L) at levels 1≤l≤ℓ−11 \leq l \leq \ell - 1:

For all clusters X∈TlX \in \mathcal{T}^l, calculate

uXcver←uXcver+U~XcXveruXver,X∈parent(Xc).u_{X_c}^{ver} \leftarrow u_{X_c}^{ver} + \tilde{\mathcal{U}}_{X_c X}^{ver} u_{X}^{ver}, \quad X \in parent(X_c).

• Local to particles (L2P) at level ℓ\ell:

For all leaf clusters X∈TℓX \in \mathcal{T}^{\ell}, calculate

ϕXver=UXveruXver.\phi_{X}^{ver} = \mathcal{U}_{X}^{ver} u_{X}^{ver}.

  1. Switching level MVP. Analogous to Algorithm 3.6.

  2. Finer levels MVP. Analogous to Algorithm 3.7.

Final computed MVP. For every leaf cluster X∈TLX \in \mathcal{T}^L, 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

ϕ~X=ϕXfar⏟Far−field MVP+ϕXver⏟Vertex−sharing MVP+ϕX′⏟Finer levels MVP+KX,XqX⏟Self interaction MVP.\tilde{\phi}_{X}=\underbrace{\phi_{X}^{f a r}}_{\mathrm{F a r-f i e l d~M V P}}+\underbrace{\phi_{X}^{v e r}}_{\mathrm{V e r t e x-s h a r i n g~M V P}}+\underbrace{\phi_{X}^{\prime}}_{\mathrm{F i n e r~l e v e l s~M V P}}+\underbrace{K_{X,X}q_{X}}_{\mathrm{S e l f~i n t e r a c t i o n~M V P}}.

(Nested)

(Nested)

(Non-nested)

(Direct)

The computed MVP can be expressed as ϕ~=[ϕ~X1;ϕ~X2;⋯ ;ϕ~X2dL]\tilde{\phi} = [\tilde{\phi}_{X_1}; \tilde{\phi}_{X_2}; \cdots; \tilde{\phi}_{X_{2dL}}].

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 (IL∗(X))(\mathcal{IL}_{*}(X)), 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 Hhw′′\mathcal{H}_{hw}^{\prime\prime}-matrix format, we consider ℓ<L\ell < L. If ℓ=L\ell = L, the neighboring blocks are not compressed and are instead treated as usual dense blocks. In this case, the resulting matrix structure reduces to the H∗2\mathcal{H}_{*}^{2}-matrix format of [26]. On the other hand, ℓ=0\ell = 0 yields the HODLR matrix format ( 2d2^{d}-tree-based).

3.2.3. Complexity analysis of Hhw′′\mathcal{H}_{hw}^{\prime\prime}-matrix. The cost of T2B NCA (step 2) is O(Nlog⁡(N))\mathcal{O}(N\log(N)) [33], resulting in an overall quasi-linear complexity. Although the initialization of Hhw′′\mathcal{H}_{hw}^{\prime\prime} and Hhw′\mathcal{H}_{hw}^{\prime} exhibits the same asymptotic complexity, Hhw′′\mathcal{H}_{hw}^{\prime\prime} is observed to be slightly more computationally expensive because T2B NCA incurs a higher computational cost than ACA. However, the Hhw′′\mathcal{H}_{hw}^{\prime\prime}-MVP is faster than Hhw′\mathcal{H}_{hw}^{\prime}-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 B,N\mathcal{B}, \mathcal{N}, and D\mathcal{D} 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: O(p(m+n))\mathcal{O}(p(m+n))) and dense matrix (cost: O(mn)\mathcal{O}(mn)) formats, respectively. More precisely, LR−B∗1:ℓLR-\mathcal{B}_{*}^{1:\ell} 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 ℓ\ell.

The total storage cost of the proposed hybrid weak admissibility-based algorithms is given by

(3.2)

Shw=LR−B∗1:ℓ+LR−N∗ℓ+LR−Bwℓ+1:L+D−DL.\mathcal{S}_{h w}=L R\mathcal{-B}_{*}^{1:\ell}+L R\mathcal{-N}_{*}^{\ell}+L R\mathcal{-B}_{w}^{\ell+1:L}+D\mathcal{-D}^{L}.

The total storage cost of the (uniform) weak admissibility-based algorithms [26] is given by

(3.3)

S∗=LR−B∗1:L+D−N∗L+D−DL=LR−B∗1:ℓ+LR−B∗ℓ+1:L+D−N∗L+D−DL.\mathcal{S}_{*}=L R\mathcal{-B}_{*}^{1:L}+D\mathcal{-N}_{*}^{L}+D\mathcal{-D}^{L}=L R\mathcal{-B}_{*}^{1:\ell}+L R\mathcal{-B}_{*}^{\ell+1:L}+D\mathcal{-N}_{*}^{L}+D\mathcal{-D}^{L}.

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)

S(ℓ)=S∗−Shw=(LR−B∗ℓ+1:L+D−N∗L)−(LR−N∗ℓ+LR−Bwℓ+1:L).\mathcal{S}\left(\ell\right)=\mathcal{S}_{*}-\mathcal{S}_{h w}=\left(L R\mathcal{-B}_{*}^{\ell+1:L}+D\mathcal{-N}_{*}^{L}\right)-\left(L R\mathcal{-N}_{*}^{\ell}+L R\mathcal{-B}_{w}^{\ell+1:L}\right).

Therefore, the proposed algorithms are advantageous in terms of storage requirements and MVP execution costs if S(ℓ)>0\mathcal{S}(\ell) > 0. 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 ℓ∗\ell^*, which maximizes the performance gains over the uniformly weak admissibility-based counterparts, i.e.,

ℓ∗=arg⁡max⁡0<ℓ<L(S(ℓ)).\ell^ {*} = \arg \max _ {0 < \ell < L} \left(\mathcal {S} \left(\ell\right)\right).

In practice, one may evaluate S(ℓ)\mathcal{S}(\ell) for ℓ=L−1,L−2,…,1\ell = L - 1, L - 2, \ldots, 1 to identify the optimal switching level. However, this can be computationally expensive. Therefore, in all numerical experiments reported in Section 4, we heuristically fix ℓ=L−1\ell = L - 1 for simplicity.

  1. 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.
nmaxn_{max}Maximum number of particles at leaf-clusters. We set nmax=125n_{max} = 125.
K~\tilde{K}K~\tilde{K} represent the hierarchical matrix representation of the original kernel matrix KK.
Mem.Total memory (in GB) needed to store the hierarchical low-rank representation (K~\tilde{K}).
tinitt_{init}Time taken (in s) to initialize the hierarchical representation K~\tilde{K}
tFMVPt_{FMVP}Time taken (in s) to compute the fast MVP (K~q\tilde{K}\mathbf{q}).
tDMVPt_{DMVP}The time taken (in s) to compute the direct MVP.
REMVPRE_{MVP}The 2-norm relative error in the MVP.
#iterThe 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 NN uniformly distributed particles located at {xi}i=1N\{\pmb{x}_i\}_{i=1}^N in the cube [−1,1]3[-1,1]^3. The kernel function is chosen as the single-layer Laplacian in 3D, and the (i,j)th(i,j)^{th} entry of the kernel matrix K∈RN×NK \in \mathbb{R}^{N \times N} is given by

K(i,j)={1r=1∥xi−xj∥2 if i≠j0 otherwise (4.1)K (i, j) = \left\{ \begin{array}{l l} \frac {1}{r} = \frac {1}{\| \boldsymbol {x} _ {i} - \boldsymbol {x} _ {j} \| _ {2}} & \text { if } i \neq j \\ 0 & \text { otherwise } \end{array} \right. \tag {4.1}

We compare the proposed hybrid weak admissibility-based Hhw′\mathcal{H}_{hw}^{\prime} and Hhw′′\mathcal{H}_{hw}^{\prime \prime} formats with their (uniform) weak admissibility-based counterparts, (H2+H)∗(\mathcal{H}^2 + \mathcal{H})_* and H∗2\mathcal{H}_*^2, respectively, where the weak admissibility condition (2.4) is applied to all the levels. Additionally, we compare these formats with the standard admissibility-based Hη2\mathcal{H}_{\eta}^2-matrix format (the interaction list is analogous to that in FMM when η=d\eta = \sqrt{d}). It is worth noting that the leaf-level block size and the depth of the tree are kept the same for all H\mathcal{H}-matrix formats. A summary of the different H\mathcal{H}-matrix formats is provided in Table 4.2 for ease of comparison.

We randomly select 5 different column vectors (q)(\pmb{q}) and perform the H\mathcal{H}-matrix-vector products (K~q)(\tilde{K}\pmb{q}) using different H\mathcal{H}-matrix formats. The memory to store the H\mathcal{H}-matrix format (Mem), average initialization time (tinit)(t_{init}), H\mathcal{H}-MVP time (tFMVP)(t_{FMVP}), the

H-matrixShort descriptionAdmissibility condition/Admissible clustersCompression technique(s)Type of bases
Hhw′\mathcal{H}_{hw}^{\prime}This work, see Subsection 3.1.Hybrid weak admissibility (3.1)/Coarser levels: far-field, vertex-sharingFiner levels: adjacentB2T NCA and ACASemi-nested and non-nested
Hhw′′\mathcal{H}_{hw}^{\prime\prime}This work, see Subsection 3.2.Hybrid weak admissibility (3.1)/Coarser levels: far-field, vertex-sharingFiner levels: adjacentB2T NCA, T2B NCA, and ACANested and non-nested
(H2+H)∗(\mathcal{H}^{2} + \mathcal{H})_{*}See (H2+H)∗(\mathcal{H}^{2} + \mathcal{H})_{*}-matrix of [26].Weak admissibility condition (2.4)/far-field and vertex-sharingB2T NCA and ACASemi-nested
H∗2\mathcal{H}_{*}^{2}See H∗2\mathcal{H}_{*}^{2}-matrix of [26].Weak admissibility condition (2.4)/far-field and vertex-sharingB2T NCA (far-field) and T2B NCA (vertex-sharing)Nested
Hη2\mathcal{H}_{\eta}^{2}Standard admissibility-based H2\mathcal{H}^{2}-matrix.We set η=d\eta = \sqrt{d} in (2.1).Standard admissibility condition (2.1)/far-fieldB2T NCANested

TABLE 4.2

Different H\mathcal{H}-matrix formats and their descriptions.

NH\mathcal{H}-matrixMem (GB)tinitt_{init} (s)tFMVPt_{FMVP} (s)MFLOPtDMVPt_{DMVP} (s)REMVPRE_{MVP}
64000Hhw′\mathcal{H}_{hw}^{\prime}0.672.040.04156.228.242.39E-03
Hhw′′\mathcal{H}_{hw}^{\prime\prime}0.632.360.03150.558.242.36E-03
(H2+H)∗(\mathcal{H}^{2} + \mathcal{H})_{*}0.751.770.06175.028.241.53E-03
H∗2\mathcal{H}_{*}^{2}0.722.550.05171.438.241.59E-03
Hη2\mathcal{H}_{\eta}^{2}0.842.190.08202.738.241.42E-03
512000Hhw′\mathcal{H}_{hw}^{\prime}6.0727.260.331415.69527.612.24E-03
Hhw′′\mathcal{H}_{hw}^{\prime\prime}5.3635.460.281277.87527.612.27E-03
(H2+H)∗(\mathcal{H}^{2} + \mathcal{H})_{*}7.4121.150.521749.71527.612.17E-03
H∗2\mathcal{H}_{*}^{2}6.7334.930.481618.54527.612.28E-03
Hη2\mathcal{H}_{\eta}^{2}8.3232.530.722015.33527.612.56E-03
1000000Hhw′\mathcal{H}_{hw}^{\prime}8.8246.290.622072.142038.875.68E-03
Hhw′′\mathcal{H}_{hw}^{\prime\prime}6.59128.240.571617.632038.875.67E-03
(H2+H)∗(\mathcal{H}^{2} + \mathcal{H})_{*}14.6664.181.123535.832038.871.19E-03
H∗2\mathcal{H}_{*}^{2}12.82154.171.053173.412038.871.22E-03
Hη2\mathcal{H}_{\eta}^{2}15.4690.061.273834.682038.871.21E-03
2197000Hhw′\mathcal{H}_{hw}^{\prime}21.10130.221.244975.4210062.111.72E-03
Hhw′′\mathcal{H}_{hw}^{\prime\prime}16.84196.171.084061.6810062.112.31E-03
(H2+H)∗(\mathcal{H}^{2} + \mathcal{H})_{*}28.84121.062.126911.5410062.111.08E-03
H∗2\mathcal{H}_{*}^{2}25.75317.422.126288.3110062.111.78E-03
Hη2\mathcal{H}_{\eta}^{2}30.77166.232.527544.7110062.111.55E-03

TABLE 4.3

Comparison between different H\mathcal{H}-matrix formats when ϵ=10−3\epsilon = 10^{-3}.

mega FLOP count for H\mathcal{H}-MVP (MFLOP), and the relative error in MVP (REMVPRE_{MVP}) for different tolerances (ϵ\epsilon) are tabulated in Tables 4.3 to 4.5. We also report the direct MVP time (tDMVPt_{DMVP}).

From the above tables, we can conclude the following.

  1. Hhw′\mathcal{H}_{hw}^{\prime} and Hhw′′\mathcal{H}_{hw}^{\prime \prime} outperform their (uniform) weak-admissibility-based counterparts, (H2+H)∗(\mathcal{H}^2 + \mathcal{H})_* and H∗\mathcal{H}_*, respectively in both memory and MVP time, as S(ℓ)>0\mathcal{S}(\ell) > 0 in all cases (see (3.4)). Figure 4.1 illustrates the dense and low-rank MFLOP of the Hhw′′\mathcal{H}_{hw}^{\prime \prime} and H∗\mathcal{H}_* matrices for different tolerances (ϵ\epsilon). It can be seen that, despite employing nested bases at all levels, H∗\mathcal{H}_* 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.

  2. At finer levels, the construction of Hhw′\mathcal{H}_{hw}^{\prime} and Hhw′′\mathcal{H}_{hw}^{\prime \prime} is similar. However, Hhw′′\mathcal{H}_{hw}^{\prime \prime} achieves better memory efficiency and MVP performance due to the use of

RITESH KHAN, SIVARAM AMBIKASARAN

NH\mathcal{H}-matrixMem (GB)tinitt_{init}(s)tFMVPt_{FMVP}(s)MFLOPtDMVPt_{DMVP}(s)REMVPRE_{MVP}
64000Hhw′\mathcal{H}_{hw}^{\prime}1.327.220.09312.288.248.82E-06
Hhw′′\mathcal{H}_{hw}^{\prime\prime}1.2515.150.08302.228.248.78E-06
(H2+H)∗(\mathcal{H}^{2}+\mathcal{H})_{*}1.618.520.13383.948.241.07E-05
H∗2\mathcal{H}_{*}^{2}1.5519.720.16381.148.241.05E-05
Hη2\mathcal{H}_{\eta}^{2}1.7719.750.18435.818.248.13E-06
512000Hhw′\mathcal{H}_{hw}^{\prime}13.50116.071.173195.32527.619.03E-06
Hhw′′\mathcal{H}_{hw}^{\prime\prime}12.03321.770.952942.5527.618.52E-06
(H2+H)∗(\mathcal{H}^{2}+\mathcal{H})_{*}17.91136.681.484306.96527.619.99E-06
H∗2\mathcal{H}_{*}^{2}16.82371.251.724140.91527.611.02E-05
Hη2\mathcal{H}_{\eta}^{2}20.64346.292.425095.75527.611.03E-05
1000000Hhw′\mathcal{H}_{hw}^{\prime}28.17280.272.176799.322038.871.33E-05
Hhw′′\mathcal{H}_{hw}^{\prime\prime}25.04756.332.026228.762038.871.44E-05
(H2+H)∗(\mathcal{H}^{2}+\mathcal{H})_{*}35.98334.583.878745.572038.879.76E-06
H∗2\mathcal{H}_{*}^{2}32.64851.423.038129.672038.871.21E-05
Hη2\mathcal{H}_{\eta}^{2}38.02752.545.269473.992038.878.93E-06
2197000Hhw′\mathcal{H}_{hw}^{\prime}61.02670.825.2114598.0110062.119.22E-06
Hhw′′\mathcal{H}_{hw}^{\prime\prime}51.301960.855.0212675.910062.119.45E-06
(H2+H)∗(\mathcal{H}^{2}+\mathcal{H})_{*}92.22810.278.2822385.310062.117.34E-06
H∗2\mathcal{H}_{*}^{2}83.152217.747.2520637.310062.118.09E-06
Hη2\mathcal{H}_{\eta}^{2}99.221956.3312.5224656.410062.111.21E-05

TABLE 4.4

Comparison between different H\mathcal{H}-matrix formats when ϵ=10−5\epsilon = 10^{-5}.

NH\mathcal{H}-matrixMem (GB)tinitt_{init}(s)tFMVPt_{FMVP}(s)MFLOPtDMVPt_{DMVP}(s)REMVPRE_{MVP}
64000Hhw′\mathcal{H}_{hw}^{\prime}1.9931.020.17469.938.246.23E-08
Hhw′′\mathcal{H}_{hw}^{\prime\prime}1.8737.680.16458.758.246.25E-08
(H2+H)∗(\mathcal{H}^{2}+\mathcal{H})_{*}2.7438.820.26658.1948.248.41E-08
H∗2\mathcal{H}_{*}^{2}2.6647.690.25656.568.248.40E-08
Hη2\mathcal{H}_{\eta}^{2}2.9728.640.26734.948.248.88E-08
512000Hhw′\mathcal{H}_{hw}^{\prime}23.34673.862.205580.93527.611.06E-07
Hhw′′\mathcal{H}_{hw}^{\prime\prime}21.44970.291.925294.2527.611.09E-07
(H2+H)∗(\mathcal{H}^{2}+\mathcal{H})_{*}32.21738.833.067796.51527.611.48E-07
H∗2\mathcal{H}_{*}^{2}30.661061.463.057599.96527.611.45E-07
Hη2\mathcal{H}_{\eta}^{2}35.33542.033.128770.46527.619.98E-08
1000000Hhw′\mathcal{H}_{hw}^{\prime}66.941711.566.6416322.12038.871.63E-07
Hhw′′\mathcal{H}_{hw}^{\prime\prime}62.242523.316.1815525.82038.871.65E-07
(H2+H)∗(\mathcal{H}^{2}+\mathcal{H})_{*}70.771834.987.2917278.62038.871.02E-07
H∗2\mathcal{H}_{*}^{2}65.612660.716.9816365.92038.876.40E-07
Hη2\mathcal{H}_{\eta}^{2}77.981534.667.4219465.52038.872.34E-07
2197000Hhw′\mathcal{H}_{hw}^{\prime}131.784191.814.5131838.810062.112.35E-07
Hhw′′\mathcal{H}_{hw}^{\prime\prime}116.716682.9212.7329025.510062.112.23E-07
(H2+H)∗(\mathcal{H}^{2}+\mathcal{H})_{*}156.174324.7415.6237877.410062.111.13E-07
H∗2\mathcal{H}_{*}^{2}140.927012.115.0235076.310062.111.15E-07
Hη2\mathcal{H}_{\eta}^{2}164.583244.5116.3240996.110062.112.05E-07

TABLE 4.5

Comparison between different H\mathcal{H}-matrix formats when ϵ=10−7\epsilon = 10^{-7}.

NEW HIERARCHICAL MATRICES FOR FAST KERNEL MVP WITH APPLICATIONS 21

Figure

(a) N=512000N = 512000.

(b) N=2197000N = 2197000.

FIG. 4.1. Comparison of the MFLOP of Hhw′′\mathcal{H}_{hw}^{\prime\prime} and H∗2\mathcal{H}_{*}^{2}. For Hhw′′\mathcal{H}_{hw}^{\prime\prime}, only the diagonal blocks are dense, whereas both neighboring and diagonal blocks are dense for H∗2\mathcal{H}_{*}^{2}.

nested bases for vertex-sharing interactions at coarser levels. This can also be observed in other experiments.

  1. As shown in [26], (H2+H)∗\left(\mathcal{H}^{2} + \mathcal{H}\right)_{*} and H∗2\mathcal{H}_{*}^{2} outperform the standard admissibility based Hη2\mathcal{H}_{\eta}^{2} in terms of memory and MVP time. Arranging the five H\mathcal{H}-matrix formats (Table 4.2) in ascending order of memory usage and MVP time yields
Hhw′′<Hhw′<H∗2<(H2+H)∗<Hη2.\mathcal{H}_{h w}^{\prime\prime}<\mathcal{H}_{h w}^{\prime}<\mathcal{H}_{*}^{2}<\left(\mathcal{H}^{2}+\mathcal{H}\right)_{*}<\mathcal{H}_{\eta}^{2}.

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 O(kN2)\mathcal{O}(kN^2), where the covariance matrix K∈RN×NK \in \mathbb{R}^{N \times N}. The most computationally expensive part of the algorithm is performing matrix-matrix products, such as KΩK\Omega or KQKQ. In the fast PCA (see Appendix A), we replace KK with its hierarchical representations ( K~\tilde{K}), 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 O(kNlog⁡α(N))\mathcal{O}(kN \log^\alpha(N)), where α≥0\alpha \geq 0.

In this experiment, we consider the Matérn-3/2 covariance kernel and the Gaussian kernel (e−r2)(e^{-r^{2}}) with N randomly generated points in the cube [−1,1]3[-1,1]^{3}. We set

RITESH KHAN, SIVARAM AMBIKASARAN

k=100k = 100 and c=10c = 10 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 ϵ=10−4\epsilon = 10^{-4} to construct K~\tilde{K}. 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 (REPCA)∥ΛK~−ΛK∥2/∥ΛK∥2(RE_{PCA}) \parallel \Lambda_{\tilde{K}} - \Lambda_{K} \parallel_2 / \|\Lambda_{K}\|_2, where ΛK~\Lambda_{\tilde{K}} and ΛK\Lambda_{K} 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 NN, whereas the direct PCA demonstrates quadratic scaling.

NNH\mathcal{H}-matrixMem(GB)Time (s)REPCARE_{PCA}
tinitt_{init}tFPCAt_{FPCA}ttotalt_{total}tDPCAt_{DPCA}
1000Hhw′\mathcal{H}_{hw}^{\prime}0.0020.0020.0050.0050.0520.0520.0570.0571.581.582.89E−062.89\mathrm{E}-06
Hhw′′\mathcal{H}_{hw}^{\prime\prime}0.002\mathbf{0.002}0.0050.0050.0510.0510.056\mathbf{0.056}1.581.583.04E−063.04\mathrm{E}-06
8000Hhw′\mathcal{H}_{hw}^{\prime}0.0260.0260.0620.0620.6070.6070.6690.66994.1194.112.67E−062.67\mathrm{E}-06
Hhw′′\mathcal{H}_{hw}^{\prime\prime}0.025\mathbf{0.025}0.0660.0660.6010.6010.667\mathbf{0.667}94.1194.113.15E−063.15\mathrm{E}-06
64000Hhw′\mathcal{H}_{hw}^{\prime}0.2160.2161.7811.7816.1016.1017.8827.8825592.795592.798.07E−068.07\mathrm{E}-06
Hhw′′\mathcal{H}_{hw}^{\prime\prime}0.193\mathbf{0.193}1.9241.9245.8445.8447.7687.7685592.795592.798.39E−068.39\mathrm{E}-06
512000Hhw′\mathcal{H}_{hw}^{\prime}1.6681.66820.92820.92853.39953.39974.32774.327−-−-
Hhw′′\mathcal{H}_{hw}^{\prime\prime}1.281\mathbf{1.281}23.04423.04447.05847.05870.102\mathbf{70.102}−-−-

TABLE 4.6

Comparison between H\mathcal{H}-matrix accelerated PCA (FPCA) and direct PCA (DPCA) for Matérn-3/2 covariance kernel. tDPCAt_{DPCA} scales as O(N2)\mathcal{O}(N^2).

NNH\mathcal{H}-matrixMem(GB)Time (s)REPCARE_{PCA}
tinitt_{init}tFPCAt_{FPCA}ttotalt_{total}tDPCAt_{DPCA}
1000Hhw′\mathcal{H}_{hw}^{\prime}0.0030.0030.0070.0070.0580.0580.0650.0651.521.527.52E−067.52\mathrm{E}-06
Hhw′′\mathcal{H}_{hw}^{\prime\prime}0.002\mathbf{0.002}0.0060.0060.0570.0570.063\mathbf{0.063}1.521.527.59E−067.59\mathrm{E}-06
8000Hhw′\mathcal{H}_{hw}^{\prime}0.0360.0360.0830.0830.8130.8130.8960.89692.1792.174.90E−064.90\mathrm{E}-06
Hhw′′\mathcal{H}_{hw}^{\prime\prime}0.034\mathbf{0.034}0.0830.0830.8010.8010.884\mathbf{0.884}92.1792.175.77E−065.77\mathrm{E}-06
64000Hhw′\mathcal{H}_{hw}^{\prime}0.3100.3103.0543.0547.9077.90710.96110.9615158.395158.392.76E−052.76\mathrm{E}-05
Hhw′′\mathcal{H}_{hw}^{\prime\prime}0.262\mathbf{0.262}3.3783.3787.0487.04810.426\mathbf{10.426}5158.395158.391.78E−051.78\mathrm{E}-05
512000Hhw′\mathcal{H}_{hw}^{\prime}2.3532.35328.46228.46265.57265.57294.03494.034−-−-
Hhw′′\mathcal{H}_{hw}^{\prime\prime}1.660\mathbf{1.660}33.91733.91754.45254.45288.369\mathbf{88.369}−-−-

TABLE 4.7

Comparison between H\mathcal{H}-matrix accelerated PCA (FPCA) and direct PCA (DPCA) for Gaussian kernel. tDPCAt_{DPCA} scales as O(N2)\mathcal{O}(N^2).

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].

(K+μI)x=b,(4.2)(K + \mu I)x = b, \tag{4.2}

where K∈RN×NK \in \mathbb{R}^{N \times N} is a symmetric positive definite (SPD) kernel matrix and regularization parameter μ≥0\mu \ge 0.

(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.

  1. We construct the fast randomized Nyström preconditioner PP as described in Appendix B.1.

  2. Once we have the preconditioner PP, 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 KK, i.e., K~\tilde{K}, to accelerate the associated MVPs.

For a numerical experiment, we consider the Matérn-1/2 kernel (exp (−r)(-r)) with μ=0.0001\mu = 0.0001. Synthetic datasets are generated by randomly distributing points, xi\pmb{x}_i, in the cube [−1,1]3[-1, 1]^3. We use NN points for training and m=N/5m = N/5 additional points for testing. The corresponding output values are denoted by bi∈R\pmb{b}_i \in \mathbb{R}. The hierarchical representation K~\tilde{K} is formed by setting tolerance ϵ=10−5\epsilon = 10^{-5}. K~\tilde{K} is used to construct the fast randomized Nyström preconditioner PP and to accelerate the MVP in CG. While constructing the fast randomized Nyström preconditioner, we set rank k=250k = 250. For CG, the maximum number of iterations is 500 with stopping tolerance ϵCG=10−5\epsilon_{CG} = 10^{-5}.

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. tFNPCGt_{FNPCG} 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 N>1000N > 1000, both DPCG and CG fail to converge within 500 iterations, whereas the fast Nyström PCG (FNPCG) method converges.

NH-matrixRMSETime (s)# Iter
tinitt_{init}tFNPCGt_{FNPCG}ttotalt_{total}FNPCGDPCGCG
1000Hhw′\mathcal{H}_{hw}^{\prime}0.2 %0.0080.150.1589112156
Hhw′′\mathcal{H}_{hw}^{\prime\prime}0.2 %0.0080.130.13810112156
8000Hhw′\mathcal{H}_{hw}^{\prime}0.9 %0.282.783.0665--
Hhw′′\mathcal{H}_{hw}^{\prime\prime}0.9 %0.282.362.6467--
64000Hhw′\mathcal{H}_{hw}^{\prime}0.8 %7.4856.3163.79312--
Hhw′′\mathcal{H}_{hw}^{\prime\prime}0.8 %8.0852.7160.79316--

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.

  1. 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, Hhw′\mathcal{H}_{hw}^{\prime} and Hhw′′\mathcal{H}_{hw}^{\prime \prime}. For the Hhw′\mathcal{H}_{hw}^{\prime} format, we have employed nested bases for far-field interactions and non-nested bases for vertex-sharing interactions. In contrast, for the Hhw′′\mathcal{H}_{hw}^{\prime \prime} 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 H2\mathcal{H}^{2}-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 O(Nlog⁡N)\mathcal{O}(N \log N) 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 H2H^{2}-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 O(N)\mathcal{O}(N) 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 KΩK\Omega or KQKQ. We accelerate these operations by replacing the covariance matrix KK with its hierarchical representations K~\tilde{K}, 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 K∈RN×NK \in \mathbb{R}^{N \times N}, denoted as K~\tilde{K} and ll 2: Output: Q∈RN×lQ \in \mathbb{R}^{N \times l} 3: function FAST RANDOMIZED RANGE FINDER(K~,l\tilde{K}, l) 4: Ω=randn(N,l)\Omega = \text{randn}(N, l) 5: Y=K~ΩY = \tilde{K}\Omega 6: Q=qr(Y,0)Q = \text{qr}(Y, 0) 7: end function

▹\triangleright We perform ll fast MVPs ▹\triangleright Thin QR factorization

Algorithm A.2 Fast Nyström approximation of K∈RN×NK \in \mathbb{R}^{N \times N}, i.e., Knys=UΛ^UTK_{nys} = U\hat{\Lambda}U^{T}

1: Input: Hierarchical representation of SPD matrix KK, K~\tilde{K} and rank l=k+cl = k + c 2: Output: Rank-kk approximation Knys=UΛ^UTK_{nys} = U\hat{\Lambda}U^{T}, where U∈RN×kU \in \mathbb{R}^{N \times k}, Λ^∈Rk×k\hat{\Lambda} \in \mathbb{R}^{k \times k} 3: function FAST NYSTRÖM APPROXIMATION(K~,l\tilde{K}, l) 4: Q=Fast Randomized Range Finder(K~,l)Q = \text{Fast Randomized Range Finder}\left(\tilde{K}, l\right) ▹\triangleright From Algorithm A.1 5: B1=K~QB_{1} = \tilde{K}Q 6: ν=eps(norm(B1))\nu = \text{eps}\left(\text{norm}(B_{1})\right) 7: Bν=(B1+νQ)B_{\nu} = (B_{1} + \nu Q) 8: B2=Q∗BνB_{2} = Q^{*}B_{\nu} 9: C=chol(B2)C = \text{chol}(B_{2}) 10: F=Bν/CF = B_{\nu}/C 11: [U,Σ,∼]=svd(F,0)[U, \Sigma, \sim] = \text{svd}(F, 0) 12: Λ=max⁡{0,Σ2−νI}\Lambda = \max\{0, \Sigma^{2} - \nu I\}. 13: U=U(:,1:k)U = U(:, 1:k) and Λ^=Λ(1:k,1:k)\hat{\Lambda} = \Lambda(1:k, 1:k) 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)

(K+μI)x=b(K+\mu I)x=b

where K∈RN×NK \in \mathbb{R}^{N \times N} is a symmetric positive definite (SPD) kernel matrix and regularization parameter μ≥0\mu \ge 0.

We leverage the hierarchical representation of KK, i.e., K~\tilde{K}, 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)

P=1λ^k+μU(Λ^+μI)UT+(I−UUT)P=\frac{1}{\hat{\lambda}_{k}+\mu}U\left(\hat{\Lambda}+\mu I\right)U^{T}+\left(I-U U^{T}\right)

NEW HIERARCHICAL MATRICES FOR FAST KERNEL MVP WITH APPLICATIONS 27

(B.3)

P−1=(λ^k+μ)U(Λ^+μI)−1UT+(I−UUT),P^{-1}=\left(\hat{\lambda}_{k}+\mu\right)U\left(\hat{\Lambda}+\mu I\right)^{-1}U^{T}+\left(I-U U^{T}\right),

where Knys=UΛ^UTK_{nys} = U\hat{\Lambda}U^T and λ^k\hat{\lambda}_k is the kthk^{th} eigenvalue.

The naive cost to construct the Nyström preconditioner PP scales as O(kN2)\mathcal{O}(kN^2). However, the factors associated with the Nyström preconditioner, UU and Λ^\hat{\Lambda}, are obtained using the fast Nyström Approximation (see Algorithm A.2), leading to computational cost O(kNlog⁡α(N)),α≥0\mathcal{O}(kN\log^\alpha(N)), \alpha \geq 0.

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 K~\tilde{K}, regularization parameter μ\mu, right hand side b, initial guess x0x_0, CG tolerance ϵCG\epsilon_{CG} and P−1P^{-1}.

2: Output: Approximate solution x^\hat{x}

3: function PCG( K~\tilde{K}, μ\mu, b, x0x_0, ϵCG\epsilon_{CG}, P−1P^{-1})

4: r0=b−μx0−K~x0r_0 = b - \mu x_0 - \tilde{K} x_0

5: z0=P−1r0z_0 = P^{-1} r_0

6: p0=z0p_0 = z_0

7: while ∥r∥2>ϵCG\|r\|_2 > \epsilon_{CG} do

8: v=K~p0+μp0v = \tilde{K} p_0 + \mu p_0

9: α=r0Tz0p0Tv0\alpha = \frac{r_0^T z_0}{p_0^T v_0}

10: x=x0+αp0x = x_0 + \alpha p_0

11: r=r0−αvr = r_0 - \alpha v

12: z=P−1rz = P^{-1} r

13: β=rTzr0Tz0\beta = \frac{r^T z}{r_0^T z_0}

14: x0←x,r0←r,p0←(z+βp0),z0←zx_0 \leftarrow x, r_0 \leftarrow r, p_0 \leftarrow (z + \beta p_0), z_0 \leftarrow z

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.