xtim 4.2.1__tar.gz → 4.3.0__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 (589) hide show
  1. {xtim-4.2.1 → xtim-4.3.0}/CHANGELOG.md +177 -0
  2. {xtim-4.2.1 → xtim-4.3.0}/CITATION.cff +2 -2
  3. {xtim-4.2.1 → xtim-4.3.0}/PKG-INFO +1 -1
  4. {xtim-4.2.1 → xtim-4.3.0}/cpp/bindings/xtim_py.cpp +242 -15
  5. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/canonical_stab_sum.hpp +17 -1
  6. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/coherentize_feedback.hpp +5 -0
  7. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/dem_export.hpp +18 -0
  8. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/dem_preamble.hpp +10 -1
  9. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/engine_version.hpp +9 -1
  10. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/feedback.hpp +47 -6
  11. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/frame.hpp +15 -8
  12. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/framed_superposition.hpp +2 -0
  13. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/normal_form.hpp +7 -0
  14. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/pauli_diagonalize.hpp +19 -1
  15. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/pauli_kernels.hpp +1 -0
  16. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/pauli_rotation_form.hpp +37 -7
  17. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/propagation_table.hpp +15 -1
  18. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/stab_affine.hpp +12 -0
  19. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/stab_disentangle.hpp +14 -0
  20. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/stab_generators.hpp +4 -1
  21. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/term_residual.hpp +11 -0
  22. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/twirl_planes.hpp +5 -0
  23. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/twirl_sampler.hpp +5 -1
  24. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/xdem_file.hpp +19 -0
  25. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/xdem_sampler.hpp +3 -1
  26. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/xdem_writer.hpp +6 -2
  27. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/bare_state_memo.cpp +3 -2
  28. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/canonical_stab_sum.cpp +33 -8
  29. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/coherentize_feedback.cpp +46 -1
  30. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/dem_export.cpp +272 -41
  31. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/feedback.cpp +250 -20
  32. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/frame.cpp +70 -12
  33. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/framed_superposition.cpp +56 -11
  34. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/normal_form.cpp +10 -5
  35. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/parity_assemble.cpp +2 -85
  36. xtim-4.3.0/cpp/src/parity_assemble_internal.hpp +115 -0
  37. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/pauli_diagonalize.cpp +139 -18
  38. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/pauli_rotation_form.cpp +233 -16
  39. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/propagation_table.cpp +108 -20
  40. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/run_stim.cpp +4 -2
  41. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/stab_affine.cpp +87 -0
  42. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/stab_disentangle.cpp +171 -0
  43. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/stab_generators.cpp +5 -4
  44. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/stim_emit.cpp +20 -2
  45. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/term_residual.cpp +119 -0
  46. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/twirl_planes.cpp +97 -4
  47. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/twirl_sampler_fam.cpp +19 -1
  48. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/twirl_sampler_rot.cpp +70 -22
  49. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/xdem_file.cpp +100 -0
  50. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/xdem_writer.cpp +16 -5
  51. xtim-4.3.0/docs/twirl_record_sampler.md +183 -0
  52. {xtim-4.2.1 → xtim-4.3.0}/docs/usage.md +19 -0
  53. {xtim-4.2.1 → xtim-4.3.0}/docs/xdem.md +87 -2
  54. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/README.md +15 -15
  55. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/ccz_toy.xdem +1 -0
  56. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/ccz_toy_obs.xdem +1 -0
  57. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/ccz_toy_obs_p5.xdem +1 -0
  58. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/ch_cultivation.xdem +1 -0
  59. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/code_switching_faithful_noobs.xdem +1 -0
  60. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/code_switching_rate_noobs.xdem +1 -0
  61. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/color5_cultivation.xdem +1 -0
  62. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/cultivation_d3_faithful.xdem +1 -0
  63. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/cultivation_d5.xdem +1 -0
  64. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/distillation_15_1_3_gatenoise.xdem +1 -0
  65. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/ex422_obs.xdem +1 -0
  66. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/miniature_oracle.xdem +1 -0
  67. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/rm15rep.xdem +1 -0
  68. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/tdag_cycle.xdem +1 -0
  69. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/toy2obs.xdem +1 -0
  70. {xtim-4.2.1 → xtim-4.3.0}/pyproject.toml +1 -1
  71. {xtim-4.2.1 → xtim-4.3.0}/tests/test_carried_compose_frame_pin.py +10 -7
  72. {xtim-4.2.1 → xtim-4.3.0}/tests/test_compile_scaling.py +2 -1
  73. xtim-4.3.0/tests/test_coset_spotcheck.py +54 -0
  74. xtim-4.3.0/tests/test_f2_completion.py +118 -0
  75. xtim-4.3.0/tests/test_f3_rotation_frame.py +179 -0
  76. xtim-4.3.0/tests/test_f4_determinism_routes.py +160 -0
  77. xtim-4.3.0/tests/test_f5_determinism_sweep.py +61 -0
  78. xtim-4.3.0/tests/test_feedback_compile_linear.py +47 -0
  79. {xtim-4.2.1 → xtim-4.3.0}/tests/test_fid_speed.py +3 -1
  80. {xtim-4.2.1 → xtim-4.3.0}/tests/test_fp_contract.py +2 -2
  81. {xtim-4.2.1 → xtim-4.3.0}/tests/test_frame_cosets_cpp.py +6 -2
  82. xtim-4.3.0/tests/test_fresh_record_compile_scaling.py +43 -0
  83. xtim-4.3.0/tests/test_fresh_record_t_chain.py +112 -0
  84. {xtim-4.2.1 → xtim-4.3.0}/tests/test_if_refusal.py +50 -0
  85. {xtim-4.2.1 → xtim-4.3.0}/tests/test_ja_term_key.py +9 -2
  86. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_branch_frame.py +26 -1
  87. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_fidelity_vs_production.py +5 -1
  88. {xtim-4.2.1 → xtim-4.3.0}/tests/test_keyed_streams.py +1 -1
  89. {xtim-4.2.1 → xtim-4.3.0}/tests/test_lean_l6.py +18 -13
  90. xtim-4.3.0/tests/test_noiseless_prefix_contract.py +336 -0
  91. xtim-4.3.0/tests/test_nondet_magic_hint.py +84 -0
  92. {xtim-4.2.1 → xtim-4.3.0}/tests/test_qw_e_dem.py +12 -12
  93. {xtim-4.2.1 → xtim-4.3.0}/tests/test_threads.py +4 -3
  94. xtim-4.3.0/tests/test_tpp.py +90 -0
  95. xtim-4.3.0/tests/test_version_consistency.py +80 -0
  96. xtim-4.3.0/tests/test_x7_feedback_fold.py +101 -0
  97. xtim-4.3.0/tests/test_xdem_absorbed.py +72 -0
  98. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_api.py +2 -2
  99. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_examples.py +5 -1
  100. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_export.py +9 -2
  101. xtim-4.3.0/tests/test_xdem_law_api.py +166 -0
  102. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_lean.py +5 -2
  103. xtim-4.3.0/tests/test_xdem_provenance.py +107 -0
  104. {xtim-4.2.1 → xtim-4.3.0}/xtim/__init__.py +26 -11
  105. {xtim-4.2.1 → xtim-4.3.0}/xtim/circuit.py +21 -4
  106. {xtim-4.2.1 → xtim-4.3.0}/xtim/errors.py +54 -7
  107. {xtim-4.2.1 → xtim-4.3.0}/xtim/twirl.py +1 -1
  108. {xtim-4.2.1 → xtim-4.3.0}/xtim/xdem.py +80 -1
  109. {xtim-4.2.1 → xtim-4.3.0}/xtim.egg-info/PKG-INFO +1 -1
  110. {xtim-4.2.1 → xtim-4.3.0}/xtim.egg-info/SOURCES.txt +16 -0
  111. xtim-4.2.1/docs/twirl_record_sampler.md +0 -78
  112. xtim-4.2.1/tests/test_version_consistency.py +0 -69
  113. {xtim-4.2.1 → xtim-4.3.0}/LICENSE +0 -0
  114. {xtim-4.2.1 → xtim-4.3.0}/LICENSES/Apache-2.0.txt +0 -0
  115. {xtim-4.2.1 → xtim-4.3.0}/MANIFEST.in +0 -0
  116. {xtim-4.2.1 → xtim-4.3.0}/README.md +0 -0
  117. {xtim-4.2.1 → xtim-4.3.0}/THIRD_PARTY_NOTICES.md +0 -0
  118. {xtim-4.2.1 → xtim-4.3.0}/benchmarks/cultivation_d3_rate.stim +0 -0
  119. {xtim-4.2.1 → xtim-4.3.0}/cpp/bindings/common_py.hpp +0 -0
  120. {xtim-4.2.1 → xtim-4.3.0}/cpp/bindings/family_sampler.hpp +0 -0
  121. {xtim-4.2.1 → xtim-4.3.0}/cpp/bindings/framed_py.hpp +0 -0
  122. {xtim-4.2.1 → xtim-4.3.0}/cpp/bindings/injection.hpp +0 -0
  123. {xtim-4.2.1 → xtim-4.3.0}/cpp/bindings/output_state_py.hpp +0 -0
  124. {xtim-4.2.1 → xtim-4.3.0}/cpp/bindings/record_api.hpp +0 -0
  125. {xtim-4.2.1 → xtim-4.3.0}/cpp/bindings/record_buffer.hpp +0 -0
  126. {xtim-4.2.1 → xtim-4.3.0}/cpp/bindings/refusal_text.hpp +0 -0
  127. {xtim-4.2.1 → xtim-4.3.0}/cpp/bindings/twirl_binding_access.hpp +0 -0
  128. {xtim-4.2.1 → xtim-4.3.0}/cpp/bindings/twirl_front.hpp +0 -0
  129. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/amplitudes.hpp +0 -0
  130. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/bare_state_errors.hpp +0 -0
  131. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/bare_state_memo.hpp +0 -0
  132. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/bitmat.hpp +0 -0
  133. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/born_law_coset.hpp +0 -0
  134. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/branch_hint.hpp +0 -0
  135. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/branch_scaffold.hpp +0 -0
  136. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/branch_table.hpp +0 -0
  137. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/carried_compose.hpp +0 -0
  138. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/circuit_ir.hpp +0 -0
  139. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/clifford_conjugate.hpp +0 -0
  140. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/clifford_frames.hpp +0 -0
  141. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/clifford_op.hpp +0 -0
  142. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/clifford_tableau.hpp +0 -0
  143. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/compiler_builtins.hpp +0 -0
  144. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/deferral.hpp +0 -0
  145. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/dem_classify.hpp +0 -0
  146. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/dem_decompose.hpp +0 -0
  147. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/dem_pe_per_shot.hpp +0 -0
  148. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/diag_conjugate.hpp +0 -0
  149. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/diag_error_sampler.hpp +0 -0
  150. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/errors.hpp +0 -0
  151. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/exact_phase.hpp +0 -0
  152. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/exact_scope.hpp +0 -0
  153. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/factored_stab.hpp +0 -0
  154. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/fast_todd.hpp +0 -0
  155. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/fault_record_law.hpp +0 -0
  156. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/frame_cosets.hpp +0 -0
  157. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/framed_sampler.hpp +0 -0
  158. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/free_dir.hpp +0 -0
  159. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/gf2_gauss.hpp +0 -0
  160. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/keyed_rng.hpp +0 -0
  161. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/noise_chain.hpp +0 -0
  162. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/normalize.hpp +0 -0
  163. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/output_state.hpp +0 -0
  164. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/parity_assemble.hpp +0 -0
  165. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/parity_support.hpp +0 -0
  166. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/pauli.hpp +0 -0
  167. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/plan_arena.hpp +0 -0
  168. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/plan_class.hpp +0 -0
  169. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/port_contract.hpp +0 -0
  170. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/ppr_residual.hpp +0 -0
  171. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/ray_stab_bits.hpp +0 -0
  172. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/record_fidelity.hpp +0 -0
  173. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/record_general.hpp +0 -0
  174. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/record_signs.hpp +0 -0
  175. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/record_space_b.hpp +0 -0
  176. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/record_table.hpp +0 -0
  177. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/ref_io.hpp +0 -0
  178. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/residue_projection.hpp +0 -0
  179. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/resolve_branches.hpp +0 -0
  180. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/rf_pauli_expansion.hpp +0 -0
  181. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/run_stim.hpp +0 -0
  182. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/sampler.hpp +0 -0
  183. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/scratch.hpp +0 -0
  184. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/stab_overlap.hpp +0 -0
  185. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/stab_state.hpp +0 -0
  186. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/state_budget.hpp +0 -0
  187. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/stim_parse.hpp +0 -0
  188. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/thread_pool.hpp +0 -0
  189. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/twirl_kernel.hpp +0 -0
  190. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/twirl_rotation.hpp +0 -0
  191. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/visibility.hpp +0 -0
  192. {xtim-4.2.1 → xtim-4.3.0}/cpp/include/qeccore/xdem_lean.hpp +0 -0
  193. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/bitmat.cpp +0 -0
  194. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/born_law_coset.cpp +0 -0
  195. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/branch_scaffold.cpp +0 -0
  196. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/branch_table.cpp +0 -0
  197. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/carried_compose.cpp +0 -0
  198. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/clifford_conjugate.cpp +0 -0
  199. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/clifford_frames.cpp +0 -0
  200. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/clifford_op.cpp +0 -0
  201. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/clifford_tableau.cpp +0 -0
  202. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/deferral.cpp +0 -0
  203. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/dem_decompose.cpp +0 -0
  204. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/dem_pe_per_shot.cpp +0 -0
  205. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/dem_solve_channel.cpp +0 -0
  206. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/diag_error_sampler.cpp +0 -0
  207. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/exact_scope.cpp +0 -0
  208. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/factored_active_block.cpp +0 -0
  209. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/factored_stab.cpp +0 -0
  210. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/fast_todd.cpp +0 -0
  211. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/fault_record_law.cpp +0 -0
  212. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/framed_sampler.cpp +0 -0
  213. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/noise_chain.cpp +0 -0
  214. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/normalize.cpp +0 -0
  215. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/output_state.cpp +0 -0
  216. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/parity_support.cpp +0 -0
  217. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/pauli.cpp +0 -0
  218. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/plan_arena.cpp +0 -0
  219. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/plan_class.cpp +0 -0
  220. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/port_contract.cpp +0 -0
  221. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/ppr_residual.cpp +0 -0
  222. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/record_fidelity.cpp +0 -0
  223. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/record_general.cpp +0 -0
  224. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/record_signs.cpp +0 -0
  225. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/record_space_b.cpp +0 -0
  226. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/record_table.cpp +0 -0
  227. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/record_table_internal.hpp +0 -0
  228. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/ref_io.cpp +0 -0
  229. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/ref_overlap.cpp +0 -0
  230. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/reference_records.cpp +0 -0
  231. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/residue_projection.cpp +0 -0
  232. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/resolve_branches.cpp +0 -0
  233. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/rf_pauli_expansion.cpp +0 -0
  234. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/sampler.cpp +0 -0
  235. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/stab_affine_internal.hpp +0 -0
  236. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/stab_overlap.cpp +0 -0
  237. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/state_budget.cpp +0 -0
  238. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/stim_emit_internal.hpp +0 -0
  239. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/stim_parse.cpp +0 -0
  240. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/thread_pool.cpp +0 -0
  241. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/twirl_kernel_sampler.cpp +0 -0
  242. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/twirl_law.cpp +0 -0
  243. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/twirl_law_internal.hpp +0 -0
  244. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/twirl_normal_form.cpp +0 -0
  245. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/twirl_rotation.cpp +0 -0
  246. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/twirl_sampler.cpp +0 -0
  247. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/twirl_sampler_er.cpp +0 -0
  248. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/twirl_sampler_impl.inc.hpp +0 -0
  249. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/twirl_sampler_rotloop.inc.hpp +0 -0
  250. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/twirl_sampler_rotw.cpp +0 -0
  251. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/twirl_sampler_runw.inc.hpp +0 -0
  252. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/twirl_sampler_threads.cpp +0 -0
  253. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/twirl_signs.cpp +0 -0
  254. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/xdem_lean.cpp +0 -0
  255. {xtim-4.2.1 → xtim-4.3.0}/cpp/src/xdem_sampler.cpp +0 -0
  256. {xtim-4.2.1 → xtim-4.3.0}/docs/README.md +0 -0
  257. {xtim-4.2.1 → xtim-4.3.0}/docs/branch_frames.md +0 -0
  258. {xtim-4.2.1 → xtim-4.3.0}/docs/frame_cosets_cpp.md +0 -0
  259. {xtim-4.2.1 → xtim-4.3.0}/docs/performance.md +0 -0
  260. {xtim-4.2.1 → xtim-4.3.0}/docs/xtim_forced_faults.md +0 -0
  261. {xtim-4.2.1 → xtim-4.3.0}/docs/xtim_postselected_logical_error_rate.md +0 -0
  262. {xtim-4.2.1 → xtim-4.3.0}/docs/xtim_simulable_class.md +0 -0
  263. {xtim-4.2.1 → xtim-4.3.0}/examples/01_quickstart_distillation.py +0 -0
  264. {xtim-4.2.1 → xtim-4.3.0}/examples/02_cultivation_d3.py +0 -0
  265. {xtim-4.2.1 → xtim-4.3.0}/examples/03_color5_postselected.py +0 -0
  266. {xtim-4.2.1 → xtim-4.3.0}/examples/04_h_cultivation.py +0 -0
  267. {xtim-4.2.1 → xtim-4.3.0}/examples/05_ccz_cube.py +0 -0
  268. {xtim-4.2.1 → xtim-4.3.0}/examples/06_code_switching.py +0 -0
  269. {xtim-4.2.1 → xtim-4.3.0}/examples/07_refusals.py +0 -0
  270. {xtim-4.2.1 → xtim-4.3.0}/examples/08_bring_your_own.py +0 -0
  271. {xtim-4.2.1 → xtim-4.3.0}/examples/09_decoded_fidelity.py +0 -0
  272. {xtim-4.2.1 → xtim-4.3.0}/examples/10_gpu_estimate.py +0 -0
  273. {xtim-4.2.1 → xtim-4.3.0}/examples/README.md +0 -0
  274. {xtim-4.2.1 → xtim-4.3.0}/examples/ch_cultivation.stim +0 -0
  275. {xtim-4.2.1 → xtim-4.3.0}/examples/code_switching_faithful.stim +0 -0
  276. {xtim-4.2.1 → xtim-4.3.0}/examples/code_switching_rate.stim +0 -0
  277. {xtim-4.2.1 → xtim-4.3.0}/examples/color5_cultivation.stim +0 -0
  278. {xtim-4.2.1 → xtim-4.3.0}/examples/cube_ccz.stim +0 -0
  279. {xtim-4.2.1 → xtim-4.3.0}/examples/cultivation_d3_faithful.stim +0 -0
  280. {xtim-4.2.1 → xtim-4.3.0}/examples/cultivation_d3_rate.stim +0 -0
  281. {xtim-4.2.1 → xtim-4.3.0}/examples/cultivation_d5.stim +0 -0
  282. {xtim-4.2.1 → xtim-4.3.0}/examples/distillation_15_1_3.stim +0 -0
  283. {xtim-4.2.1 → xtim-4.3.0}/examples/miniature_oracle.stim +0 -0
  284. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/ccz_toy.stim +0 -0
  285. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/ccz_toy_obs.stim +0 -0
  286. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/ccz_toy_obs_p5.stim +0 -0
  287. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/ch_cultivation.stim +0 -0
  288. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/code_switching_faithful_noobs.stim +0 -0
  289. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/code_switching_rate_noobs.stim +0 -0
  290. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/color5_cultivation.stim +0 -0
  291. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/cultivation_d3_faithful.stim +0 -0
  292. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/cultivation_d3_rate.stim +0 -0
  293. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/cultivation_d3_rate.xdem +0 -0
  294. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/cultivation_d5.stim +0 -0
  295. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/distillation_15_1_3.stim +0 -0
  296. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/distillation_15_1_3.xdem +0 -0
  297. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/distillation_15_1_3_gatenoise.stim +0 -0
  298. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/ex422_obs.stim +0 -0
  299. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/miniature_oracle.stim +0 -0
  300. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/regenerate.py +0 -0
  301. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/rm15rep.stim +0 -0
  302. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/tdag_cycle.stim +0 -0
  303. {xtim-4.2.1 → xtim-4.3.0}/examples/xdem/toy2obs.stim +0 -0
  304. {xtim-4.2.1 → xtim-4.3.0}/setup.cfg +0 -0
  305. {xtim-4.2.1 → xtim-4.3.0}/setup.py +0 -0
  306. {xtim-4.2.1 → xtim-4.3.0}/smoke_test.py +0 -0
  307. {xtim-4.2.1 → xtim-4.3.0}/tests/_branch_oracle.py +0 -0
  308. {xtim-4.2.1 → xtim-4.3.0}/tests/_carried_oracle.py +0 -0
  309. {xtim-4.2.1 → xtim-4.3.0}/tests/_dem_compare.py +0 -0
  310. {xtim-4.2.1 → xtim-4.3.0}/tests/_dem_parse.py +0 -0
  311. {xtim-4.2.1 → xtim-4.3.0}/tests/_dense_oracle.py +0 -0
  312. {xtim-4.2.1 → xtim-4.3.0}/tests/_exact.py +0 -0
  313. {xtim-4.2.1 → xtim-4.3.0}/tests/_exact_engine.py +0 -0
  314. {xtim-4.2.1 → xtim-4.3.0}/tests/_exact_forced.py +0 -0
  315. {xtim-4.2.1 → xtim-4.3.0}/tests/_exact_law.py +0 -0
  316. {xtim-4.2.1 → xtim-4.3.0}/tests/_exact_reference.py +0 -0
  317. {xtim-4.2.1 → xtim-4.3.0}/tests/_fake_cupy.py +0 -0
  318. {xtim-4.2.1 → xtim-4.3.0}/tests/_forced_oracle.py +0 -0
  319. {xtim-4.2.1 → xtim-4.3.0}/tests/_frames.py +0 -0
  320. {xtim-4.2.1 → xtim-4.3.0}/tests/_frames_contract.py +0 -0
  321. {xtim-4.2.1 → xtim-4.3.0}/tests/_gpu_compare.py +0 -0
  322. {xtim-4.2.1 → xtim-4.3.0}/tests/_gpu_ref.py +0 -0
  323. {xtim-4.2.1 → xtim-4.3.0}/tests/_ja_fixtures.py +0 -0
  324. {xtim-4.2.1 → xtim-4.3.0}/tests/_n1_reference.py +0 -0
  325. {xtim-4.2.1 → xtim-4.3.0}/tests/_nc_oracle.py +0 -0
  326. {xtim-4.2.1 → xtim-4.3.0}/tests/_orig_examples.py +0 -0
  327. {xtim-4.2.1 → xtim-4.3.0}/tests/_output_state_oracle.py +0 -0
  328. {xtim-4.2.1 → xtim-4.3.0}/tests/_private.py +0 -0
  329. {xtim-4.2.1 → xtim-4.3.0}/tests/_public.py +0 -0
  330. {xtim-4.2.1 → xtim-4.3.0}/tests/_record_law_x.py +0 -0
  331. {xtim-4.2.1 → xtim-4.3.0}/tests/_record_oracle.py +0 -0
  332. {xtim-4.2.1 → xtim-4.3.0}/tests/_record_oracle_mixed.py +0 -0
  333. {xtim-4.2.1 → xtim-4.3.0}/tests/_register_oracle.py +0 -0
  334. {xtim-4.2.1 → xtim-4.3.0}/tests/_traj_oracle.py +0 -0
  335. {xtim-4.2.1 → xtim-4.3.0}/tests/_xdem_circuits.py +0 -0
  336. {xtim-4.2.1 → xtim-4.3.0}/tests/_xdem_engine.py +0 -0
  337. {xtim-4.2.1 → xtim-4.3.0}/tests/_xdem_fuzz_gen.py +0 -0
  338. {xtim-4.2.1 → xtim-4.3.0}/tests/_xdem_lean_fuzz.py +0 -0
  339. {xtim-4.2.1 → xtim-4.3.0}/tests/_xdem_model.py +0 -0
  340. {xtim-4.2.1 → xtim-4.3.0}/tests/_xdem_synth.py +0 -0
  341. {xtim-4.2.1 → xtim-4.3.0}/tests/conftest.py +0 -0
  342. {xtim-4.2.1 → xtim-4.3.0}/tests/data/ladder_settle/gen_cases.py +0 -0
  343. {xtim-4.2.1 → xtim-4.3.0}/tests/data/ladder_settle/gen_pairs.py +0 -0
  344. {xtim-4.2.1 → xtim-4.3.0}/tests/exact_sv.py +0 -0
  345. {xtim-4.2.1 → xtim-4.3.0}/tests/s2b/test_sigma_joint_law.py +0 -0
  346. {xtim-4.2.1 → xtim-4.3.0}/tests/test_api.py +0 -0
  347. {xtim-4.2.1 → xtim-4.3.0}/tests/test_audit_frontend.py +0 -0
  348. {xtim-4.2.1 → xtim-4.3.0}/tests/test_bare_state_coset_family.py +0 -0
  349. {xtim-4.2.1 → xtim-4.3.0}/tests/test_bare_state_memo.py +0 -0
  350. {xtim-4.2.1 → xtim-4.3.0}/tests/test_barrier_refusal.py +0 -0
  351. {xtim-4.2.1 → xtim-4.3.0}/tests/test_bench_replay_hook_absent.py +0 -0
  352. {xtim-4.2.1 → xtim-4.3.0}/tests/test_bloat_removed_names.py +0 -0
  353. {xtim-4.2.1 → xtim-4.3.0}/tests/test_born_fastpath.py +0 -0
  354. {xtim-4.2.1 → xtim-4.3.0}/tests/test_born_trie.py +0 -0
  355. {xtim-4.2.1 → xtim-4.3.0}/tests/test_branch_frames.py +0 -0
  356. {xtim-4.2.1 → xtim-4.3.0}/tests/test_caps1_widths.py +0 -0
  357. {xtim-4.2.1 → xtim-4.3.0}/tests/test_caps2_widths.py +0 -0
  358. {xtim-4.2.1 → xtim-4.3.0}/tests/test_channel_support_atoms.py +0 -0
  359. {xtim-4.2.1 → xtim-4.3.0}/tests/test_coin_stream_continuation.py +0 -0
  360. {xtim-4.2.1 → xtim-4.3.0}/tests/test_compile_chi_guard.py +0 -0
  361. {xtim-4.2.1 → xtim-4.3.0}/tests/test_compile_peak_memory.py +0 -0
  362. {xtim-4.2.1 → xtim-4.3.0}/tests/test_compile_speed.py +0 -0
  363. {xtim-4.2.1 → xtim-4.3.0}/tests/test_correlated_error.py +0 -0
  364. {xtim-4.2.1 → xtim-4.3.0}/tests/test_coset_family_pauli.py +0 -0
  365. {xtim-4.2.1 → xtim-4.3.0}/tests/test_deferral_liveness.py +0 -0
  366. {xtim-4.2.1 → xtim-4.3.0}/tests/test_dem_ch.py +0 -0
  367. {xtim-4.2.1 → xtim-4.3.0}/tests/test_dem_correlated_reads.py +0 -0
  368. {xtim-4.2.1 → xtim-4.3.0}/tests/test_dem_diagonal_fallback.py +0 -0
  369. {xtim-4.2.1 → xtim-4.3.0}/tests/test_dem_erasure.py +0 -0
  370. {xtim-4.2.1 → xtim-4.3.0}/tests/test_dem_erasure_out.py +0 -0
  371. {xtim-4.2.1 → xtim-4.3.0}/tests/test_dem_exact_oracle.py +0 -0
  372. {xtim-4.2.1 → xtim-4.3.0}/tests/test_dem_expectation_frames.py +0 -0
  373. {xtim-4.2.1 → xtim-4.3.0}/tests/test_dem_factored_law_golden.py +0 -0
  374. {xtim-4.2.1 → xtim-4.3.0}/tests/test_dem_feedback.py +0 -0
  375. {xtim-4.2.1 → xtim-4.3.0}/tests/test_dem_measurement_noise.py +0 -0
  376. {xtim-4.2.1 → xtim-4.3.0}/tests/test_dem_output_frame_refusal.py +0 -0
  377. {xtim-4.2.1 → xtim-4.3.0}/tests/test_dem_pe_per_shot.py +0 -0
  378. {xtim-4.2.1 → xtim-4.3.0}/tests/test_dem_refusal_message.py +0 -0
  379. {xtim-4.2.1 → xtim-4.3.0}/tests/test_determinism_signs.py +0 -0
  380. {xtim-4.2.1 → xtim-4.3.0}/tests/test_diagnose_state_route.py +0 -0
  381. {xtim-4.2.1 → xtim-4.3.0}/tests/test_early_reject.py +0 -0
  382. {xtim-4.2.1 → xtim-4.3.0}/tests/test_env_levers_read_once.py +0 -0
  383. {xtim-4.2.1 → xtim-4.3.0}/tests/test_exact_engine_audit_fixes.py +0 -0
  384. {xtim-4.2.1 → xtim-4.3.0}/tests/test_exact_out_removed_names.py +0 -0
  385. {xtim-4.2.1 → xtim-4.3.0}/tests/test_example_scripts.py +0 -0
  386. {xtim-4.2.1 → xtim-4.3.0}/tests/test_expfix_dem_law.py +0 -0
  387. {xtim-4.2.1 → xtim-4.3.0}/tests/test_expfix_frame_cosets.py +0 -0
  388. {xtim-4.2.1 → xtim-4.3.0}/tests/test_expfix_python_caps.py +0 -0
  389. {xtim-4.2.1 → xtim-4.3.0}/tests/test_expfix_removed_names.py +0 -0
  390. {xtim-4.2.1 → xtim-4.3.0}/tests/test_explaw.py +0 -0
  391. {xtim-4.2.1 → xtim-4.3.0}/tests/test_fcs_fixed_cost.py +0 -0
  392. {xtim-4.2.1 → xtim-4.3.0}/tests/test_feedback_after_t.py +0 -0
  393. {xtim-4.2.1 → xtim-4.3.0}/tests/test_feedback_oracle.py +0 -0
  394. {xtim-4.2.1 → xtim-4.3.0}/tests/test_fidelity_refusals.py +0 -0
  395. {xtim-4.2.1 → xtim-4.3.0}/tests/test_fidorth.py +0 -0
  396. {xtim-4.2.1 → xtim-4.3.0}/tests/test_forced_branches.py +0 -0
  397. {xtim-4.2.1 → xtim-4.3.0}/tests/test_forced_golden.py +0 -0
  398. {xtim-4.2.1 → xtim-4.3.0}/tests/test_forced_law.py +0 -0
  399. {xtim-4.2.1 → xtim-4.3.0}/tests/test_forced_provenance.py +0 -0
  400. {xtim-4.2.1 → xtim-4.3.0}/tests/test_forced_vs_sampler.py +0 -0
  401. {xtim-4.2.1 → xtim-4.3.0}/tests/test_frame_no_expand.py +0 -0
  402. {xtim-4.2.1 → xtim-4.3.0}/tests/test_framed_harness_bindings.py +0 -0
  403. {xtim-4.2.1 → xtim-4.3.0}/tests/test_frames_born_dec_refusal.py +0 -0
  404. {xtim-4.2.1 → xtim-4.3.0}/tests/test_frames_contract.py +0 -0
  405. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_api.py +0 -0
  406. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_backend.py +0 -0
  407. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_cuda.py +0 -0
  408. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_docs.py +0 -0
  409. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_estimate.py +0 -0
  410. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_geo.py +0 -0
  411. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_kernels.py +0 -0
  412. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_launchloop.py +0 -0
  413. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_lawfast.py +0 -0
  414. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_lawtable.py +0 -0
  415. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_metal.py +0 -0
  416. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_multiword.py +0 -0
  417. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_nostatus.py +0 -0
  418. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_postselect.py +0 -0
  419. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_robustness.py +0 -0
  420. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_structure.py +0 -0
  421. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_structure_mw.py +0 -0
  422. {xtim-4.2.1 → xtim-4.3.0}/tests/test_gpu_tables.py +0 -0
  423. {xtim-4.2.1 → xtim-4.3.0}/tests/test_injection_prebake.py +0 -0
  424. {xtim-4.2.1 → xtim-4.3.0}/tests/test_input_frame_mirror.py +0 -0
  425. {xtim-4.2.1 → xtim-4.3.0}/tests/test_ja_branch.py +0 -0
  426. {xtim-4.2.1 → xtim-4.3.0}/tests/test_ja_dual_run.py +0 -0
  427. {xtim-4.2.1 → xtim-4.3.0}/tests/test_ja_family_law.py +0 -0
  428. {xtim-4.2.1 → xtim-4.3.0}/tests/test_ja_frames.py +0 -0
  429. {xtim-4.2.1 → xtim-4.3.0}/tests/test_ja_ppr_records.py +0 -0
  430. {xtim-4.2.1 → xtim-4.3.0}/tests/test_ja_record_space_b.py +0 -0
  431. {xtim-4.2.1 → xtim-4.3.0}/tests/test_ja_retention.py +0 -0
  432. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_barrier_buffer.py +0 -0
  433. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_branch_identity.py +0 -0
  434. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_branch_law.py +0 -0
  435. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_branch_law_e0.py +0 -0
  436. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_branch_readers.py +0 -0
  437. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_c0hat.py +0 -0
  438. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_carried_compose.py +0 -0
  439. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_comdat_owner.py +0 -0
  440. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_consumer_ladder.py +0 -0
  441. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_engine_selection.py +0 -0
  442. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_exact_counter.py +0 -0
  443. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_k2_arena.py +0 -0
  444. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_materialize_speed.py +0 -0
  445. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_noncommuting.py +0 -0
  446. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_p2.py +0 -0
  447. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_p4.py +0 -0
  448. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_port_reference.py +0 -0
  449. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_recb_fam.py +0 -0
  450. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_record_api.py +0 -0
  451. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_record_fidelity_l3.py +0 -0
  452. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_removed_names.py +0 -0
  453. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb1_tools.py +0 -0
  454. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb2_absent.py +0 -0
  455. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb2_kappa_rec_law.py +0 -0
  456. {xtim-4.2.1 → xtim-4.3.0}/tests/test_jb2_tools.py +0 -0
  457. {xtim-4.2.1 → xtim-4.3.0}/tests/test_ladder_settle.py +0 -0
  458. {xtim-4.2.1 → xtim-4.3.0}/tests/test_lean_d1s1.py +0 -0
  459. {xtim-4.2.1 → xtim-4.3.0}/tests/test_lean_d1s2.py +0 -0
  460. {xtim-4.2.1 → xtim-4.3.0}/tests/test_lean_d1s3.py +0 -0
  461. {xtim-4.2.1 → xtim-4.3.0}/tests/test_lean_l1.py +0 -0
  462. {xtim-4.2.1 → xtim-4.3.0}/tests/test_lean_l2.py +0 -0
  463. {xtim-4.2.1 → xtim-4.3.0}/tests/test_lean_l3.py +0 -0
  464. {xtim-4.2.1 → xtim-4.3.0}/tests/test_lean_l4.py +0 -0
  465. {xtim-4.2.1 → xtim-4.3.0}/tests/test_lean_l5.py +0 -0
  466. {xtim-4.2.1 → xtim-4.3.0}/tests/test_lean_l7.py +0 -0
  467. {xtim-4.2.1 → xtim-4.3.0}/tests/test_lean_n1.py +0 -0
  468. {xtim-4.2.1 → xtim-4.3.0}/tests/test_lean_p3sab.py +0 -0
  469. {xtim-4.2.1 → xtim-4.3.0}/tests/test_lm1_lazy_bare.py +0 -0
  470. {xtim-4.2.1 → xtim-4.3.0}/tests/test_lm2_lean_nondet.py +0 -0
  471. {xtim-4.2.1 → xtim-4.3.0}/tests/test_lm3_sparse_sweep.py +0 -0
  472. {xtim-4.2.1 → xtim-4.3.0}/tests/test_noframe_removed_names.py +0 -0
  473. {xtim-4.2.1 → xtim-4.3.0}/tests/test_noise_frame_commutation.py +0 -0
  474. {xtim-4.2.1 → xtim-4.3.0}/tests/test_output_qubits_grammar.py +0 -0
  475. {xtim-4.2.1 → xtim-4.3.0}/tests/test_output_state_api.py +0 -0
  476. {xtim-4.2.1 → xtim-4.3.0}/tests/test_output_state_oracle.py +0 -0
  477. {xtim-4.2.1 → xtim-4.3.0}/tests/test_overlap_binding.py +0 -0
  478. {xtim-4.2.1 → xtim-4.3.0}/tests/test_parser_stim_edges.py +0 -0
  479. {xtim-4.2.1 → xtim-4.3.0}/tests/test_pauli_channel_order.py +0 -0
  480. {xtim-4.2.1 → xtim-4.3.0}/tests/test_perf_glue.py +0 -0
  481. {xtim-4.2.1 → xtim-4.3.0}/tests/test_plan_cache_ownership.py +0 -0
  482. {xtim-4.2.1 → xtim-4.3.0}/tests/test_plan_class.py +0 -0
  483. {xtim-4.2.1 → xtim-4.3.0}/tests/test_plan_payload_budget.py +0 -0
  484. {xtim-4.2.1 → xtim-4.3.0}/tests/test_port_basic.py +0 -0
  485. {xtim-4.2.1 → xtim-4.3.0}/tests/test_port_groups.py +0 -0
  486. {xtim-4.2.1 → xtim-4.3.0}/tests/test_public_examples.py +0 -0
  487. {xtim-4.2.1 → xtim-4.3.0}/tests/test_qw_d_lazy.py +0 -0
  488. {xtim-4.2.1 → xtim-4.3.0}/tests/test_qwc_rot_chunk.py +0 -0
  489. {xtim-4.2.1 → xtim-4.3.0}/tests/test_readme_quickstart.py +0 -0
  490. {xtim-4.2.1 → xtim-4.3.0}/tests/test_readme_snippets.py +0 -0
  491. {xtim-4.2.1 → xtim-4.3.0}/tests/test_record_fidelity.py +0 -0
  492. {xtim-4.2.1 → xtim-4.3.0}/tests/test_record_law_oracle.py +0 -0
  493. {xtim-4.2.1 → xtim-4.3.0}/tests/test_record_layout.py +0 -0
  494. {xtim-4.2.1 → xtim-4.3.0}/tests/test_record_report.py +0 -0
  495. {xtim-4.2.1 → xtim-4.3.0}/tests/test_ref_battery_sizing.py +0 -0
  496. {xtim-4.2.1 → xtim-4.3.0}/tests/test_refusal_design_inputs.py +0 -0
  497. {xtim-4.2.1 → xtim-4.3.0}/tests/test_rf_retention.py +0 -0
  498. {xtim-4.2.1 → xtim-4.3.0}/tests/test_rfref_correction.py +0 -0
  499. {xtim-4.2.1 → xtim-4.3.0}/tests/test_rfref_route.py +0 -0
  500. {xtim-4.2.1 → xtim-4.3.0}/tests/test_rotation_form_oracle.py +0 -0
  501. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s2_fillin_switch.py +0 -0
  502. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s2b_mechanisms.py +0 -0
  503. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s2b_r7.py +0 -0
  504. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s2b_readers.py +0 -0
  505. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s2b_record_law.py +0 -0
  506. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s2b_record_table.py +0 -0
  507. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s2b_removed_names.py +0 -0
  508. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s2b_route_identity.py +0 -0
  509. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s2b_state_equals_bits.py +0 -0
  510. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s2t10a_accounting.py +0 -0
  511. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s2t6_record_columns.py +0 -0
  512. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s2t7_wire_rows.py +0 -0
  513. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s5a_fast_retention.py +0 -0
  514. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s7_grep_gates.py +0 -0
  515. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s8_born_memo.py +0 -0
  516. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s8_busy.py +0 -0
  517. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s8_prep.py +0 -0
  518. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s8_rf_lambda.py +0 -0
  519. {xtim-4.2.1 → xtim-4.3.0}/tests/test_s8_rf_route.py +0 -0
  520. {xtim-4.2.1 → xtim-4.3.0}/tests/test_sampler_stream.py +0 -0
  521. {xtim-4.2.1 → xtim-4.3.0}/tests/test_scale_noise_measurements.py +0 -0
  522. {xtim-4.2.1 → xtim-4.3.0}/tests/test_selfcheck_once.py +0 -0
  523. {xtim-4.2.1 → xtim-4.3.0}/tests/test_set_seed_equivalence.py +0 -0
  524. {xtim-4.2.1 → xtim-4.3.0}/tests/test_small_items.py +0 -0
  525. {xtim-4.2.1 → xtim-4.3.0}/tests/test_state_budget.py +0 -0
  526. {xtim-4.2.1 → xtim-4.3.0}/tests/test_termroute_a.py +0 -0
  527. {xtim-4.2.1 → xtim-4.3.0}/tests/test_tlc_scratch_lifetime.py +0 -0
  528. {xtim-4.2.1 → xtim-4.3.0}/tests/test_twirl.py +0 -0
  529. {xtim-4.2.1 → xtim-4.3.0}/tests/test_twirl_audit_sampling.py +0 -0
  530. {xtim-4.2.1 → xtim-4.3.0}/tests/test_twirl_decision_detector_sampler.py +0 -0
  531. {xtim-4.2.1 → xtim-4.3.0}/tests/test_twirl_diagnostics.py +0 -0
  532. {xtim-4.2.1 → xtim-4.3.0}/tests/test_twirl_factory_kappa.py +0 -0
  533. {xtim-4.2.1 → xtim-4.3.0}/tests/test_twirl_feedback_semantics.py +0 -0
  534. {xtim-4.2.1 → xtim-4.3.0}/tests/test_twirl_retained_records.py +0 -0
  535. {xtim-4.2.1 → xtim-4.3.0}/tests/test_twirl_routes.py +0 -0
  536. {xtim-4.2.1 → xtim-4.3.0}/tests/test_wide_channel_rows.py +0 -0
  537. {xtim-4.2.1 → xtim-4.3.0}/tests/test_without_noise.py +0 -0
  538. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_canonical.py +0 -0
  539. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_ch.py +0 -0
  540. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_cross_route.py +0 -0
  541. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_engine_loop.py +0 -0
  542. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_file.py +0 -0
  543. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_fuzz.py +0 -0
  544. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_graph_law.py +0 -0
  545. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_lines.py +0 -0
  546. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_model_oracle.py +0 -0
  547. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_multiword.py +0 -0
  548. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_optimal.py +0 -0
  549. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_oracle_configs.py +0 -0
  550. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_safety.py +0 -0
  551. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_sampler.py +0 -0
  552. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_scaling.py +0 -0
  553. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_status_c.py +0 -0
  554. {xtim-4.2.1 → xtim-4.3.0}/tests/test_xdem_writer.py +0 -0
  555. {xtim-4.2.1 → xtim-4.3.0}/tests/test_zero_alloc_per_shot.py +0 -0
  556. {xtim-4.2.1 → xtim-4.3.0}/xtim/__main__.py +0 -0
  557. {xtim-4.2.1 → xtim-4.3.0}/xtim/_diagnostics.py +0 -0
  558. {xtim-4.2.1 → xtim-4.3.0}/xtim/_exact_scope.py +0 -0
  559. {xtim-4.2.1 → xtim-4.3.0}/xtim/_examples/ch_cultivation.stim +0 -0
  560. {xtim-4.2.1 → xtim-4.3.0}/xtim/_examples/code_switching_faithful.stim +0 -0
  561. {xtim-4.2.1 → xtim-4.3.0}/xtim/_examples/code_switching_rate.stim +0 -0
  562. {xtim-4.2.1 → xtim-4.3.0}/xtim/_examples/color5_cultivation.stim +0 -0
  563. {xtim-4.2.1 → xtim-4.3.0}/xtim/_examples/cube_ccz.stim +0 -0
  564. {xtim-4.2.1 → xtim-4.3.0}/xtim/_examples/cultivation_d3_faithful.stim +0 -0
  565. {xtim-4.2.1 → xtim-4.3.0}/xtim/_examples/cultivation_d3_rate.stim +0 -0
  566. {xtim-4.2.1 → xtim-4.3.0}/xtim/_examples/cultivation_d5.stim +0 -0
  567. {xtim-4.2.1 → xtim-4.3.0}/xtim/_examples/distillation_15_1_3.stim +0 -0
  568. {xtim-4.2.1 → xtim-4.3.0}/xtim/_examples/miniature_oracle.stim +0 -0
  569. {xtim-4.2.1 → xtim-4.3.0}/xtim/_noise.py +0 -0
  570. {xtim-4.2.1 → xtim-4.3.0}/xtim/_record_groups.py +0 -0
  571. {xtim-4.2.1 → xtim-4.3.0}/xtim/examples.py +0 -0
  572. {xtim-4.2.1 → xtim-4.3.0}/xtim/fidelity_helpers.py +0 -0
  573. {xtim-4.2.1 → xtim-4.3.0}/xtim/gpu/__init__.py +0 -0
  574. {xtim-4.2.1 → xtim-4.3.0}/xtim/gpu/_stubs.py +0 -0
  575. {xtim-4.2.1 → xtim-4.3.0}/xtim/gpu/backend.py +0 -0
  576. {xtim-4.2.1 → xtim-4.3.0}/xtim/gpu/cuda.py +0 -0
  577. {xtim-4.2.1 → xtim-4.3.0}/xtim/gpu/launch.py +0 -0
  578. {xtim-4.2.1 → xtim-4.3.0}/xtim/gpu/metal.py +0 -0
  579. {xtim-4.2.1 → xtim-4.3.0}/xtim/gpu/structure.py +0 -0
  580. {xtim-4.2.1 → xtim-4.3.0}/xtim/gpu/tables.py +0 -0
  581. {xtim-4.2.1 → xtim-4.3.0}/xtim/gpu/xdem_kernels.h +0 -0
  582. {xtim-4.2.1 → xtim-4.3.0}/xtim/ler.py +0 -0
  583. {xtim-4.2.1 → xtim-4.3.0}/xtim/output_helpers.py +0 -0
  584. {xtim-4.2.1 → xtim-4.3.0}/xtim/port.py +0 -0
  585. {xtim-4.2.1 → xtim-4.3.0}/xtim/py.typed +0 -0
  586. {xtim-4.2.1 → xtim-4.3.0}/xtim/record_fidelity.py +0 -0
  587. {xtim-4.2.1 → xtim-4.3.0}/xtim.egg-info/dependency_links.txt +0 -0
  588. {xtim-4.2.1 → xtim-4.3.0}/xtim.egg-info/requires.txt +0 -0
  589. {xtim-4.2.1 → xtim-4.3.0}/xtim.egg-info/top_level.txt +0 -0
