---
title: H²-Matrix-Matrix Multiplication
url: https://www.emergentmind.com/topics/h-2-matrix-matrix-multiplication
type: topic
---

# H²-Matrix-Matrix Multiplication

Searching arXiv for recent papers on $\mathcal H^2$-matrix-matrix multiplication and closely related algorithms.
$\mathcal H^2$-matrix-matrix multiplication denotes a family of algorithms for multiplying hierarchical, data-sparse matrices that exploit nested low-rank bases. In the $\mathcal H^2$ format, admissible off-diagonal blocks are represented as
$$
G_{\hat t \times \hat s} \approx V_t\, S_b\, W_s^*,
$$
with local cluster bases $V_t$, $W_s$ and small coupling matrices $S_b$, while inadmissible blocks are stored as small dense blocks. This structure reduces storage and matrix-vector multiplication to $\mathcal{O}(nk)$ for an $n$-dimensional matrix with local rank $k$, and it also furnishes the basis for more advanced multiplication tasks: applying an $\mathcal H^2$-matrix to a dense block of right-hand sides, and multiplying two $\mathcal H^2$-matrices while preserving or reconstructing an $\mathcal H^2$ representation of the product [2509.17257][2403.01566].

## 1. Representation and algebraic setting

$\mathcal H^2$-matrices are hierarchical matrices designed for dense operators with local low-rank structure, including matrices arising from boundary element methods, solution operators of partial differential equations, and integral operators [2509.17257][2403.01566]. Their defining feature is nestedness: bases at coarser clusters are built from child bases through transfer matrices, so basis information is not duplicated across the hierarchy. This nested structure distinguishes $\mathcal H^2$-matrices from classical $\mathcal H$-matrices and is the reason storage can be reduced to $\mathcal{O}(nk)$ rather than $\mathcal{O}(nk \log n)$ [2403.01566].

For admissible leaves, the low-rank form
$$
G|_{\hat t\times\hat s} = V_t S_{ts} W_s^*
$$
or, in equivalent notation,
$$
R_{t,s} = V_t S_{t,s} V_s^T
$$
encodes the block through nested row and column cluster bases and a small coupling matrix [1908.05218][2309.09061]. Inadmissible or nearfield blocks remain dense. The resulting arithmetic is hierarchical: traversal over row and column cluster trees replaces direct dense multiplication, and small-rank operations replace large dense ones wherever admissibility holds.

This representation creates two distinct multiplication problems. The first is $\mathcal H^2$-matrix times a dense matrix of $m$ right-hand sides, which is central in block iterative methods. The second is $\mathcal H^2 \times \mathcal H^2$, in which both factors are hierarchically compressed and the output must again be approximated in $\mathcal H^2$ form. The latter is algorithmically harder because the product generally does not lie in the original cluster bases of the factors [2509.17257][1908.05218].

## 2. Multiplication with dense blocks of right-hand sides

When an $\mathcal H^2$-matrix is multiplied by a dense matrix $X \in \mathbb{C}^{n \times m}$, the vector algorithm of Börm and Hackbusch is promoted to a block algorithm with three stages: forward transformation, multiplication phase, and backward transformation [2509.17257].

In the forward transformation, the column cluster tree is traversed bottom-up. For a leaf cluster $s$, one computes
$$
\widehat X_s = W_s^*\,X|_{\hat s \times m},
$$
while non-leaf clusters combine children through transfer matrices. The effect is to project the $m$ right-hand sides into the nested column bases. In the multiplication phase, each admissible block $(t,s)$ contributes
$$
\widehat Y_t = \widehat Y_t + S_b\, \widehat X_s,
$$
a $k \times m$ matrix-matrix multiplication on small coupling matrices, whereas each inadmissible block contributes a dense block multiplication
$$
Y|_{\hat t \times m} = Y|_{\hat t \times m} + G|_{\hat t \times \hat s}\, X|_{\hat s \times m}.
$$
Finally, the backward transformation traverses the row cluster tree top-down and reconstructs the output through the row bases and transfer matrices [2509.17257].

