dit 1.2.3__tar.gz → 2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (536) hide show
  1. dit-2.1/.gitignore +63 -0
  2. dit-2.1/PKG-INFO +489 -0
  3. {dit-1.2.3 → dit-2.1}/README.rst +122 -87
  4. dit-2.1/dit/__init__.py +39 -0
  5. dit-2.1/dit/abc.py +116 -0
  6. {dit-1.2.3 → dit-2.1}/dit/abstractdist.py +27 -37
  7. dit-2.1/dit/algorithms/__init__.py +39 -0
  8. dit-2.1/dit/algorithms/admui.py +202 -0
  9. dit-2.1/dit/algorithms/broja_cone.py +368 -0
  10. dit-2.1/dit/algorithms/broja_method.py +178 -0
  11. dit-2.1/dit/algorithms/broja_util.py +11 -0
  12. dit-2.1/dit/algorithms/channelcapacity.py +145 -0
  13. dit-2.1/dit/algorithms/convex_maximization.py +89 -0
  14. {dit-1.2.3 → dit-2.1}/dit/algorithms/distribution_optimizers.py +241 -96
  15. {dit-1.2.3 → dit-2.1}/dit/algorithms/frankwolfe.py +25 -34
  16. dit-2.1/dit/algorithms/ipf.py +111 -0
  17. {dit-1.2.3 → dit-2.1}/dit/algorithms/lattice.py +73 -111
  18. {dit-1.2.3 → dit-2.1}/dit/algorithms/maxentropy.py +167 -142
  19. {dit-1.2.3 → dit-2.1}/dit/algorithms/maxentropyfw.py +51 -89
  20. {dit-1.2.3 → dit-2.1}/dit/algorithms/minimal_sufficient_statistic.py +32 -61
  21. dit-2.1/dit/algorithms/optimization.py +2226 -0
  22. dit-2.1/dit/algorithms/optimization_jax.py +2259 -0
  23. dit-2.1/dit/algorithms/optimization_pytensor.py +1948 -0
  24. dit-2.1/dit/algorithms/optimization_torch.py +2194 -0
  25. {dit-1.2.3 → dit-2.1}/dit/algorithms/optutil.py +65 -60
  26. {dit-1.2.3 → dit-2.1}/dit/algorithms/pid_broja.py +181 -203
  27. {dit-1.2.3 → dit-2.1}/dit/algorithms/prune_expand.py +55 -30
  28. dit-2.1/dit/algorithms/stats.py +488 -0
  29. {dit-1.2.3 → dit-2.1}/dit/bgm.py +33 -36
  30. dit-2.1/dit/cdisthelpers.py +77 -0
  31. dit-2.1/dit/channelorder/__init__.py +27 -0
  32. dit-2.1/dit/channelorder/_utils.py +190 -0
  33. dit-2.1/dit/channelorder/deficiency.py +473 -0
  34. dit-2.1/dit/channelorder/orderings.py +569 -0
  35. dit-2.1/dit/coding/__init__.py +78 -0
  36. dit-2.1/dit/coding/_channel.py +119 -0
  37. dit-2.1/dit/coding/_gf2.py +128 -0
  38. dit-2.1/dit/coding/_util.py +76 -0
  39. dit-2.1/dit/coding/base.py +248 -0
  40. dit-2.1/dit/coding/block_codes.py +147 -0
  41. dit-2.1/dit/coding/codes.py +391 -0
  42. dit-2.1/dit/coding/convolutional.py +166 -0
  43. dit-2.1/dit/coding/ldpc.py +154 -0
  44. dit-2.1/dit/coding/linear.py +197 -0
  45. dit-2.1/dit/coding/polar.py +143 -0
  46. dit-2.1/dit/coding/symbol_code.py +258 -0
  47. dit-2.1/dit/coding/tunstall.py +181 -0
  48. dit-2.1/dit/coding/universal.py +130 -0
  49. {dit-1.2.3 → dit-2.1}/dit/distconst.py +335 -154
  50. dit-2.1/dit/distribution.py +2501 -0
  51. {dit-1.2.3 → dit-2.1}/dit/divergences/__init__.py +10 -15
  52. {dit-1.2.3 → dit-2.1}/dit/divergences/_kl_nonmerge.py +20 -12
  53. dit-2.1/dit/divergences/copy_mutual_information.py +82 -0
  54. {dit-1.2.3 → dit-2.1}/dit/divergences/coupling_metrics.py +5 -18
  55. {dit-1.2.3 → dit-2.1}/dit/divergences/cross_entropy.py +9 -24
  56. {dit-1.2.3 → dit-2.1}/dit/divergences/earth_movers_distance.py +14 -6
  57. {dit-1.2.3 → dit-2.1}/dit/divergences/generalized_divergences.py +38 -101
  58. dit-2.1/dit/divergences/hypercontractivity_coefficient.py +228 -0
  59. {dit-1.2.3 → dit-2.1}/dit/divergences/jensen_shannon_divergence.py +30 -28
  60. {dit-1.2.3 → dit-2.1}/dit/divergences/kullback_leibler_divergence.py +8 -14
  61. {dit-1.2.3 → dit-2.1}/dit/divergences/maximum_correlation.py +24 -25
  62. {dit-1.2.3 → dit-2.1}/dit/divergences/pmf.py +29 -10
  63. {dit-1.2.3 → dit-2.1}/dit/divergences/variational_distance.py +16 -6
  64. dit-2.1/dit/example_channels/__init__.py +36 -0
  65. dit-2.1/dit/example_channels/_util.py +52 -0
  66. dit-2.1/dit/example_channels/binary.py +142 -0
  67. dit-2.1/dit/example_channels/qary.py +99 -0
  68. dit-2.1/dit/example_channels/trivial.py +57 -0
  69. {dit-1.2.3 → dit-2.1}/dit/example_dists/__init__.py +2 -2
  70. dit-2.1/dit/example_dists/circuits.py +109 -0
  71. dit-2.1/dit/example_dists/dependencies.py +69 -0
  72. {dit-1.2.3 → dit-2.1}/dit/example_dists/dice.py +54 -13
  73. {dit-1.2.3 → dit-2.1}/dit/example_dists/giant_bit.py +12 -7
  74. dit-2.1/dit/example_dists/intrinsic.py +30 -0
  75. dit-2.1/dit/example_dists/mdbsi.py +17 -0
  76. dit-2.1/dit/example_dists/miscellaneous.py +11 -0
  77. {dit-1.2.3 → dit-2.1}/dit/example_dists/n_mod_m.py +9 -11
  78. {dit-1.2.3 → dit-2.1}/dit/example_dists/nonsignalling_boxes.py +11 -11
  79. {dit-1.2.3 → dit-2.1}/dit/example_dists/numeric.py +99 -22
  80. {dit-1.2.3 → dit-2.1}/dit/exceptions.py +35 -43
  81. {dit-1.2.3 → dit-2.1}/dit/helpers.py +80 -180
  82. {dit-1.2.3 → dit-2.1}/dit/inference/__init__.py +2 -2
  83. {dit-1.2.3 → dit-2.1}/dit/inference/binning.py +10 -10
  84. {dit-1.2.3 → dit-2.1}/dit/inference/counts.py +59 -29
  85. {dit-1.2.3 → dit-2.1}/dit/inference/estimators.py +11 -5
  86. {dit-1.2.3 → dit-2.1}/dit/inference/knn_estimators.py +28 -22
  87. {dit-1.2.3 → dit-2.1}/dit/inference/pycounts.pyx +5 -5
  88. {dit-1.2.3 → dit-2.1}/dit/inference/segmentaxis.py +23 -23
  89. {dit-1.2.3 → dit-2.1}/dit/inference/time_series.py +14 -11
  90. dit-2.1/dit/math/__init__.py +20 -0
  91. {dit-1.2.3 → dit-2.1}/dit/math/_close.pyx +1 -19
  92. {dit-1.2.3 → dit-2.1}/dit/math/_samplediscrete.pyx +0 -2
  93. {dit-1.2.3 → dit-2.1}/dit/math/aitchison.py +41 -63
  94. {dit-1.2.3 → dit-2.1}/dit/math/combinatorics.py +10 -11
  95. {dit-1.2.3 → dit-2.1}/dit/math/equal.py +23 -27
  96. {dit-1.2.3 → dit-2.1}/dit/math/fraction.py +1 -8
  97. {dit-1.2.3 → dit-2.1}/dit/math/misc.py +21 -25
  98. {dit-1.2.3 → dit-2.1}/dit/math/ops.py +67 -74
  99. {dit-1.2.3 → dit-2.1}/dit/math/pmfops.py +38 -43
  100. {dit-1.2.3 → dit-2.1}/dit/math/sampling.py +38 -53
  101. {dit-1.2.3 → dit-2.1}/dit/math/sigmaalgebra.py +17 -20
  102. dit-2.1/dit/multivariate/__init__.py +23 -0
  103. dit-2.1/dit/multivariate/_backend.py +210 -0
  104. {dit-1.2.3 → dit-2.1}/dit/multivariate/caekl_mutual_information.py +10 -15
  105. {dit-1.2.3 → dit-2.1}/dit/multivariate/cohesion.py +7 -16
  106. {dit-1.2.3 → dit-2.1}/dit/multivariate/coinformation.py +16 -21
  107. dit-2.1/dit/multivariate/common_informations/__init__.py +16 -0
  108. {dit-1.2.3 → dit-2.1}/dit/multivariate/common_informations/base_markov_optimizer.py +169 -74
  109. dit-2.1/dit/multivariate/common_informations/beta_common_information.py +344 -0
  110. {dit-1.2.3 → dit-2.1}/dit/multivariate/common_informations/exact_common_information.py +17 -5
  111. {dit-1.2.3 → dit-2.1}/dit/multivariate/common_informations/functional_common_information.py +26 -48
  112. {dit-1.2.3 → dit-2.1}/dit/multivariate/common_informations/gk_common_information.py +16 -19
  113. dit-2.1/dit/multivariate/common_informations/kamath_common_information.py +134 -0
  114. dit-2.1/dit/multivariate/common_informations/maxent_function.py +323 -0
  115. {dit-1.2.3 → dit-2.1}/dit/multivariate/common_informations/mss_common_information.py +12 -13
  116. dit-2.1/dit/multivariate/common_informations/stochastic_gk_common_information.py +176 -0
  117. {dit-1.2.3 → dit-2.1}/dit/multivariate/common_informations/wyner_common_information.py +16 -3
  118. dit-2.1/dit/multivariate/delta_gamma.py +120 -0
  119. {dit-1.2.3 → dit-2.1}/dit/multivariate/deweese.py +45 -48
  120. dit-2.1/dit/multivariate/dual_total_correlation.py +148 -0
  121. {dit-1.2.3 → dit-2.1}/dit/multivariate/entropy.py +9 -13
  122. {dit-1.2.3 → dit-2.1}/dit/multivariate/interaction_information.py +5 -10
  123. dit-2.1/dit/multivariate/logarithmic_decomposition.py +468 -0
  124. {dit-1.2.3 → dit-2.1}/dit/multivariate/necessary_conditional_entropy.py +12 -15
  125. dit-2.1/dit/multivariate/o_information.py +50 -0
  126. dit-2.1/dit/multivariate/quax_synergy.py +250 -0
  127. dit-2.1/dit/multivariate/secret_key_agreement/__init__.py +50 -0
  128. {dit-1.2.3 → dit-2.1}/dit/multivariate/secret_key_agreement/base_skar_optimizers.py +444 -263
  129. dit-2.1/dit/multivariate/secret_key_agreement/interactive_intrinsic_mutual_informations.py +186 -0
  130. {dit-1.2.3 → dit-2.1}/dit/multivariate/secret_key_agreement/intrinsic_mutual_informations.py +27 -18
  131. {dit-1.2.3 → dit-2.1}/dit/multivariate/secret_key_agreement/minimal_intrinsic_mutual_informations.py +49 -20
  132. {dit-1.2.3 → dit-2.1}/dit/multivariate/secret_key_agreement/no_communication.py +4 -14
  133. {dit-1.2.3 → dit-2.1}/dit/multivariate/secret_key_agreement/one_way_skar.py +24 -25
  134. {dit-1.2.3 → dit-2.1}/dit/multivariate/secret_key_agreement/reduced_intrinsic_mutual_informations.py +21 -25
  135. {dit-1.2.3 → dit-2.1}/dit/multivariate/secret_key_agreement/secrecy_capacity.py +12 -18
  136. dit-2.1/dit/multivariate/secret_key_agreement/skar_lower_bounds.py +86 -0
  137. dit-2.1/dit/multivariate/secret_key_agreement/trivial_bounds.py +132 -0
  138. {dit-1.2.3 → dit-2.1}/dit/multivariate/secret_key_agreement/two_part_intrinsic_mutual_informations.py +20 -21
  139. dit-2.1/dit/multivariate/secret_key_agreement/two_way_skar.py +133 -0
  140. dit-2.1/dit/multivariate/synergistic_disclosure.py +218 -0
  141. {dit-1.2.3 → dit-2.1}/dit/multivariate/total_correlation.py +6 -11
  142. dit-2.1/dit/multivariate/transmission.py +56 -0
  143. {dit-1.2.3 → dit-2.1}/dit/multivariate/tse_complexity.py +8 -14
  144. dit-2.1/dit/multivariate/union_information.py +205 -0
  145. {dit-1.2.3 → dit-2.1}/dit/other/__init__.py +7 -0
  146. {dit-1.2.3 → dit-2.1}/dit/other/cumulative_residual_entropy.py +32 -43
  147. dit-2.1/dit/other/disequilibrium.py +75 -0
  148. {dit-1.2.3 → dit-2.1}/dit/other/extropy.py +11 -24
  149. {dit-1.2.3 → dit-2.1}/dit/other/lautum_information.py +6 -11
  150. dit-2.1/dit/other/perplexity.py +38 -0
  151. {dit-1.2.3 → dit-2.1}/dit/other/renyi_entropy.py +7 -17
  152. dit-2.1/dit/other/sibson_mutual_information.py +309 -0
  153. {dit-1.2.3 → dit-2.1}/dit/other/tsallis_entropy.py +7 -20
  154. dit-2.1/dit/params.py +152 -0
  155. dit-2.1/dit/pid/__init__.py +9 -0
  156. dit-2.1/dit/pid/distributions/__init__.py +55 -0
  157. dit-2.1/dit/pid/distributions/bivariate.py +125 -0
  158. dit-2.1/dit/pid/distributions/trivariate.py +85 -0
  159. dit-2.1/dit/pid/hcs.py +71 -0
  160. dit-2.1/dit/pid/helpers.py +112 -0
  161. dit-2.1/dit/pid/hmos.py +224 -0
  162. dit-2.1/dit/pid/measures/__init__.py +56 -0
  163. dit-2.1/dit/pid/measures/ibroja.py +157 -0
  164. dit-2.1/dit/pid/measures/iccs.py +107 -0
  165. dit-2.1/dit/pid/measures/ict.py +77 -0
  166. dit-2.1/dit/pid/measures/ideg.py +187 -0
  167. dit-2.1/dit/pid/measures/idelta.py +107 -0
  168. dit-2.1/dit/pid/measures/ideltalambda.py +257 -0
  169. dit-2.1/dit/pid/measures/idep.py +253 -0
  170. dit-2.1/dit/pid/measures/ido.py +132 -0
  171. dit-2.1/dit/pid/measures/igh.py +185 -0
  172. dit-2.1/dit/pid/measures/iig.py +130 -0
  173. dit-2.1/dit/pid/measures/iipid.py +148 -0
  174. dit-2.1/dit/pid/measures/imc.py +301 -0
  175. dit-2.1/dit/pid/measures/imes.py +39 -0
  176. dit-2.1/dit/pid/measures/imin.py +69 -0
  177. {dit-1.2.3/dit/pid → dit-2.1/dit/pid/measures}/immi.py +11 -11
  178. dit-2.1/dit/pid/measures/ipm.py +97 -0
  179. dit-2.1/dit/pid/measures/iprec.py +220 -0
  180. {dit-1.2.3/dit/pid → dit-2.1/dit/pid/measures}/iproj.py +40 -33
  181. dit-2.1/dit/pid/measures/irav.py +106 -0
  182. dit-2.1/dit/pid/measures/irdr.py +166 -0
  183. {dit-1.2.3/dit/pid → dit-2.1/dit/pid/measures}/irr.py +12 -12
  184. {dit-1.2.3/dit/pid → dit-2.1/dit/pid/measures}/iskar.py +61 -58
  185. dit-2.1/dit/pid/measures/isx.py +105 -0
  186. dit-2.1/dit/pid/measures/iwedge.py +44 -0
  187. dit-2.1/dit/pid/ped.py +56 -0
  188. dit-2.1/dit/pid/pid.py +940 -0
  189. dit-2.1/dit/pid/syndisc.py +585 -0
  190. {dit-1.2.3 → dit-2.1}/dit/profiles/__init__.py +3 -4
  191. {dit-1.2.3 → dit-2.1}/dit/profiles/base_profile.py +63 -14
  192. {dit-1.2.3 → dit-2.1}/dit/profiles/complexity_profile.py +9 -13
  193. {dit-1.2.3 → dit-2.1}/dit/profiles/entropy_triangle.py +22 -17
  194. {dit-1.2.3 → dit-2.1}/dit/profiles/information_partitions.py +122 -133
  195. {dit-1.2.3 → dit-2.1}/dit/profiles/marginal_utility_of_information.py +38 -35
  196. {dit-1.2.3 → dit-2.1}/dit/profiles/schneidman.py +18 -21
  197. dit-2.1/dit/profiles/shapley_info_decomposition.py +210 -0
  198. {dit-1.2.3 → dit-2.1}/dit/rate_distortion/__init__.py +2 -1
  199. {dit-1.2.3 → dit-2.1}/dit/rate_distortion/blahut_arimoto.py +48 -30
  200. {dit-1.2.3 → dit-2.1}/dit/rate_distortion/curves.py +79 -54
  201. dit-2.1/dit/rate_distortion/distortions.py +50 -0
  202. dit-2.1/dit/rate_distortion/gray_wyner/__init__.py +31 -0
  203. dit-2.1/dit/rate_distortion/gray_wyner/curve.py +148 -0
  204. dit-2.1/dit/rate_distortion/gray_wyner/network.py +248 -0
  205. dit-2.1/dit/rate_distortion/gray_wyner/optimizer.py +298 -0
  206. dit-2.1/dit/rate_distortion/gray_wyner/plotting.py +49 -0
  207. {dit-1.2.3 → dit-2.1}/dit/rate_distortion/information_bottleneck.py +80 -48
  208. {dit-1.2.3 → dit-2.1}/dit/rate_distortion/plotting.py +33 -32
  209. {dit-1.2.3 → dit-2.1}/dit/rate_distortion/rate_distortion.py +116 -34
  210. {dit-1.2.3 → dit-2.1}/dit/samplespace.py +42 -57
  211. dit-2.1/dit/shannon/__init__.py +5 -0
  212. {dit-1.2.3 → dit-2.1}/dit/shannon/shannon.py +20 -41
  213. {dit-1.2.3 → dit-2.1}/dit/utils/__init__.py +4 -9
  214. dit-2.1/dit/utils/bindargs.py +42 -0
  215. {dit-1.2.3 → dit-2.1}/dit/utils/context.py +9 -6
  216. {dit-1.2.3 → dit-2.1}/dit/utils/latexarray.py +53 -53
  217. dit-2.1/dit/utils/logger.py +45 -0
  218. {dit-1.2.3 → dit-2.1}/dit/utils/misc.py +72 -83
  219. {dit-1.2.3 → dit-2.1}/dit/utils/optimization.py +105 -40
  220. dit-2.1/dit/utils/table.py +35 -0
  221. {dit-1.2.3 → dit-2.1}/dit/utils/testing.py +127 -20
  222. {dit-1.2.3 → dit-2.1}/dit/utils/units.py +9 -7
  223. {dit-1.2.3 → dit-2.1}/dit/validate.py +21 -25
  224. dit-2.1/pyproject.toml +311 -0
  225. dit-2.1/tests/_backends.py +48 -0
  226. dit-2.1/tests/algorithms/test_admui.py +61 -0
  227. dit-2.1/tests/algorithms/test_broja_cone.py +33 -0
  228. dit-2.1/tests/algorithms/test_channelcapacity.py +201 -0
  229. dit-2.1/tests/algorithms/test_degrees_of_freedom.py +63 -0
  230. dit-2.1/tests/algorithms/test_ipf.py +91 -0
  231. {dit-1.2.3/dit/algorithms/tests → dit-2.1/tests/algorithms}/test_lattice.py +38 -41
  232. dit-2.1/tests/algorithms/test_marginal_constraints.py +38 -0
  233. dit-2.1/tests/algorithms/test_maxentropy_fast.py +134 -0
  234. dit-2.1/tests/algorithms/test_minimal_sufficient_statistic.py +56 -0
  235. dit-2.1/tests/algorithms/test_optimizers.py +296 -0
  236. dit-2.1/tests/algorithms/test_parallel_sweep.py +105 -0
  237. dit-2.1/tests/algorithms/test_prune_expand.py +92 -0
  238. dit-2.1/tests/algorithms/test_stats.py +286 -0
  239. dit-2.1/tests/channelorder/test_deficiency.py +191 -0
  240. dit-2.1/tests/channelorder/test_orderings.py +232 -0
  241. dit-2.1/tests/channelorder/test_properties.py +202 -0
  242. dit-2.1/tests/channelorder/test_utils.py +105 -0
  243. dit-2.1/tests/coding/__init__.py +0 -0
  244. dit-2.1/tests/coding/test_base.py +45 -0
  245. dit-2.1/tests/coding/test_channel.py +60 -0
  246. dit-2.1/tests/coding/test_channel_codes.py +146 -0
  247. dit-2.1/tests/coding/test_edge_cases.py +157 -0
  248. dit-2.1/tests/coding/test_gf2.py +49 -0
  249. dit-2.1/tests/coding/test_golomb.py +76 -0
  250. dit-2.1/tests/coding/test_linear.py +115 -0
  251. dit-2.1/tests/coding/test_source_edges.py +158 -0
  252. dit-2.1/tests/coding/test_symbol_codes.py +178 -0
  253. dit-2.1/tests/coding/test_tunstall.py +63 -0
  254. dit-2.1/tests/coding/test_universal.py +74 -0
  255. dit-2.1/tests/conftest.py +8 -0
  256. dit-2.1/tests/divergences/test_copy_mutual_information.py +24 -0
  257. {dit-1.2.3/dit/divergences/tests → dit-2.1/tests/divergences}/test_coupling_metrics.py +3 -5
  258. dit-2.1/tests/divergences/test_cross_entropy.py +70 -0
  259. dit-2.1/tests/divergences/test_emd.py +57 -0
  260. {dit-1.2.3/dit/divergences/tests → dit-2.1/tests/divergences}/test_generalized_divergences.py +92 -70
  261. {dit-1.2.3/dit/divergences/tests → dit-2.1/tests/divergences}/test_hypercontractivity_coefficient.py +24 -29
  262. {dit-1.2.3/dit/divergences/tests → dit-2.1/tests/divergences}/test_jensen_shannon_divergence.py +21 -16
  263. dit-2.1/tests/divergences/test_kullback_leibler_divergence.py +69 -0
  264. {dit-1.2.3/dit/divergences/tests → dit-2.1/tests/divergences}/test_maximum_correlation.py +16 -13
  265. {dit-1.2.3/dit/divergences/tests → dit-2.1/tests/divergences}/test_nonmerge.py +7 -8
  266. {dit-1.2.3/dit/divergences/tests → dit-2.1/tests/divergences}/test_variational_distance.py +8 -10
  267. dit-2.1/tests/example_channels/__init__.py +0 -0
  268. dit-2.1/tests/example_channels/test_binary.py +100 -0
  269. dit-2.1/tests/example_channels/test_qary.py +91 -0
  270. dit-2.1/tests/example_channels/test_trivial.py +51 -0
  271. dit-2.1/tests/example_channels/test_util.py +63 -0
  272. {dit-1.2.3/dit/example_dists/tests → dit-2.1/tests/example_dists}/test_circuits.py +18 -19
  273. {dit-1.2.3/dit/example_dists/tests → dit-2.1/tests/example_dists}/test_dependencies.py +3 -4
  274. {dit-1.2.3/dit/example_dists/tests → dit-2.1/tests/example_dists}/test_dice.py +5 -5
  275. {dit-1.2.3/dit/example_dists/tests → dit-2.1/tests/example_dists}/test_giant_bit.py +7 -7
  276. dit-2.1/tests/example_dists/test_mdbsi.py +80 -0
  277. {dit-1.2.3/dit/example_dists/tests → dit-2.1/tests/example_dists}/test_miscellaneous.py +1 -1
  278. dit-2.1/tests/example_dists/test_n_mod_m.py +47 -0
  279. dit-2.1/tests/example_dists/test_numeric.py +176 -0
  280. dit-2.1/tests/example_dists/test_pr_box.py +38 -0
  281. dit-2.1/tests/inference/__init__.py +3 -0
  282. {dit-1.2.3/dit/inference/tests → dit-2.1/tests/inference}/test_binning.py +2 -2
  283. dit-2.1/tests/inference/test_counts.py +46 -0
  284. {dit-1.2.3/dit/inference/tests → dit-2.1/tests/inference}/test_estimators.py +6 -6
  285. dit-2.1/tests/inference/test_knn_estimators.py +99 -0
  286. dit-2.1/tests/inference/test_segmentaxis.py +84 -0
  287. {dit-1.2.3/dit/inference/tests → dit-2.1/tests/inference}/test_timeseries.py +32 -7
  288. {dit-1.2.3/dit/math/tests → dit-2.1/tests/math}/test_aitchison.py +64 -52
  289. dit-2.1/tests/math/test_combinatorics.py +57 -0
  290. dit-2.1/tests/math/test_equal.py +89 -0
  291. {dit-1.2.3/dit/math/tests → dit-2.1/tests/math}/test_fraction.py +15 -12
  292. dit-2.1/tests/math/test_misc.py +106 -0
  293. {dit-1.2.3/dit/math/tests → dit-2.1/tests/math}/test_ops.py +22 -32
  294. {dit-1.2.3/dit/math/tests → dit-2.1/tests/math}/test_pmfops.py +32 -53
  295. {dit-1.2.3/dit/math/tests → dit-2.1/tests/math}/test_sampling.py +57 -57
  296. dit-2.1/tests/math/test_sigmaalgebra.py +148 -0
  297. dit-2.1/tests/multivariate/common_informations/__init__.py +3 -0
  298. dit-2.1/tests/multivariate/common_informations/test_backend_switching.py +253 -0
  299. dit-2.1/tests/multivariate/common_informations/test_beta_common_information.py +303 -0
  300. dit-2.1/tests/multivariate/common_informations/test_common_informations.py +83 -0
  301. dit-2.1/tests/multivariate/common_informations/test_exact_common_information.py +63 -0
  302. dit-2.1/tests/multivariate/common_informations/test_functional_common_information.py +56 -0
  303. dit-2.1/tests/multivariate/common_informations/test_gk_common_information.py +68 -0
  304. dit-2.1/tests/multivariate/common_informations/test_kamath_common_information.py +129 -0
  305. dit-2.1/tests/multivariate/common_informations/test_maxent_function.py +191 -0
  306. dit-2.1/tests/multivariate/common_informations/test_mss_common_information.py +59 -0
  307. dit-2.1/tests/multivariate/common_informations/test_stochastic_gk_common_information.py +171 -0
  308. dit-2.1/tests/multivariate/common_informations/test_wyner_common_information.py +77 -0
  309. dit-2.1/tests/multivariate/secret_key_agreement/__init__.py +3 -0
  310. dit-2.1/tests/multivariate/secret_key_agreement/test_interactive_intrinsic_mutual_information.py +18 -0
  311. dit-2.1/tests/multivariate/secret_key_agreement/test_intrinsic_mutual_information.py +227 -0
  312. dit-2.1/tests/multivariate/secret_key_agreement/test_lower_intrinsic_mutual_information.py +17 -0
  313. dit-2.1/tests/multivariate/secret_key_agreement/test_minimal_intrinsic_mutual_information.py +68 -0
  314. dit-2.1/tests/multivariate/secret_key_agreement/test_necessary_intrinsic_mutual_information.py +20 -0
  315. dit-2.1/tests/multivariate/secret_key_agreement/test_reduced_intrinsic_mutual_information.py +118 -0
  316. dit-2.1/tests/multivariate/secret_key_agreement/test_secrecy_capacity.py +31 -0
  317. dit-2.1/tests/multivariate/secret_key_agreement/test_skars.py +45 -0
  318. dit-2.1/tests/multivariate/secret_key_agreement/test_trivial_bounds.py +41 -0
  319. dit-2.1/tests/multivariate/secret_key_agreement/test_two_part_intrinsic_mutual_information.py +82 -0
  320. dit-2.1/tests/multivariate/secret_key_agreement/test_two_way_skar.py +30 -0
  321. dit-2.1/tests/multivariate/test_caekl_mutual_information.py +51 -0
  322. {dit-1.2.3/dit/multivariate/tests → dit-2.1/tests/multivariate}/test_cohesion.py +26 -14
  323. {dit-1.2.3/dit/multivariate/tests → dit-2.1/tests/multivariate}/test_coinformation.py +28 -21
  324. dit-2.1/tests/multivariate/test_delta_gamma.py +84 -0
  325. dit-2.1/tests/multivariate/test_deweese.py +58 -0
  326. dit-2.1/tests/multivariate/test_dual_total_correlation.py +115 -0
  327. dit-2.1/tests/multivariate/test_entropy.py +71 -0
  328. dit-2.1/tests/multivariate/test_interaction_information.py +38 -0
  329. dit-2.1/tests/multivariate/test_logarithmic_decomposition.py +410 -0
  330. {dit-1.2.3/dit/multivariate/tests → dit-2.1/tests/multivariate}/test_mutual_informations.py +6 -7
  331. dit-2.1/tests/multivariate/test_necessary_conditional_entropy.py +16 -0
  332. dit-2.1/tests/multivariate/test_o_information.py +29 -0
  333. dit-2.1/tests/multivariate/test_quax_synergy.py +145 -0
  334. dit-2.1/tests/multivariate/test_synergistic_disclosure.py +174 -0
  335. {dit-1.2.3/dit/multivariate/tests → dit-2.1/tests/multivariate}/test_total_correlation.py +22 -25
  336. dit-2.1/tests/multivariate/test_transmission.py +67 -0
  337. dit-2.1/tests/multivariate/test_tse_complexity.py +30 -0
  338. dit-2.1/tests/multivariate/test_union_information.py +160 -0
  339. {dit-1.2.3/dit/other/tests → dit-2.1/tests/other}/test_cumulative_residual_entropy.py +66 -40
  340. {dit-1.2.3/dit/other/tests → dit-2.1/tests/other}/test_disequilibrium.py +19 -21
  341. dit-2.1/tests/other/test_extropy.py +95 -0
  342. {dit-1.2.3/dit/other/tests → dit-2.1/tests/other}/test_lautum_information.py +3 -5
  343. dit-2.1/tests/other/test_perplexity.py +56 -0
  344. {dit-1.2.3/dit/other/tests → dit-2.1/tests/other}/test_renyi_entropy.py +6 -9
  345. dit-2.1/tests/other/test_sibson_mutual_information.py +128 -0
  346. {dit-1.2.3/dit/other/tests → dit-2.1/tests/other}/test_tsallis_entropy.py +5 -8
  347. dit-2.1/tests/pid/__init__.py +3 -0
  348. {dit-1.2.3/dit/pid/tests → dit-2.1/tests/pid}/test_hcs.py +22 -20
  349. dit-2.1/tests/pid/test_hmos.py +175 -0
  350. {dit-1.2.3/dit/pid/tests → dit-2.1/tests/pid}/test_ibroja.py +21 -9
  351. {dit-1.2.3/dit/pid/tests → dit-2.1/tests/pid}/test_iccs.py +23 -9
  352. dit-2.1/tests/pid/test_ict.py +56 -0
  353. dit-2.1/tests/pid/test_ideg.py +106 -0
  354. dit-2.1/tests/pid/test_idelta.py +45 -0
  355. {dit-1.2.3/dit/pid/tests → dit-2.1/tests/pid}/test_idep.py +12 -12
  356. dit-2.1/tests/pid/test_ido.py +121 -0
  357. dit-2.1/tests/pid/test_igh.py +60 -0
  358. dit-2.1/tests/pid/test_iig.py +59 -0
  359. dit-2.1/tests/pid/test_iipid.py +92 -0
  360. dit-2.1/tests/pid/test_imc.py +121 -0
  361. dit-2.1/tests/pid/test_imes.py +21 -0
  362. {dit-1.2.3/dit/pid/tests → dit-2.1/tests/pid}/test_imin.py +4 -4
  363. {dit-1.2.3/dit/pid/tests → dit-2.1/tests/pid}/test_immi.py +3 -3
  364. dit-2.1/tests/pid/test_ipm.py +172 -0
  365. dit-2.1/tests/pid/test_iprec.py +65 -0
  366. {dit-1.2.3/dit/pid/tests → dit-2.1/tests/pid}/test_iproj.py +4 -4
  367. dit-2.1/tests/pid/test_irav.py +83 -0
  368. dit-2.1/tests/pid/test_irdr.py +60 -0
  369. {dit-1.2.3/dit/pid/tests → dit-2.1/tests/pid}/test_irr.py +3 -3
  370. {dit-1.2.3/dit/pid/tests → dit-2.1/tests/pid}/test_iskar.py +16 -11
  371. dit-2.1/tests/pid/test_isx.py +244 -0
  372. {dit-1.2.3/dit/pid/tests → dit-2.1/tests/pid}/test_iwedge.py +3 -3
  373. dit-2.1/tests/pid/test_modified_syndisc.py +148 -0
  374. dit-2.1/tests/pid/test_pid_distribution.py +178 -0
  375. dit-2.1/tests/pid/test_syndisc.py +173 -0
  376. dit-2.1/tests/pid/test_syndisc_fast.py +128 -0
  377. dit-2.1/tests/pid/test_syndisc_lattice.py +124 -0
  378. dit-2.1/tests/profiles/__init__.py +3 -0
  379. dit-2.1/tests/profiles/test_base_profile.py +34 -0
  380. dit-2.1/tests/profiles/test_complexity_profile.py +30 -0
  381. dit-2.1/tests/profiles/test_entropy_triangle.py +71 -0
  382. dit-2.1/tests/profiles/test_information_partitions.py +162 -0
  383. dit-2.1/tests/profiles/test_mui.py +46 -0
  384. dit-2.1/tests/profiles/test_schneidman.py +49 -0
  385. dit-2.1/tests/profiles/test_shapley_info_decomposition.py +82 -0
  386. dit-2.1/tests/rate_distortion/__init__.py +3 -0
  387. {dit-1.2.3/dit/rate_distortion/tests → dit-2.1/tests/rate_distortion}/test_curves.py +14 -18
  388. dit-2.1/tests/rate_distortion/test_gray_wyner.py +175 -0
  389. {dit-1.2.3/dit/rate_distortion/tests → dit-2.1/tests/rate_distortion}/test_ib.py +2 -5
  390. {dit-1.2.3/dit/rate_distortion/tests → dit-2.1/tests/rate_distortion}/test_rd.py +2 -6
  391. dit-2.1/tests/shannon/test_shannon.py +89 -0
  392. dit-2.1/tests/test_abstractdist.py +69 -0
  393. {dit-1.2.3/dit → dit-2.1}/tests/test_bgm.py +49 -52
  394. dit-2.1/tests/test_cdisthelpers.py +61 -0
  395. {dit-1.2.3/dit → dit-2.1}/tests/test_distconst.py +154 -120
  396. dit-2.1/tests/test_distribution.py +1630 -0
  397. dit-2.1/tests/test_distribution_coverage.py +447 -0
  398. dit-2.1/tests/test_exceptions.py +137 -0
  399. dit-2.1/tests/test_helpers.py +122 -0
  400. {dit-1.2.3/dit → dit-2.1}/tests/test_inequalities.py +71 -74
  401. {dit-1.2.3/dit → dit-2.1}/tests/test_params.py +19 -22
  402. dit-2.1/tests/test_samplespace.py +184 -0
  403. {dit-1.2.3/dit → dit-2.1}/tests/test_validate.py +7 -8
  404. dit-2.1/tests/utils/test_bindargs.py +35 -0
  405. {dit-1.2.3/dit/utils/tests → dit-2.1/tests/utils}/test_bindargs3.py +10 -6
  406. {dit-1.2.3/dit/utils/tests → dit-2.1/tests/utils}/test_context.py +6 -9
  407. {dit-1.2.3/dit/utils/tests → dit-2.1/tests/utils}/test_latexarray.py +19 -21
  408. {dit-1.2.3/dit/utils/tests → dit-2.1/tests/utils}/test_misc.py +29 -23
  409. {dit-1.2.3/dit/utils/tests → dit-2.1/tests/utils}/test_optimization.py +2 -2
  410. dit-2.1/tests/utils/test_table.py +21 -0
  411. {dit-1.2.3/dit/utils/tests → dit-2.1/tests/utils}/test_testing.py +25 -29
  412. {dit-1.2.3/dit/utils/tests → dit-2.1/tests/utils}/test_units.py +11 -14
  413. dit-1.2.3/MANIFEST.in +0 -10
  414. dit-1.2.3/PKG-INFO +0 -371
  415. dit-1.2.3/dit/__init__.py +0 -39
  416. dit-1.2.3/dit/abc.py +0 -84
  417. dit-1.2.3/dit/algorithms/__init__.py +0 -18
  418. dit-1.2.3/dit/algorithms/channelcapacity.py +0 -148
  419. dit-1.2.3/dit/algorithms/optimization.py +0 -1461
  420. dit-1.2.3/dit/algorithms/stats.py +0 -170
  421. dit-1.2.3/dit/algorithms/tests/test_channelcapacity.py +0 -121
  422. dit-1.2.3/dit/algorithms/tests/test_marginal_constraints.py +0 -34
  423. dit-1.2.3/dit/algorithms/tests/test_minimal_sufficient_statistic.py +0 -61
  424. dit-1.2.3/dit/algorithms/tests/test_optimizers.py +0 -123
  425. dit-1.2.3/dit/algorithms/tests/test_prune_expand.py +0 -100
  426. dit-1.2.3/dit/algorithms/tests/test_stats.py +0 -76
  427. dit-1.2.3/dit/cdisthelpers.py +0 -141
  428. dit-1.2.3/dit/convert.py +0 -83
  429. dit-1.2.3/dit/distribution.py +0 -837
  430. dit-1.2.3/dit/divergences/hypercontractivity_coefficient.py +0 -137
  431. dit-1.2.3/dit/divergences/tests/test_cross_entropy.py +0 -68
  432. dit-1.2.3/dit/divergences/tests/test_emd.py +0 -56
  433. dit-1.2.3/dit/divergences/tests/test_kullback_leibler_divergence.py +0 -67
  434. dit-1.2.3/dit/example_dists/circuits.py +0 -105
  435. dit-1.2.3/dit/example_dists/dependencies.py +0 -68
  436. dit-1.2.3/dit/example_dists/intrinsic.py +0 -29
  437. dit-1.2.3/dit/example_dists/mdbsi.py +0 -13
  438. dit-1.2.3/dit/example_dists/miscellaneous.py +0 -15
  439. dit-1.2.3/dit/example_dists/tests/test_mdbsi.py +0 -51
  440. dit-1.2.3/dit/example_dists/tests/test_n_mod_m.py +0 -49
  441. dit-1.2.3/dit/example_dists/tests/test_numeric.py +0 -110
  442. dit-1.2.3/dit/example_dists/tests/test_pr_box.py +0 -35
  443. dit-1.2.3/dit/inference/tests/test_counts.py +0 -21
  444. dit-1.2.3/dit/inference/tests/test_knn_estimators.py +0 -71
  445. dit-1.2.3/dit/inference/tests/test_segmentaxis.py +0 -97
  446. dit-1.2.3/dit/math/__init__.py +0 -28
  447. dit-1.2.3/dit/math/tests/test_combinatorics.py +0 -55
  448. dit-1.2.3/dit/math/tests/test_equal.py +0 -69
  449. dit-1.2.3/dit/math/tests/test_misc.py +0 -79
  450. dit-1.2.3/dit/math/tests/test_sigmaalgebra.py +0 -147
  451. dit-1.2.3/dit/multivariate/__init__.py +0 -20
  452. dit-1.2.3/dit/multivariate/common_informations/__init__.py +0 -9
  453. dit-1.2.3/dit/multivariate/dual_total_correlation.py +0 -113
  454. dit-1.2.3/dit/multivariate/secret_key_agreement/__init__.py +0 -46
  455. dit-1.2.3/dit/multivariate/secret_key_agreement/interactive_intrinsic_mutual_informations.py +0 -154
  456. dit-1.2.3/dit/multivariate/secret_key_agreement/skar_lower_bounds.py +0 -88
  457. dit-1.2.3/dit/multivariate/secret_key_agreement/trivial_bounds.py +0 -167
  458. dit-1.2.3/dit/multivariate/secret_key_agreement/two_way_skar.py +0 -135
  459. dit-1.2.3/dit/multivariate/tests/test_caekl_mutual_information.py +0 -53
  460. dit-1.2.3/dit/multivariate/tests/test_deweese.py +0 -49
  461. dit-1.2.3/dit/multivariate/tests/test_dual_total_correlation.py +0 -96
  462. dit-1.2.3/dit/multivariate/tests/test_entropy.py +0 -74
  463. dit-1.2.3/dit/multivariate/tests/test_interaction_information.py +0 -40
  464. dit-1.2.3/dit/multivariate/tests/test_necessary_conditional_entropy.py +0 -17
  465. dit-1.2.3/dit/multivariate/tests/test_tse_complexity.py +0 -31
  466. dit-1.2.3/dit/npdist.py +0 -1488
  467. dit-1.2.3/dit/npscalardist.py +0 -1864
  468. dit-1.2.3/dit/other/disequilibrium.py +0 -96
  469. dit-1.2.3/dit/other/perplexity.py +0 -52
  470. dit-1.2.3/dit/other/tests/test_extropy.py +0 -97
  471. dit-1.2.3/dit/other/tests/test_perplexity.py +0 -59
  472. dit-1.2.3/dit/params.py +0 -143
  473. dit-1.2.3/dit/pid/__init__.py +0 -39
  474. dit-1.2.3/dit/pid/distributions/__init__.py +0 -52
  475. dit-1.2.3/dit/pid/distributions/bivariate.py +0 -92
  476. dit-1.2.3/dit/pid/distributions/trivariate.py +0 -52
  477. dit-1.2.3/dit/pid/hcs.py +0 -93
  478. dit-1.2.3/dit/pid/helpers.py +0 -54
  479. dit-1.2.3/dit/pid/ibroja.py +0 -128
  480. dit-1.2.3/dit/pid/iccs.py +0 -97
  481. dit-1.2.3/dit/pid/idep.py +0 -247
  482. dit-1.2.3/dit/pid/imin.py +0 -68
  483. dit-1.2.3/dit/pid/ipm.py +0 -39
  484. dit-1.2.3/dit/pid/irav.py +0 -51
  485. dit-1.2.3/dit/pid/iwedge.py +0 -44
  486. dit-1.2.3/dit/pid/lattice.py +0 -210
  487. dit-1.2.3/dit/pid/pid.py +0 -691
  488. dit-1.2.3/dit/pid/tests/test_ipm.py +0 -32
  489. dit-1.2.3/dit/pid/tests/test_irav.py +0 -48
  490. dit-1.2.3/dit/pid/tests/test_lattice.py +0 -15
  491. dit-1.2.3/dit/profiles/tests/test_complexity_profile.py +0 -29
  492. dit-1.2.3/dit/profiles/tests/test_entropy_triangle.py +0 -59
  493. dit-1.2.3/dit/profiles/tests/test_information_partitions.py +0 -157
  494. dit-1.2.3/dit/profiles/tests/test_mui.py +0 -36
  495. dit-1.2.3/dit/profiles/tests/test_schneidman.py +0 -46
  496. dit-1.2.3/dit/rate_distortion/distortions.py +0 -55
  497. dit-1.2.3/dit/shannon/__init__.py +0 -7
  498. dit-1.2.3/dit/shannon/tests/test_shannon.py +0 -91
  499. dit-1.2.3/dit/tests/test_abstractdist.py +0 -38
  500. dit-1.2.3/dit/tests/test_cdisthelpers.py +0 -57
  501. dit-1.2.3/dit/tests/test_convert.py +0 -51
  502. dit-1.2.3/dit/tests/test_distribution.py +0 -362
  503. dit-1.2.3/dit/tests/test_helpers.py +0 -91
  504. dit-1.2.3/dit/tests/test_npdist.py +0 -244
  505. dit-1.2.3/dit/tests/test_npscalardist.py +0 -324
  506. dit-1.2.3/dit/tests/test_samplespace.py +0 -114
  507. dit-1.2.3/dit/utils/bindargs.py +0 -124
  508. dit-1.2.3/dit/utils/exitstack.py +0 -10
  509. dit-1.2.3/dit/utils/logger.py +0 -45
  510. dit-1.2.3/dit/utils/tests/test_bindargs.py +0 -35
  511. dit-1.2.3/dit.egg-info/PKG-INFO +0 -371
  512. dit-1.2.3/dit.egg-info/SOURCES.txt +0 -285
  513. dit-1.2.3/dit.egg-info/dependency_links.txt +0 -1
  514. dit-1.2.3/dit.egg-info/requires.txt +0 -8
  515. dit-1.2.3/dit.egg-info/top_level.txt +0 -1
  516. dit-1.2.3/pytest.ini +0 -7
  517. dit-1.2.3/requirements.txt +0 -8
  518. dit-1.2.3/requirements_lt33.txt +0 -1
  519. dit-1.2.3/requirements_optional.txt +0 -9
  520. dit-1.2.3/requirements_testing.txt +0 -8
  521. dit-1.2.3/setup.cfg +0 -11
  522. dit-1.2.3/setup.py +0 -224
  523. {dit-1.2.3 → dit-2.1}/CREDITS.rst +0 -0
  524. {dit-1.2.3 → dit-2.1}/LICENSE.txt +0 -0
  525. {dit-1.2.3 → dit-2.1}/dit/inference/counts.c +0 -0
  526. {dit-1.2.3 → dit-2.1}/dit/inference/counts.h +0 -0
  527. {dit-1.2.3/dit → dit-2.1}/tests/__init__.py +0 -0
  528. {dit-1.2.3/dit/algorithms/tests → dit-2.1/tests/algorithms}/__init__.py +0 -0
  529. {dit-1.2.3/dit/profiles/tests → dit-2.1/tests/channelorder}/__init__.py +0 -0
  530. {dit-1.2.3/dit/divergences/tests → dit-2.1/tests/divergences}/__init__.py +0 -0
  531. {dit-1.2.3/dit/example_dists/tests → dit-2.1/tests/example_dists}/__init__.py +0 -0
  532. {dit-1.2.3/dit/math/tests → dit-2.1/tests/math}/__init__.py +0 -0
  533. {dit-1.2.3/dit/multivariate/tests → dit-2.1/tests/multivariate}/__init__.py +0 -0
  534. {dit-1.2.3/dit/other/tests → dit-2.1/tests/other}/__init__.py +0 -0
  535. {dit-1.2.3/dit/shannon/tests → dit-2.1/tests/shannon}/__init__.py +0 -0
  536. {dit-1.2.3/dit/utils/tests → dit-2.1/tests/utils}/__init__.py +0 -0
