lzcomplexity
lzcomplexity is a high-performance C++ library developed for complexity analysis using entropic magnitudes. The library provides efficient implementations for analyzing time series data, with applications in information theory, signal processing, and neuroscience.
- Language
- Rust
- Stars
- 4
README
lzcomplexity
Randomness, structure and similarity in symbolic sequences.
Explore how a sequence balances unpredictability and organization, or compare
the patterns shared by different sequences. lzcomplexity brings Lempel–Ziv
analysis to Python and standalone command-line tools, powered by a Rust core.
| Measure | What you can explore |
|---|---|
| Entropy density h | Unpredictability, the production of new information and freedom of choice within a sequence. |
| Effective measure complexity E | Organization and correlations across different ranges of a sequence. |
| Information distance d | Similarity between sequences through the patterns they share. |
Use h and E together to distinguish changes in randomness from changes in organization. Use d to compare recordings, texts or symbolic trajectories.
Start in Python
pip install lzcomplexity
import lzcomplexity as lz
sequence = "00010111" * 256
other = "01010101" * 256
h = lz.h(sequence, log_base=2) # Randomness
E, increments = lz.emc(sequence, max_block_size=16) # Structure across ranges
d = lz.nid(sequence, other) # Distance between sequences
Pass text or bytes directly. For categorical data, assign one byte to each symbol; for continuous signals, first choose a symbolic representation. The Python reference documents each function. The separate usage cheatsheet collects the common calls.
From the terminal
Download the standalone tools from GitHub Releases.
lzcomplexity recording.txt -F text -l 2 # Analyze a sequence; write a JSON report
lzdistance sequences.txt -I TXT # Compare one sequence per line
The command-line guide covers file formats, batch analysis and distance matrices, with a separate usage cheatsheet.
Research applications
These studies show the kinds of scientific questions that entropy, structure and distance can help investigate:
| Application | Explore |
|---|---|
| Nonlinear dynamics | Transitions between collective patterns and chaos in coupled Adler-type oscillators (Physical Review E, 2023). |
| Brain activity | Patterns and connectivity across brain regions during cognitive tasks in task-based fMRI (arXiv preprint, 2025). |
| Written language | The balance between innovation and context at different levels of text organization (PLOS ONE, 2019). |
See the worked examples and research references to develop an analysis for your own data.
Authors & citation
- Efrén Aragón Pérez — creator and principal author.
- Daniel Estévez Moya — Rust implementation.
- Ernesto Estévez Rams — scientific foundations.
Aragón-Pérez, E., & Estevez-Rams, E. (2025). Lzcomplexity: Entropy Measurement Library. Revista Cubana de Física, 42(2), 80–86. Article · Software DOI · BibTeX
Released under the MIT license.
Software

ResDAG
A modern, GPU-accelerated Reservoir Computing library for PyTorch. ResDAG brings the power of Echo State Networks (ESNs) and reservoir computing to PyTorch with a clean, modular API. Built for researchers and practitioners who need fast, flexible, and production-ready reservoir computing models.

TSDynamics
TSDynamics: A Python package for defining and simulating continuous and discrete dynamical systems, including time-delay equations and maps. With a user-friendly interface for RHS definitions, it provides tools for numerical analysis and aims to integrate advanced time series analysis tools..

hilbertplot
The complete set of 40 two-dimensional Hilbert curves, and fast data plots on them.