query-complexity 0.1.1__tar.gz → 0.2.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 (252) hide show
  1. query_complexity-0.2.0/CHANGELOG.md +20 -0
  2. query_complexity-0.2.0/CONTRIBUTING.md +16 -0
  3. query_complexity-0.2.0/MANIFEST.in +12 -0
  4. query_complexity-0.2.0/PKG-INFO +195 -0
  5. query_complexity-0.2.0/README.md +137 -0
  6. query_complexity-0.2.0/docs/README.md +57 -0
  7. query_complexity-0.2.0/docs/api.md +70 -0
  8. query_complexity-0.2.0/docs/examples.md +67 -0
  9. query_complexity-0.2.0/docs/guides/irrep-hierarchy.md +221 -0
  10. query_complexity-0.2.0/docs/guides/junta-learning.md +173 -0
  11. query_complexity-0.2.0/docs/guides/query-complexity.md +100 -0
  12. query_complexity-0.2.0/docs/installation.md +62 -0
  13. query_complexity-0.2.0/docs/junta/bounded_size_log_cost.md +344 -0
  14. query_complexity-0.2.0/docs/junta/majority_rank_one_non_h.tex +274 -0
  15. query_complexity-0.2.0/docs/junta/majority_rank_one_optimization_origin.tex +303 -0
  16. query_complexity-0.2.0/docs/junta/multibias.md +448 -0
  17. query_complexity-0.2.0/docs/releasing.md +30 -0
  18. query_complexity-0.2.0/examples/example_or.py +8 -0
  19. query_complexity-0.2.0/examples/example_threshold_blocks.py +11 -0
  20. query_complexity-0.2.0/examples/general_function.py +16 -0
  21. query_complexity-0.2.0/examples/majority_junta.py +15 -0
  22. query_complexity-0.2.0/examples/symmetric_hierarchy.py +15 -0
  23. query_complexity-0.2.0/examples/triangle_hierarchy.py +19 -0
  24. query_complexity-0.2.0/experiments/experiment_bm_adaptive_alpha.py +311 -0
  25. query_complexity-0.2.0/experiments/experiment_bm_n7_pipeline.py +489 -0
  26. query_complexity-0.2.0/experiments/experiment_bm_threshold_n6.py +306 -0
  27. query_complexity-0.2.0/experiments/experiment_exact_alpha_bisect.py +180 -0
  28. query_complexity-0.2.0/experiments/experiment_exact_rank2_from_symmetric_warmstart.py +200 -0
  29. query_complexity-0.2.0/experiments/experiment_exact_symmetric_block_rank.py +271 -0
  30. query_complexity-0.2.0/experiments/experiment_fixed_rank_tradeoff.py +324 -0
  31. query_complexity-0.2.0/experiments/experiment_irrep_hierarchy.py +43 -0
  32. query_complexity-0.2.0/experiments/experiment_majority_junta.py +45 -0
  33. query_complexity-0.2.0/experiments/experiment_nonsymmetric_n5_min_rank.py +216 -0
  34. query_complexity-0.2.0/experiments/experiment_or_symmetric_value.py +7 -0
  35. query_complexity-0.2.0/experiments/experiment_random_weighted_trace.py +242 -0
  36. query_complexity-0.2.0/experiments/experiment_symmetric_fixed_rank_grid.py +255 -0
  37. query_complexity-0.2.0/experiments/experiment_symmetric_orbit_min_rank.py +341 -0
  38. query_complexity-0.2.0/experiments/experiment_symmetric_pattern_alpha_bisect.py +312 -0
  39. query_complexity-0.2.0/experiments/experiment_symmetric_zero_block_rank.py +231 -0
  40. query_complexity-0.2.0/experiments/experiment_threshold_tradeoff.py +181 -0
  41. query_complexity-0.2.0/experiments/experiment_triangle_hierarchy.py +32 -0
  42. query_complexity-0.2.0/experiments/experiment_triangle_level2_scaling.py +59 -0
  43. query_complexity-0.2.0/julia/Manifest.toml +919 -0
  44. query_complexity-0.2.0/julia/PROVENANCE.md +17 -0
  45. query_complexity-0.2.0/julia/Project.toml +13 -0
  46. query_complexity-0.2.0/julia/benchmarks/benchmark_sdplrplus.jl +164 -0
  47. query_complexity-0.2.0/julia/test/runtests.jl +25 -0
  48. query_complexity-0.2.0/julia/triangle/README.md +689 -0
  49. query_complexity-0.2.0/julia/triangle/analyze_balanced_complete_pair_scores.jl +88 -0
  50. query_complexity-0.2.0/julia/triangle/analyze_k33_surgery_pair_scores.jl +181 -0
  51. query_complexity-0.2.0/julia/triangle/analyze_n5_full_scores.jl +102 -0
  52. query_complexity-0.2.0/julia/triangle/analyze_n5_pair_scores.jl +106 -0
  53. query_complexity-0.2.0/julia/triangle/classify_n6_orbit_ratios.jl +200 -0
  54. query_complexity-0.2.0/julia/triangle/graph_collision_adversary_dual.jl +645 -0
  55. query_complexity-0.2.0/julia/triangle/plot_adv_ratio_positive.py +167 -0
  56. query_complexity-0.2.0/julia/triangle/plot_adversary_evolution.py +399 -0
  57. query_complexity-0.2.0/julia/triangle/plot_cs_collision_promises.py +53 -0
  58. query_complexity-0.2.0/julia/triangle/plot_cs_graph_collision.py +75 -0
  59. query_complexity-0.2.0/julia/triangle/plot_t_surgery_vs_complete_bipartite.py +158 -0
  60. query_complexity-0.2.0/julia/triangle/results/adv_ratio_positive_vs_general.csv +16 -0
  61. query_complexity-0.2.0/julia/triangle/results/adv_ratio_positive_vs_general.png +0 -0
  62. query_complexity-0.2.0/julia/triangle/results/adv_ratio_positive_vs_general.svg +2219 -0
  63. query_complexity-0.2.0/julia/triangle/results/balanced_complete_bipartite_values.csv +6 -0
  64. query_complexity-0.2.0/julia/triangle/results/balanced_complete_bipartite_values.svg +24 -0
  65. query_complexity-0.2.0/julia/triangle/results/balanced_max_t_surgery_growth.png +0 -0
  66. query_complexity-0.2.0/julia/triangle/results/balanced_max_t_surgery_growth.svg +1790 -0
  67. query_complexity-0.2.0/julia/triangle/results/balanced_max_t_surgery_values.csv +5 -0
  68. query_complexity-0.2.0/julia/triangle/results/balanced_max_t_surgery_values.svg +11 -0
  69. query_complexity-0.2.0/julia/triangle/results/cs_collision_marginal_n8.csv +9 -0
  70. query_complexity-0.2.0/julia/triangle/results/cs_collision_marginal_n9.csv +9 -0
  71. query_complexity-0.2.0/julia/triangle/results/cs_collision_promise_growth.png +0 -0
  72. query_complexity-0.2.0/julia/triangle/results/cs_collision_promise_growth.svg +1616 -0
  73. query_complexity-0.2.0/julia/triangle/results/cs_collision_promise_n8.csv +21 -0
  74. query_complexity-0.2.0/julia/triangle/results/cs_graph_collision_growth.png +0 -0
  75. query_complexity-0.2.0/julia/triangle/results/cs_graph_collision_growth.svg +1885 -0
  76. query_complexity-0.2.0/julia/triangle/results/cs_graph_collision_values.csv +9 -0
  77. query_complexity-0.2.0/julia/triangle/results/graph_collision_n5_results.toml +535 -0
  78. query_complexity-0.2.0/julia/triangle/results/graph_collision_n6_results.toml +2487 -0
  79. query_complexity-0.2.0/julia/triangle/results/n6_reps_701_957.svg +69 -0
  80. query_complexity-0.2.0/julia/triangle/results/n6_single_orbit_ratios.csv +5 -0
  81. query_complexity-0.2.0/julia/triangle/results/n6_single_orbit_ratios.svg +17 -0
  82. query_complexity-0.2.0/julia/triangle/results/n6_single_orbit_ratios_cont.csv +7 -0
  83. query_complexity-0.2.0/julia/triangle/results/n6_single_orbit_ratios_cont.svg +21 -0
  84. query_complexity-0.2.0/julia/triangle/results/n6_single_orbit_ratios_merged.csv +11 -0
  85. query_complexity-0.2.0/julia/triangle/results/n6_single_orbit_ratios_merged.svg +29 -0
  86. query_complexity-0.2.0/julia/triangle/results/n7_important_orbits.svg +320 -0
  87. query_complexity-0.2.0/julia/triangle/results/positive_adversary_benchmarks.csv +7 -0
  88. query_complexity-0.2.0/julia/triangle/results/positive_almost_forward_n5.csv +7 -0
  89. query_complexity-0.2.0/julia/triangle/results/positive_vs_general_greedy_n5.png +0 -0
  90. query_complexity-0.2.0/julia/triangle/results/positive_vs_general_greedy_n5.svg +1693 -0
  91. query_complexity-0.2.0/julia/triangle/results/requested_positive_ratios.csv +4 -0
  92. query_complexity-0.2.0/julia/triangle/results/t_surgery_vs_complete_bipartite.png +0 -0
  93. query_complexity-0.2.0/julia/triangle/results/t_surgery_vs_complete_bipartite.svg +1942 -0
  94. query_complexity-0.2.0/julia/triangle/results/triangle_adversary_evolution.png +0 -0
  95. query_complexity-0.2.0/julia/triangle/results/triangle_adversary_evolution.svg +2124 -0
  96. query_complexity-0.2.0/julia/triangle/results/triangle_benchmark_comparison.png +0 -0
  97. query_complexity-0.2.0/julia/triangle/results/triangle_benchmark_comparison.svg +1555 -0
  98. query_complexity-0.2.0/julia/triangle/results/triangle_greedy_round_evolution.png +0 -0
  99. query_complexity-0.2.0/julia/triangle/results/triangle_greedy_round_evolution.svg +1426 -0
  100. query_complexity-0.2.0/julia/triangle/results/triangle_orbit_results.toml +89 -0
  101. query_complexity-0.2.0/julia/triangle/run_balanced_complete_batch.jl +277 -0
  102. query_complexity-0.2.0/julia/triangle/run_balanced_max_t_surgery_batch.jl +197 -0
  103. query_complexity-0.2.0/julia/triangle/run_cs_collision_promises.jl +290 -0
  104. query_complexity-0.2.0/julia/triangle/run_cs_graph_collision.jl +180 -0
  105. query_complexity-0.2.0/julia/triangle/run_graph_collision_hosts.jl +452 -0
  106. query_complexity-0.2.0/julia/triangle/run_n8_high_aut_supplied.jl +82 -0
  107. query_complexity-0.2.0/julia/triangle/run_n8_t_surgery_direct.jl +200 -0
  108. query_complexity-0.2.0/julia/triangle/run_positive_adversary_benchmarks.jl +123 -0
  109. query_complexity-0.2.0/julia/triangle/run_requested_positive_ratios.jl +127 -0
  110. query_complexity-0.2.0/julia/triangle/run_triangle_promise.jl +73 -0
  111. query_complexity-0.2.0/julia/triangle/run_triangle_symmetric.jl +2437 -0
  112. query_complexity-0.2.0/julia/triangle/triangle_adversary_dual_restricted.jl +761 -0
  113. query_complexity-0.2.0/julia/triangle/triangle_cb_degree_sdp.jl +697 -0
  114. query_complexity-0.2.0/julia/triangle/triangle_common.jl +257 -0
  115. query_complexity-0.2.0/julia/vendor/SDPLRPlus/LICENSE +21 -0
  116. query_complexity-0.2.0/julia/vendor/SDPLRPlus/Project.toml +34 -0
  117. query_complexity-0.2.0/julia/vendor/SDPLRPlus/README.md +63 -0
  118. query_complexity-0.2.0/julia/vendor/SDPLRPlus/src/SDPLRPlus.jl +49 -0
  119. query_complexity-0.2.0/julia/vendor/SDPLRPlus/src/complex_embed.jl +129 -0
  120. query_complexity-0.2.0/julia/vendor/SDPLRPlus/src/coreop.jl +526 -0
  121. query_complexity-0.2.0/julia/vendor/SDPLRPlus/src/lbfgs.jl +149 -0
  122. query_complexity-0.2.0/julia/vendor/SDPLRPlus/src/linesearch.jl +191 -0
  123. query_complexity-0.2.0/julia/vendor/SDPLRPlus/src/lowrankopt.jl +137 -0
  124. query_complexity-0.2.0/julia/vendor/SDPLRPlus/src/myprint.jl +48 -0
  125. query_complexity-0.2.0/julia/vendor/SDPLRPlus/src/options.jl +24 -0
  126. query_complexity-0.2.0/julia/vendor/SDPLRPlus/src/preprocess.jl +169 -0
  127. query_complexity-0.2.0/julia/vendor/SDPLRPlus/src/sdplr.jl +490 -0
  128. query_complexity-0.2.0/julia/vendor/SDPLRPlus/src/structs.jl +380 -0
  129. query_complexity-0.2.0/julia/vendor/SDPLRPlus/src/utils.jl +11 -0
  130. query_complexity-0.2.0/majority_rank_one_closed_X.pdf +0 -0
  131. query_complexity-0.2.0/notebooks/query_complexity_visual_examples.ipynb +1059 -0
  132. query_complexity-0.2.0/plots/plot_alpha_min_rank_curves.py +138 -0
  133. query_complexity-0.2.0/plots/plot_alpha_rank_patterns.py +104 -0
  134. query_complexity-0.2.0/plots/plot_bm_threshold_n5_n6.py +79 -0
  135. query_complexity-0.2.0/plots/plot_symmetric_vs_nonsymmetric_exact_n7.py +138 -0
  136. query_complexity-0.2.0/pyproject.toml +48 -0
  137. query_complexity-0.2.0/results/hierarchy/README.md +61 -0
  138. query_complexity-0.2.0/results/hierarchy/TRIANGLE_LEVEL2_SCALING.md +62 -0
  139. query_complexity-0.2.0/results/hierarchy/symmetric_functions.json +1832 -0
  140. query_complexity-0.2.0/results/hierarchy/triangle_finding.json +294 -0
  141. query_complexity-0.2.0/results/hierarchy/triangle_level2_scaling.json +153 -0
  142. query_complexity-0.2.0/results/junta/README.md +24 -0
  143. query_complexity-0.2.0/results/junta/majority_comparison.csv +8 -0
  144. query_complexity-0.2.0/results/query_space/alpha_min_rank_curves.png +0 -0
  145. query_complexity-0.2.0/results/query_space/alpha_min_rank_curves_zoom_near1.png +0 -0
  146. query_complexity-0.2.0/results/query_space/alpha_min_rank_curves_zoom_rank1.png +0 -0
  147. query_complexity-0.2.0/results/query_space/alpha_min_rank_curves_zoom_rank2.png +0 -0
  148. query_complexity-0.2.0/results/query_space/alpha_rank_patterns.png +0 -0
  149. query_complexity-0.2.0/results/query_space/bm_exact_n5_fast.csv +20 -0
  150. query_complexity-0.2.0/results/query_space/bm_exact_n5_fast.png +0 -0
  151. query_complexity-0.2.0/results/query_space/bm_exact_n7_adaptive_full.png +0 -0
  152. query_complexity-0.2.0/results/query_space/bm_exact_n7_adaptive_rank1.png +0 -0
  153. query_complexity-0.2.0/results/query_space/bm_exact_n7_adaptive_rank2.png +0 -0
  154. query_complexity-0.2.0/results/query_space/bm_exact_n7_adaptive_rank_tests.csv +379 -0
  155. query_complexity-0.2.0/results/query_space/bm_exact_n7_adaptive_summary.csv +138 -0
  156. query_complexity-0.2.0/results/query_space/bm_threshold_n5_n6.png +0 -0
  157. query_complexity-0.2.0/results/query_space/bm_threshold_n6.csv +143 -0
  158. query_complexity-0.2.0/results/query_space/bm_threshold_n6.png +0 -0
  159. query_complexity-0.2.0/results/query_space/bm_threshold_n7_fast.csv +102 -0
  160. query_complexity-0.2.0/results/query_space/bm_threshold_n7_full.png +0 -0
  161. query_complexity-0.2.0/results/query_space/bm_threshold_n7_rank1.png +0 -0
  162. query_complexity-0.2.0/results/query_space/bm_threshold_n7_rank2.png +0 -0
  163. query_complexity-0.2.0/results/query_space/bm_threshold_n7_refined.csv +249 -0
  164. query_complexity-0.2.0/results/query_space/exact_alpha_bisect_n5_fast.csv +21 -0
  165. query_complexity-0.2.0/results/query_space/exact_alpha_bisect_n5_refined.csv +33 -0
  166. query_complexity-0.2.0/results/query_space/exact_alpha_bisect_n6_fast.csv +19 -0
  167. query_complexity-0.2.0/results/query_space/exact_alpha_bisect_n6_refined.csv +31 -0
  168. query_complexity-0.2.0/results/query_space/exact_alpha_intermediate_n5.csv +55 -0
  169. query_complexity-0.2.0/results/query_space/exact_alpha_intermediate_n6_k1.csv +16 -0
  170. query_complexity-0.2.0/results/query_space/exact_alpha_intermediate_n6_k2.csv +25 -0
  171. query_complexity-0.2.0/results/query_space/exact_alpha_intermediate_n6_k3.csv +29 -0
  172. query_complexity-0.2.0/results/query_space/exact_n7_k2_rank2_from_symmetric_warmstart.csv +10 -0
  173. query_complexity-0.2.0/results/query_space/exact_n7_rank2_threshold_comparison.png +0 -0
  174. query_complexity-0.2.0/results/query_space/exact_n7_symmetric_vs_nonsymmetric_rank2.png +0 -0
  175. query_complexity-0.2.0/results/query_space/exact_symmetric_block_rank_n5.csv +11 -0
  176. query_complexity-0.2.0/results/query_space/exact_symmetric_block_rank_n5.png +0 -0
  177. query_complexity-0.2.0/results/query_space/fixed_rank_tradeoff.csv +89 -0
  178. query_complexity-0.2.0/results/query_space/fixed_rank_tradeoff.png +0 -0
  179. query_complexity-0.2.0/results/query_space/nonsymmetric_n5_min_rank.csv +133 -0
  180. query_complexity-0.2.0/results/query_space/nonsymmetric_n5_min_rank.png +0 -0
  181. query_complexity-0.2.0/results/query_space/random_weighted_trace_exact5_2_alpha1.csv +14 -0
  182. query_complexity-0.2.0/results/query_space/random_weighted_trace_exact5_2_alpha1.png +0 -0
  183. query_complexity-0.2.0/results/query_space/random_weighted_trace_exact5_2_alpha121.csv +14 -0
  184. query_complexity-0.2.0/results/query_space/random_weighted_trace_exact5_2_alpha121.png +0 -0
  185. query_complexity-0.2.0/results/query_space/random_weighted_trace_exact5_2_alpha121_spread15.csv +22 -0
  186. query_complexity-0.2.0/results/query_space/random_weighted_trace_exact5_2_alpha121_spread15.png +0 -0
  187. query_complexity-0.2.0/results/query_space/random_weighted_trace_threshold5_2_alpha103.csv +22 -0
  188. query_complexity-0.2.0/results/query_space/random_weighted_trace_threshold5_2_alpha103.png +0 -0
  189. query_complexity-0.2.0/results/query_space/random_weighted_trace_threshold5_2_alpha115.csv +22 -0
  190. query_complexity-0.2.0/results/query_space/random_weighted_trace_threshold5_2_alpha115.png +0 -0
  191. query_complexity-0.2.0/results/query_space/random_weighted_trace_threshold5_3_alpha103.csv +14 -0
  192. query_complexity-0.2.0/results/query_space/random_weighted_trace_threshold5_3_alpha103.png +0 -0
  193. query_complexity-0.2.0/results/query_space/symmetric_exact_n5_pattern200_alpha_bisect.csv +19 -0
  194. query_complexity-0.2.0/results/query_space/symmetric_exact_n5_rank2_alpha_bisect.csv +20 -0
  195. query_complexity-0.2.0/results/query_space/symmetric_exact_n6_pattern200_alpha_bisect.csv +25 -0
  196. query_complexity-0.2.0/results/query_space/symmetric_exact_n7_pattern2000_alpha_bisect.csv +34 -0
  197. query_complexity-0.2.0/results/query_space/symmetric_exact_n7_pattern2000_alpha_bisect_probe.csv +19 -0
  198. query_complexity-0.2.0/results/query_space/symmetric_fixed_rank_grid.csv +385 -0
  199. query_complexity-0.2.0/results/query_space/symmetric_fixed_rank_grid.png +0 -0
  200. query_complexity-0.2.0/results/query_space/symmetric_fixed_rank_grid_small.csv +166 -0
  201. query_complexity-0.2.0/results/query_space/symmetric_orbit_exact_n5_quick.csv +8 -0
  202. query_complexity-0.2.0/results/query_space/symmetric_orbit_exact_n5_refined.csv +25 -0
  203. query_complexity-0.2.0/results/query_space/symmetric_orbit_exact_n5_targeted.csv +53 -0
  204. query_complexity-0.2.0/results/query_space/symmetric_orbit_exact_n5_targeted.png +0 -0
  205. query_complexity-0.2.0/results/query_space/symmetric_orbit_threshold_n5_targeted.csv +91 -0
  206. query_complexity-0.2.0/results/query_space/symmetric_orbit_threshold_n5_targeted.png +0 -0
  207. query_complexity-0.2.0/results/query_space/symmetric_threshold_n7_pattern2000_alpha_bisect.csv +4 -0
  208. query_complexity-0.2.0/results/query_space/symmetric_zero_block_rank.csv +40 -0
  209. query_complexity-0.2.0/results/query_space/symmetric_zero_block_rank.png +0 -0
  210. query_complexity-0.2.0/results/query_space/threshold_alpha_bisect_n5_k3_refined.csv +17 -0
  211. query_complexity-0.2.0/results/query_space/threshold_alpha_bisect_n5_refined.csv +15 -0
  212. query_complexity-0.2.0/results/query_space/threshold_alpha_bisect_n6_refined.csv +21 -0
  213. query_complexity-0.2.0/results/query_space/threshold_alpha_intermediate_n5.csv +25 -0
  214. query_complexity-0.2.0/results/query_space/threshold_alpha_intermediate_n6.csv +46 -0
  215. query_complexity-0.2.0/results/query_space/threshold_tradeoff.csv +28 -0
  216. query_complexity-0.2.0/results/query_space/threshold_tradeoff.png +0 -0
  217. query_complexity-0.2.0/src/junta_learning/__init__.py +5 -0
  218. query_complexity-0.2.0/src/junta_learning/bounded_size.py +183 -0
  219. query_complexity-0.2.0/src/junta_learning/compare_rank_one.py +64 -0
  220. query_complexity-0.2.0/src/junta_learning/majority_sdp.py +95 -0
  221. query_complexity-0.2.0/src/junta_learning/multibias.py +572 -0
  222. query_complexity-0.2.0/src/junta_learning/rank_one.py +216 -0
  223. query_complexity-0.2.0/src/junta_learning/witness_audit.py +410 -0
  224. query_complexity-0.2.0/src/query_complexity/__init__.py +9 -0
  225. query_complexity-0.2.0/src/query_complexity/core.py +2325 -0
  226. query_complexity-0.2.0/src/query_complexity.egg-info/PKG-INFO +195 -0
  227. query_complexity-0.2.0/src/query_complexity.egg-info/SOURCES.txt +240 -0
  228. query_complexity-0.2.0/src/query_complexity.egg-info/requires.txt +20 -0
  229. query_complexity-0.2.0/src/query_complexity.egg-info/top_level.txt +3 -0
  230. query_complexity-0.2.0/src/sdp_hierarchy/__init__.py +5 -0
  231. query_complexity-0.2.0/src/sdp_hierarchy/examples.py +60 -0
  232. query_complexity-0.2.0/src/sdp_hierarchy/pipeline.py +171 -0
  233. query_complexity-0.2.0/src/sdp_hierarchy/representation.py +123 -0
  234. query_complexity-0.2.0/tests/test_junta_learning.py +84 -0
  235. query_complexity-0.2.0/tests/test_public_api.py +21 -0
  236. query_complexity-0.2.0/tests/test_sdp_hierarchy.py +147 -0
  237. query_complexity-0.2.0/tests/test_trace_minimization.py +92 -0
  238. query_complexity-0.2.0/tests/test_triangle_hierarchy.py +28 -0
  239. query_complexity-0.2.0/tests/test_triangle_scaling.py +19 -0
  240. query_complexity-0.1.1/PKG-INFO +0 -172
  241. query_complexity-0.1.1/README.md +0 -138
  242. query_complexity-0.1.1/pyproject.toml +0 -47
  243. query_complexity-0.1.1/src/query_complexity/__init__.py +0 -5
  244. query_complexity-0.1.1/src/query_complexity/core.py +0 -1342
  245. query_complexity-0.1.1/src/query_complexity.egg-info/PKG-INFO +0 -172
  246. query_complexity-0.1.1/src/query_complexity.egg-info/SOURCES.txt +0 -11
  247. query_complexity-0.1.1/src/query_complexity.egg-info/requires.txt +0 -14
  248. query_complexity-0.1.1/src/query_complexity.egg-info/top_level.txt +0 -1
  249. query_complexity-0.1.1/tests/test_smoke.py +0 -19
  250. {query_complexity-0.1.1 → query_complexity-0.2.0}/LICENSE +0 -0
  251. {query_complexity-0.1.1 → query_complexity-0.2.0}/setup.cfg +0 -0
  252. {query_complexity-0.1.1 → query_complexity-0.2.0}/src/query_complexity.egg-info/dependency_links.txt +0 -0
