Latex Documentation

This page contains the Latex Package documentation.

The blockentropy Module

Simple command write out entropy or mutual information from a string.

cmpy.latex.blockentropy.mutual_information_string(shorthand, alt=False, sep=':')

Returns a LaTeX string representing the given shorthand.

Typing various block entropies or mutual informations can be tedious. We can easily make this more flexible, but for now, we adopt the following shorthand notation:

X is a random variable for a measurement S is a random variable for a state

Then we use the following context free grammar:

A -> HB | IB | IB B -> C | CgC C -> CC | D D -> E | EF | EFF E -> X | S F -> any single character

As an example,

HX0LSL corresponds to H[X_0^L, S_L] IS1S2 corresponds to I[S_1 : S_2] when sep=’:’ HSLgX0L correpsonds to H[S_L | X_0^L]

The sep parameter species how mutual informations should separate random variables. This is usually be a ‘:’ or a ‘;’.


shorthand : str

A string to be converted to LaTeX.

alt : bool

If True, then we use AlternateState instead of CausalState.

sep : string

The separator to use between mutual information random variables.


latex : str

The LaTeX string representing the shorthand.

cmpy.latex.blockentropy.parse(shorthand, alt, sep)