@@ -4,6 +4,183 @@ All notable changes to `xtim` are documented here. The format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project adheres
5
5
  to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [4.3.0] - 2026-12-04
8
+
9
+ Compile-time fixes, then xdem usability additions (user feedback, 2026-12-04; the last group of entries below). No
10
+ sampled stream changes. The compile-time fixes change no DEM / xdem export for a circuit that compiles within the
11
+ state-memory budget on both sides (byte-identical on the oracle corpus, the test corpus and noise / rotation fuzz).
12
+ Declared representation changes (the T-gate compile entry below): the bare state's frame labelling and everything derived from it
13
+ (ideal-state token, branch_table_digest, branch frames, `BarrierBuffer.frames()` Born axes, `output_state()` rotations /
14
+ clifford_paulis), per-shot fidelities in the last bits, and the free-row index in carried-axis refusal messages.
15
+ One further declared exception at the budget edge (the deep-superposition read below charges less scratch): a circuit
16
+ that 4.2.1 refused at the dual-image scratch charge may now compile, or refuse at a later allocation with a different
17
+ message, and its DEM / xdem export changes accordingly. **`xtim.ENGINE_VERSION` `xtim-engine-18` -> `xtim-engine-19`**
18
+ (the frame labelling moved; no sampled stream moves): ideal-state tokens and branch handles from 4.2.x are refused by
19
+ this release, as at 4.2.0.
20
+ Declared xdem usability changes: every extended xdem export gains one `# xdem absorbed` comment line after its
21
+ header (nothing else in the file moves, and it samples byte for byte as without it); the determinism refusal's
22
+ `XtimDemError` hint text changes (the engine message does not) and the error gains `nondeterministic_expectations` /
23
+ `nondeterministic_sign_known` (also keys of the export result dict); new: `TPP` / `TPP_DAG` parsing,
24
+ `XdemSampler.law()` and optional xdem provenance comments (off by default); `xtim.__version__` is read from
25
+ `pyproject.toml`.
26
+
27
+ - **DEM export and detector_determinism faster, no output change**: on the Clifford route export no longer builds a string per fault alternative and writes ` D<n>` / ` L<n>` targets with `std::to_chars`; detector_determinism and expectation_frames skip the class table on circuits with no non-Clifford gate; the feedback record relabel (`FeedbackFold`) keeps each row sparse until it passes M/64 entries, then a bitset, and folds through one reusable M-bit accumulator. d = 13 T⁴ window export 1.17 → 0.82 s, window determinism 0.47 → 0.26 s, check_basis determinism 1.28 → 0.82 s; feedback-chain circuits no slower and no larger (teleport wire 30 000 records: −28% RSS). Every DEM / xdem / determinism output bitwise identical (10 007 comparisons; dense fold oracle in tests/test_x7_feedback_fold.py).
28
+
29
+ - **detector_determinism reads its detectors through export_dem's prefetched sweep, no output change**: sparse seeds and one backward `Frame::sweep` instead of an O(M) fill and a dense Pauli per channel; d = 13 T⁴ check_basis text (45 024 detectors) 6.4 → 1.7 s, every field bitwise identical (the dense reads stay behind a test-only seam as the oracle; tests/test_f5_determinism_sweep.py).
30
+
31
+ - **detector_determinism memory / time, no output change**: its setup no longer builds N-sized dense objects —
32
+ the class check uses the sparse table forms (a), the propagation walk's gate-position index holds each wire as
33
+ block-sparse (word, mask) pairs or a bitset, whichever is smaller by exact byte count (c; n × |gates|/64 words before:
34
+ 2.8 GB at windowed d = 13, now 4 MB), and `build_feedback_plan` reads its probe atoms over their support (b).
35
+ Windowed d = 13: 5.8 s / 4.1 GB peak → 1.4 s / 0.6 GB; d = 13 1.6 → 0.4 s; DEM export of the same programs ~4×
36
+ faster. Every result field of detector_determinism / expectation_frames / export_dem and every sampled byte identical
37
+ where the old route completed (corpus, randoms, T⁴ programs, magic corpus); the class check no longer builds the
38
+ PPR-accepted atoms' dense n × n tableaux, so a circuit whose old class check ran out of memory may now get an answer.
39
+ The block-sparse index costs ~1 % of the propagation-table build on small magic circuits (cultivation_d5,
40
+ magna_color5_fid: 1.010, in-process min of 40). The three dense routes stay behind test-only seams as oracles
41
+ (tests/test_f4_determinism_routes.py).
42
+
43
+ - **T-gate compile at the size of the magic, not of the circuit** (`diagonalize_commuting_layer` `prefer_z`,
44
+ `complete_lagrangian_z`, `disentangle_from_generators_sparse`, `Frame::build_inv_`, `from_coset_family`'s (A')
45
+ generators, `RowCombinationSolver`): the bare-state build completed the magic layer's Lagrangian by X on every
46
+ wire, so the parity support carried one free variable per deferred qubit (k = N: 17 178 at surface d = 9, 117 206
47
+ at windowed d = 13) and every stage after it held N × N objects — the dense Lagrangian and its disentangling (3N²/4
48
+ bytes), the (A') generators (N²/4), the parity solver (N²/8), and the frame's dense inverse cache (N²/2 retained).
49
+ The Lagrangian is now completed by the Z-strings that commute with the terms (L = V + (Z ∩ V^⊥): isotropic, dimension
50
+ N, exactly ρ = rank of the terms' X-parts free variables — 4 on a T⁴ program), the disentangling runs on sparse rows
51
+ (the dense routine stays as the oracle, gate for gate), the (A') generators and the solver drop their N-sized rows,
52
+ and a compact frame's inverse images are built sparse unless the dense dual is smaller (the sizes compared, no
53
+ threshold). Noiseless surface-code T⁴ programs, compile s / peak GB / retained GB: d = 9: 18.3 / 0.86 / 0.32 →
54
+ 0.33 / 0.23 / 0.03; windowed d = 9: 117 / 4.35 / 1.56 → 1.1 / 0.88 / 0.05; d = 13: 163 / 6.27 / 2.20 →
55
+ 1.7 / 1.22 / 0.07; windowed d = 13: 963 / +34.9 / 13.6 → 7.5 / 7.0 / 0.15. Clifford circuits are
56
+ unchanged (the empty-layer case was already this rule).
57
+ **The rotation form's frame without the dense N × N** (`build_pauli_rotation_form`'s `SparseInverseFrame`):
58
+ the last N² object of the compile was the rotation form's `InverseFrame` — the 2N images C⁻¹X_qC / C⁻¹Z_qC of
59
+ the Clifford prefix as dense N-bit Paulis (N²/2 bytes: 6.9 GB at windowed d = 13, the whole remaining peak, and
60
+ most of the remaining time), read to conjugate each magic generator into the |0⟩ frame. The same 2N operators are
61
+ now held by support (`SparsePauli` rows, right-sized: the rows' vectors allocate exactly their payload, Σ 4·weight
62
+ = 1.9 MB at windowed d = 13 where the widest image is 429 wires, plus 64 B of header per row = 15 MB; the frame's
63
+ whole heap is ≈ 0.02 GB there) and synced / multiplied with the sparse Pauli kernels; a row whose sparse bytes would
64
+ exceed the dense row's is held as the dense Pauli instead — the exact size comparison per row, no constant — so
65
+ no circuit ever pays more than the dense frame did (on the in-tree magic corpus 5–65 of the 2N rows go dense,
66
+ on bt81 133 of 1 962). A Pauli i^phase X^x Z^z is a unique
67
+ representation, so every image and every byte of the form is identical by construction; the dense frame is kept
68
+ verbatim as an oracle beside the per-gate walk, behind test-only seams (`tests/test_f3_rotation_frame.py`: the
69
+ corpus, the sparse completion's random family on two seeds,
70
+ 600 raw random circuits, every Clifford kind, rows crossing the rule both ways). The local gate images are
71
+ computed once per gate kind (by the walk's own `conjugate`, as before) instead of once per gate, so the frame is
72
+ also faster on the magic corpus (the rotation form of cultivation / bt27 / bt81 / bh100-class circuits 1.4–3× quicker; whole compiles
73
+ within noise). Noiseless surface-code T⁴ programs, compile s / peak GB / retained GB: d = 13: 1.7 / 1.22 / 0.07 →
74
+ 0.6 / 0.24 / 0.07; windowed d = 9: 1.1 / 0.88 / 0.05 → 0.5 / 0.18 / 0.05; windowed d = 13: 7.5 / 7.0 / 0.15 →
75
+ 2.0 / 0.45 / 0.15. **No byte changes at all**: the rotation forms of the 28-circuit corpus and the T⁴ programs
76
+ equal the dense frame's and the walk's term by term, and the 100 000-shot decision digests, the corpus hashes,
77
+ the stream fixtures, the coefficient pins and the ctor digests are identical to those of the sparse completion above.
78
+ **No sampled byte changes** on everything measured: the 100 000-shot decision digests of 8 programs at two seeds,
79
+ the 28-circuit corpus at two seeds, the stream fixtures' sampled components, and 600 random Clifford+T circuits on
80
+ both completions (`tests/test_f2_completion.py`, the old completion behind a test-only seam). **Declared representation change** (owner-approved re-pin): the bare state's
81
+ frame LABELLING — `free` indices, sigma keys, frame rows and the destabiliser gauge (`bare_frames`, `branch_frames`,
82
+ `_ctor_digest`'s frame-derived segments, the ideal-state token) — and, through the branch gauge α(g) that the
83
+ destabiliser choice fixes, the stored branch coefficients c_g = coeffs/ζ8^{z(g)} on circuits where the gauge moves
84
+ (5 of the 35 pinned: cultivation_d5 (examples/ and tests/data/), color5_cultivation, magna_color5_fid,
85
+ merlin_switch3_bt27_p0): an exact ζ8 rotation applied in floating point (≤ ~10 ulp). Also derived from the
86
+ labelling: `RecordFidelity` per-shot F (exact zeros carry a float residue ≤ 6e-32; color5 2853/20000 rows, means
87
+ equal), `output_state()` rotations / clifford_paulis (another valid split, see its docstring),
88
+ `BarrierBuffer.frames()` / `plan_structure` Born axes, and the 'free row k' index in carried-axis refusal messages.
89
+ The state is the same: the engine's exact overlap between the two
90
+ routes' bare states is 1 within 60 ulp (χ = 512) and the Born-weight multisets agree within 10 ulp
91
+ (`cpp/tests/test_lagrangian_completion.cpp`, `test_disentangle_sparse.cpp`; the re-pinned
92
+ `test_frame_cosets_cpp.py::test_sampling_stream_pinned_public`, `test_lean_l6.py` digests and
93
+ `test_jb1_branch_frame.py`'s p2 producer, whose branch frame now equals the ideal one).
94
+ - **Noiseless prefix consistency documented and stamped** (`xtim.NOISELESS_PREFIX_CONTRACT == 1`;
95
+ docs/twirl_record_sampler.md "Noiseless prefix consistency", X1-X5; `tests/test_noiseless_prefix_contract.py`): in
96
+ a circuit with no noise lines a shot's record bits are keyed by (seed, cumulative shot index, record column in global
97
+ record order — detectors, observables, decisions), so a shared prefix gives the same bits under any shot count or
98
+ thread count and under per-shot input frames, and under a different suffix when the stated conditions hold; the
99
+ boundaries (random detectors / observables, the suffix's included, are scanned before the decisions; a suffix
100
+ rotation on a measured, unreset qubit changes a column's class; the IF-partitioned sampler regroups shots by pattern
101
+ and is not prefix-consistent) are stated and pinned. No change to any sampled
102
+ stream or export; one new module constant.
103
+ - **Coset-family spot check in O(k²/64)** (`CanonicalStabSum::from_coset_family`, new
104
+ `AffineState::inner_product_shared_form`): the bare-state construction's probe rays are gauged by the shared-form
105
+ overlap — the probe ray and D_σ·anchor carry the anchor's (R, J, D mod 2) word for word, so one G_θ solve of the
106
+ anchor's `PreparedAffine` (now handed back by `stabilizer_generators_sparse` instead of being dropped) decides
107
+ ⟨ray_g|D_σ(g) anchor⟩ exactly — instead of the exact joint-system inner product (O(k³/64) time and an r_ker × r_ker
108
+ bilinear with r_ker = k ~ the normalised circuit's qubit count: ~90 % of the compile of T programs on wide Clifford
109
+ circuits). Same verdict, exactly (the exact overlap stays the fallback for a form mismatch and the tests' oracle;
110
+ `cpp/tests/test_coset_spotcheck.cpp` pins the two field for field and shows both refuse the same corrupted
111
+ families). Noiseless surface-code T⁴ programs, compile s / peak GB: d = 5: 1.57 / 0.14 → 0.27 / 0.09; d = 7:
112
+ 20.4 / 0.57 → 2.2 / 0.27; d = 9: 162 / 2.0 → 13.1 / 0.86; d = 13: > 1200 s, > 10 GB → 161 s / 6.3 GB. No output
113
+ depends on the check: every sampled byte is unchanged.
114
+ - **Feedback sources resolved in one forward pass**: compile is no longer quadratic in the number of classically
115
+ controlled Paulis.
116
+ - **Planes build holds heavy sparse working rows as packed words** (the long copy-ancilla parity rows no longer make
117
+ row reduction quadratic).
118
+ - **Rotation records from one backward sensitivity pass** instead of a forward propagation per chunk. Known cost: the
119
+ pass holds every fault alternative's id list at once, so peak compile memory grows on wide scrambling circuits
120
+ (1000 qubits, depth 100: 626 MB -> 3.8 GB); realistic circuits are unchanged (surface d=21: 247 -> 266 MB).
121
+ - **Frame sweep skips CX / CZ gates that provably change nothing**; **the IF pre-scan skips the full parse** when no
122
+ line can open an IF block.
123
+ - **Deep-superposition reads build each survivor's dual image from the F+1 generator images** (the free X rows and
124
+ the read's row: conjugation is a group automorphism) instead of scanning every survivor: O(F) instead of O(chi)
125
+ frame scans per anticommuting read. Fresh-record feedback chains with T on corrected wires: 1354-line chains
126
+ 597 s / 637 s / >1200 s -> 13 s / 15 s / 34-88 s. Budget-edge change: the read's chi-scaled scratch charge is smaller
127
+ (the F+1 generator images replace the per-survivor targets), so a circuit that 4.2.1 refused
128
+ (`XtimCapacityError`) at the dual-image scratch charge may now compile, or refuse at a later allocation with a
129
+ different message (one fuzz circuit does). The DEM / xdem export follows: the lean export's determinism refusal
130
+ prints the noiseless parity's sign only when the noiseless reference run fits the budget (otherwise the unsigned
131
+ `+-|ev|` fallback), so at the budget edge a refusal that printed `+-|ev|` on 4.2.1 can now print the resolved
132
+ sign, and a budget refusal can become an export.
133
+ - Clifford compile 1.4-3.8x faster (d=13, 26 SE rounds: 4.8 s -> 1.2 s; surface d=21: 2.7 s -> 0.6 s). Magic compile
134
+ within -9% / +1.3% (bt81 +1.3%, merlin_bh100 +0.9%, sub-millisecond circuits +3 to +12 us).
135
+ - **Clifford DEM / xdem export linear in the window length**: a circuit with no non-Clifford gate takes a column route
136
+ (one backward sweep of the deferred circuit — the xdem writer's own fault columns, stim's error-analyzer method —
137
+ including its PAULI_EXPECTATION and DECISION columns) in place of the per-alternative walk, and builds no
138
+ propagation table. The walk's signature and feedback-invariant work grew with the rounds after each fault
139
+ (quadratic in the window): surface d=9 memory, 72 rounds per side (11.6k detectors, 820k alternatives, with
140
+ feedback), 39 s -> 1.8 s; d=13 surgery+spectator window (15k detectors, 1.1M alternatives) 35 s -> 3.0 s, i.e.
141
+ 1.3-2.1x stim's analyzer; peak RSS 0.79 -> 0.50 GB and 1.04 -> 0.85 GB. Byte-identical text and refusals on the
142
+ repo corpus, the audit windows and 1155 fuzzed Clifford circuits (feedback, M(p)/MPP(p) family, DECISION,
143
+ PAULI_EXPECTATION, correlated errors; ~580 export, the rest compare refusal texts); circuits with a non-Clifford gate
144
+ keep the walk, unchanged in time.
145
+
146
+ xdem usability (user feedback, 2026-12-04):
147
+
148
+ - **The absorbed no-effect mass is recorded**: an extended xdem export's second line is the comment
149
+ `# xdem absorbed faults=<N> mass=<sum p>` (the fault events dropped for having no effect; the analogue of the
150
+ Clifford export's `dropped_mass=`). The format stays `xdem 1`: every reader, older ones included, skips comments,
151
+ and the file samples byte for byte as without it. The bundled `examples/xdem/*.xdem` and the writer fixtures are
152
+ regenerated (each gains that line, nothing else). A conventional output is unchanged. docs/xdem.md §2.
153
+ - **The non-determinism hint names the magic-readout case**: a detector or observable reading a Pauli of a state
154
+ rotated by non-Clifford gates (an S circuit converted to T, whose logical `MPP` now measures X of a T-rotated state)
155
+ is not fixed by Pauli feedback; the hint says to undo the non-Clifford layer noiselessly before the readout, and
156
+ leads with it when any refused target's noiseless expectation is strictly between 0 and +-1 (its signature).
157
+ New: `XtimDemError.nondeterministic_expectations` (each refused target's noiseless expectation, parallel to
158
+ `.nondeterministic`) and `XtimDemError.nondeterministic_sign_known` (False when the noiseless reference is over
159
+ capacity: the values are then magnitudes only, printed `+-|e|`), also the export result dict's keys
160
+ `nondeterministic_expectations` / `nondeterministic_sign_known`. docs/xdem.md §8.
161
+ - **`xtim.__version__` is single-sourced** from `pyproject.toml`: the installed metadata, or in a source tree the
162
+ tree's own `pyproject.toml` plus `+dev`; `xtim/__init__.py` no longer holds a version literal to bump.
163
+ - **`TPP` / `TPP_DAG`** (the Tsim/Clifft dialect's Pauli-product pi/8 rotations) are parsed, like `SPP`: a basis change onto the first
164
+ factor's qubit, a CX ladder, `T` / `T_DAG` there, the ladder undone (`TPP Z0` = `T 0`; `TPP P` twice = `SPP P`).
165
+ A circuit without them parses to the same stream as before. docs/usage.md.
166
+ - **`XdemSampler.law(lines, postselect=mask)`**: the exact law of one fired line set (offset and coins), its
167
+ acceptance under a post-selection mask, each observable's marginal and Pr(all observables 0) given acceptance, from
168
+ the sampler's own law path (`xtim.xdem.XdemLaw`). Checked against brute-force enumeration, including masks on
169
+ detectors that are not pivot columns of the coins. docs/xdem.md §3.1.
170
+ - **Optional provenance**: `detector_error_model_text(format="xdem", provenance=True)` appends `# provenance` comments
171
+ mapping each line to the circuit fault locations (instruction, qubits, Pauli, source line, step, p) it carries;
172
+ `xtim.xdem.read_provenance` parses them. Off by default: the text and the export's cost are unchanged. On, the
173
+ export runs the writer's reference route with its atom map (about 2-10x the export time). docs/xdem.md §2.1.
174
+
175
+ ### Known issues
176
+ - Unchanged from 4.2.0: on a magic circuit whose detector group fills in under elimination, twirl sampling with the
177
+ default selfcheck (the first 2000 shots oracle-checked) is about 2x slower than at an earlier 4.2.0 development build
178
+ (see 4.2.0's Known issues for the synthetic circuit). This release: n=900, first `sample(600)` with selfcheck,
179
+ 5.17 s / 76 MB (4.2.1: 5.20 s / 84 MB). Compile, DEM export and sampling with `selfcheck=0` are not affected. Not
180
+ yet bisected.
181
+ - Peak compile memory grows on wide scrambling circuits (1000 qubits, depth 100: 626 MB -> 3.8 GB); see the
182
+ rotation-records entry above.
183
+
7
184
  ## [4.2.1] - 2026-11-26
8
185
 
9
186
  A packaging and macOS follow-up; no change to any sampled stream, DEM / xdem export or message
@@ -9,7 +9,7 @@ title: "xtim"
9
9
  authors:
10
10
  - family-names: "Kim"
11
11
  given-names: "Isaac H."
12
- version: "4.2.1"
13
- date-released: "2026-11-26"
12
+ version: "4.3.0"
13
+ date-released: "2026-12-04"
14
14
  repository-code: "https://github.com/ikim-quantum/xtim"
15
15
  license: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xtim
3
- Version: 4.2.1
3
+ Version: 4.3.0
4
4
  Summary: Stim-superset simulator for magic-state preparation: the exact per-shot fidelity of the prepared output under circuit noise.
5
5
  Author: The xtim Authors
6
6
  Project-URL: Repository, https://github.com/ikim-quantum/xtim
@@ -25,6 +25,7 @@
25
25
  #include <pybind11/pybind11.h>
26
26
  #include <pybind11/stl.h>
27
27
 
28
+ #include <chrono>
28
29
  #include <cmath>
29
30
  #include <complex>
30
31
  #include <map>
@@ -157,6 +158,80 @@ py::dict py_parse_info(const std::string& text) {
157
158
  }
158
159
 
159
160
 
161
+ // The provenance block of an extended xdem export (docs/xdem.md §2.1), from the writer's atom map (census.atoms: one
162
+ // atom per channel alternative with p > 0 and per readout flip, with the line carrying its own line key, -1: none).
163
+ // One comment line per error line that carries atoms, then the atoms with no line of their own:
164
+ // # provenance line <i>: <loc> | <loc> | ...
165
+ // # provenance none: <loc> | ...
166
+ // loc = `<NAME> <qubits, comma-joined> <pauli word> @<source line>#<step> p=<p>` for a noise alternative
167
+ // (`<NAME>` = the instruction's source spelling up to '(' or a space; the word in the instruction's own qubit order;
168
+ // step = the instruction's dispatch ordinal, which tells REPEAT iterations apart), `M rec<j> flip @<line>#<step>
169
+ // p=<p>` for a readout flip M(p) of record j.
170
+ std::string xdem_provenance_block(const std::string& text, const qeccore::DemLawCensus& c) {
171
+ const qeccore::ParsedStim cp = qeccore::parse_stim_circuit(text, /*track_source=*/true);
172
+ std::vector<std::string> src; // source lines, 1-based via [line - 1]
173
+ for (size_t b = 0; b <= text.size();) {
174
+ size_t e = text.find('\n', b);
175
+ if (e == std::string::npos) e = text.size();
176
+ src.push_back(text.substr(b, e - b));
177
+ b = e + 1;
178
+ }
179
+ std::vector<size_t> site_at, rec_at; // stream index of the s-th Noise / j-th Measure
180
+ for (size_t i = 0; i < cp.circuit.stream.size(); ++i) {
181
+ if (cp.circuit.stream[i].kind == qeccore::Instr::Kind::Noise) site_at.push_back(i);
182
+ if (cp.circuit.stream[i].kind == qeccore::Instr::Kind::Measure) rec_at.push_back(i);
183
+ }
184
+ auto where = [&](size_t i) {
185
+ const int ln = i < cp.stream_line.size() ? cp.stream_line[i] : -1;
186
+ const int st = i < cp.stream_step.size() ? cp.stream_step[i] : -1;
187
+ return " @" + std::to_string(ln) + "#" + std::to_string(st);
188
+ };
189
+ auto name_at = [&](size_t i) {
190
+ const int ln = i < cp.stream_line.size() ? cp.stream_line[i] : -1;
191
+ if (ln < 1 || (size_t)ln > src.size()) return std::string("?");
192
+ const std::string& s = src[(size_t)ln - 1];
193
+ size_t b = s.find_first_not_of(" \t");
194
+ if (b == std::string::npos) return std::string("?");
195
+ size_t e = b;
196
+ while (e < s.size() && s[e] != '(' && s[e] != ' ' && s[e] != '\t' && s[e] != '\r') ++e;
197
+ return s.substr(b, e - b);
198
+ };
199
+ char pb[40];
200
+ std::map<int, std::string> by_line;
201
+ std::string none;
202
+ for (const auto& a : c.atoms) {
203
+ std::string loc;
204
+ if (a.record >= 0) {
205
+ loc = "M rec" + std::to_string(a.record) + " flip";
206
+ if ((size_t)a.record < rec_at.size()) loc += where(rec_at[(size_t)a.record]);
207
+ } else if (a.site >= 0 && (size_t)a.site < site_at.size()) {
208
+ const size_t i = site_at[(size_t)a.site];
209
+ const qeccore::Instr& ins = cp.circuit.stream[i];
210
+ const bool two = ins.channel == qeccore::NoiseChannel::DEPOLARIZE2 ||
211
+ ins.channel == qeccore::NoiseChannel::PAULI_CHANNEL_2;
212
+ const bool chain = ins.channel == qeccore::NoiseChannel::CORRELATED;
213
+ std::vector<int> qs;
214
+ if (chain) qs = ins.qubits;
215
+ else if (two && (size_t)(2 * a.target + 1) < ins.qubits.size())
216
+ qs = {ins.qubits[(size_t)(2 * a.target)], ins.qubits[(size_t)(2 * a.target + 1)]};
217
+ else if (!two && a.target >= 0 && (size_t)a.target < ins.qubits.size()) qs = {ins.qubits[(size_t)a.target]};
218
+ loc = name_at(i) + " ";
219
+ for (size_t k = 0; k < qs.size(); ++k) loc += (k ? "," : "") + std::to_string(qs[k]);
220
+ loc += " " + a.word + where(i);
221
+ } else {
222
+ loc = "?";
223
+ }
224
+ std::snprintf(pb, sizeof pb, " p=%.17g", a.p);
225
+ loc += pb;
226
+ std::string& dst = a.line >= 0 ? by_line[a.line] : none;
227
+ dst += dst.empty() ? loc : " | " + loc;
228
+ }
229
+ std::string out;
230
+ for (const auto& [l, s] : by_line) out += "# provenance line " + std::to_string(l) + ": " + s + "\n";
231
+ if (!none.empty()) out += "# provenance none: " + none + "\n";
232
+ return out;
233
+ }
234
+
160
235
  py::dict py_export_dem_text(const std::string& text,
161
236
  bool include_expectations,
162
237
  bool decompose_errors,
@@ -168,7 +243,10 @@ py::dict py_export_dem_text(const std::string& text,
168
243
  int clifford_cutoff,
169
244
  bool erasure,
170
245
  const std::string& format,
171
- bool require_canonical) {
246
+ bool require_canonical,
247
+ bool provenance) {
248
+ if (provenance && format != "xdem")
249
+ throw std::invalid_argument("export_dem_text: provenance=True is a format=\"xdem\" option");
172
250
  if (clifford_cutoff < qeccore::kDemCliffordCutoffExact)
173
251
  throw std::invalid_argument("export_dem_text: clifford_cutoff must be >= 0 (or -1 = exact), got " +
174
252
  std::to_string(clifford_cutoff));
@@ -176,14 +254,29 @@ py::dict py_export_dem_text(const std::string& text,
176
254
  throw std::invalid_argument("export_dem_text: format must be \"stim\" or \"xdem\", got \"" + format + "\"");
177
255
  const qeccore::DemFormat fmt = format == "xdem" ? qeccore::DemFormat::Xdem : qeccore::DemFormat::Stim;
178
256
  DemExportResult dr;
257
+ // provenance=True: the same export with the census (the writer's atom map; it runs the oracle route, which writes
258
+ // the same bytes as the lean one), then the provenance comment block. Off: the unchanged call.
259
+ std::unique_ptr<qeccore::DemLawCensus> census;
260
+ if (provenance) census = std::make_unique<qeccore::DemLawCensus>();
179
261
  {
180
262
  py::gil_scoped_release rel;
181
- dr = export_dem(text, include_expectations,
182
- decompose_errors, ignore_decomposition_failures,
183
- drop_gauge_observables,
184
- trusted_detectors.empty() ? nullptr : &trusted_detectors,
185
- trusted_observables.empty() ? nullptr : &trusted_observables,
186
- approximate_disjoint_errors, clifford_cutoff, nullptr, erasure, fmt, require_canonical);
263
+ try {
264
+ dr = export_dem(text, include_expectations,
265
+ decompose_errors, ignore_decomposition_failures,
266
+ drop_gauge_observables,
267
+ trusted_detectors.empty() ? nullptr : &trusted_detectors,
268
+ trusted_observables.empty() ? nullptr : &trusted_observables,
269
+ approximate_disjoint_errors, clifford_cutoff, census.get(), erasure, fmt,
270
+ require_canonical);
271
+ } catch (const qeccore::BareStateCapacityError& e) {
272
+ if (!census) throw;
273
+ // the census forces the reference route, which builds the bare state (with its capacity limit)
274
+ throw qeccore::BareStateCapacityError(
275
+ std::string("provenance=True runs the xdem writer's reference route, which builds the noiseless bare "
276
+ "state; export without provenance=True (the default route usually builds none): ") +
277
+ e.what());
278
+ }
279
+ if (census && dr.ok && dr.dem.rfind("xdem 1", 0) == 0) dr.dem += xdem_provenance_block(text, *census);
187
280
  }
188
281
  py::dict d;
189
282
  d["ok"] = dr.ok;
@@ -195,6 +288,8 @@ py::dict py_export_dem_text(const std::string& text,
195
288
  d["dropped_observables"] = dr.dropped_observables;
196
289
  d["reject_detectors"] = dr.reject_detectors;
197
290
  d["nondeterministic_targets"] = dr.nondeterministic_targets;
291
+ d["nondeterministic_expectations"] = dr.nondeterministic_expectations;
292
+ d["nondeterministic_sign_known"] = dr.nondeterministic_sign_known;
198
293
  d["postselect_faults"] = dr.postselect_faults;
199
294
  d["dropped_expectation_columns"] = dr.dropped_expectation_columns;
200
295
  d["clifford_faults"] = dr.clifford_faults;
@@ -420,9 +515,13 @@ static std::string rotation_form_first_diff(const PauliRotationForm& a, const Pa
420
515
  return "";
421
516
  }
422
517
 
423
- py::tuple py_rotation_form_oracle_diff(const std::string& text, bool normalize) {
518
+ // F3: the production route is the SPARSE frame; the pre-F3 dense frame is the second oracle. `walk` = also build
519
+ // on the per-gate walk and compare every image with it (O(terms · |C| · n): the corpus and random circuits, not the
520
+ // 10⁵-wire programs, which compare the two frames).
521
+ py::tuple py_rotation_form_oracle_diff(const std::string& text, bool normalize, bool walk) {
424
522
  std::string diff, err;
425
523
  RotationFormCheck chk;
524
+ chk.with_walk = walk;
426
525
  size_t nterms = 0;
427
526
  {
428
527
  py::gil_scoped_release rel;
@@ -432,12 +531,18 @@ py::tuple py_rotation_form_oracle_diff(const std::string& text, bool normalize)
432
531
  } else {
433
532
  Circuit c = normalize ? normalize_for_twirl(ps.circuit).normalized : ps.circuit;
434
533
  PauliRotationForm prod = build_pauli_rotation_form(c);
435
- PauliRotationForm walk = build_pauli_rotation_form(c, /*walk_oracle=*/true);
436
- PauliRotationForm cross = build_pauli_rotation_form(c, /*walk_oracle=*/false, &chk);
534
+ PauliRotationForm dense = build_pauli_rotation_form(c, RotationFrameRoute::Dense);
535
+ PauliRotationForm cross = build_pauli_rotation_form(c, RotationFrameRoute::Sparse, &chk);
437
536
  nterms = prod.terms.size();
438
537
  if (!chk.first_diff.empty()) diff = chk.first_diff;
439
538
  else {
440
- diff = rotation_form_first_diff(prod, walk);
539
+ diff = rotation_form_first_diff(prod, dense);
540
+ if (!diff.empty()) diff = "dense-frame build differs: " + diff;
541
+ if (diff.empty() && walk) {
542
+ PauliRotationForm w = build_pauli_rotation_form(c, RotationFrameRoute::Walk);
543
+ diff = rotation_form_first_diff(prod, w);
544
+ if (!diff.empty()) diff = "walk build differs: " + diff;
545
+ }
441
546
  if (diff.empty()) {
442
547
  std::string d2 = rotation_form_first_diff(prod, cross);
443
548
  if (!d2.empty()) diff = "cross-check build differs: " + d2;
@@ -449,6 +554,59 @@ py::tuple py_rotation_form_oracle_diff(const std::string& text, bool normalize)
449
554
  return py::make_tuple(diff, chk.terms_checked, chk.frame_terms, nterms);
450
555
  }
451
556
 
557
+ // F3: the sparse frame's rows after a production build (RotationFrameRows). `rows_only`: the check record only
558
+ // counts the terms and reports the rows — no dense frame is synced, so the build's footprint is the production one.
559
+ py::dict py_rotation_frame_rows(const std::string& text, bool normalize) {
560
+ std::string err;
561
+ RotationFormCheck chk;
562
+ chk.with_walk = false;
563
+ chk.rows_only = true;
564
+ {
565
+ py::gil_scoped_release rel;
566
+ ParsedStim ps = parse_stim_circuit(text);
567
+ if (!ps.ok()) err = "parse failed";
568
+ else {
569
+ Circuit c = normalize ? normalize_for_twirl(ps.circuit).normalized : ps.circuit;
570
+ (void)build_pauli_rotation_form(c, RotationFrameRoute::Sparse, &chk);
571
+ }
572
+ }
573
+ if (!err.empty()) throw std::invalid_argument(err);
574
+ py::dict d;
575
+ const RotationFrameRows& r = chk.rows;
576
+ d["n"] = r.n; d["synced"] = r.synced; d["rows_dense"] = r.rows_dense; d["rows_sparse"] = r.rows_sparse;
577
+ d["row_bytes"] = r.row_bytes; d["dense_bytes"] = r.dense_bytes; d["rule_violations"] = r.rule_violations;
578
+ d["capacity_bytes"] = r.capacity_bytes; d["header_bytes"] = r.header_bytes;
579
+ d["weight_sum"] = r.weight_sum; d["weight_max"] = r.weight_max;
580
+ return d;
581
+ }
582
+
583
+ // F3: wall seconds of ONE build_pauli_rotation_form on the named route ("sparse" / "dense" / "walk"); the parse and
584
+ // the normalization are outside the timer.
585
+ double py_rotation_form_build_seconds(const std::string& text, bool normalize, const std::string& route) {
586
+ RotationFrameRoute r;
587
+ if (route == "sparse") r = RotationFrameRoute::Sparse;
588
+ else if (route == "dense") r = RotationFrameRoute::Dense;
589
+ else if (route == "walk") r = RotationFrameRoute::Walk;
590
+ else throw std::invalid_argument("route must be 'sparse', 'dense' or 'walk'");
591
+ std::string err;
592
+ double secs = 0.0;
593
+ {
594
+ py::gil_scoped_release rel;
595
+ ParsedStim ps = parse_stim_circuit(text);
596
+ if (!ps.ok()) err = "parse failed";
597
+ else {
598
+ Circuit c = normalize ? normalize_for_twirl(ps.circuit).normalized : ps.circuit;
599
+ const auto t0 = std::chrono::steady_clock::now();
600
+ PauliRotationForm f = build_pauli_rotation_form(c, r);
601
+ const auto t1 = std::chrono::steady_clock::now();
602
+ (void)f;
603
+ secs = std::chrono::duration<double>(t1 - t0).count();
604
+ }
605
+ }
606
+ if (!err.empty()) throw std::invalid_argument(err);
607
+ return secs;
608
+ }
609
+
452
610
  PyFramedSuperposition py_bare_state_of(const std::string& text) {
453
611
  std::string err;
454
612
  FramedSuperposition fs(0);
@@ -597,6 +755,28 @@ py::dict py_port_contract_of_state(const PyFramedSuperposition& st,
597
755
 
598
756
  // Return list of (port_index, bit_index) tuples for bits driving any IF condition.
599
757
  py::list py_if_driving_bits(const std::string& text) {
758
+ // An IF block opens only on a line whose trimmed content (the parser's LineSplitter: '\n' lines, " \t\r" trimmed)
759
+ // starts with IF, in any case, followed by a space or tab (stim_parse.cpp build_tree: opens_block(s, "IF") is the
760
+ // only source of IfBegin in a parse). Without such a line the parse cannot yield a driving bit, so an IF-free
761
+ // text skips the full parse (compile_twirl_sampler parses it again anyway). A parse failure of an IF-free text
762
+ // now reads as [] here. Of its three Python callers, two (compile_twirl_sampler, twirl.py; _unresolved_if_conditions,
763
+ // circuit.py) already map a parse failure to [] and leave it to the compile that follows; the third
764
+ // (PartitionedTwirlSampler.__init__, twirl.py) does not catch; compile_twirl_sampler builds it only for a text with
765
+ // IF-driving bits, so the skip leaves its behaviour unchanged.
766
+ {
767
+ bool cand = false;
768
+ for (size_t i = 0, L = text.size(); i < L && !cand;) {
769
+ size_t e = text.find('\n', i);
770
+ if (e == std::string::npos) e = L;
771
+ size_t b = i;
772
+ while (b < e && (text[b] == ' ' || text[b] == '\t' || text[b] == '\r')) ++b;
773
+ if (e - b >= 3 && (text[b] == 'I' || text[b] == 'i') && (text[b + 1] == 'F' || text[b + 1] == 'f') &&
774
+ (text[b + 2] == ' ' || text[b + 2] == '\t'))
775
+ cand = true;
776
+ i = e + 1;
777
+ }
778
+ if (!cand) return py::list();
779
+ }
600
780
  ParsedStim ps;
601
781
  {
602
782
  py::gil_scoped_release rel;
@@ -995,6 +1175,39 @@ void register_xdem_sampler(py::module_& m) {
995
1175
  "have the law of sample(shots, seed, threads, first_block) followed by the filter; counts {attempts, "
996
1176
  "passed, discarded, early}. postselect: a dtype=bool mask of length num_detectors or distinct detector "
997
1177
  "indices (xtim's postselect rules). fired=True: also the survivors' fired-line CSR.")
1178
+ .def("law", [](S& s, const std::vector<int>& ids, py::object postselect) -> py::dict {
1179
+ const int D = s.num_detectors(), O = s.num_observables();
1180
+ const std::vector<uint8_t> f = postselect.is_none() ? std::vector<uint8_t>((size_t)D, 0)
1181
+ : postselect_flags(postselect, D);
1182
+ qeccore::xdem::LawSummary L;
1183
+ {
1184
+ py::gil_scoped_release rel;
1185
+ qeccore::xdem::Bits off;
1186
+ std::vector<qeccore::xdem::Bits> coins;
1187
+ s.law_of(ids, off, coins); // the production law (the sampler's own path, no coin draw)
1188
+ L = qeccore::xdem::law_summary(D, O, off, coins, f);
1189
+ }
1190
+ const size_t n = (size_t)D + (size_t)O;
1191
+ auto bits = [&](const qeccore::xdem::Bits& b, uint8_t* p) {
1192
+ for (size_t j = 0; j < n; ++j) p[j] = (b.w[j >> 6] >> (j & 63)) & 1;
1193
+ };
1194
+ py::array_t<uint8_t> offset((py::ssize_t)n);
1195
+ bits(L.offset, offset.mutable_data());
1196
+ py::array_t<uint8_t> coins({(py::ssize_t)L.coins.size(), (py::ssize_t)n});
1197
+ for (size_t i = 0; i < L.coins.size(); ++i) bits(L.coins[i], coins.mutable_data() + i * n);
1198
+ py::dict d;
1199
+ d["offset"] = offset;
1200
+ d["coins"] = coins;
1201
+ d["accept"] = L.accept;
1202
+ d["obs_one"] = xdem_owned(std::move(L.obs_one));
1203
+ d["obs_all_zero"] = L.obs_all_zero;
1204
+ return d;
1205
+ },
1206
+ py::arg("ids"), py::arg("postselect") = py::none(),
1207
+ "The law of the composite of the line ids (any order; repeats cancel) with an optional postselect mask "
1208
+ "(xtim's postselect rules): dict(offset uint8[D+O], coins uint8[dim, D+O] (RREF, descending pivot), "
1209
+ "accept, obs_one float64[O] = Pr(L_k = 1 | accepted), obs_all_zero = Pr(all L = 0 | accepted)); "
1210
+ "docs/xdem.md §3.1. An id outside [0, num_lines) raises IndexError.")
998
1211
  .def("cspaces", [](const S& s, size_t first, long long n) {
999
1212
  std::vector<std::vector<uint64_t>> tab;
1000
1213
  {
@@ -1253,6 +1466,7 @@ PYBIND11_MODULE(_xtim, m) {
1253
1466
  });
1254
1467
  m.doc() = "xtim engine bindings: parse / twirl record sampling / DEM export / state API.";
1255
1468
  m.attr("ENGINE_VERSION") = kEngineVersion;
1469
+ m.attr("NOISELESS_PREFIX_CONTRACT") = kNoiselessPrefixContract; // the noiseless-coin keying contract (X1-X5)
1256
1470
  // J-b1 P13: the runtime exact-construction counter and the explicit-exact scope (xtim/_exact_scope.py).
1257
1471
  // FFS: the dict of a TwirlSampler._plan_structure_blob blob (plan_structure_dict on the blob's plan export).
1258
1472
  m.def("_plan_structure_unpack", [](const py::bytes& blob) {
@@ -1315,7 +1529,10 @@ PYBIND11_MODULE(_xtim, m) {
1315
1529
  py::arg("erasure") = false,
1316
1530
  py::arg("format") = std::string("stim"),
1317
1531
  py::arg("require_canonical") = false,
1532
+ py::arg("provenance") = false,
1318
1533
  "Stim-compatible DEM text export (run_stim_main --dem semantics). "
1534
+ "provenance=True (xdem only): an extended output ends with `# provenance` comment lines mapping each error "
1535
+ "line to the circuit fault locations it carries (docs/xdem.md §2.1). "
1319
1536
  "format=\"xdem\": the xdem text (qeccore/xdem_file.hpp); a circuit with no rotating fault gets the "
1320
1537
  "format=\"stim\" export with the same options; on an extended output a set option is refused by name. "
1321
1538
  "require_canonical=True (xdem only): refuse a circuit not in canonical single-stage form (error names "
@@ -1408,10 +1625,19 @@ PYBIND11_MODULE(_xtim, m) {
1408
1625
  "adaptq's port restriction (the carried state rebuilt on the port wires only).");
1409
1626
  mdef(m, "bare_state_of", &py_bare_state_of, py::arg("circuit_text"), bare_state_of_doc);
1410
1627
  mdef(m, "_rotation_form_oracle_diff", &py_rotation_form_oracle_diff, py::arg("circuit_text"),
1411
- py::arg("normalize") = true,
1628
+ py::arg("normalize") = true, py::arg("walk") = true,
1412
1629
  "TEST ORACLE: (diff, terms_checked, frame_terms, n_terms) — diff is '' iff the production "
1413
- "rotation form equals the per-gate-walk oracle term by term (bits AND phase) and as a whole "
1414
- "form (terms, coeffs, Clifford list, global-phase bytes, reject fields).");
1630
+ "rotation form (the sparse frame, F3) equals the pre-F3 dense frame's and, with walk=True, the "
1631
+ "per-gate-walk oracle's, term by term (bits AND phase) and as a whole form (terms, coeffs, "
1632
+ "Clifford list, global-phase bytes, reject fields).");
1633
+ mdef(m, "_rotation_frame_rows", &py_rotation_frame_rows, py::arg("circuit_text"), py::arg("normalize") = true,
1634
+ "TEST ONLY (F3): the sparse frame's rows after the production build (nothing else is synced: the "
1635
+ "production footprint) — n, synced, rows_dense, rows_sparse, row_bytes (the payload), capacity_bytes "
1636
+ "(what the rows' vectors allocate; == row_bytes), header_bytes (the Row array + out-of-line dense Paulis), "
1637
+ "dense_bytes (the dense frame's), rule_violations (0), weight_sum, weight_max.");
1638
+ mdef(m, "_rotation_form_build_seconds", &py_rotation_form_build_seconds, py::arg("circuit_text"),
1639
+ py::arg("normalize") = true, py::arg("route") = "sparse",
1640
+ "TEST ONLY (F3): wall seconds of one build_pauli_rotation_form on route 'sparse' / 'dense' / 'walk'.");
1415
1641
  mdef(m, "_bare_state_oracle_diff", &py_bare_state_oracle_diff, py::arg("circuit_text"),
1416
1642
  "TEST ORACLE: (diff, chi) — diff is '' iff the production (coset-family) bare state is "
1417
1643
  "byte-identical to the 3.1.7 per-branch construction (frame, eps, free, anchor, branch "
@@ -1732,7 +1958,8 @@ PYBIND11_MODULE(_xtim, m) {
1732
1958
  mdef(m, "if_driving_bits", &py_if_driving_bits, py::arg("text"),
1733
1959
  "Return list of (port_index, bit_index) tuples for decision bits that "
1734
1960
  "appear in any IF condition in the circuit. Duplicates deduplicated; "
1735
- "raises ValueError on parse failure.");
1961
+ "raises ValueError on parse failure of a text with an IF line (a text with no IF "
1962
+ "line returns [] without a full parse).");
1736
1963
  mdef(m, "if_driving_global_offsets", &py_if_driving_global_offsets, py::arg("text"),
1737
1964
  "Return list of global bit offsets (sum of prior Bits port widths + bit_idx) "
1738
1965
  "for IF-driving bits. Order matches if_driving_bits(). Raises ValueError on parse failure.");
@@ -12,6 +12,8 @@
12
12
 
13
13
  namespace qeccore {
14
14
 
15
+ struct PreparedAffine; // stab_overlap.hpp
16
+
15
17
  // CanonicalStabSum (v2): a superposition Σ_{i<χ} c_i |φ_i⟩ of stabilizer branches that
16
18
  // share a single stabilizer group up to signs, stored in the form of Definition 2 of
17
19
  // an internal derivation note (not shipped):
@@ -94,6 +96,16 @@ struct CanonicalStabSum {
94
96
  std::vector<int> a2; // z8 of α(e_i ⊕ e_j), i < j, row-major
95
97
  std::vector<uint8_t> b2; // b_ij (r×r, upper triangle)
96
98
  std::vector<uint32_t> u; // re-based linear syndrome columns (n)
99
+ // F2 (tests only): the branch gauges z8 of α(g) for every g (ztab) and the parity assembler's coefficients
100
+ // before the gauge division (coeffs[g]); the stored branch coefficient is coeffs[g] / ζ8^{ztab[g]}, so
101
+ // branch.c · ζ8^{ztab} is the labelling-invariant quantity (the invariant coefficient pin).
102
+ std::vector<uint8_t> ztab;
103
+ std::vector<std::complex<double>> coeffs_pre;
104
+ // Tests only (F1). exact_spot_check: gauge the spot-check probes by the exact joint-system inner product —
105
+ // the pre-F1 check, the oracle of the shared-form one. corrupt_probe(g, ray): applied to each materialised
106
+ // probe ray before it is gauged (a test corrupts a coset family and proves the check refuses it).
107
+ bool exact_spot_check = false;
108
+ std::function<void(uint32_t, AffineState&)> corrupt_probe;
97
109
  };
98
110
  static CanonicalStabSum from_coset_family(
99
111
  int n, int r, const AffineState& psi, const std::vector<Pauli>& zs,
@@ -156,7 +168,11 @@ struct CanonicalStabSum {
156
168
  std::vector<std::vector<uint8_t>>& fs) const;
157
169
  // The gauge rebuild_from_rays divides by: ⟨ray|D_σ anchor⟩ with D_σ = Π_{d: σ_d} Xrow[free[d]]
158
170
  // applied in ascending d (exact; a unit phase when ray and D_σ anchor are the same ray).
159
- ExactPhase branch_gauge(const AffineState& ray, const std::vector<uint8_t>& sigma) const;
171
+ // `pa` (F1): the anchor's PreparedAffine — the overlap of two states of the anchor's form (every probe ray and
172
+ // D_σ·anchor) is then AffineState::inner_product_shared_form, exact in O(k²/64); without it, or on a form
173
+ // mismatch, the exact joint-system inner product.
174
+ ExactPhase branch_gauge(const AffineState& ray, const std::vector<uint8_t>& sigma,
175
+ const PreparedAffine* pa = nullptr) const;
160
176
  };
161
177
 
162
178
  } // namespace qeccore
@@ -69,6 +69,11 @@ struct FeedbackSource {
69
69
 
70
70
  FeedbackSource resolve_feedback_source(const Circuit& user, int controlled_pauli_stream_index);
71
71
 
72
+ // resolve_feedback_source for EVERY ControlledPauli, one entry per ControlledPauli in stream order, in one O(L)
73
+ // forward pass (record -> stream-index table + per-qubit last-touch index). Entry-for-entry equal to calling
74
+ // resolve_feedback_source on each ControlledPauli (which is O(L) per call and is kept as the test oracle).
75
+ std::vector<FeedbackSource> resolve_all_feedback_sources(const Circuit& user);
76
+
72
77
  // Per-feedback verdict of the deferred-measurement hoist (refusal attribution; off every hot
73
78
  // path). One entry per ControlledPauli in stream order.
74
79
  struct FeedbackHoistInfo {