qLDPC 0.4.2.dev20261004__tar.gz → 0.4.2.dev20261023__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 (198) hide show
  1. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/PKG-INFO +84 -79
  2. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/README.md +74 -72
  3. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/pyproject.toml +9 -7
  4. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/pyproject.toml.orig +13 -9
  5. qldpc-0.4.2.dev20261023/src/qldpc/__init__.py +35 -0
  6. qldpc-0.4.2.dev20261023/src/qldpc/_deprecations/__init__.py +31 -0
  7. qldpc-0.4.2.dev20261023/src/qldpc/_deprecations/core.py +499 -0
  8. qldpc-0.4.2.dev20261023/src/qldpc/_deprecations/core_test.py +229 -0
  9. qldpc-0.4.2.dev20261023/src/qldpc/_deprecations/decoders.py +693 -0
  10. qldpc-0.4.2.dev20261023/src/qldpc/_deprecations/decoders_test.py +587 -0
  11. qldpc-0.4.2.dev20261023/src/qldpc/_deprecations/lookup.py +154 -0
  12. qldpc-0.4.2.dev20261023/src/qldpc/_deprecations/lookup_test.py +155 -0
  13. qldpc-0.4.2.dev20261004/src/qldpc/_util.py → qldpc-0.4.2.dev20261023/src/qldpc/_utils.py +38 -96
  14. qldpc-0.4.2.dev20261004/src/qldpc/_util_test.py → qldpc-0.4.2.dev20261023/src/qldpc/_utils_test.py +19 -49
  15. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/abstract/__init__.py +13 -23
  16. qldpc-0.4.2.dev20261023/src/qldpc/abstract/_coefficients.py +223 -0
  17. qldpc-0.4.2.dev20261023/src/qldpc/abstract/_coefficients_test.py +104 -0
  18. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/abstract/groups.py +269 -418
  19. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/abstract/groups_test.py +65 -79
  20. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/abstract/linalg.py +47 -39
  21. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/abstract/linalg_test.py +2 -2
  22. qldpc-0.4.2.dev20261004/src/qldpc/abstract/_monomials_test.py → qldpc-0.4.2.dev20261023/src/qldpc/abstract/monomials_test.py +1 -1
  23. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/abstract/ring_array.py +77 -259
  24. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/abstract/ring_array_test.py +18 -95
  25. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/abstract/rings.py +26 -41
  26. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/abstract/rings_test.py +15 -50
  27. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/abstract/wedderburn_artin.py +130 -128
  28. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/cache.py +60 -57
  29. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/cache_test.py +6 -6
  30. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/circuits/__init__.py +13 -4
  31. qldpc-0.4.2.dev20261023/src/qldpc/circuits/benchmarking/__init__.py +16 -0
  32. qldpc-0.4.2.dev20261023/src/qldpc/circuits/benchmarking/logical_errors.py +260 -0
  33. qldpc-0.4.2.dev20261023/src/qldpc/circuits/benchmarking/logical_errors_test.py +133 -0
  34. qldpc-0.4.2.dev20261004/src/qldpc/circuits/benchmarking.py → qldpc-0.4.2.dev20261023/src/qldpc/circuits/benchmarking/state_prep_diagnostics.py +79 -194
  35. qldpc-0.4.2.dev20261023/src/qldpc/circuits/benchmarking/state_prep_diagnostics_test.py +149 -0
  36. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/circuits/bookkeeping.py +2 -2
  37. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/circuits/common.py +29 -20
  38. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/circuits/common_test.py +16 -13
  39. qldpc-0.4.2.dev20261023/src/qldpc/circuits/conftest.py +62 -0
  40. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/circuits/encoding.py +74 -30
  41. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/circuits/encoding_test.py +38 -22
  42. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/circuits/memory/__init__.py +11 -2
  43. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/circuits/memory/alpha_syndrome.py +50 -41
  44. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/circuits/memory/alpha_syndrome_test.py +75 -37
  45. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/circuits/memory/memory.py +158 -151
  46. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/circuits/memory/memory_test.py +18 -3
  47. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/circuits/memory/syndrome_measurement.py +56 -55
  48. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/circuits/memory/syndrome_measurement_test.py +12 -11
  49. qldpc-0.4.2.dev20261023/src/qldpc/circuits/noise_model/__init__.py +172 -0
  50. qldpc-0.4.2.dev20261023/src/qldpc/circuits/noise_model/_moments.py +316 -0
  51. qldpc-0.4.2.dev20261023/src/qldpc/circuits/noise_model/_moments_test.py +163 -0
  52. qldpc-0.4.2.dev20261023/src/qldpc/circuits/noise_model/_operations.py +208 -0
  53. qldpc-0.4.2.dev20261023/src/qldpc/circuits/noise_model/_operations_test.py +81 -0
  54. qldpc-0.4.2.dev20261023/src/qldpc/circuits/noise_model/channels.py +476 -0
  55. qldpc-0.4.2.dev20261023/src/qldpc/circuits/noise_model/channels_test.py +223 -0
  56. qldpc-0.4.2.dev20261023/src/qldpc/circuits/noise_model/noise_model.py +810 -0
  57. {qldpc-0.4.2.dev20261004/src/qldpc/circuits → qldpc-0.4.2.dev20261023/src/qldpc/circuits/noise_model}/noise_model_test.py +170 -586
  58. qldpc-0.4.2.dev20261023/src/qldpc/circuits/noise_model/rules.py +413 -0
  59. qldpc-0.4.2.dev20261023/src/qldpc/circuits/noise_model/rules_test.py +255 -0
  60. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/circuits/transversal.py +31 -18
  61. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/circuits/transversal_test.py +7 -9
  62. qldpc-0.4.2.dev20261023/src/qldpc/code_style_test.py +47 -0
  63. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/codes/__init__.py +23 -6
  64. qldpc-0.4.2.dev20261004/src/qldpc/codes/code_capacity.py → qldpc-0.4.2.dev20261023/src/qldpc/codes/_code_capacity.py +233 -184
  65. qldpc-0.4.2.dev20261004/src/qldpc/codes/code_capacity_test.py → qldpc-0.4.2.dev20261023/src/qldpc/codes/_code_capacity_test.py +116 -193
  66. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/codes/classical.py +28 -25
  67. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/codes/classical_test.py +48 -36
  68. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/codes/common.py +746 -678
  69. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/codes/common_test.py +384 -228
  70. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/__init__.py +36 -0
  71. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/_binary.py +322 -0
  72. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/_binary_test.py +239 -0
  73. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/_brouwer_zimmermann.py +512 -0
  74. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/_brouwer_zimmermann_test.py +484 -0
  75. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/_brute_force.py +123 -0
  76. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/_brute_force_test.py +165 -0
  77. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/_information_sets.py +361 -0
  78. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/_information_sets_test.py +174 -0
  79. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/_macwilliams.py +247 -0
  80. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/_macwilliams_test.py +45 -0
  81. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/brouwer_zimmermann.md +632 -0
  82. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/conftest.py +48 -0
  83. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/core.py +221 -0
  84. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/core_test.py +196 -0
  85. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/logical_counts.py +1062 -0
  86. qldpc-0.4.2.dev20261023/src/qldpc/codes/distance/logical_counts_test.py +660 -0
  87. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/codes/monte_carlo.py +145 -76
  88. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/codes/monte_carlo_test.py +38 -27
  89. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/codes/quantum.py +190 -162
  90. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/codes/quantum_test.py +85 -176
  91. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/conftest.py +57 -1
  92. qldpc-0.4.2.dev20261023/src/qldpc/decoders/__init__.py +118 -0
  93. qldpc-0.4.2.dev20261004/src/qldpc/decoders/capabilities.py → qldpc-0.4.2.dev20261023/src/qldpc/decoders/_capabilities.py +17 -9
  94. qldpc-0.4.2.dev20261023/src/qldpc/decoders/_capabilities_test.py +95 -0
  95. qldpc-0.4.2.dev20261023/src/qldpc/decoders/adapters/__init__.py +18 -0
  96. qldpc-0.4.2.dev20261023/src/qldpc/decoders/adapters/_observable_decoders.py +111 -0
  97. qldpc-0.4.2.dev20261004/src/qldpc/decoders/adapters/observable_decoders_test.py → qldpc-0.4.2.dev20261023/src/qldpc/decoders/adapters/_observable_decoders_test.py +27 -52
  98. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/adapters/error_decoders.py +42 -38
  99. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/adapters/error_decoders_test.py +34 -21
  100. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/common.py +33 -59
  101. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/common_test.py +15 -53
  102. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/conftest.py +11 -8
  103. qldpc-0.4.2.dev20261023/src/qldpc/decoders/construction/__init__.py +11 -0
  104. qldpc-0.4.2.dev20261004/src/qldpc/decoders/construction/resolution.py → qldpc-0.4.2.dev20261023/src/qldpc/decoders/construction/_resolution.py +32 -62
  105. qldpc-0.4.2.dev20261004/src/qldpc/decoders/construction/resolution_test.py → qldpc-0.4.2.dev20261023/src/qldpc/decoders/construction/_resolution_test.py +100 -240
  106. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/construction/factories.py +6 -4
  107. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/construction/factories_test.py +9 -7
  108. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/construction/specs.py +60 -61
  109. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/construction/specs_test.py +64 -155
  110. qldpc-0.4.2.dev20261023/src/qldpc/decoders/custom/__init__.py +37 -0
  111. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/custom/_lookup_enumeration.py +20 -13
  112. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/custom/_lookup_enumeration_test.py +70 -60
  113. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/custom/composition.py +41 -36
  114. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/custom/composition_test.py +11 -8
  115. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/custom/guf.py +31 -49
  116. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/custom/guf_test.py +8 -8
  117. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/custom/ilp.py +47 -42
  118. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/custom/ilp_test.py +19 -11
  119. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/custom/lookup.py +250 -262
  120. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/custom/lookup_test.py +85 -116
  121. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/dems.py +73 -69
  122. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/dems_test.py +1 -1
  123. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/external/frontier.py +29 -48
  124. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/external/frontier_test.py +87 -82
  125. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/external/ldpc.py +103 -186
  126. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/external/ldpc_test.py +44 -26
  127. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/external/pymatching.py +122 -128
  128. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/external/pymatching_test.py +46 -16
  129. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/external/relay_bp.py +130 -186
  130. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/external/relay_bp_test.py +85 -36
  131. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/external/tesseract.py +123 -130
  132. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/external/tesseract_test.py +84 -97
  133. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/legacy_api_test.py +36 -34
  134. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/protocols.py +46 -40
  135. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/protocols_test.py +41 -30
  136. qldpc-0.4.2.dev20261023/src/qldpc/decoders/sinter/__init__.py +37 -0
  137. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/sinter/core.py +31 -46
  138. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/sinter/core_test.py +32 -21
  139. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/sinter/subgraph.py +9 -6
  140. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/sinter/subgraph_test.py +1 -2
  141. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/sinter/window.py +39 -36
  142. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/sinter/window_test.py +30 -4
  143. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/experimental/__init__.py +4 -2
  144. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/experimental/surgery/__init__.py +3 -1
  145. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/experimental/surgery/_compiler.py +111 -132
  146. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/experimental/surgery/_compiler_test.py +51 -142
  147. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/experimental/surgery/bridge.py +167 -172
  148. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/experimental/surgery/bridge_test.py +80 -291
  149. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/experimental/surgery/cheeger.py +139 -143
  150. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/experimental/surgery/cheeger_test.py +92 -177
  151. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/experimental/surgery/circuit.py +261 -340
  152. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/experimental/surgery/circuit_test.py +258 -1108
  153. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/experimental/surgery/conftest.py +6 -18
  154. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/experimental/surgery/construction.py +20 -18
  155. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/experimental/surgery/construction_test.py +2 -0
  156. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/experimental/surgery/gadget.py +117 -150
  157. qldpc-0.4.2.dev20261023/src/qldpc/experimental/surgery/gadget_test.py +442 -0
  158. qldpc-0.4.2.dev20261023/src/qldpc/external/__init__.py +16 -0
  159. qldpc-0.4.2.dev20261004/src/qldpc/external/codes.py → qldpc-0.4.2.dev20261023/src/qldpc/external/_codes.py +121 -83
  160. qldpc-0.4.2.dev20261004/src/qldpc/external/codes_test.py → qldpc-0.4.2.dev20261023/src/qldpc/external/_codes_test.py +44 -30
  161. qldpc-0.4.2.dev20261004/src/qldpc/external/groups.py → qldpc-0.4.2.dev20261023/src/qldpc/external/_groups.py +155 -111
  162. qldpc-0.4.2.dev20261004/src/qldpc/external/groups_test.py → qldpc-0.4.2.dev20261023/src/qldpc/external/_groups_test.py +133 -79
  163. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/external/gap.py +203 -179
  164. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/external/gap_test.py +67 -48
  165. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/external/sqetch.py +49 -41
  166. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/external/sqetch_test.py +1 -10
  167. qldpc-0.4.2.dev20261023/src/qldpc/import_test.py +14 -0
  168. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/math.py +101 -75
  169. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/math_test.py +39 -29
  170. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/objects.py +139 -28
  171. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/objects_test.py +51 -2
  172. qldpc-0.4.2.dev20261004/src/qldpc/__init__.py +0 -20
  173. qldpc-0.4.2.dev20261004/src/qldpc/circuits/benchmarking_test.py +0 -219
  174. qldpc-0.4.2.dev20261004/src/qldpc/circuits/conftest.py +0 -35
  175. qldpc-0.4.2.dev20261004/src/qldpc/circuits/noise_model.py +0 -2068
  176. qldpc-0.4.2.dev20261004/src/qldpc/codes/distance.py +0 -1099
  177. qldpc-0.4.2.dev20261004/src/qldpc/codes/distance_test.py +0 -1058
  178. qldpc-0.4.2.dev20261004/src/qldpc/decoders/__init__.py +0 -307
  179. qldpc-0.4.2.dev20261004/src/qldpc/decoders/adapters/__init__.py +0 -28
  180. qldpc-0.4.2.dev20261004/src/qldpc/decoders/adapters/observable_decoders.py +0 -130
  181. qldpc-0.4.2.dev20261004/src/qldpc/decoders/capabilities_test.py +0 -92
  182. qldpc-0.4.2.dev20261004/src/qldpc/decoders/construction/__init__.py +0 -3
  183. qldpc-0.4.2.dev20261004/src/qldpc/decoders/construction/legacy.py +0 -492
  184. qldpc-0.4.2.dev20261004/src/qldpc/decoders/construction/legacy_test.py +0 -454
  185. qldpc-0.4.2.dev20261004/src/qldpc/decoders/custom/__init__.py +0 -58
  186. qldpc-0.4.2.dev20261004/src/qldpc/decoders/custom_test.py +0 -28
  187. qldpc-0.4.2.dev20261004/src/qldpc/decoders/sinter/__init__.py +0 -56
  188. qldpc-0.4.2.dev20261004/src/qldpc/decoders/sinter_test.py +0 -21
  189. qldpc-0.4.2.dev20261004/src/qldpc/decoders_test.py +0 -40
  190. qldpc-0.4.2.dev20261004/src/qldpc/experimental/surgery/gadget_test.py +0 -737
  191. qldpc-0.4.2.dev20261004/src/qldpc/external/__init__.py +0 -5
  192. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/COPYRIGHT +0 -0
  193. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/LICENSE +0 -0
  194. /qldpc-0.4.2.dev20261004/src/qldpc/abstract/_monomials.py → /qldpc-0.4.2.dev20261023/src/qldpc/abstract/monomials.py +0 -0
  195. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/abstract/wedderburn_artin_test.py +0 -0
  196. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/circuits/bookkeeping_test.py +0 -0
  197. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/decoders/external/__init__.py +0 -0
  198. {qldpc-0.4.2.dev20261004 → qldpc-0.4.2.dev20261023}/src/qldpc/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qldpc
