comnum#
Link-level simulation of digital communication systems, wireless and optical.
comnum is the Python interface of comnum:
the blocks of a digital or optical link — sources, constellations, pulse shaping,
channels, fibre propagation, devices, receiver DSP and metrics — implemented in Rust
and driven from Python with NumPy arrays. Monte Carlo campaigns run on every core with
reproducible random streams, and their results come with confidence intervals.
Lightweight: one run-time dependency in Python (numpy), 9 direct crates in Rust and no C, C++ or Fortran library to build; 27 MB installed with its dependencies (the benchmark’s environment: komm 22 MB, OptiCommPy 321 MB, Sionna 1004 MB).
Fast: compiled Rust, Monte Carlo runs on every core; on one CPU thread, the links of the benchmark take 2.1 to 33 times as long with komm, 2.3 to 4.7 times as long with OptiCommPy and 1.1 to 7.4 times as long with Sionna as with comnum.
Safe:
unsafecode forbidden in every crate, invalid inputs are errors (one error type), results independent of the thread count; 750 unit tests, 198 validation tests, 276 Python tests.Validated: compared with 139 papers, standards and reference tools (88 fully reproduced, 47 partly), 120 inconsistencies found in them; 104 validation cards rerun a comparison without the paper.
The details, and how these numbers are produced: Why comnum. .. highlights:end
import comnum
rng = comnum.Rng(1)
c = comnum.Constellation("qam", 16).normalized()
bits = comnum.bits(4 * 100_000, rng)
y = comnum.awgn_ebn0(c.map_bits(bits), 10.0, 4, rng)
comnum.ber(c.demap_bits(y), bits), comnum.theory_ber(16, 10.0, "qam")
Learning#
Installation, conventions (arrays, generators, units) and a first link.
Step by step: a first link, a classical single-carrier chain, a block of your own in Python, a campaign as a specification run from the command line, the profile of a chain, the signals along it, and a measured signal.
Doing#
Monte Carlo campaigns in Python and on the parallel Rust runner, chains of blocks, declarative specifications, the analysis of a campaign, wireless and optical links, the standards, recordings.
Error rates over AWGN and fading, information rates, pulse shaping, dispersion, nonlinear propagation, MIMO detection, space-time codes and capacity, PAPR reduction, amplifiers and predistortion — against theory, and against named figures and tables of the literature.
Understanding#
The four kinds of evidence, the validation cards, the two registries and the pages generated from them, what the validation found.
The evidence behind every module: validated against a publication, a standard or a reference implementation, against a closed form, or self-consistent only.
OptiCommPy, GNPy, AFF3CT, Sionna, py3gpp, sigmf-python: what is compared, how closely, the differences found, and the deliberate deviations.
Lightweight, fast, safe and validated: the numbers behind each, recomputed from the repository.
The same links in komm, OptiCommPy, Sionna and comnum: agreement of the error rates and of the fields, and the time of every library on one thread and on all.
Where the time goes, and how the runner scales with the cores.
Reference#
Every function and class, with the formula it implements.
The fourteen crates on docs.rs, and the architecture, the decisions and the changelog on GitHub.