In a paper published in SoftwareX, researchers Alejandro Santorum and Alberto Suárez have introduced scikit-rmt, an open-source Python library designed to streamline the sampling, characterization, and numerical simulation of random matrix ensembles. Operating within the scientific Python ecosystem alongside NumPy, SciPy, Matplotlib, and Scikit-learn, the package establishes a unified computational framework for studying high-dimensional random matrices. The software integrates matrix ensemble generation, theoretical spectral law evaluation, accelerated spectral histogramming, and practical signal processing tools within an accessible programming interface available via the Python Package Index.
Random matrix theory investigates the mathematical properties of matrices whose individual entries are random variables, providing fundamental insights into complex systems across diverse scientific disciplines. Over several decades, researchers have harnessed random matrix theory to derive multidimensional generalizations of statistical tests such as the chi-squared distribution and the multivariate Student t-test, evaluate numerical error propagation in matrix operations, and model the distribution of zeros in the Riemann zeta function. In the physical sciences, random matrix principles describe the discrete energy levels of heavy atomic nuclei and synaptic connection patterns within biological neural networks. More recently, investigators have applied these techniques to analyze weight structures in deep neural networks and conduct quantitative risk modeling and portfolio optimization in financial markets. A cornerstone of the field is universality, which dictates that the eigenvalue distributions of random matrices converge toward universal spectral laws depending solely on symmetry and entry distributions rather than specific matrix realizations.
The core architecture of scikit-rmt is structured around an abstract base class named BaseEnsemble, which defines the primary interface for sampling random matrices and analyzing their properties. Specific ensemble families are implemented as concrete derived classes: GaussianEnsemble, WishartEnsemble, ManovaEnsemble, and CircularEnsemble. Whenever a user instantiates one of these classes, the library automatically generates a random matrix sample stored internally in its matrix property, while a dedicated resample method generates fresh independent samples on demand. The architecture exposes several core methods, including eigvals for computing eigenvalues with optional scaling, eigval_hist for compiling eigenvalue histograms, plot_eigval_hist for plotting spectral distributions, and joint_eigval_pdf for evaluating joint probability densities. By adhering to a consistent object-oriented interface across all supported ensembles, scikit-rmt lowers technical barriers for researchers seeking reproducible computational workflows in Python.
The library provides comprehensive support for four prominent random matrix ensemble families, each parameterized by the classic Dyson index beta, where beta equals one for real entries, two for complex entries, and four for quaternion entries. The first major category comprises the Gaussian or Hermite ensembles, defined as symmetric matrices whose entries are independent Gaussian random variables constructed via conjugate transpose symmetrization. This category encompasses the Gaussian Orthogonal Ensemble, the Gaussian Unitary Ensemble, and the Gaussian Symplectic Ensemble, which remain invariant under orthogonal, unitary, and symplectic transformations, respectively. The second category consists of Wishart or Laguerre ensembles, constructed as symmetric non-negative definite matrices formed by multiplying a rectangular Gaussian matrix by its conjugate transpose. Supporting an arbitrary entry variance parameter, Wishart ensembles generalize the chi-squared distribution to matrix dimensions and include the Wishart Real Ensemble, Wishart Complex Ensemble, and Wishart Quaternion Ensemble.
The third ensemble family implemented in the library is the multivariate analysis of variance, or MANOVA, ensemble, also referred to as the Jacobi ensemble. The fourth family contains the circular or Dyson ensembles, which consist of unitary matrices distributed according to the invariant Haar measure. Originally introduced by Dyson to model quantum energy levels and complex physical systems, these ensembles include the Circular Orthogonal Ensemble, Circular Unitary Ensemble, and Circular Symplectic Ensemble, corresponding to symmetric, general, and self-dual unitary matrices. Because all circular ensemble matrices satisfy strict unitary constraints, their eigenvalues lie strictly on the unit circle in the complex plane, exhibiting characteristic circular symmetry.
To bridge empirical simulations with formal mathematical theory, scikit-rmt includes a dedicated spectral_law submodule implementing exact asymptotic probability distributions. This module provides classes representing the Wigner semicircle distribution, the Marchenko-Pastur distribution, the MANOVA spectrum distribution, and the Tracy-Widom distribution. Each class provides methods for evaluating probability density and cumulative distribution functions, generating random variates, and plotting empirical and theoretical curves. Under the Wigner semicircle law, the eigenvalue density of scaled Gaussian matrices forms a bounded semicircle whose spectral radius is determined by the entry variance and the Dyson index. Under the Marchenko-Pastur law, the scaled eigenvalue spectrum of Wishart matrices converges to a continuous density bounded between distinct lower and upper spectral edges determined by the matrix aspect ratio. When this aspect ratio exceeds unity, meaning the row dimension exceeds the column dimension, the Marchenko-Pastur distribution correctly includes an exact point mass at zero.
The software provides analytical routines to track how empirical eigenvalue distributions converge toward theoretical spectral laws as matrix dimensions expand. In numerical simulations, the bulk eigenvalue distribution of Gaussian Orthogonal Ensemble matrices converges weakly to the Wigner semicircle distribution at a theoretical rate of order n to the negative one-half. For Wishart random matrices, empirical spectra converge to the Marchenko-Pastur law at an order n to the negative one-half rate when the aspect ratio lies strictly between zero and one, slowing to order n to the negative one-fourth when the aspect ratio equals one. Beyond bulk spectra, the library implements the Tracy-Widom law to characterize the behavior of the largest individual eigenvalue in Gaussian ensembles. By centering the maximum eigenvalue by twice the square root of n and rescaling edge fluctuations by n to the one-sixth power, the package successfully models limiting distributions for extreme spectral values.
A major computational optimization in scikit-rmt concerns the calculation of spectral histograms for large Gaussian and Wishart matrices. In standard numerical workflows, computing the eigenvalues of a dense random matrix of size n by n relies on standard LAPACK routines that scale cubically, incurring an operational cost of order n cubed. Sampling an equivalent tridiagonal matrix with chi-distributed off-diagonal entries reduces eigenvalue computation to quadratic scaling of order n squared. However, constructing an m-bin histogram from explicit eigenvalues still incurs additional overhead. To bypass eigenvalue extraction entirely, scikit-rmt evaluates Sturm sequences directly on the tridiagonal matrix. This method determines the exact count of eigenvalues falling within each histogram bin without calculating individual eigenvalues. For an m-bin histogram, this technique reduces computational complexity to order m times n, which transitions execution scaling from quadratic to strictly linear with respect to matrix size when n is much larger than m.
In addition to macroscopic spectral histograms, scikit-rmt provides analytical tools to examine microscopic eigenvalue interactions, including the joint probability density function of random matrix eigenvalues across classical ensembles. Known analytic expressions demonstrate that the joint probability density drops to zero as any two eigenvalues approach each other, reflecting the fundamental physical phenomenon of eigenvalue repulsion. The library implements this evaluation through the joint_eigval_pdf method available in the ensemble classes. In illustrative experiments using two-by-two Gaussian Orthogonal Ensemble matrices, the authors compared empirical two-dimensional histograms of sorted eigenvalues against exact theoretical joint probability density functions.
Demonstrating practical engineering utility beyond theoretical mathematics, scikit-rmt incorporates a specialized image denoising submodule grounded in random matrix principles. The submodule features the MarchenkoPasturPCADenoiser class, which applies Marchenko-Pastur principal component analysis to overlapping image patches reshaped into local data matrices. Grounded in the separation of low-rank signals from noise conforming to the Marchenko-Pastur bulk, the algorithm suppresses noise by hard-thresholding singular values against the theoretical upper spectral edge. The tool conforms to the Scikit-learn estimator interface, supporting fit, transform, and fit_transform workflows alongside automated noise estimation strategies including median, min_eigen, and mp_fit estimators. In validation experiments utilizing one hundred simulated diffusion-weighted magnetic resonance imaging acquisitions generated from the BraTS2020 brain dataset corrupted by Rician noise, noisy acquisitions exhibited an average signal-to-noise ratio of 4.36 and a peak signal-to-noise ratio of 9.99. Pixelwise averaging across all acquisitions yielded modest improvements to 6.37 and 12.00, respectively, whereas the mp_fit estimator substantially increased the signal-to-noise ratio to 11.40 and the peak signal-to-noise ratio to 17.04.
Beyond neuroimaging, the authors emphasize that scikit-rmt supports diverse applied fields, such as filtering empirical correlation matrices for portfolio optimization in finance and evaluating channel capacities in wireless communications. Compared with existing packages such as RandomMatrices in Julia, Mathematica, and RMAT in R, scikit-rmt uniquely integrates circular ensembles, fast tridiagonal histogramming, and image denoising into Python. Nevertheless, the authors outline important limitations and future research directions. The current implementation is restricted to Dyson indices beta in one, two, and four, leaving general beta ensembles for future releases. Furthermore, the Marchenko-Pastur PCA denoiser relies on standard assumptions of locally low-rank signals and compatible noise, meaning complex artifacts like spatially varying variance or Rician bias require extended modeling. Finally, while simulated BraTS2020 experiments establish computational benchmarks, systematic validation on independently acquired clinical data remains necessary. Overall, scikit-rmt fills a critical gap by providing an accessible, unified open-source environment for theoretical and applied random matrix research.
Subject of Research: Open-source Python software for random matrix theory simulation, spectral analysis, and PCA image denoising
Article Title: scikit-rmt: A python library for random matrix analysis and simulation
Article References: Santorum, A., & Suárez, A. (2026). scikit-rmt: A python library for random matrix analysis and simulation. SoftwareX, 36, Article 103267. https://doi.org/10.1016/j.softx.2026.103267
Image Credits: AI Generated
DOI: 10.1016/j.softx.2026.103267
Keywords: scikit-rmt, random matrix theory, Gaussian ensembles, Wishart ensembles, MANOVA ensembles, circular ensembles, Wigner semicircle law, Marchenko-Pastur law, Tracy-Widom distribution, Sturm sequences, tridiagonal matrix sampling, eigenvalue repulsion, MP-PCA denoising, diffusion MRI, spectral histogramming, Dyson index, scientific Python
Cite Scienmag News
Denise Maddox. (November 27, 2026). Open-Source Python Library Accelerates Random Matrix Computations and Medical Denoising. Scienmag. https://scienmag.com/open-source-python-library-accelerates-random-matrix-computations-and-medical-denoising/
Denise Maddox. "Open-Source Python Library Accelerates Random Matrix Computations and Medical Denoising." Scienmag, 27 November 2026, https://scienmag.com/open-source-python-library-accelerates-random-matrix-computations-and-medical-denoising/. Accessed 27 November 2026.
Denise Maddox. "Open-Source Python Library Accelerates Random Matrix Computations and Medical Denoising." Scienmag. November 27, 2026. https://scienmag.com/open-source-python-library-accelerates-random-matrix-computations-and-medical-denoising/