3
- Version: 0.4.2.dev20261004
3
+ Version: 0.4.2.dev20261023
4
4
  Summary: Tools for constructing and analyzing quantum low density parity check (qLDPC) codes.
5
5
  Keywords: LDPC,low density parity check codes,quantum computing,quantum error correction
6
6
  Author: Michael A. Perlin
@@ -18,20 +18,21 @@ Classifier: Programming Language :: Python :: 3.13
18
18
  Classifier: Programming Language :: Python :: 3.14
19
19
  Classifier: Topic :: Scientific/Engineering :: Mathematics
20
20
  Classifier: Topic :: Scientific/Engineering :: Physics
21
- Requires-Dist: cvxpy>=1.3.2
22
21
  Requires-Dist: diskcache>=5
23
- Requires-Dist: galois>=0.4.2
22
+ Requires-Dist: galois>=0.4.11
24
23
  Requires-Dist: ldpc>=2.4.1
25
- Requires-Dist: networkx>=2.6.2
26
- Requires-Dist: numpy>=1.24
24
+ Requires-Dist: networkx>=2.7
25
+ Requires-Dist: numba>=0.61.2
26
+ Requires-Dist: numpy>=2.1
27
27
  Requires-Dist: platformdirs>=4
28
28
  Requires-Dist: pymatching>=2.3
