arXiv:2609.04397cond-mat.mtrl-sciSep 2026

Manuscript Offprint

arXiv:2609.04397

Accelerating Atom Simulations with Variable-Block Sparse Matrix Library

Zhanghao Zhouyin, Hong Guo

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Zhanghao Zhouyin¹ and Hong Guo¹

¹Department of Physics, McGill University, Montreal, Quebec, Canada H3A 2T8 (Dated: September 7, 2026)

Modern atomistic simulations increasingly employ localized orbitals to represent quantum operators, yielding sparse block matrices whose block shapes vary with chemical species and basis choice. Conventional scalar sparse formats store the entries of each block individually, obscuring this local structure and limiting the use of efficient block algorithms. We present VBCSR, a distributed sparse matrix library that preserves variable-size atomic blocks and accelerates the core linear algebra of large-scale atomistic simulations. A unified interface automatically maps scalar, uniform-basis, and multispecies operators to compressed sparse row (CSR), block sparse row (BSR), or variable-block compressed sparse row (VBCSR). Our advanced acceleration method groups blocks of equal shape and dispatches them to optimized dense kernels. In the reported benchmarks, VBCSR outperforms the tested Python-accessible reference implementations for several block-sparse benchmarks. We further demonstrate VBCSR in an InP nanoparticle application containing more than 10610^6 atoms.

I. INTRODUCTION

Localized-orbital methods provide an efficient and physically transparent description of atomistic systems. By associating basis functions with individual atoms, they represent short-range interactions through sparse Hamiltonian, overlap, density, and response operators. This locality provides a compact representation for large-scale systems such as interfaces, defects, disordered materials, moiré structures, and multicomponent junctions. As the simulated structure grows, the cost of these calculations is increasingly determined by how these sparse operators are stored, applied, transformed, and distributed across a parallel machine.

The sparse structure of an atomistic operator is naturally block-valued. If atom ii carries bib_i localized orbitals and atom jj carries bjb_j, their interaction is a dense block of size bi×bjb_i \times b_j. In a single-species system, these blocks may have a uniform shape, whereas multispecies systems generally produce several shapes because their constituent atoms use different orbital counts. Conventional scalar compressed sparse row (CSR) storage expands these couplings into individual entries, increasing structural metadata and hiding reusable dense work. A uniform-block representation avoids scalar expansion but must pad smaller interactions to the largest block size, introducing values that must be stored, processed, and communicated even though they are absent from the physical model. These representation costs grow with system size and can restrict the scale that can be reached.

Existing electronic-structure packages and high-performance sparse libraries address important parts of this problem. RESCU and CP2K provide scalable capabilities within comprehensive atomistic workflows [1, 2]. DBCSR, NTPoly, BML, and CheSS provide optimized block operations or matrix algorithms for demanding electronic-structure calculations [3-6], while specialized microkernel systems accelerate dense computations within block-sparse workloads [7]. A complementary need remains for developers of atomistic methods:

a lightweight distributed operator layer that preserves species-dependent atomic blocks, scales to large simulations, and can be embedded easily in specialized scientific workflows. Without such a layer, each application must devote substantial effort to managing quantum-operator matrices rather than to implementing the physical model of interest.

We address this need with VBCSR, a distributed sparse matrix library that supports variable block sizes and provides customized high-performance kernels. Each graph node represents an atom and its localized degrees of freedom, while each graph edge stores an atom-atom interaction block. The graph determines the matrix structure, rank ownership, and ghost communication. Blocks of equal shape are stored together, converting irregular atomic connectivity into regular work for optimized dense kernels. To use kernels suited to each structure, VBCSR automatically selects CSR for scalar operators, block sparse row (BSR) for a uniform basis, or variable-block compressed sparse row (VBCSR) for a species-dependent basis. Figure 1 summarizes how VBCSR maps the physical atomic structure to distributed execution.

We first evaluate single-node kernel efficiency and then assess distributed strong and weak scaling. Across scalar, fixed-block, and variable-block operators, VBCSR is competitive with or faster than the tested reference implementations. In particular, variable-block sparse matrix-matrix multiplication is accelerated by up to 8.4×8.4\times with one thread and 3.8×3.8\times with 16 threads. The distributed experiments then quantify how this performance changes as the number of MPI ranks increases. As an application illustration, we simulate InP nanoparticles using a tight-binding Hamiltonian. We compute the density of states and extract the size-dependent band gap for systems containing up to 1,063,609 atoms, demonstrating the million-atom scalability of VBCSR for large atomistic operators.