A practical implementation introduces a preparation phase that builds, for each row cluster, a block-list $B_t$ of all relevant leaf blocks. This permits conflict-free parallel processing because all row clusters can be processed concurrently, and forward and backward transformations can be parallelized across clusters on the same tree level. The arithmetic is systematically cast into BLAS level-3 form: admissible blocks use GEMM on $k \times k$ and $k \times m$ operands, inadmissible dense blocks use GEMM on all $m$ columns at once, and transfer-matrix applications are likewise promoted to batched or block BLAS-3 operations [2509.17257].

The significance of this formulation is hardware-oriented. Grouping many right-hand sides into a single dense matrix raises arithmetic intensity, improves cache reuse, and avoids the poor locality of repeated GEMV-based matrix-vector products. In the reported experiments, the block $\mathcal H^2$-matrix-matrix multiplication achieved speedups of **10–13x** for $m=100$, and up to **50x** for large $m$ and suitable chunk sizes; for sufficiently large $m$ and sufficiently high-accuracy matrices, the implementation saturated available memory bandwidth [2509.17257].

## 3. Multiplication of two $\mathcal H^2$-matrices

The product of two $\mathcal H^2$-matrices is more delicate than multiplication by a dense block because the natural bases of the product are not, in general, the original bases of the factors. Recent work therefore centers on adaptive basis construction and recompression [1908.05218][2403.01566][2309.09061].

A 2023 algorithm presents a two-phase strategy. First, it constructs an intermediate representation of $XY$ on an induced block tree with induced cluster bases; second, it performs structural recompression so that the result matches a prescribed output block tree [2309.09061]. The induced row basis for a cluster $t$ is described as
$$
V_t := \begin{pmatrix}
V_{X,t} & X|_{\hat t\times\hat s_1} V_{Y,s_1} & \ldots & X|_{\hat t\times\hat s_m} V_{Y,s_m}
\end{pmatrix},
$$
where the additional terms encode product contributions that cannot be represented in the original basis alone. These bases are then compressed recursively by SVD-based low-rank approximation while preserving nested transfer relations [2309.09061].

A 2024 algorithm emphasizes mathematically rigorous error control by constructing the *exact* product in an intermediate hierarchical representation before any truncation is applied [2403.01566]. Its central data structures are cluster trees, block trees, and a 3-way product tree whose nodes are triples $(t,s,r)$ tracking recursive products $X|_{\hat t \times \hat s}Y|_{\hat s \times \hat r}$. For admissible blocks,
$$
X|_{\hat t\times\hat s} Y|_{\hat s\times\hat r}
= V_{X,t} S_{X,ts} P_{XY,s} S_{Y,sr} W_{Y,r}^*,
$$
with precomputed basis product matrices
$$
P_{XY,s} = W_{X,s}^* V_{Y,s}.
$$
The paper also uses semi-uniform matrices of the form $A_{tr} W_{Y,r}^* + V_{X,t} B_{tr}^*$ as recursive accumulators [2403.01566].

A 2019 approach pursues explicit accuracy control while preserving the original $\mathcal H^2$ structure of the product [1908.05218]. Instead of fixing the cluster bases beforehand, it instantaneously updates them during the matrix product computation according to a prescribed truncation accuracy $\epsilon_{trunc}$. This is framed as an alternative to earlier formatted multiplication algorithms that inherited cluster bases directly from the input factors and therefore did not control the product accuracy [1908.05218].

## 4. Basis adaptation and error control

Accuracy control is the central differentiator among $\mathcal H^2 \times \mathcal H^2$ algorithms. Earlier formatted multiplication schemes could retain linear complexity only by assuming that a suitable basis for the result was already known or by reusing the bases of the factors. Later work argues that this assumption is often invalid, because multiplication can generate new subspaces that are not captured by the original nested bases [1908.05218][2309.09061].

