arXiv:2610.27951cs.ITOct 2026

Manuscript Offprint

arXiv:2610.27951

infomeasure-rs: A High-Performance Rust Library for Information-Theoretic Measures and Estimators

Carlson Moses Büth

Abstract

Information theory has become a standard tool across the natural and social sciences, yet practical use is limited by estimator choice, fragmented software, reproducibility, and computational cost. We present infomeasure-rs, an open-source Rust library that brings a broad set of information-theoretic measures and estimators into one self-contained, type-safe package. It covers entropy, mutual information, conditional mutual information, transfer entropy, conditional transfer entropy, cross-entropy, and the Kullback–Leibler and Jensen–Shannon divergences, with discrete (plug-in and bias-corrected), kernel, ordinal, and nearest-neighbour estimators, including the Rényi and Tsallis families, and exposes local and global values and significance testing through a consistent trait interface. It ships as a single portable binary with no runtime dependency and is continuously validated against a reference implementation. On a single central processing unit (CPU) core, and even without its GPU or parallel paths, it is the fastest of the packages we compared across languages, matching the closest packages only for plug-in discrete entropy and substantially faster for mutual information, the conditional and transfer measures, and the kernel, ordinal, and generalised-entropy estimators. The optional GPU and multi-threaded paths accelerate selected continuous estimators further. The library is open source and, to our knowledge, the most complete information-theory package for Rust.

Keywords: information theory; entropy; mutual information; transfer entropy; estimators; statistical significance; Rust; performance; open-source

Preprint. Technical Note submitted to Entropy (Special Issue: “Entropy-Based Time Series Analysis: Theory and Applications”).

1 Introduction

Information theory, the mathematical study of information and its processing [1], has become a cornerstone of modern data analysis, with applications ranging from neuroscience [2, 3] and complex systems [4] to finance [5]. Applying it in practice, however, is rarely as simple as choosing a measure and computing it. Four barriers recur [6]. First, information-theoretic quantities are functionals of probability distributions that are unknown in practice and must be estimated from finite samples. The choice of estimator strongly affects the result, and limited guidelines exist for selecting it [7, 8]. Second, the software landscape is fragmented: individual packages tend to concentrate on a subset of measures or estimators, which makes systematic comparison

*ORCID: 0000-0003-2298-8438.

cumbersome. Third, implementation-level differences between packages hinder reproducibility. Fourth, the estimators are computationally intensive, so large data sets are prohibitive unless the implementation is carefully optimised.

The Python package infomeasure was introduced to lower these barriers by unifying a broad set of measures and estimators under one consistent interface [6]. After a year since its introduction, it is used in research across several fields, including neuroscience [9, 10, 11, 12], transport-delay analysis [13, 14], energy and industrial monitoring [15, 16], biology and biophysics [17, 18], security and privacy [19], the study of complex systems [20], and methodological work on information estimation [21, 22, 23, 24, 25]. This highlights the importance that such unifying implementations have in the scientific community, as they lower the implementation cost and enhance reproducibility. For the most demanding workloads the Python runtime is the limiting factor, and a compiled implementation removes it while keeping the numerical results identical. The same compiled library can serve as a backend for the Python package, so existing users gain the speed without changing their workflow.

We present infomeasure-rs, a Rust library that reimplements the infomeasure measure and estimator set from first principles. Rust offers the performance of a compiled language together with memory safety and predictable semantics, and it produces a single portable binary without a runtime. The Rust information-theory ecosystem is still young, and we survey it in Section 2. The contributions of this Technical Note are:

  • a complete Rust library covering the measures and estimators of the Python reference, exposed through a type-safe trait interface.

  • a continuous validation strategy that re-checks every estimator against the validated Python implementation on each change.

  • a fair, reproducible cross-package benchmark (identical inputs, identical parameters, a single CPU thread).

  • an average speed-up of about ten times over the Python implementation on a single thread, with optional GPU and multi-threaded acceleration.

References (52)