qkd_key_rate.utils.entropy module

Functions used for entropy calculations. For computational stability, we define two functions and use one based on the applicable setting.

qkd_key_rate.utils.entropy.binary_entropy(e)[source]

Binary entropy function.

\(h(e):\mathbb{R} \rightarrow [0,1]\) is the binary entropy function.

The domain of the function has been extended such that the optimizer can do a proper constrained non-linear optimization.

Return type:

float

qkd_key_rate.utils.entropy.one_minus_binary_entropy(e)[source]

One minus the binary entropy function.

\(h(e):\mathbb{R} \rightarrow [0,1]\) is the binary entropy function.

The domain of the function has been extended such that the optimizer can do a proper constrained non-linear optimization.

This computation is more precise if \(h(e)\) is close to zero or one.

Return type:

float