Skip to content

Documentation

lzcomplexity analyzes symbolic sequences: text, binary states, categorical events, DNA or a discretized time series. Use it to measure entropy density h, effective measure complexity E and information distance. The Python library and standalone binaries share the same Rust core.

Start an analysis

Install lzcomplexity, then follow your first factorization for a complete Python example. The input guide explains how to represent symbols as bytes, including numeric states and Unicode text.

import lzcomplexity as lz

sequence = b"00010111" * 256
result = lz.lz76(sequence, log_base=2, max_block_size=16)
print(result["h"])
print(result["emc"]["value"])

Continue with reading the numbers to interpret the results and choose comparable lengths, encodings and units.

Python library

The Python API reference documents every function, its parameters, return values and examples:

  • factorization returns the factor count and byte boundaries.
  • h measures entropy density.
  • emc returns effective measure complexity E and its range profile.
  • nid compares two sequences using information distance.
  • lz76 returns the complete analysis in one call.

For a compact reminder of the calls and input preparation, keep the Python usage cheatsheet nearby.

Standalone binaries

The command-line guide covers installation, file preparation and output. Use lzcomplexity to analyze sequences and lzdistance to compare collections. Both have worked examples and an option reference. The separate CLI usage cheatsheet collects common commands.

Apply it to your data

The recipes walk through neural time series, DNA and FASTA, nonlinear dynamics and comparisons across many sequences. Each explains the input preparation alongside the analysis.

The concept chapters explain LZ76 factorization, entropy density, E and information distance. For native applications, the Rust reference covers measurement functions, sequence operations and result types.