In the 2019 method, basis adaptation is performed during the product itself. For each product block, the algorithm collects contributions into Gram matrices, normalizes them, computes an SVD of the aggregated Gram matrix, and truncates singular vectors whose singular values fall below the prescribed threshold $\epsilon_{trunc}$. This basis update proceeds recursively from leaves to the root, so that all additions and multiplications are either exact or computed based on prescribed accuracy, and the product remains in $\mathcal H^2$ form throughout [1908.05218].

The 2024 method takes a different route: it delays approximation. The exact product is represented in an intermediate hierarchical structure, and low-rank truncations are applied only during coarsening and recompression. For each block $G|_{\hat t\times\hat r}$, the paper states the block-relative spectral-norm guarantee
$$
\left\| G|_{\hat t\times\hat r} - \text{approx.}\right\|_2
\leq \hat\epsilon \left\| G|_{\hat t\times\hat r} \right\|_2,
$$
obtained by choosing a local tolerance
$$
\epsilon := \frac{\hat\epsilon}{2mn},
$$
where $m$ and $n$ are the maximal numbers of block rows and columns in the merge [2403.01566].

The 2023 linear-complexity algorithm also uses adaptive compression with localized error estimates, but its guarantee is expressed relative to the contributing input blocks:
$$
\|X|_{\hat t\times\hat s} Y|_{\hat s\times\hat r}
- Q_t Q_t^* X|_{\hat t\times\hat s}Y|_{\hat s\times\hat r}\|_2
\leq \varepsilon \|X|_{\hat t\times\hat s}\|_2 \|Y|_{\hat s\times\hat r}\|_2.
$$
The paper notes that full block-relative error is not always guaranteed in this formulation, although the reported practical error is very close [2309.09061].

A recurrent misconception is that linear-time $\mathcal H^2$ multiplication and explicit accuracy control are automatically compatible. The literature summarized here distinguishes these objectives sharply: some algorithms are optimized for linear complexity with adaptive bases, while others accept an additional logarithmic factor in exchange for rigorous block-relative error control [2403.01566][2309.09061].

## 5. Complexity, hardware efficiency, and algorithmic trade-offs

The principal algorithmic variants can be organized by the type of right-hand factor and the form of accuracy control.

| Setting | Core mechanism | Stated complexity or guarantee |
|---|---|---|
| $\mathcal H^2 \times$ dense block | Forward transform, block multiplication, backward transform; GEMM throughout | $\mathcal{O}(nkm)$; linear in $n$, $k$, and linearly scalable with $m$ [2509.17257] |
| $\mathcal H^2 \times \mathcal H^2$ with basis updates | Instantaneous change of cluster bases using SVD truncation | $O(N)$ for constant rank; $O(N\log N)$ time and $O(N)$ memory for variable-rank cases described in the paper [1908.05218] |
| $\mathcal H^2 \times \mathcal H^2$ with exact intermediate product | Product trees, basis trees, coarsening, recompression | $\mathcal{O}(n k^2 \log n)$ with block-relative error estimates for submatrices [2403.01566] |
| Adaptive linear-complexity $\mathcal H^2 \times \mathcal H^2$ | Induced block structure followed by structural recompression | $\mathcal{O}(n k^2)$ for fixed $k$ under the stated tree and sparsity conditions [2309.09061] |

For multiplication by dense blocks, complexity is dominated by $\mathcal{O}(nkm)$ work in the forward and backward transformations and the block multiplication phase. Each admissible block costs $\mathcal{O}(k^2 m)$, each inadmissible block costs $\mathcal{O}(s_t s_s m)$ for small block sizes $s_t$, $s_s$, and the total cost remains linear in $n$ and $k$ while scaling linearly with the number of columns $m$ [2509.17257]. The key implementation point is not only asymptotic count but arithmetic intensity: for $m \gg 1$, the ratio of FLOP to data moved is much higher than in repeated matrix-vector multiplication, so cache and memory bandwidth can be used more effectively [2509.17257].