@@ -0,0 +1,20 @@
1
+ # Changelog
2
+
3
+ ## 0.2.0
4
+
5
+ - Preserve the `query_complexity` API in a standard `src/` package layout.
6
+ - Include the `junta_learning` and `sdp_hierarchy` Python packages in the release.
7
+ - Add intersection-free majority SDPs, explicit period-four rank-one witnesses,
8
+ mixed-size learning and multi-bias optimizers.
9
+ - Add finite permutation-action irrep-prefix hierarchies, independent reference
10
+ formulations and witness diagnostics.
11
+ - Add symmetric-function and triangle-finding builders, reproducible comparisons,
12
+ and explicit memory guards for larger triangle domains.
13
+ - Consolidate guides, add installation/API documentation and runnable examples,
14
+ restore the existing MIT license, and correct repository metadata.
15
+ - Keep Julia/SymbolicWedderburn sources and research artifacts in the source
16
+ archive and repository, outside the Python runtime wheel.
17
+
18
+ ## 0.1.2
19
+
20
+ Previously published Boolean adversary-SDP and phase-transducer package.
@@ -0,0 +1,16 @@
1
+ # Contributing
2
+
3
+ Install from the checkout using `python -m pip install -e '.[dev,experiments,symbolic]'`.
4
+ Run `python -m pytest -q`. Python code belongs under `src/`; public examples
5
+ belong under `examples/`; expensive sweeps belong under `experiments/`.
6
+ Keep archived measurements separate from runtime code.
7
+
8
+ Preserve the existing three import namespaces and the documented objective
9
+ normalizations. Numerical changes should include checks against independent
10
+ formulations, known small values, or reconstructed witness constraints.
11
+ Record solver status and residuals along with objective values. Do not
12
+ replace missing large-instance solves with extrapolated measurements.
13
+
14
+ Build with `python -m build` and check metadata with `python -m twine check dist/*`.
15
+ Verify both wheel and source archive in a temporary environment before a
16
+ release. See [release instructions](docs/releasing.md).
@@ -0,0 +1,12 @@
1
+ include LICENSE README.md CHANGELOG.md CONTRIBUTING.md
2
+ recursive-include src *.py
3
+ recursive-include docs *.md *.tex
4
+ recursive-include examples *.py
5
+ recursive-include tests *.py
6
+ recursive-include experiments *.py *.jl
7
+ recursive-include plots *.py
8
+ recursive-include results *.md *.json *.csv *.png *.svg
9
+ recursive-include julia *.jl *.toml *.md *.py *.csv *.png *.svg LICENSE
10
+ include majority_rank_one_closed_X.pdf
11
+ recursive-include notebooks *.ipynb
12
+ global-exclude __pycache__ *.py[cod] .DS_Store
@@ -0,0 +1,195 @@
1
+ Metadata-Version: 2.2
2
+ Name: query-complexity
3
+ Version: 0.2.0
4
+ Summary: Quantum query complexity: adversary SDPs, junta learning, irrep hierarchies, and transducers
5
+ Author: Ke Li
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Ke Li
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/stockfish-soup/query-complexity
29
+ Project-URL: Repository, https://github.com/stockfish-soup/query-complexity
30
+ Project-URL: Documentation, https://github.com/stockfish-soup/query-complexity/blob/main/docs/README.md
31
+ Project-URL: Issues, https://github.com/stockfish-soup/query-complexity/issues
32
+ Keywords: quantum,query complexity,semidefinite programming,junta learning,representation theory
33
+ Classifier: Development Status :: 3 - Alpha
34
+ Classifier: Intended Audience :: Science/Research
35
+ Classifier: Programming Language :: Python :: 3
36
+ Classifier: Programming Language :: Python :: 3.10
37
+ Classifier: Programming Language :: Python :: 3.11
38
+ Classifier: Programming Language :: Python :: 3.12
39
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
40
+ Requires-Python: >=3.10
41
+ Description-Content-Type: text/markdown
42
+ License-File: LICENSE
43
+ Requires-Dist: numpy>=1.23
44
+ Requires-Dist: scipy>=1.9
45
+ Requires-Dist: cvxpy>=1.3
46
+ Provides-Extra: experiments
47
+ Requires-Dist: matplotlib>=3.6; extra == "experiments"
48
+ Provides-Extra: dev
49
+ Requires-Dist: pytest>=7; extra == "dev"
50
+ Requires-Dist: build>=1; extra == "dev"
51
+ Requires-Dist: twine>=5; extra == "dev"
52
+ Provides-Extra: mosek
53
+ Requires-Dist: mosek; extra == "mosek"
54
+ Provides-Extra: qiskit
55
+ Requires-Dist: qiskit; extra == "qiskit"
56
+ Provides-Extra: symbolic
57
+ Requires-Dist: sympy>=1.11; extra == "symbolic"
58
+
59
+ # query-complexity
60
+
61
+ Python research tools for quantum query complexity: adversary-bound SDPs,
62
+ phase-oracle transducers, symmetric-junta learning, and representation-based
63
+ SDP hierarchies. The repository also contains Julia triangle-finding solvers
64
+ using SymbolicWedderburn.
65
+
66
+ ## Install
67
+
68
+ ```bash
69
+ python -m pip install query-complexity
70
+ ```
71
+
72
+ Python 3.10 or later is required. NumPy, SciPy and CVXPY are installed as
73
+ core dependencies. The examples below use analytic formulas or Clarabel;
74
+ they do not require a commercial solver license.
75
+
76
+ Optional extras:
77
+
78
+ ```bash
79
+ python -m pip install 'query-complexity[experiments]' # Matplotlib
80
+ python -m pip install 'query-complexity[symbolic]' # SymPy audit checks
81
+ python -m pip install 'query-complexity[mosek]' # requires a MOSEK license
82
+ python -m pip install 'query-complexity[qiskit]' # optional circuit export
83
+ ```
84
+
85
+ ## Use cases
86
+
87
+ ### Construct a small query transducer
88
+
89
+ ```python
90
+ import query_complexity as qc
91
+
92
+ solution = qc.analytic_or_solution(3)
93
+ transducer = qc.build_adversary_transducer(solution)
94
+ print(solution.objective_value) # sqrt(3)/2
95
+ print(transducer.private_dim) # 3
96
+ print(transducer.map_error) # approximately 1e-15
97
+ ```
98
+
99
+ The Boolean-evaluation module uses the phase-normalized value `Adv±(f)/2`.
100
+ It also solves general and symmetric-function SDPs, minimizes witness trace,
101
+ and searches for fixed-rank witnesses.
102
+
103
+ ### Learn a majority junta
104
+
105
+ ```python
106
+ from junta_learning import majority_sdp, rank_one
107
+
108
+ z = rank_one.count_witness(7)
109
+ print(z @ z) # explicit rank-one witness cost: 5.155555...
110
+ cost, matrix, status = majority_sdp.solve(7)
111
+ print(cost, status) # approximately 5.069052, optimal
112
+ ```
113
+
114
+ The explicit period-four witness has proved `O(log k)` cost. The convex
115
+ count SDP can improve its cost; it does not impose rank one. Learning costs
116
+ use `max_A sum_S X_S[A,A]`, without the phase factor `1/2`.
117
+
118
+ ### Compare an intersection-free SDP with higher irrep levels
119
+
120
+ ```python
121
+ from sdp_hierarchy import Hierarchy, symmetric_evaluation
122
+
123
+ hierarchy = Hierarchy(symmetric_evaluation(3, [0, 0, 1, 1]))
124
+ for r in range(hierarchy.max_level + 1):
125
+ result = hierarchy.solve(r)
126
+ print(r, result["cost"], result["numerically_feasible"])
127
+ # Level 0: approximately 3; level 1: approximately 2.
128
+ ```
129
+
130
+ Level `r` keeps the first `r+1` present irreducible types of each query
131
+ stabilizer, starting with the trivial type. Level 0 is the query-orbit
132
+ intersection-free model. The final level equals the full covariant SDP.
133
+ This package enumerates finite group actions and targets small instances.
134
+
135
+ ### Test triangle finding
136
+
137
+ ```python
138
+ from sdp_hierarchy import Hierarchy, triangle_finding
139
+
140
+ hierarchy = Hierarchy(triangle_finding(4))
141
+ result = hierarchy.solve(2)
142
+ print(result["cost"], result["status"]) # approximately 3
143
+ ```
144
+
145
+ Four vertices means 64 graph inputs. Five vertices already exceed the
146
+ reference backend's practical memory budget. Solver status and residuals
147
+ must be checked: some boundary cases return `optimal_inaccurate`.
148
+ No claimed numerical result here is an exact feasibility certificate.
149
+
150
+ ## Documentation and runnable examples
151
+
152
+ - [Documentation index](https://github.com/stockfish-soup/query-complexity/blob/main/docs/README.md)
153
+ - [Installation and solvers](https://github.com/stockfish-soup/query-complexity/blob/main/docs/installation.md)
154
+ - [Example walkthroughs](https://github.com/stockfish-soup/query-complexity/blob/main/docs/examples.md)
155
+ - [Python API reference](https://github.com/stockfish-soup/query-complexity/blob/main/docs/api.md)
156
+ - [Query complexity and transducers](https://github.com/stockfish-soup/query-complexity/blob/main/docs/guides/query-complexity.md)
157
+ - [Intersection-free junta learning](https://github.com/stockfish-soup/query-complexity/blob/main/docs/guides/junta-learning.md)
158
+ - [Irrep-prefix hierarchy definition](https://github.com/stockfish-soup/query-complexity/blob/main/docs/guides/irrep-hierarchy.md)
159
+ - [Triangle scaling results and limits](https://github.com/stockfish-soup/query-complexity/blob/main/results/hierarchy/TRIANGLE_LEVEL2_SCALING.md)
160
+
161
+ Run the examples from a source checkout after an editable installation:
162
+
163
+ ```bash
164
+ python -m pip install -e '.[dev,experiments]'
165
+ python examples/example_or.py
166
+ python examples/general_function.py
167
+ python examples/majority_junta.py
168
+ python examples/symmetric_hierarchy.py
169
+ python examples/triangle_hierarchy.py --vertices 4
170
+ python -m pytest -q
171
+ ```
172
+
173
+ The wheel installs three import packages: `query_complexity`,
174
+ `junta_learning`, and `sdp_hierarchy`. Experiments, archives, notebooks and
175
+ Julia tools are kept in the repository and source distribution, outside
176
+ the runtime packages. See the documentation index for the repository map.
177
+
178
+ ## Julia solvers
179
+
180
+ Julia is a separate environment and is not installed by pip. From a source
181
+ checkout, use Julia 1.12.5 to reproduce the pinned dependencies:
182
+
183
+ ```bash
184
+ julia --project=julia -e 'using Pkg; Pkg.instantiate()'
185
+ julia --project=julia julia/test/runtests.jl
186
+ julia --project=julia julia/triangle/triangle_cb_degree_sdp.jl 3 2 0.3333333333333333 clarabel
187
+ ```
188
+
189
+ See [the Julia guide](https://github.com/stockfish-soup/query-complexity/blob/main/julia/triangle/README.md)
190
+ and [dependency provenance](https://github.com/stockfish-soup/query-complexity/blob/main/julia/PROVENANCE.md).
191
+
192
+ ## License
193
+
194
+ MIT. Vendored SDPLRPlus retains its upstream license in
195
+ `julia/vendor/SDPLRPlus/LICENSE`.
@@ -0,0 +1,137 @@
1
+ # query-complexity
2
+
3
+ Python research tools for quantum query complexity: adversary-bound SDPs,
4
+ phase-oracle transducers, symmetric-junta learning, and representation-based
5
+ SDP hierarchies. The repository also contains Julia triangle-finding solvers
6
+ using SymbolicWedderburn.
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ python -m pip install query-complexity
12
+ ```
13
+
14
+ Python 3.10 or later is required. NumPy, SciPy and CVXPY are installed as
15
+ core dependencies. The examples below use analytic formulas or Clarabel;
16
+ they do not require a commercial solver license.
17
+
18
+ Optional extras:
19
+
20
+ ```bash
21
+ python -m pip install 'query-complexity[experiments]' # Matplotlib
22
+ python -m pip install 'query-complexity[symbolic]' # SymPy audit checks
23
+ python -m pip install 'query-complexity[mosek]' # requires a MOSEK license
24
+ python -m pip install 'query-complexity[qiskit]' # optional circuit export
25
+ ```
26
+
27
+ ## Use cases
28
+
29
+ ### Construct a small query transducer
30
+
31
+ ```python
32
+ import query_complexity as qc
33
+
34
+ solution = qc.analytic_or_solution(3)
35
+ transducer = qc.build_adversary_transducer(solution)
36
+ print(solution.objective_value) # sqrt(3)/2
37
+ print(transducer.private_dim) # 3
38
+ print(transducer.map_error) # approximately 1e-15
39
+ ```
40
+
41
+ The Boolean-evaluation module uses the phase-normalized value `Adv±(f)/2`.
42
+ It also solves general and symmetric-function SDPs, minimizes witness trace,
43
+ and searches for fixed-rank witnesses.
44
+
45
+ ### Learn a majority junta
46
+
47
+ ```python
48
+ from junta_learning import majority_sdp, rank_one
49
+
50
+ z = rank_one.count_witness(7)
51
+ print(z @ z) # explicit rank-one witness cost: 5.155555...
52
+ cost, matrix, status = majority_sdp.solve(7)
53
+ print(cost, status) # approximately 5.069052, optimal
54
+ ```
55
+
56
+ The explicit period-four witness has proved `O(log k)` cost. The convex
57
+ count SDP can improve its cost; it does not impose rank one. Learning costs
58
+ use `max_A sum_S X_S[A,A]`, without the phase factor `1/2`.
59
+
60
+ ### Compare an intersection-free SDP with higher irrep levels
61
+
62
+ ```python
63
+ from sdp_hierarchy import Hierarchy, symmetric_evaluation
64
+
65
+ hierarchy = Hierarchy(symmetric_evaluation(3, [0, 0, 1, 1]))
66
+ for r in range(hierarchy.max_level + 1):
67
+ result = hierarchy.solve(r)
68
+ print(r, result["cost"], result["numerically_feasible"])
69
+ # Level 0: approximately 3; level 1: approximately 2.
70
+ ```
71
+
72
+ Level `r` keeps the first `r+1` present irreducible types of each query
73
+ stabilizer, starting with the trivial type. Level 0 is the query-orbit
74
+ intersection-free model. The final level equals the full covariant SDP.
75
+ This package enumerates finite group actions and targets small instances.
76
+
77
+ ### Test triangle finding
78
+
79
+ ```python
80
+ from sdp_hierarchy import Hierarchy, triangle_finding
81
+
82
+ hierarchy = Hierarchy(triangle_finding(4))
83
+ result = hierarchy.solve(2)
84
+ print(result["cost"], result["status"]) # approximately 3
85
+ ```
86
+
87
+ Four vertices means 64 graph inputs. Five vertices already exceed the
88
+ reference backend's practical memory budget. Solver status and residuals
89
+ must be checked: some boundary cases return `optimal_inaccurate`.
90
+ No claimed numerical result here is an exact feasibility certificate.
91
+
92
+ ## Documentation and runnable examples
93
+
94
+ - [Documentation index](https://github.com/stockfish-soup/query-complexity/blob/main/docs/README.md)
95
+ - [Installation and solvers](https://github.com/stockfish-soup/query-complexity/blob/main/docs/installation.md)
96
+ - [Example walkthroughs](https://github.com/stockfish-soup/query-complexity/blob/main/docs/examples.md)
97
+ - [Python API reference](https://github.com/stockfish-soup/query-complexity/blob/main/docs/api.md)
98
+ - [Query complexity and transducers](https://github.com/stockfish-soup/query-complexity/blob/main/docs/guides/query-complexity.md)
99
+ - [Intersection-free junta learning](https://github.com/stockfish-soup/query-complexity/blob/main/docs/guides/junta-learning.md)
100
+ - [Irrep-prefix hierarchy definition](https://github.com/stockfish-soup/query-complexity/blob/main/docs/guides/irrep-hierarchy.md)
101
+ - [Triangle scaling results and limits](https://github.com/stockfish-soup/query-complexity/blob/main/results/hierarchy/TRIANGLE_LEVEL2_SCALING.md)
102
+
103
+ Run the examples from a source checkout after an editable installation:
104
+
105
+ ```bash
106
+ python -m pip install -e '.[dev,experiments]'
107
+ python examples/example_or.py
108
+ python examples/general_function.py
109
+ python examples/majority_junta.py
110
+ python examples/symmetric_hierarchy.py
111
+ python examples/triangle_hierarchy.py --vertices 4
112
+ python -m pytest -q
113
+ ```
114
+
115
+ The wheel installs three import packages: `query_complexity`,
116
+ `junta_learning`, and `sdp_hierarchy`. Experiments, archives, notebooks and
117
+ Julia tools are kept in the repository and source distribution, outside
118
+ the runtime packages. See the documentation index for the repository map.
119
+
120
+ ## Julia solvers
121
+
122
+ Julia is a separate environment and is not installed by pip. From a source
123
+ checkout, use Julia 1.12.5 to reproduce the pinned dependencies:
124
+
125
+ ```bash
126
+ julia --project=julia -e 'using Pkg; Pkg.instantiate()'
127
+ julia --project=julia julia/test/runtests.jl
128
+ julia --project=julia julia/triangle/triangle_cb_degree_sdp.jl 3 2 0.3333333333333333 clarabel
129
+ ```
130
+
131
+ See [the Julia guide](https://github.com/stockfish-soup/query-complexity/blob/main/julia/triangle/README.md)
132
+ and [dependency provenance](https://github.com/stockfish-soup/query-complexity/blob/main/julia/PROVENANCE.md).
133
+
134
+ ## License
135
+
136
+ MIT. Vendored SDPLRPlus retains its upstream license in
137
+ `julia/vendor/SDPLRPlus/LICENSE`.
@@ -0,0 +1,57 @@
1
+ # Documentation
2
+
3
+ Start with [installation](installation.md), then [runnable examples](examples.md).
4
+
5
+ ## Choose an API
6
+
7
+ | Task | Import | Guide |
8
+ | --- | --- | --- |
9
+ | Boolean adversary SDPs, trace/rank tradeoffs, transducers | `import query_complexity as qc` | [Query-complexity guide](guides/query-complexity.md) |
10
+ | Hidden-support learning and logarithmic-cost majority witnesses | `from junta_learning import majority_sdp, rank_one` | [Junta guide](guides/junta-learning.md) |
11
+ | General finite permutation-action SDP hierarchies | `from sdp_hierarchy import Hierarchy` | [Hierarchy guide](guides/irrep-hierarchy.md) |
12
+ | Large selected triangle graph families using Julia | Julia environment | [Triangle guide](../julia/triangle/README.md) |
13
+
14
+ The [API reference](api.md) lists the supported entry points. The guides
15
+ state mathematical conventions, assumptions, and numerical limitations.
16
+
17
+ ## Repository organization
18
+
19
+ | Directory | Contents |
20
+ | --- | --- |
21
+ | `src/query_complexity/` | Boolean-query numerical implementation and stable public exports |
22
+ | `src/junta_learning/` | Count SDPs, rank-one formulas, mixed-size and multi-bias learning |
23
+ | `src/sdp_hierarchy/` | Group decomposition, generic SDP pipeline, example model builders |
24
+ | `examples/` | Small runnable introductions, using public APIs |
25
+ | `tests/` | Numerical and structural regression tests |
26
+ | `experiments/` | Longer research sweeps and artifact generation |
27
+ | `plots/` | Rendering of query/space measurements |
28
+ | `results/` | Archived measurements, statuses, provenance and scaling reports |
29
+ | `docs/guides/` | User and mathematical guides |
30
+ | `docs/junta/` | Majority proof sources and derivations |
31
+ | `julia/` | Separate pinned Julia project, triangle tools, vendored solver |
32
+ | `notebooks/` | Interactive research examples |
33
+
34
+ Python runtime packages contain no archived plots or solver transcripts.
35
+ The wheel is the Python runtime distribution. The source archive also
36
+ contains guides, examples, tests, experiments, recorded data and Julia
37
+ sources. Use a Git checkout for development; source archives have no Git
38
+ history. The Julia environment requires Julia and its own dependencies.
39
+
40
+ ## Reproduce results
41
+
42
+ After an editable installation, from the repository root:
43
+
44
+ ```bash
45
+ python experiments/experiment_majority_junta.py
46
+ python experiments/experiment_irrep_hierarchy.py
47
+ python experiments/experiment_triangle_hierarchy.py
48
+ python experiments/experiment_triangle_level2_scaling.py
49
+ ```
50
+
51
+ Experiments can overwrite their documented output files. The level-2
52
+ triangle scaling script records explicit resource-limit skips rather than
53
+ allocating infeasible graph domains. For plotting older query/space runs,
54
+ run from `results/query_space` as described in the query-complexity guide.
55
+
56
+ See [contributing](../CONTRIBUTING.md), [release procedure](releasing.md),
57
+ and [changes in 0.2.0](../CHANGELOG.md).
@@ -0,0 +1,70 @@
1
+ # Python API reference
2
+
3
+ All three packages are installed by the `query-complexity` distribution.
4
+ The functions' docstrings provide full signatures and keyword options.
5
+
6
+ ## `query_complexity`
7
+
8
+ | Entry point | Purpose |
9
+ | --- | --- |
10
+ | `analytic_or_solution(n)` | Analytic phase-normalized OR witness |
11
+ | `all_binary_inputs(n)` | Enumerate Boolean inputs |
12
+ | `OR_layers`, `AND_layers`, `EXACT_layers`, `THRESHOLD_layers`, `PARITY_layers` | Symmetric output profiles |
13
+ | `solve_adversary_sdp(inputs, outputs, ...)` | General Boolean adversary witness |
14
+ | `solve_symmetric_value(n, layer_values, ...)` | Symmetric adversary value SDP |
15
+ | `solve_symmetric_orbit_sdp(n, layer_values, ...)` | Compact symmetric witness blocks |
16
+ | `solve_symmetric_adversary_sdp(n, layer_values, ...)` | Expanded symmetric witness |
17
+ | `solve_trace_minimized_dual(...)` | Trace minimization under a relaxed cost cap |
18
+ | `solve_symmetric_trace_minimized_dual(...)` | Symmetric trace minimization |
19
+ | `solve_fixed_rank_dual_feasibility(...)` | Nonconvex fixed-rank search |
20
+ | `solve_symmetric_fixed_rank_dual_feasibility(...)` | Symmetric fixed-rank search |
21
+ | `symmetric_witness_rank(...)` | Recover witness rank from compact blocks |
22
+ | `build_adversary_transducer(solution, ...)` | Extract the input-independent unitary |
23
+ | `run_adversary_algorithm(transducer, x, K, ...)` | Simulate repeated transduction |
24
+ | `threshold_eta_blocks(n, k)` | Analytic threshold block factors |
25
+ | `qiskit_adversary_circuit(...)` | Optional dense Qiskit circuit export |
26
+
27
+ Results include dataclasses `AdversarySolution`, `OrbitSolution`,
28
+ `SdpValueResult`, `AdversaryTransducer` and feasibility-search results.
29
+ Core implementation is in `query_complexity.core`; public imports from
30
+ `query_complexity` are preserved.
31
+
32
+ ## `junta_learning`
33
+
34
+ Import submodules explicitly, for example `from junta_learning import rank_one`.
35
+
36
+ | Submodule / entry point | Purpose |
37
+ | --- | --- |
38
+ | `majority_sdp.solve(k)` | Return `(cost, count_psd_matrix, status)` for odd k |
39
+ | `majority_sdp.solve_cross_block(k)` | Equivalent nuclear-norm optimization |
40
+ | `rank_one.count_witness(k)` | Explicit period-four compact count factor |
41
+ | `rank_one.exact_cost(k)`, `exact_cost_squared(k)` | Explicit cost; squared value uses rational arithmetic |
42
+ | `rank_one.exhaustive_best(k)` | Finite half-set search, combinatorial in k |
43
+ | `bounded_size.solve(k, ...)` | Global PSD optimization across support-size layers |
44
+ | `multibias.solve_general_level0_cvxpy(...)` | Arbitrary symmetric profile and finite bias set |
45
+ | `multibias.solve_exact_primal_cvxpy(...)` | Specialized finite-bias EXACT SOCP |
46
+ | `multibias.exchange_exact_continuum(...)` | Numerical bias exchange, using a scanned continuum envelope |
47
+ | `witness_audit.construct_witness(k)` | Earlier dyadic-current construction |
48
+ | `witness_audit.explicit_dual_residual(k, n)` | Small original-SDP enumeration |
49
+
50
+ ## `sdp_hierarchy`
51
+
52
+ - `OracleProblem(answers, generators, targets=None)` defines an explicit
53
+ binary oracle table, group action and desired target equivalence.
54
+ - `Hierarchy(problem, max_order=10000, decomposer=..., sector_order=None)`
55
+ prepares query orbits and multiplicity PSD blocks.
56
+ - `Hierarchy.solve(level=0, solver="CLARABEL", dense=False,
57
+ intersection_free=False, validation_tol=1e-6)` solves a prefix or independent
58
+ reference formulation. An invalid level is rejected. Prefixes may be infeasible.
59
+ - `Hierarchy.block_summary()` reports sector labels, degrees and multiplicities.
60
+ - `symmetric_evaluation(n, profile)`, `symmetric_junta(n, k, profile)` and
61
+ `triangle_finding(n)` build example problems.
62
+
63
+ Solve results include `cost`, `status`, `solver`, `block_sizes`, and
64
+ `numerically_feasible`. When a witness exists, they also include reconstructed
65
+ `matrices`, equality residual, minimum eigenvalue, maximum load, support
66
+ leakage and covariance residual. Dense references report no support leakage.
67
+ The representation backend lives in `sdp_hierarchy.representation`.
68
+
69
+ See the guides for the mathematical definitions; a numerical status or
70
+ validation flag is not an exact certificate.
@@ -0,0 +1,67 @@
1
+ # Example walkthroughs
2
+
3
+ Install the package first. The snippets in the main README work from any
4
+ working directory. The following scripts are in the repository and source
5
+ archive; execute them from the repository root.
6
+
7
+ | Script | Use case | Expected result |
8
+ | --- | --- | --- |
9
+ | `python examples/example_or.py` | Analytic three-bit OR transducer | Objective sqrt(3)/2, private dimension 3, tiny mapping error |
10
+ | `python examples/example_threshold_blocks.py` | Analytic threshold factors | Schrijver block labels, factors and matrices |
11
+ | `python examples/general_function.py` | Nonsymmetric Boolean SDP | Finite phase objective and a transducer mapping residual |
12
+ | `python examples/majority_junta.py` | Explicit rank-one majority witness versus convex optimum | Costs approximately 5.155556 and 5.069052 |
13
+ | `python examples/symmetric_hierarchy.py` | Irrep prefixes on three-bit majority | Level 0 cost 3, next and dense-reference costs 2 |
14
+ | `python examples/triangle_hierarchy.py --vertices 4` | Triangle-finding level 2 | Approximately 3; status/residual validation reported |
15
+
16
+ All use analytic formulas or Clarabel/SCS; no MOSEK license is needed.
17
+ Roundoff and solver versions can slightly change numbers and statuses.
18
+
19
+ ## Select the right normalization
20
+
21
+ `query_complexity` reports phase-normalized `Adv/2`. The learning modules
22
+ and generic hierarchy report the unhalved filtered-adversary objective.
23
+ For example, analytic OR on three bits reports sqrt(3)/2 through the former
24
+ API, while evaluating OR through the generic hierarchy gives sqrt(3).
25
+
26
+ ## Export a majority witness
27
+
28
+ ```python
29
+ import numpy as np
30
+ from junta_learning.rank_one import count_witness
31
+
32
+ z = count_witness(7)
33
+ np.save("majority_count_factor.npy", z)
34
+ ```
35
+
36
+ This compact count-space factor defines rank-one PSD matrices for all
37
+ subset queries without enumerating the ambient universe. The
38
+ [junta guide](guides/junta-learning.md) gives the normalization and lift.
39
+ The theorem proves O(log k); the observed 4/pi asymptotic coefficient
40
+ remains numerical.
41
+
42
+ ## Define a different finite oracle problem
43
+
44
+ ```python
45
+ from sdp_hierarchy import OracleProblem, Hierarchy
46
+
47
+ problem = OracleProblem(
48
+ answers=[[0, 1], [1, 0]],
49
+ generators=[([1, 0], [1, 0])],
50
+ targets=[0, 1],
51
+ )
52
+ result = Hierarchy(problem).solve(0)
53
+ assert result["numerically_feasible"]
54
+ ```
55
+
56
+ Generators specify zero-based concept and query permutations. The pipeline
57
+ validates oracle covariance and target equivalence. Level 0 is the trivial
58
+ query-stabilizer sector; level r keeps r+1 present types. See the
59
+ [hierarchy guide](guides/irrep-hierarchy.md) for ordering and scale limits.
60
+
61
+ ## Larger experiments
62
+
63
+ The `experiments/` scripts generate measurements; the short `examples/`
64
+ scripts introduce APIs. Experiments document output locations and may
65
+ replace archived files. The earlier unrestricted OR value experiment
66
+ `experiment_or_symmetric_value.py` uses n=60 and a solver, so it is kept
67
+ with experiments rather than introductory examples.