29
29
  Requires-Dist: pyperclip>=1.11
30
- Requires-Dist: scipy>=1.14.1
30
+ Requires-Dist: scipy>=1.16
31
31
  Requires-Dist: sinter>=1.16
32
32
  Requires-Dist: stim>=1.16
33
- Requires-Dist: sympy>=1.12
33
+ Requires-Dist: sympy>=1.12.1
34
34
  Requires-Dist: tqdm>=4
35
+ Requires-Dist: qldpc[ilp] ; extra == 'decoders'
35
36
  Requires-Dist: qldpc[relay-bp] ; extra == 'decoders'
36
37
  Requires-Dist: qldpc[tesseract] ; (python_full_version < '3.15' and platform_machine == 'arm64' and sys_platform == 'darwin' and extra == 'decoders') or (python_full_version < '3.15' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'decoders')
37
38
  Requires-Dist: checks-superstaq>=0.5.67 ; extra == 'dev'
@@ -49,6 +50,7 @@ Requires-Dist: sphinx>=7 ; extra == 'docs'
49
50
  Requires-Dist: sphinx-autoapi>=3 ; extra == 'docs'
50
51
  Requires-Dist: sphinx-rtd-theme>=2 ; extra == 'docs'
51
52
  Requires-Dist: passagemath-gap==10.8.12 ; python_full_version == '3.13.*' and sys_platform != 'win32' and extra == 'gap'
53
+ Requires-Dist: cvxpy>=1.5.3 ; extra == 'ilp'
52
54
  Requires-Dist: relay-bp[stim]==0.2.2 ; extra == 'relay-bp'
53
55
  Requires-Dist: tesseract-decoder==0.1.1.dev20260910235247 ; python_full_version >= '3.12' and extra == 'tesseract'
54
56
  Requires-Python: >=3.11
@@ -59,6 +61,7 @@ Provides-Extra: decoders
59
61
  Provides-Extra: dev
60
62
  Provides-Extra: docs
61
63
  Provides-Extra: gap
64
+ Provides-Extra: ilp
62
65
  Provides-Extra: relay-bp
63
66
  Provides-Extra: tesseract
64
67
  Description-Content-Type: text/markdown
@@ -66,30 +69,73 @@ Description-Content-Type: text/markdown
66
69
  # qLDPC
67
70
 
