A C implementation of the Smith massager algorithm

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wang, Ziwen, Birmpilis, Stavros, Labahn, George, Storjohann, Arne
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866916025545523200
author Wang, Ziwen
Birmpilis, Stavros
Labahn, George
Storjohann, Arne
author_facet Wang, Ziwen
Birmpilis, Stavros
Labahn, George
Storjohann, Arne
contents We describe a C implementation of the Las Vegas algorithm of Birmpilis, Labahn and Storjohann from 2020 for computing the Smith normal form of a nonsingular integer matrix. The algorithm computes a Smith massager for the input matrix using $O(n^ω\, \B(\log n + \log \|A\|)\, (\log n)^2)$ bit operations, which is softly equivalent to the cost of multiplying two matrices of the same dimension and entry size. We describe the key implementation techniques that bridge the gap between the theoretical algorithm and practical performance, including BLAS-accelerated modular arithmetic via the Residue Number System and an adaptive batching scheme that collapses the theoretical $O(\log n)$ iterations to $O(1)$ in practice. Experiments on matrices of dimension up to $n = 10007$ show that the implementation's running time scales proportionally to that of a single BLAS matrix multiplication, with both exhibiting the same effective growth rate on a log-log plot.
format Preprint
id arxiv_https___arxiv_org_abs_2605_19254
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle A C implementation of the Smith massager algorithm
Wang, Ziwen
Birmpilis, Stavros
Labahn, George
Storjohann, Arne
Mathematical Software
Commutative Algebra
68Q25, 68W30, 15A21, 15A36
We describe a C implementation of the Las Vegas algorithm of Birmpilis, Labahn and Storjohann from 2020 for computing the Smith normal form of a nonsingular integer matrix. The algorithm computes a Smith massager for the input matrix using $O(n^ω\, \B(\log n + \log \|A\|)\, (\log n)^2)$ bit operations, which is softly equivalent to the cost of multiplying two matrices of the same dimension and entry size. We describe the key implementation techniques that bridge the gap between the theoretical algorithm and practical performance, including BLAS-accelerated modular arithmetic via the Residue Number System and an adaptive batching scheme that collapses the theoretical $O(\log n)$ iterations to $O(1)$ in practice. Experiments on matrices of dimension up to $n = 10007$ show that the implementation's running time scales proportionally to that of a single BLAS matrix multiplication, with both exhibiting the same effective growth rate on a log-log plot.
title A C implementation of the Smith massager algorithm
topic Mathematical Software
Commutative Algebra
68Q25, 68W30, 15A21, 15A36
url https://arxiv.org/abs/2605.19254