For $\mathcal H^2 \times \mathcal H^2$, the complexity depends on how the product basis is managed. The 2019 method gives
$$
O\left(\sum_{l=0}^L 2^l k_l^3\right)
$$
time and
$$
O\left(\sum_{l=0}^L 2^l k_l^2\right)
$$
memory, implying $O(N)$ time and memory for constant rank and $O(N\log N)$ time with $O(N)$ memory when rank grows linearly with electrical problem size [1908.05218]. The 2024 method reports $\mathcal{O}(n k^2 \log n)$, with the logarithmic factor reflecting recursive product-tree and recompression operations [2403.01566]. The 2023 method states $\mathcal{O}(n k^2)$ under three technical assumptions: leaf size proportional to $k$, bounded sparsity, and a bounded refinement ratio between fine and coarse block trees [2309.09061].

These algorithms therefore expose a genuine trade-off. This suggests that the multiplication problem is not characterized by a single “best” complexity class; rather, the practical choice depends on whether the dominant requirement is BLAS-3 throughput for many right-hand sides, linear-time adaptive basis construction, or rigorous blockwise error guarantees.

## 6. Applications, performance evidence, and limitations

The most immediate application of $\mathcal H^2$-matrix-matrix multiplication by dense blocks is in block Krylov subspace methods. The 2025 implementation uses the block multiplication kernel to accelerate block-CG and block-GMRES with hierarchical preconditioners, and reports that matrix operations become a small part of total runtime, with practical speedups of **30–50x** over a standard sequential approach [2509.17257]. This is specifically relevant when multiple systems with the same hierarchical matrix must be solved.

For $\mathcal H^2 \times \mathcal H^2$, the applications emphasized in the literature include efficient preconditioners, matrix functions, and fast solvers for large-scale electromagnetic analysis [2403.01566][1908.05218]. The 2019 accuracy-controlled product is demonstrated on large-scale capacitance extraction and electromagnetic scattering problems involving **millions of unknowns on a single core**, with time and memory scaling linearly in constant-rank capacitance examples and as predicted by theory in variable-rank scattering examples [1908.05218]. The 2023 adaptive linear-complexity method reports multiplication for boundary element matrices of the 3D Laplacian, including examples up to **$2,097,152 \times 2,097,152$**, with the main multiplication completed in **53.5 seconds for the final matrix formation (on a single core)** [2309.09061]. The 2024 method states that experiments confirm multiplication for matrices of size $n > 10^6$ while maintaining the prescribed block-relative spectral error bound [2403.01566].

Several limitations recur. In the block right-hand-side setting, the memory footprint grows with the number of columns $m$ because auxiliary matrices scale as $n \times m$; for very large $m$, chunked processing is recommended [2509.17257]. In the $\mathcal H^2 \times \mathcal H^2$ setting, the intermediate representation can be substantially larger than the final output: the 2023 method notes that it is sometimes **3x** larger, although only transiently [2309.09061]. Another limitation is methodological: the only linear-time algorithms known before the recent adaptive approaches either required the very special structure of HSS-matrices or required a suitable basis for all submatrices in advance [2309.09061].

Taken together, these developments define $\mathcal H^2$-matrix-matrix multiplication as a mature but internally differentiated area of hierarchical linear algebra. One branch focuses on exploiting modern hardware through GEMM-based block application to many right-hand sides; another focuses on preserving or rebuilding $\mathcal H^2$ structure under matrix products with adaptive bases; and a third prioritizes mathematically rigorous block-relative error control through exact intermediate representations and subsequent recompression [2509.17257][2403.01566].

Source: https://www.emergentmind.com/topics/h-2-matrix-matrix-multiplication