dit-2.1/.gitignore ADDED
@@ -0,0 +1,63 @@
1
+ # Python related
2
+ *.pyc
3
+ *.pyo
4
+ *.so
5
+
6
+ # Creating during installation
7
+ MANIFEST
8
+ build/
9
+ dist/
10
+ dit.egg-info/
11
+
12
+ # gedit
13
+ *.*~
14
+
15
+ # known autogenerated .c files
16
+ *.o
17
+
18
+ dit/math/_close.c
19
+ dit/math/_samplediscrete.c
20
+ dit/math/_*.html
21
+
22
+ # ignore coverage information
23
+ .coverage*
24
+ coverage.xml
25
+
26
+ # ignore project files for various IDEs
27
+
28
+ # komodo
29
+ *.kpf
30
+ *.komodoproject
31
+ .komodotools
32
+
33
+ # geany
34
+ *.geany
35
+
36
+ # ignore rope's project directory...
37
+ .ropeproject
38
+
39
+ # vscode
40
+ .vscode
41
+
42
+ # cursor
43
+ .cursor/
44
+
45
+ # vim
46
+ *.swp
47
+ *.swo
48
+
49
+ # ignore the documentation build directory
50
+ docs/_build/
51
+ docs/images/idiagrams.pdf
52
+ docs/images/*.png
53
+ .idea/
54
+ .cache/
55
+ .hypothesis/
56
+ .pypirc
57
+ .pytest_cache/
58
+ .vscode
59
+ dit/inference/pycounts.c
60
+ .mypy_cache
61
+ dit.code-workspace
62
+ newrelic_agent.log
63
+ __marimo__
dit-2.1/PKG-INFO ADDED
@@ -0,0 +1,489 @@
1
+ Metadata-Version: 2.4
2
+ Name: dit
3
+ Version: 2.1
4
+ Summary: Python package for information theory on discrete random variables.
5
+ Project-URL: Homepage, http://dit.io
6
+ Project-URL: Repository, https://github.com/dit/dit
7
+ Project-URL: Documentation, http://docs.dit.io
8
+ Author-email: chebee7i <admin@dit.io>, "Ryan G. James" <dit@autoplectic.com>
9
+ License-Expression: BSD-3-Clause
10
+ License-File: LICENSE.txt
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: License :: OSI Approved :: BSD License
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Scientific/Engineering
20
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
21
+ Classifier: Topic :: Scientific/Engineering :: Physics
22
+ Requires-Python: >=3.11
23
+ Requires-Dist: boltons
24
+ Requires-Dist: debtcollector
25
+ Requires-Dist: lattices>=0.5.0
26
+ Requires-Dist: loguru
27
+ Requires-Dist: networkx>=2.6
28
+ Requires-Dist: numpy>=1.22
29
+ Requires-Dist: pltable
30
+ Requires-Dist: scipy>=1.7
31
+ Requires-Dist: xarray
32
+ Provides-Extra: broja
33
+ Requires-Dist: ecos; extra == 'broja'
34
+ Provides-Extra: dev
35
+ Requires-Dist: colorama; extra == 'dev'
36
+ Requires-Dist: hypothesis; extra == 'dev'
37
+ Requires-Dist: hypothesis>=6.0; extra == 'dev'
38
+ Requires-Dist: hypothesis[numpy]; extra == 'dev'
39
+ Requires-Dist: ipython; extra == 'dev'
40
+ Requires-Dist: jax; extra == 'dev'
41
+ Requires-Dist: jaxlib; extra == 'dev'
42
+ Requires-Dist: matplotlib; extra == 'dev'
43
+ Requires-Dist: nbconvert; extra == 'dev'
44
+ Requires-Dist: numdifftools; extra == 'dev'
45
+ Requires-Dist: optimistix; extra == 'dev'
46
+ Requires-Dist: pint; extra == 'dev'
47
+ Requires-Dist: pycddlib-standalone; extra == 'dev'
48
+ Requires-Dist: pypoman; extra == 'dev'
49
+ Requires-Dist: pytensor; extra == 'dev'
50
+ Requires-Dist: pytest-cov; extra == 'dev'
51
+ Requires-Dist: pytest-rerunfailures; extra == 'dev'
52
+ Requires-Dist: pytest-sugar; extra == 'dev'
53
+ Requires-Dist: pytest-xdist; extra == 'dev'
54
+ Requires-Dist: pytest>=9.0.3; extra == 'dev'
55
+ Requires-Dist: python-ternary; extra == 'dev'
56
+ Requires-Dist: ruff; extra == 'dev'
57
+ Requires-Dist: scikit-learn; extra == 'dev'
58
+ Requires-Dist: slsqp-jax; extra == 'dev'
59
+ Requires-Dist: sphinx; extra == 'dev'
60
+ Requires-Dist: sphinx-rtd-theme; extra == 'dev'
61
+ Requires-Dist: sphinxcontrib-bibtex; extra == 'dev'
62
+ Requires-Dist: torch; extra == 'dev'
63
+ Requires-Dist: ty; extra == 'dev'
64
+ Provides-Extra: docs
65
+ Requires-Dist: colorama; extra == 'docs'
66
+ Requires-Dist: hypothesis; extra == 'docs'
67
+ Requires-Dist: ipython; extra == 'docs'
68
+ Requires-Dist: matplotlib; extra == 'docs'
69
+ Requires-Dist: nbconvert; extra == 'docs'
70
+ Requires-Dist: numdifftools; extra == 'docs'
71
+ Requires-Dist: pint; extra == 'docs'
72
+ Requires-Dist: pycddlib-standalone; extra == 'docs'
73
+ Requires-Dist: pypoman; extra == 'docs'
74
+ Requires-Dist: python-ternary; extra == 'docs'
75
+ Requires-Dist: scikit-learn; extra == 'docs'
76
+ Requires-Dist: sphinx; extra == 'docs'
77
+ Requires-Dist: sphinx-rtd-theme; extra == 'docs'
78
+ Requires-Dist: sphinxcontrib-bibtex; extra == 'docs'
79
+ Provides-Extra: jax
80
+ Requires-Dist: jax; extra == 'jax'
81
+ Requires-Dist: jaxlib; extra == 'jax'
82
+ Requires-Dist: optimistix; extra == 'jax'
83
+ Requires-Dist: slsqp-jax; extra == 'jax'
84
+ Provides-Extra: optional
85
+ Requires-Dist: colorama; extra == 'optional'
86
+ Requires-Dist: matplotlib; extra == 'optional'
87
+ Requires-Dist: numdifftools; extra == 'optional'
88
+ Requires-Dist: pint; extra == 'optional'
89
+ Requires-Dist: pycddlib-standalone; extra == 'optional'
90
+ Requires-Dist: pypoman; extra == 'optional'
91
+ Requires-Dist: scikit-learn; extra == 'optional'
92
+ Provides-Extra: pytensor
93
+ Requires-Dist: pytensor; extra == 'pytensor'
94
+ Provides-Extra: test
95
+ Requires-Dist: hypothesis>=6.0; extra == 'test'
96
+ Requires-Dist: hypothesis[numpy]; extra == 'test'
97
+ Requires-Dist: pytest-cov; extra == 'test'
98
+ Requires-Dist: pytest-rerunfailures; extra == 'test'
99
+ Requires-Dist: pytest-sugar; extra == 'test'
100
+ Requires-Dist: pytest-xdist; extra == 'test'
101
+ Requires-Dist: pytest>=9.0.3; extra == 'test'
102
+ Provides-Extra: torch
103
+ Requires-Dist: torch; extra == 'torch'
104
+ Description-Content-Type: text/x-rst
105
+
106
+ ``dit`` is a Python package for information theory.
107
+
108
+ |build| |codecov| |docs| |conda|
109
+
110
+ |joss| |zenodo| |slack|
111
+
112
+ Introduction
113
+ ------------
114
+
115
+ Information theory is a powerful extension to probability and statistics, quantifying dependencies
116
+ among arbitrary random variables in a way that is consistent and comparable across systems and
117
+ scales. Information theory was originally developed to quantify how quickly and reliably information
118
+ could be transmitted across an arbitrary channel. The demands of modern, data-driven science have
119
+ been coopting and extending these quantities and methods into unknown, multivariate settings where
120
+ the interpretation and best practices are not known. For example, there are at least four reasonable
121
+ multivariate generalizations of the mutual information, none of which inherit all the
122
+ interpretations of the standard bivariate case. Which is best to use is context-dependent. ``dit``
123
+ implements a vast range of multivariate information measures in an effort to allow information
124
+ practitioners to study how these various measures behave and interact in a variety of contexts. We
125
+ hope that having all these measures and techniques implemented in one place will allow the
126
+ development of robust techniques for the automated quantification of dependencies within a system
127
+ and concrete interpretation of what those dependencies mean.
128
+
129
+ Citing
130
+ ------
131
+
132
+ If you use `dit` in your research, please cite it as::
133
+
134
+ @article{dit,
135
+ Author = {James, R. G. and Ellison, C. J. and Crutchfield, J. P.},
136
+ Title = {{dit}: a {P}ython package for discrete information theory},
137
+ Journal = {The Journal of Open Source Software},
138
+ Volume = {3},
139
+ Number = {25},
140
+ Pages = {738},
141
+ Year = {2018},
142
+ Doi = {https://doi.org/10.21105/joss.00738}
143
+ }
144
+
145
+ Basic Information
146
+ -----------------
147
+
148
+ Documentation
149
+ *************
150
+
151
+ http://docs.dit.io
152
+
153
+ Downloads
154
+ *********
155
+
156
+ https://pypi.org/project/dit/
157
+
158
+ https://anaconda.org/conda-forge/dit
159
+
160
+ +-------------------------------------------------------------------+
161
+ | Dependencies |
162
+ +===================================================================+
163
+ | * Python 3.11+ |
164
+ | * `boltons <https://boltons.readthedocs.io>`_ |
165
+ | * `debtcollector <https://docs.openstack.org/debtcollector/>`_ |
166
+ | * `lattices <https://github.com/dit/lattices>`_ |
167
+ | * `loguru <https://loguru.readthedocs.io>`_ |
168
+ | * `networkx <https://networkx.github.io/>`_ |
169
+ | * `numpy <http://www.numpy.org/>`_ |
170
+ | * `PLTable <https://github.com/platomav/PLTable>`_ |
171
+ | * `scipy <https://www.scipy.org/>`_ |
172
+ | * `xarray <https://docs.xarray.dev/>`_ |
173
+ +-------------------------------------------------------------------+
174
+
175
+ Optional Dependencies
176
+ ~~~~~~~~~~~~~~~~~~~~~
177
+ * colorama: colored column heads in PID indicating failure modes
178
+ * cython: faster sampling from distributions
179
+ * hypothesis: random sampling of distributions
180
+ * jax, jaxlib: JAX-based optimization backend with autodiff support
181
+ * matplotlib, python-ternary: plotting of various information-theoretic expansions
182
+ * numdifftools: numerical evaluation of gradients and hessians during optimization
183
+ * pint: add units to informational values
184
+ * pycddlib-standalone, pypoman: polytope vertex enumeration for convex-maximization-based measures
185
+ * pytensor: PyTensor-based optimization backend with autodiff support
186
+ * scikit-learn: faster nearest-neighbor lookups during entropy/mutual information estimation from samples
187
+ * torch: PyTorch-based optimization backend with autodiff and GPU support
188
+
189
+ Install
190
+ *******
191
+
192
+ The easiest way to install is:
193
+
194
+ .. code-block:: bash
195
+
196
+ pip install dit
197
+
198
+ If you want to install ``dit`` within a conda environment, you can simply do:
199
+
200
+ .. code-block:: bash
201
+
202
+ conda install -c conda-forge dit
203
+
204
+ For development, we recommend `uv <https://docs.astral.sh/uv/>`_:
205
+
206
+ .. code-block:: bash
207
+
208
+ git clone https://github.com/dit/dit.git
209
+ cd dit
210
+ uv sync --extra dev
211
+
212
+ This installs ``dit`` in editable mode with all development dependencies
213
+ (tests, docs, linting, type checking, and optional backends).
214
+
215
+ Testing
216
+ *******
217
+
218
+ .. code-block:: bash
219
+
220
+ # Using uv (recommended)
221
+ uv run pytest
222
+
223
+ # Or with pip
224
+ pip install -e ".[test]"
225
+ pytest
226
+
227
+ Code and bug tracker
228
+ ********************
229
+
230
+ https://github.com/dit/dit
231
+
232
+ License
233
+ *******
234
+
235
+ BSD 3-Clause, see LICENSE.txt for details.
236
+
237
+ Implemented Measures
238
+ --------------------
239
+
240
+ ``dit`` implements the following information measures. Most of these are implemented in multivariate & conditional
241
+ generality, where such generalizations either exist in the literature or are relatively obvious --- for example,
242
+ though it is not in the literature, the multivariate conditional exact common information is implemented here.
243
+
244
+ +------------------------------------------+-----------------------------------------+-----------------------------------+
245
+ | Entropies | Mutual Informations | Divergences |
246
+ | | | |
247
+ | * Shannon Entropy | * Co-Information | * Variational Distance |
248
+ | * Renyi Entropy | * Interaction Information | * Kullback-Leibler Divergence / |
249
+ | * Tsallis Entropy | * Total Correlation / Multi-Information | Relative Entropy |
250
+ | * Necessary Conditional Entropy | * Dual Total Correlation / Binding | * Cross Entropy |
251
+ | * Residual Entropy / Independent | Information | * Jensen-Shannon Divergence |
252
+ | Information / Variation of Information | * CAEKL Multivariate Mutual Information | * Earth Mover's Distance |
253
+ +------------------------------------------+ * O-Information +-----------------------------------+
254
+ | Common Informations | * Cohesion | Other Measures |
255
+ | | * Transmission | |
256
+ | * Gacs-Korner Common Information | * Union Information | * Channel Capacity |
257
+ | * Wyner Common Information | * Logarithmic Decomposition | * Complexity Profile |
258
+ | * Exact Common Information | * Delta^k / Gamma^k | * Connected Informations |
259
+ | * Functional Common Information | * DeWeese Mutual Information | * Copy Mutual Information |
260
+ | * MSS Common Information +-----------------------------------------+ * Cumulative Residual Entropy |
261
+ | * Kamath-Anantharam Dual Common | Partial Information Decomposition | * Extropy |
262
+ | Information | | * Hypercontractivity Coefficient |
263
+ | * Beta Common Information | * :math:`I_{min}` | * Information Bottleneck |
264
+ | * Salamatian-Cohen-Medard Maximum Entropy| * :math:`I_{\wedge}` | * Information Diagrams |
265
+ | Function | * :math:`I_{RR}` | * Information Trimming |
266
+ +------------------------------------------+ * :math:`I_{\downarrow}` | * Lautum Information |
267
+ | Secret Key Agreement Bounds | * :math:`I_{proj}` | * LMPR Complexity |
268
+ | | * :math:`I_{BROJA}` | * Marginal Utility of Information |
269
+ | * Secrecy Capacity | * :math:`I_{ccs}` | * Maximum Correlation |
270
+ | * Intrinsic Mutual Information | * :math:`I_{\pm}` | * Maximum Entropy Distributions |
271
+ | * Reduced Intrinsic Mutual Information | * :math:`I_{sx}` | * Perplexity |
272
+ | * Minimal Intrinsic Mutual Information | * :math:`I_{dep}` | * Rate-Distortion Theory |
273
+ | * Necessary Intrinsic Mutual Information | * :math:`I_{RAV}` | * TSE Complexity |
274
+ | * Two-Part Intrinsic Mutual Information | * :math:`I_{mmi}` | * Gray-Wyner Network |
275
+ | | * :math:`I_{\prec}` | |
276
+ | | * :math:`I_{RA}` | |
277
+ | | * :math:`I_{SKAR}` | |
278
+ | | * :math:`I_{IG}` | |
279
+ | | * :math:`I_{RDR}` | |
280
+ | | * :math:`I_{do}` | |
281
+ +------------------------------------------+-----------------------------------------+-----------------------------------+
282
+
283
+ Quickstart
284
+ ----------
285
+
286
+ The basic usage of ``dit`` corresponds to creating distributions, modifying them
287
+ if need be, and then computing properties of those distributions. First, we
288
+ import:
289
+
290
+ .. code:: python
291
+
292
+ >>> import dit
293
+
294
+ Suppose we have a really thick coin, one so thick that there is a reasonable
295
+ chance of it landing on its edge. Here is how we might represent the coin in
296
+ ``dit``.
297
+
298
+ .. code:: python
299
+
300
+ >>> d = dit.Distribution(['H', 'T', 'E'], [.4, .4, .2])
301
+ >>> print(d)
302
+ Class: Distribution
303
+ Alphabet: ('E', 'H', 'T') for all rvs
304
+ Base: linear
305
+ Outcome Class: str
306
+ Outcome Length: 1
307
+ RV Names: None
308
+
309
+ x p(x)
310
+ E 0.2
311
+ H 0.4
312
+ T 0.4
313
+
314
+ Calculate the probability of ``H`` and also of the combination ``H or T``.
315
+
316
+ .. code:: python
317
+
318
+ >>> d['H']
319
+ 0.4
320
+ >>> d.event_probability(['H','T'])
321
+ 0.8
322
+
323
+ Calculate the Shannon entropy and extropy of the joint distribution.
324
+
325
+ .. code:: python
326
+
327
+ >>> dit.shannon.entropy(d)
328
+ 1.5219280948873621
329
+ >>> dit.other.extropy(d)
330
+ 1.1419011889093373
331
+
332
+ Create a distribution where ``Z = xor(X, Y)``.
333
+
334
+ .. code:: python
335
+
336
+ >>> import dit.example_dists
337
+ >>> d = dit.example_dists.Xor()
338
+ >>> d.set_rv_names(['X', 'Y', 'Z'])
339
+ >>> print(d)
340
+ Class: Distribution
341
+ Alphabet: ('0', '1') for all rvs
342
+ Base: linear
343
+ Outcome Class: str
344
+ Outcome Length: 3
345
+ RV Names: ('X', 'Y', 'Z')
346
+
347
+ x p(x)
348
+ 000 0.25
349
+ 011 0.25
350
+ 101 0.25
351
+ 110 0.25
352
+
353
+ Calculate the Shannon mutual informations ``I[X:Z]``, ``I[Y:Z]``, and
354
+ ``I[X,Y:Z]``.
355
+
356
+ .. code:: python
357
+
358
+ >>> dit.shannon.mutual_information(d, ['X'], ['Z'])
359
+ 0.0
360
+ >>> dit.shannon.mutual_information(d, ['Y'], ['Z'])
361
+ 0.0
362
+ >>> dit.shannon.mutual_information(d, ['X', 'Y'], ['Z'])
363
+ 1.0
364
+
365
+ Calculate the marginal distribution ``P(X,Z)``.
366
+ Then print its probabilities as fractions, showing the mask.
367
+
368
+ .. code:: python
369
+
370
+ >>> d2 = d.marginal(['X', 'Z'])
371
+ >>> print(d2.to_string(show_mask=True, exact=True))
372
+ Class: Distribution
373
+ Alphabet: ('0', '1') for all rvs
374
+ Base: linear
375
+ Outcome Class: str
376
+ Outcome Length: 2 (mask: 3)
377
+ RV Names: ('X', 'Z')
378
+
379
+ x p(x)
380
+ 0*0 1/4
381
+ 0*1 1/4
382
+ 1*0 1/4
383
+ 1*1 1/4
384
+
385
+ Convert the distribution probabilities to log (base 3.5) probabilities, and
386
+ access its probability mass function.
387
+
388
+ .. code:: python
389
+
390
+ >>> d2.set_base(3.5)
391
+ >>> d2.pmf
392
+ array([-1.10658951, -1.10658951, -1.10658951, -1.10658951])
393
+
394
+ Draw 5 random samples from this distribution.
395
+
396
+ .. code:: python
397
+
398
+ >>> dit.math.prng.seed(1)
399
+ >>> d2.rand(5)
400
+ ['01', '10', '00', '01', '00']
401
+
402
+ Source and Channel Coding
403
+ -------------------------
404
+
405
+ Beyond measures, ``dit`` builds explicit codes and ships a catalog of channels.
406
+
407
+ The ``dit.coding`` module constructs lossless *source codes* (Shannon, Fano,
408
+ Shannon-Fano-Elias, Huffman, length-limited Huffman, Golomb/Rice, Tunstall, and
409
+ the universal integer codes) and reports their code-theoretic properties (rate,
410
+ redundancy, efficiency, the Kraft sum, and whether the code is prefix-free /
411
+ uniquely decodable / optimal).
412
+
413
+ .. code:: python
414
+
415
+ >>> from dit.coding import huffman
416
+ >>> d = dit.Distribution(['a', 'b', 'c', 'd', 'e'], [0.4, 0.2, 0.2, 0.1, 0.1])
417
+ >>> code = huffman(d)
418
+ >>> code.average_length()
419
+ 2.2
420
+ >>> float(code.source_entropy())
421
+ 2.1219280948873624
422
+ >>> code.is_optimal(), code.is_prefix_free()
423
+ (True, True)
424
+
425
+ It also builds binary (GF(2)) *channel codes* --- linear block codes
426
+ (repetition, parity-check, Hamming, Reed-Muller, Golay) as well as LDPC, polar,
427
+ and convolutional codes --- and evaluates them against a noisy channel supplied
428
+ as a conditional ``Distribution`` ``p(Y|X)``.
429
+
430
+ .. code:: python
431
+
432
+ >>> from dit.coding import hamming
433
+ >>> code = hamming(3)
434
+ >>> code.length, code.dimension, code.minimum_distance()
435
+ (7, 4, 3)
436
+ >>> bsc = dit.example_channels.binary_symmetric_channel(0.05)
437
+ >>> float(code.probability_of_error(bsc, method='exact'))
438
+ 0.04438054218749993
439
+
440
+ The ``dit.example_channels`` module is a catalog of canonical discrete
441
+ memoryless channels (binary symmetric, binary erasure, Z-channel, q-ary
442
+ symmetric/erasure, noisy typewriter, ...). Each constructor returns a
443
+ conditional ``Distribution`` ``p(Y|X)`` ready for
444
+ ``dit.algorithms.channel_capacity`` or the coding layer above.
445
+
446
+ .. code:: python
447
+
448
+ >>> from dit.algorithms import channel_capacity
449
+ >>> bec = dit.example_channels.binary_erasure_channel(0.25)
450
+ >>> float(channel_capacity(bec)[0])
451
+ 0.75
452
+
453
+ Contributions & Help
454
+ --------------------
455
+
456
+ If you'd like to feature added to ``dit``, please file an issue. Or, better yet, open a pull request. Ideally, all code should be tested and documented, but please don't let this be a barrier to contributing. We'll work with you to ensure that all pull requests are in a mergable state.
457
+
458
+ If you'd like to get in contact about anything, you can reach us through our `slack channel <https://dit-python.slack.com/>`_.
459
+
460
+
461
+ .. badges:
462
+
463
+ .. |build| image:: https://github.com/dit/dit/actions/workflows/build.yml/badge.svg
464
+ :target: https://github.com/dit/dit/actions/workflows/build.yml
465
+ :alt: Continuous Integration Status
466
+
467
+ .. |codecov| image:: https://codecov.io/gh/dit/dit/branch/master/graph/badge.svg
468
+ :target: https://codecov.io/gh/dit/dit
469
+ :alt: Test Coverage Status
470
+
471
+ .. |docs| image:: https://readthedocs.org/projects/dit/badge/?version=latest
472
+ :target: http://dit.readthedocs.org/en/latest/?badge=latest
473
+ :alt: Documentation Status
474
+
475
+ .. |conda| image:: https://anaconda.org/conda-forge/dit/badges/installer/conda.svg
476
+ :target: https://anaconda.org/conda-forge/dit
477
+ :alt: Conda installation
478
+
479
+ .. |zenodo| image:: https://zenodo.org/badge/13201610.svg
480
+ :target: https://zenodo.org/badge/latestdoi/13201610
481
+ :alt: DOI
482
+
483
+ .. |slack| image:: https://img.shields.io/badge/Slack-dit--python-lightgrey.svg
484
+ :target: https://dit-python.slack.com/
485
+ :alt: dit chat
486
+
487
+ .. |joss| image:: http://joss.theoj.org/papers/10.21105/joss.00738/status.svg
488
+ :target: https://doi.org/10.21105/joss.00738
489
+ :alt: JOSS Status