68
71
  `qLDPC` is a Python toolkit for constructing and analyzing finite-size [quantum low-density parity-check codes](https://errorcorrectionzoo.org/c/qldpc), as well as stabilizer and subsystem codes more broadly.
69
- The goal is simple: make the quantum error-correction literature easier to explore, reproduce, and build on.
70
- Codes can start from parity-check matrices or from higher-level ingredients such as polynomials, group rings, Tanner graphs, and chain complexes.
71
- Once a code is built, you can inspect its logical operators, compute or bound its distance, plug in a decoder, estimate logical error rates, and—for qubit codes—build [`stim`](https://github.com/quantumlib/Stim) circuits.
72
+ It aims to make constructions and algorithms from the quantum error-correction literature easier to explore, reproduce, and build on.
73
+ You can define codes using parity-check matrices or higher-level ingredients such as polynomials, group rings, Tanner graphs, and chain complexes.
74
+ From there, you can inspect logical operators, compute or bound code distance, choose a decoder, estimate logical error rates, and—for qubit codes—build [`stim`](https://github.com/quantumlib/Stim) circuits.
72
75
 
73
76
  Most code-level tools work over arbitrary finite fields.
74
77
  Circuit tools currently only support qubit codes.
75
78
 
76
- ## ✨ A taste of qLDPC
77
-
78
- - **From textbook codes to the research frontier.**
79
- Build familiar surface, toric, Hamming, and Reed–Muller codes alongside hypergraph-product, lifted-product, bivariate-bicycle, quantum Tanner, SHYPS, GALA, and other modern families.
80
- - **Go beyond binary.**
81
- Many constructions and core algorithms work over arbitrary prime-power finite fields, not just qubits.
82
- - **Ask more of a code than `[[n, k, d]]`.**
83
- Work with check matrices, Tanner graphs, canonical logical operators, subsystem gauges, exact distances, upper bounds, and code-capacity error estimates.
84
- - **Move from codes to circuits.**
85
- Build memory experiments, encoding circuits, Pauli noise models, state-preparation diagnostics, Sinter decoders, sliding-window decoders, and transversal Clifford searches.
86
- - **Use the algebra that modern constructions need.**
87
- qLDPC includes finite groups, group rings, lifted matrices, Cayley complexes, chain complexes, and optional GAP integration.
88
- - **Steal from the examples.**
89
- The notebooks progress from the basics to circuit-level logical error rates, custom noise, transversal gates, and experimental lattice surgery.
90
-
91
- qLDPC is still research software, and it is honest about the tradeoffs.
92
- Some searches are expensive, some bounds are heuristic, experimental APIs can change, and optional tools may have side effects.
79
+ ## ✨ A few things to try
80
+
81
+ - **Code families.**
82
+ Construct surface, toric, Hamming, and Reed–Muller codes, along with hypergraph-product, lifted-product, bivariate-bicycle, quantum Tanner, SHYPS, GALA, and other families.
83
+ - **Distance calculations.**
84
+ Compute exact distances of binary codes with an [optimized Brouwer–Zimmermann search](src/qldpc/codes/distance/brouwer_zimmermann.md), or bound code distance using [QDistRnd](https://arxiv.org/abs/2308.15140) or [`sqetch`](https://github.com/a7b/yarn/tree/main/sqetch).
85
+ - **Code structure and analysis.**
86
+ Work with check matrices, Tanner graphs, canonical logical operators, subsystem gauge operators, and code-capacity error estimates.
87
+ - **Circuits and decoding workflows.**
88
+ Build memory experiments, encoding circuits, Pauli noise models, and state-preparation diagnostics; use Sinter and sliding-window decoders, or search for transversal Clifford gates.
89
+ - **Algebraic tools.**
90
+ Work with finite groups, group rings, lifted matrices, Cayley complexes, chain complexes, and optional GAP integration.
91
+
92
+ The [example notebooks](https://qldpc.readthedocs.io/examples/index.html) cover (among other things) code construction, custom noise models, and circuit-level logical error rates.
93
+
94
+ ## 🚀 Quickstart
95
+
96
+ ```python
97
+ from sympy.abc import x, y
98
+
99
+ from qldpc import codes
100
+
101
+ # The [[144, 12, 12]] bivariate bicycle "gross code".
102
+ code = codes.BBCode({x: 12, y: 6}, x**3 + y + y**2, y**3 + x + x**2)
103
+
104
+ print(code)
105
+ print("physical qubits:", len(code))
106
+ print("logical qubits:", code.dimension)
107
+ ```
108
+
109
+ The gross code is also available as the named construction, `codes.GrossCode()`.
110
+
111
+ ### A subsystem lifted-product code
112
+
113
+ This example builds a parity-check matrix over the group algebra `GF(2)[C₅]`, lifts each group-ring entry to a 5×5 binary block, and passes the result to `SLPCode`.
114
+ The [subsystem lifted-product construction](https://arxiv.org/abs/2404.18302) produces an 80-qubit CSS subsystem code with 5 logical qubits and 45 gauge qubits.
115
+
116
+ ```python
117
+ from qldpc import abstract, codes
118
+
119
+ group = abstract.CyclicGroup(5)
120
+ ring = abstract.GroupRing(group)
121
+ x = ring.generators[0]
122
+
123
+ repetition = abstract.RingArray.build(
124
+ [[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]],
125
+ ring,
126
+ )
127
+ connections = abstract.RingArray.build(
128
+ [[0, x, 0, 0], [0, 0, x, 0], [0, 0, 0, x]],
129
+ ring,
130
+ )
131
+ code = codes.SLPCode(repetition + connections)
132
+
133
+ print("physical qubits:", len(code)) # 80
134
+ print("logical qubits:", code.dimension) # 5
135
+ print("gauge qubits:", code.gauge_dimension) # 45
136
+ ```
137
+
138
+ The [library map](https://qldpc.readthedocs.io/library_map.html) explains the data model and package structure.
93
139
 
94
140
  ## 📦 Installation
95
141
 
@@ -105,7 +151,7 @@ python -m pip install qldpc
105
151
 
106
152
  #### Decoders
107
153
 
108
- qLDPC installs `ldpc` and `pymatching` by default, which include a host of decoders.
154
+ qLDPC installs `ldpc` and `pymatching` by default, which provide several decoding algorithms.
109
155
  Install the optional decoder integrations published as qLDPC extras for your platform with:
110
156
 
111
157
  ```bash
@@ -115,6 +161,7 @@ python -m pip install 'qldpc[decoders]'
115
161
  You can also use individual extras to install a specific optional decoder:
116
162
 
117
163
  ```bash
164
+ python -m pip install 'qldpc[ilp]'
118
165
  python -m pip install 'qldpc[relay-bp]'
119
166
  python -m pip install 'qldpc[tesseract]'
120
167
  ```
@@ -150,7 +197,7 @@ For binary CSS codes, you can select this backend with `code.get_distance_bound(
150
197
 
151
198
  ### Troubleshooting
152
199
 
153
- On macOS, you may need to install `cvxpy` manually by following its [installation instructions](https://www.cvxpy.org/install) before installing qLDPC.
200
+ On macOS, you may need to install `cvxpy`, which the ILP decoder requires, manually by following its [installation instructions](https://www.cvxpy.org/install) before installing `qldpc[ilp]` or `qldpc[decoders]`.
154
201
  If you use Conda to manage your Python environment, install `cvxpy` with:
155
202
 
156
203
  ```bash
@@ -167,50 +214,6 @@ cd qLDPC
167
214
  python -m pip install -e '.[dev]'
168
215
  ```
169
216
 
170
- ## 🚀 Quickstart
171
-
172
- ```python
173
- from sympy.abc import x, y
174
-
175
- from qldpc import codes
176
-
177
- # The [[144, 12, 12]] bivariate bicycle "gross code".
178
- code = codes.BBCode({x: 12, y: 6}, x**3 + y + y**2, y**3 + x + x**2)
179
-
180
- print(code)
181
- print("physical qubits:", len(code))
182
- print("logical qubits:", code.dimension)
183
- ```
184
-
185
- ### Go deeper: a subsystem lifted-product code
186
-
187
- The next example builds a parity-check matrix over the group algebra `GF(2)[C₅]`, lifts each group-ring entry to a 5×5 binary block, and hands the result to `SLPCode`.
188
- The [subsystem lifted-product construction](https://arxiv.org/abs/2404.18302) produces an 80-qubit CSS subsystem code with 5 logical qubits and 45 gauge qubits.
189
-
190
- ```python
191
- from qldpc import abstract, codes
192
-
193
- group = abstract.CyclicGroup(5)
194
- ring = abstract.GroupRing(group)
195
- x = ring.generators[0]
196
-
197
- repetition = abstract.RingArray.build(
198
- [[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]],
199
- ring,
200
- )
201
- connections = abstract.RingArray.build(
202
- [[0, x, 0, 0], [0, 0, x, 0], [0, 0, 0, x]],
203
- ring,
204
- )
205
- code = codes.SLPCode(repetition + connections)
206
-
207
- print("physical qubits:", len(code)) # 80
208
- print("logical qubits:", code.dimension) # 5
209
- print("gauge qubits:", code.gauge_dimension) # 45
210
- ```
211
-
212
- Continue with the [library map](https://qldpc.readthedocs.io/library_map.html) for the data model and package structure, or open the [example notebooks](https://qldpc.readthedocs.io/examples/index.html) for complete workflows.
213
-
214
217
  ## 🧭 Find your way around
215
218
 
216
219
  | Goal | Start here |
@@ -218,24 +221,26 @@ Continue with the [library map](https://qldpc.readthedocs.io/library_map.html) f
218
221
  | Understand code representations and how packages fit together | [Library map](https://qldpc.readthedocs.io/library_map.html) |
219
222
  | Learn by running complete workflows | [Examples](https://qldpc.readthedocs.io/examples/index.html) |
220
223
  | Browse code families, functions, and exact signatures | [API reference](https://qldpc.readthedocs.io/autoapi/index.html) |
221
- | Construct and analyze a first code | [qLDPC basics](https://qldpc.readthedocs.io/examples/basics.html) |
224
+ | Construct and analyze a code | [qLDPC basics](https://qldpc.readthedocs.io/examples/basics.html) |
222
225
  | Estimate logical error rates | [Logical-error-rate examples](https://qldpc.readthedocs.io/examples/index.html#logical-error-rates) |
223
226
  | Build memory circuits or noise models | [Circuit examples](https://qldpc.readthedocs.io/examples/index.html) |
224
227
  | Change or extend qLDPC safely | [Agent and contributor guide](https://github.com/qLDPCOrg/qLDPC/blob/main/AGENTS.md) |
225
228
 
226
- For the complete list of classes and functions, including construction-specific literature, use the API reference and source docstrings.
227
- This README focuses on getting started and finding the right documentation.
228
-
229
229
  ## ⚠️ Limitations and caveats
230
230
 
231
+ qLDPC is research software.
232
+ Some searches are expensive, some bounds are heuristic, experimental APIs can change, and optional tools may have side effects.
233
+
231
234
  - Circuit and tableau tools only work with qubit codes, even though other parts of qLDPC support prime-power-dimensional qudits.
232
235
  - Circuits returned by `get_encoding_circuit` are not fault-tolerant.
233
236
  Fault-tolerant encoding is tracked in [issue #327](https://github.com/qLDPCOrg/qLDPC/issues/327).
234
237
  - Exact distance calculations and transversal-gate searches can be exponential.
235
238
  When a method returns a bound rather than an exact distance, its docstring explains what kind of bound it is.
236
- - Features that use GAP may start subprocesses, use local disk caches, access online resources, or ask for manual input or permission to install a package.
239
+ - Features that use GAP may start subprocesses, access online resources, or ask for manual input or permission to install a package.
240
+ - Code lookups such as `QuditCode.from_qecdb_id` access online resources and cache results on disk; pass `refresh=True` to fetch the latest data.
237
241
  - Everything under `qldpc.experimental` has an unstable public API and may change without deprecation.
238
- In particular, lattice-surgery support has not yet received independent expert review; validate its results independently and pin the qLDPC version if you depend on it.
242
+ - Lattice-surgery support in `qldpc.experimental.surgery` is experimental and unstable, and its implementation is still pending careful expert review.
243
+ Validate its results independently, and pin the qLDPC version if you depend on it.
239
244
 
240
245
  ## 📚 Documentation and support
241
246
 
@@ -1,30 +1,73 @@
1
1
  # qLDPC
2
2
 
3
3
  `qLDPC` is a Python toolkit for constructing and analyzing finite-size [quantum low-density parity-check codes](https://errorcorrectionzoo.org/c/qldpc), as well as stabilizer and subsystem codes more broadly.
4
- The goal is simple: make the quantum error-correction literature easier to explore, reproduce, and build on.
5
- Codes can start from parity-check matrices or from higher-level ingredients such as polynomials, group rings, Tanner graphs, and chain complexes.
6
- Once a code is built, you can inspect its logical operators, compute or bound its distance, plug in a decoder, estimate logical error rates, and—for qubit codes—build [`stim`](https://github.com/quantumlib/Stim) circuits.
4
+ It aims to make constructions and algorithms from the quantum error-correction literature easier to explore, reproduce, and build on.
5
+ You can define codes using parity-check matrices or higher-level ingredients such as polynomials, group rings, Tanner graphs, and chain complexes.
6
+ From there, you can inspect logical operators, compute or bound code distance, choose a decoder, estimate logical error rates, and—for qubit codes—build [`stim`](https://github.com/quantumlib/Stim) circuits.
7
7
 
8
8
  Most code-level tools work over arbitrary finite fields.
9
9
  Circuit tools currently only support qubit codes.
10
10
 
11
- ## ✨ A taste of qLDPC
12
-
13
- - **From textbook codes to the research frontier.**
14
- Build familiar surface, toric, Hamming, and Reed–Muller codes alongside hypergraph-product, lifted-product, bivariate-bicycle, quantum Tanner, SHYPS, GALA, and other modern families.
15
- - **Go beyond binary.**
16
- Many constructions and core algorithms work over arbitrary prime-power finite fields, not just qubits.
17
- - **Ask more of a code than `[[n, k, d]]`.**
18
- Work with check matrices, Tanner graphs, canonical logical operators, subsystem gauges, exact distances, upper bounds, and code-capacity error estimates.
19
- - **Move from codes to circuits.**
20
- Build memory experiments, encoding circuits, Pauli noise models, state-preparation diagnostics, Sinter decoders, sliding-window decoders, and transversal Clifford searches.
21
- - **Use the algebra that modern constructions need.**
22
- qLDPC includes finite groups, group rings, lifted matrices, Cayley complexes, chain complexes, and optional GAP integration.
23
- - **Steal from the examples.**
24
- The notebooks progress from the basics to circuit-level logical error rates, custom noise, transversal gates, and experimental lattice surgery.
25
-
26
- qLDPC is still research software, and it is honest about the tradeoffs.
27
- Some searches are expensive, some bounds are heuristic, experimental APIs can change, and optional tools may have side effects.
11
+ ## ✨ A few things to try
12
+
13
+ - **Code families.**
14
+ Construct surface, toric, Hamming, and Reed–Muller codes, along with hypergraph-product, lifted-product, bivariate-bicycle, quantum Tanner, SHYPS, GALA, and other families.
15
+ - **Distance calculations.**
16
+ Compute exact distances of binary codes with an [optimized Brouwer–Zimmermann search](src/qldpc/codes/distance/brouwer_zimmermann.md), or bound code distance using [QDistRnd](https://arxiv.org/abs/2308.15140) or [`sqetch`](https://github.com/a7b/yarn/tree/main/sqetch).
17
+ - **Code structure and analysis.**
18
+ Work with check matrices, Tanner graphs, canonical logical operators, subsystem gauge operators, and code-capacity error estimates.
19
+ - **Circuits and decoding workflows.**
20
+ Build memory experiments, encoding circuits, Pauli noise models, and state-preparation diagnostics; use Sinter and sliding-window decoders, or search for transversal Clifford gates.
21
+ - **Algebraic tools.**
22
+ Work with finite groups, group rings, lifted matrices, Cayley complexes, chain complexes, and optional GAP integration.
23
+
24
+ The [example notebooks](https://qldpc.readthedocs.io/examples/index.html) cover (among other things) code construction, custom noise models, and circuit-level logical error rates.
25
+
26
+ ## 🚀 Quickstart
27
+
28
+ ```python
29
+ from sympy.abc import x, y
30
+
31
+ from qldpc import codes
32
+
33
+ # The [[144, 12, 12]] bivariate bicycle "gross code".
34
+ code = codes.BBCode({x: 12, y: 6}, x**3 + y + y**2, y**3 + x + x**2)
35
+
36
+ print(code)
37
+ print("physical qubits:", len(code))
38
+ print("logical qubits:", code.dimension)
39
+ ```
40
+
41
+ The gross code is also available as the named construction, `codes.GrossCode()`.
42
+
43
+ ### A subsystem lifted-product code
44
+
45
+ This example builds a parity-check matrix over the group algebra `GF(2)[C₅]`, lifts each group-ring entry to a 5×5 binary block, and passes the result to `SLPCode`.
46
+ The [subsystem lifted-product construction](https://arxiv.org/abs/2404.18302) produces an 80-qubit CSS subsystem code with 5 logical qubits and 45 gauge qubits.
47
+
48
+ ```python
49
+ from qldpc import abstract, codes
50
+
51
+ group = abstract.CyclicGroup(5)
52
+ ring = abstract.GroupRing(group)
53
+ x = ring.generators[0]
54
+
55
+ repetition = abstract.RingArray.build(
56
+ [[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]],
57
+ ring,
58
+ )
59
+ connections = abstract.RingArray.build(
60
+ [[0, x, 0, 0], [0, 0, x, 0], [0, 0, 0, x]],
61
+ ring,
62
+ )
63
+ code = codes.SLPCode(repetition + connections)
64
+
65
+ print("physical qubits:", len(code)) # 80
66
+ print("logical qubits:", code.dimension) # 5
67
+ print("gauge qubits:", code.gauge_dimension) # 45
68
+ ```
69
+
70
+ The [library map](https://qldpc.readthedocs.io/library_map.html) explains the data model and package structure.
28
71
 
29
72
  ## 📦 Installation
30
73
 
@@ -40,7 +83,7 @@ python -m pip install qldpc
40
83
 
41
84
  #### Decoders
42
85
 
43
- qLDPC installs `ldpc` and `pymatching` by default, which include a host of decoders.
86
+ qLDPC installs `ldpc` and `pymatching` by default, which provide several decoding algorithms.
44
87
  Install the optional decoder integrations published as qLDPC extras for your platform with:
45
88
 
46
89
  ```bash
@@ -50,6 +93,7 @@ python -m pip install 'qldpc[decoders]'
50
93
  You can also use individual extras to install a specific optional decoder:
51
94
 
52
95
  ```bash
96
+ python -m pip install 'qldpc[ilp]'
53
97
  python -m pip install 'qldpc[relay-bp]'
54
98
  python -m pip install 'qldpc[tesseract]'
55
99
  ```
@@ -85,7 +129,7 @@ For binary CSS codes, you can select this backend with `code.get_distance_bound(
85
129
 
86
130
  ### Troubleshooting
87
131
 
88
- On macOS, you may need to install `cvxpy` manually by following its [installation instructions](https://www.cvxpy.org/install) before installing qLDPC.
132
+ On macOS, you may need to install `cvxpy`, which the ILP decoder requires, manually by following its [installation instructions](https://www.cvxpy.org/install) before installing `qldpc[ilp]` or `qldpc[decoders]`.
89
133
  If you use Conda to manage your Python environment, install `cvxpy` with:
90
134
 
91
135
  ```bash
@@ -102,50 +146,6 @@ cd qLDPC
102
146
  python -m pip install -e '.[dev]'
103
147
  ```
104
148
 
105
- ## 🚀 Quickstart
106
-
107
- ```python
108
- from sympy.abc import x, y
109
-
110
- from qldpc import codes
111
-
112
- # The [[144, 12, 12]] bivariate bicycle "gross code".
113
- code = codes.BBCode({x: 12, y: 6}, x**3 + y + y**2, y**3 + x + x**2)
114
-
115
- print(code)
116
- print("physical qubits:", len(code))
117
- print("logical qubits:", code.dimension)
118
- ```
119
-
120
- ### Go deeper: a subsystem lifted-product code
121
-
122
- The next example builds a parity-check matrix over the group algebra `GF(2)[C₅]`, lifts each group-ring entry to a 5×5 binary block, and hands the result to `SLPCode`.
123
- The [subsystem lifted-product construction](https://arxiv.org/abs/2404.18302) produces an 80-qubit CSS subsystem code with 5 logical qubits and 45 gauge qubits.
124
-
125
- ```python
126
- from qldpc import abstract, codes
127
-
128
- group = abstract.CyclicGroup(5)
129
- ring = abstract.GroupRing(group)
130
- x = ring.generators[0]
131
-
132
- repetition = abstract.RingArray.build(
133
- [[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]],
134
- ring,
135
- )
136
- connections = abstract.RingArray.build(
137
- [[0, x, 0, 0], [0, 0, x, 0], [0, 0, 0, x]],
138
- ring,
139
- )
140
- code = codes.SLPCode(repetition + connections)
141
-
142
- print("physical qubits:", len(code)) # 80
143
- print("logical qubits:", code.dimension) # 5
144
- print("gauge qubits:", code.gauge_dimension) # 45
145
- ```
146
-
147
- Continue with the [library map](https://qldpc.readthedocs.io/library_map.html) for the data model and package structure, or open the [example notebooks](https://qldpc.readthedocs.io/examples/index.html) for complete workflows.
148
-
149
149
  ## 🧭 Find your way around
150
150
 
151
151
  | Goal | Start here |
@@ -153,24 +153,26 @@ Continue with the [library map](https://qldpc.readthedocs.io/library_map.html) f
153
153
  | Understand code representations and how packages fit together | [Library map](https://qldpc.readthedocs.io/library_map.html) |
154
154
  | Learn by running complete workflows | [Examples](https://qldpc.readthedocs.io/examples/index.html) |
155
155
  | Browse code families, functions, and exact signatures | [API reference](https://qldpc.readthedocs.io/autoapi/index.html) |
156
- | Construct and analyze a first code | [qLDPC basics](https://qldpc.readthedocs.io/examples/basics.html) |
156
+ | Construct and analyze a code | [qLDPC basics](https://qldpc.readthedocs.io/examples/basics.html) |
157
157
  | Estimate logical error rates | [Logical-error-rate examples](https://qldpc.readthedocs.io/examples/index.html#logical-error-rates) |
158
158
  | Build memory circuits or noise models | [Circuit examples](https://qldpc.readthedocs.io/examples/index.html) |
159
159
  | Change or extend qLDPC safely | [Agent and contributor guide](https://github.com/qLDPCOrg/qLDPC/blob/main/AGENTS.md) |
160
160
 
161
- For the complete list of classes and functions, including construction-specific literature, use the API reference and source docstrings.
162
- This README focuses on getting started and finding the right documentation.
163
-
164
161
  ## ⚠️ Limitations and caveats
165
162
 
163
+ qLDPC is research software.
164
+ Some searches are expensive, some bounds are heuristic, experimental APIs can change, and optional tools may have side effects.
165
+
166
166
  - Circuit and tableau tools only work with qubit codes, even though other parts of qLDPC support prime-power-dimensional qudits.
167
167
  - Circuits returned by `get_encoding_circuit` are not fault-tolerant.
168
168
  Fault-tolerant encoding is tracked in [issue #327](https://github.com/qLDPCOrg/qLDPC/issues/327).
169
169
  - Exact distance calculations and transversal-gate searches can be exponential.
170
170
  When a method returns a bound rather than an exact distance, its docstring explains what kind of bound it is.
171
- - Features that use GAP may start subprocesses, use local disk caches, access online resources, or ask for manual input or permission to install a package.
171
+ - Features that use GAP may start subprocesses, access online resources, or ask for manual input or permission to install a package.
172
+ - Code lookups such as `QuditCode.from_qecdb_id` access online resources and cache results on disk; pass `refresh=True` to fetch the latest data.
172
173
  - Everything under `qldpc.experimental` has an unstable public API and may change without deprecation.
173
- In particular, lattice-surgery support has not yet received independent expert review; validate its results independently and pin the qLDPC version if you depend on it.
174
+ - Lattice-surgery support in `qldpc.experimental.surgery` is experimental and unstable, and its implementation is still pending careful expert review.
175
+ Validate its results independently, and pin the qLDPC version if you depend on it.
174
176
 
175
177
  ## 📚 Documentation and support
176
178
 
@@ -4,7 +4,7 @@ requires = ["uv-build>=0.9.18,<0.13"]
4
4
 
5
5
  [project]
6
6
  name = "qldpc"
7
- version = "0.4.2.dev20261004"
7
+ version = "0.4.2.dev20261023"
8
8
  description = "Tools for constructing and analyzing quantum low density parity check (qLDPC) codes."
9
9
  readme = "README.md"
10
10
  keywords = [
@@ -32,19 +32,19 @@ classifiers = [
32
32
  "Topic :: Scientific/Engineering :: Physics",
33
33
  ]
34
34
  dependencies = [
35
- "cvxpy>=1.3.2",
36
35
  "diskcache>=5",
37
- "galois>=0.4.2",
36
+ "galois>=0.4.11",
38
37
  "ldpc>=2.4.1",
39
- "networkx>=2.6.2",
40
- "numpy>=1.24",
38
+ "networkx>=2.7",
39
+ "numba>=0.61.2",
40
+ "numpy>=2.1",
41
41
  "platformdirs>=4",
42
42
  "pymatching>=2.3",
43
43
  "pyperclip>=1.11",
44
- "scipy>=1.14.1",
44
+ "scipy>=1.16",
45
45
  "sinter>=1.16",
46
46
  "stim>=1.16",
47
- "sympy>=1.12",
47
+ "sympy>=1.12.1",
48
48
  "tqdm>=4",
49
49
  ]
50
50
 
@@ -54,6 +54,7 @@ email = "mika.perlin@gmail.com"
54
54
 
55
55
  [project.optional-dependencies]
56
56
  decoders = [
57
+ "qldpc[ilp]",
57
58
  "qldpc[relay-bp]",
58
59
  "qldpc[tesseract]; ((sys_platform=='darwin' and platform_machine=='arm64') or (sys_platform=='linux' and platform_machine=='x86_64')) and python_version<'3.15'",
59
60
  ]
@@ -76,6 +77,7 @@ docs = [
76
77
  "sphinx-rtd-theme>=2",
77
78
  ]
78
79
  gap = ["passagemath-gap==10.8.12; python_version=='3.13' and sys_platform!='win32'"]
80
+ ilp = ["cvxpy>=1.5.3"]
79
81
  relay-bp = ["relay-bp[stim]==0.2.2"]
80
82
  tesseract = ["tesseract-decoder==0.1.1.dev20260910235247; python_version>='3.12'"]
81
83
 
@@ -4,7 +4,7 @@ requires = [ "uv-build>=0.9.18,<0.13" ]
4
4
 
5
5
  [project]
6
6
  name = "qldpc"
7
- version = "0.4.2.dev20261004"
7
+ version = "0.4.2.dev20261023"
8
8
  description = "Tools for constructing and analyzing quantum low density parity check (qLDPC) codes."
9
9
  readme = "README.md"
10
10
  keywords = [
@@ -30,22 +30,23 @@ classifiers = [
30
30
  "Topic :: Scientific/Engineering :: Physics",
31
31
  ]
32
32
  dependencies = [
33
- "cvxpy>=1.3.2",
34
33
  "diskcache>=5",
35
- "galois>=0.4.2",
34
+ "galois>=0.4.11",
36
35
  "ldpc>=2.4.1",
37
- "networkx>=2.6.2",
38
- "numpy>=1.24",
36
+ "networkx>=2.7",
37
+ "numba>=0.61.2", # floor tested with Python 3.11 and NumPy 2.1
38
+ "numpy>=2.1",
39
39
  "platformdirs>=4",
40
40
  "pymatching>=2.3",
41
41
  "pyperclip>=1.11",
42
- "scipy>=1.14.1",
42
+ "scipy>=1.16", # earlier MILP solvers can return non-solutions to ILP decoding
43
43
  "sinter>=1.16",
44
44
  "stim>=1.16",
45
- "sympy>=1.12",
45
+ "sympy>=1.12.1", # 1.12 accepts mpmath 1.4, which it cannot import
46
46
  "tqdm>=4",
47
47
  ]
48
48
  optional-dependencies.decoders = [
49
+ "qldpc[ilp]",
49
50
  "qldpc[relay-bp]",
50
51
  """\
51
52
  qldpc[tesseract]; ((sys_platform=='darwin' and platform_machine=='arm64') or (sys_platform=='linux' and \
@@ -73,6 +74,9 @@ optional-dependencies.docs = [
73
74
  optional-dependencies.gap = [
74
75
  "passagemath-gap==10.8.12; python_version=='3.13' and sys_platform!='win32'",
75
76
  ]
77
+ optional-dependencies.ilp = [
78
+ "cvxpy>=1.5.3", # earlier releases do not import with NumPy 2
79
+ ]
76
80
  optional-dependencies.relay-bp = [ "relay-bp[stim]==0.2.2" ]
77
81
  optional-dependencies.tesseract = [
78
82
  "tesseract-decoder==0.1.1.dev20260910235247; python_version>='3.12'",
@@ -150,8 +154,8 @@ run.include = [ "./*" ]
150
154
  run.parallel = true
151
155
  run.patch = [ "subprocess" ]
152
156
  # Statement coverage only. Branch coverage is deliberately not gated: a handful of arcs flip with
153
- # the pytest-randomly seed and with the installed numpy version, so gating it would make pass/fail
154
- # nondeterministic. Audit it on demand with "checks/coverage_.py --branch".
157
+ # the pytest-randomly seed, so gating it would make pass/fail nondeterministic. Audit it on demand
158
+ # with "checks/coverage_.py --branch".
155
159
  report.fail_under = 100
156
160
  report.skip_covered = true
157
161
  report.show_missing = true
@@ -0,0 +1,35 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+
3
+ """Tools for constructing and analyzing quantum low density parity check (qLDPC) codes."""
4
+
5
+ import importlib.metadata
6
+
7
+ from . import (
8
+ _deprecations,
9
+ abstract,
10
+ cache,
11
+ circuits,
12
+ codes,
13
+ decoders,
14
+ experimental,
15
+ external,
16
+ math,
17
+ objects,
18
+ )
19
+
20
+ __version__ = importlib.metadata.version("qldpc")
21
+
22
+ __all__ = [
23
+ "__version__",
24
+ "abstract",
25
+ "cache",
26
+ "circuits",
27
+ "codes",
28
+ "decoders",
29
+ "experimental",
30
+ "external",
31
+ "math",
32
+ "objects",
33
+ ]
34
+
35
+ _deprecations.install_deprecated_methods()
@@ -0,0 +1,31 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+
3
+ """Deprecated names, methods, arguments, and decoder construction of qLDPC.
4
+
5
+ All deprecation code lives in this private package. The core module registers deprecated names,
6
+ defines deprecated methods, and provides the helpers that inline deprecated-argument blocks call.
7
+ The decoders module holds deprecated decoder construction, which qldpc.decoders serves through the
8
+ registry. Modules with deprecated decoder arguments import it directly, and
9
+ install_deprecated_methods imports it when it runs, so this package does not import it when it is
10
+ imported. The lookup module holds the deprecated direct construction of LookupDecoder and
11
+ WeightedLookupDecoder, and the lookup decoders that the deprecated predict_observable_flips=True
12
+ option builds. It imports qldpc.decoders, so it is imported only within the functions that use it.
13
+ """
14
+
15
+ from .core import (
16
+ ALIASES,
17
+ SILENT_ALIASES,
18
+ defunct,
19
+ get_deprecated_attribute,
20
+ install_deprecated_methods,
21
+ warn_deprecated,
22
+ )
23
+
24
+ __all__ = [
25
+ "ALIASES",
26
+ "SILENT_ALIASES",
27
+ "defunct",
28
+ "get_deprecated_attribute",
29
+ "install_deprecated_methods",
30
+ "warn_deprecated",
31
+ ]