qiskit-noise-learning 0.1.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 (242) hide show
  1. qiskit_noise_learning-0.1.0/.claude/agents/correctness-reviewer.md +121 -0
  2. qiskit_noise_learning-0.1.0/.claude/skills/tiered-review/SKILL.md +210 -0
  3. qiskit_noise_learning-0.1.0/.github/workflows/docs.yml +44 -0
  4. qiskit_noise_learning-0.1.0/.github/workflows/nightly.yml +62 -0
  5. qiskit_noise_learning-0.1.0/.github/workflows/release.yml +55 -0
  6. qiskit_noise_learning-0.1.0/.github/workflows/test_package.yaml +55 -0
  7. qiskit_noise_learning-0.1.0/.gitignore +177 -0
  8. qiskit_noise_learning-0.1.0/.pre-commit-config.yaml +24 -0
  9. qiskit_noise_learning-0.1.0/CITATION.bib +10 -0
  10. qiskit_noise_learning-0.1.0/CLAUDE.md +78 -0
  11. qiskit_noise_learning-0.1.0/CONTRIBUTING.md +150 -0
  12. qiskit_noise_learning-0.1.0/DEPRECATION.md +17 -0
  13. qiskit_noise_learning-0.1.0/LICENSE.txt +203 -0
  14. qiskit_noise_learning-0.1.0/PKG-INFO +114 -0
  15. qiskit_noise_learning-0.1.0/README.md +63 -0
  16. qiskit_noise_learning-0.1.0/docs/Makefile +17 -0
  17. qiskit_noise_learning-0.1.0/docs/_ext/auto_references.py +71 -0
  18. qiskit_noise_learning-0.1.0/docs/_ext/expand_math_macros.py +44 -0
  19. qiskit_noise_learning-0.1.0/docs/_ext/tex_macros.py +142 -0
  20. qiskit_noise_learning-0.1.0/docs/apidocs/analysis.rst +36 -0
  21. qiskit_noise_learning-0.1.0/docs/apidocs/circuit_generator.rst +16 -0
  22. qiskit_noise_learning-0.1.0/docs/apidocs/data.rst +19 -0
  23. qiskit_noise_learning-0.1.0/docs/apidocs/experiment_builder.rst +30 -0
  24. qiskit_noise_learning-0.1.0/docs/apidocs/gate_sets.rst +20 -0
  25. qiskit_noise_learning-0.1.0/docs/apidocs/index.rst +18 -0
  26. qiskit_noise_learning-0.1.0/docs/apidocs/math.rst +20 -0
  27. qiskit_noise_learning-0.1.0/docs/apidocs/models.rst +37 -0
  28. qiskit_noise_learning-0.1.0/docs/apidocs/protocols.rst +15 -0
  29. qiskit_noise_learning-0.1.0/docs/apidocs/sequences.rst +30 -0
  30. qiskit_noise_learning-0.1.0/docs/apidocs/visualizations.rst +16 -0
  31. qiskit_noise_learning-0.1.0/docs/conf.py +141 -0
  32. qiskit_noise_learning-0.1.0/docs/docutils.conf +2 -0
  33. qiskit_noise_learning-0.1.0/docs/guides/formalism.md +224 -0
  34. qiskit_noise_learning-0.1.0/docs/guides/index.md +9 -0
  35. qiskit_noise_learning-0.1.0/docs/guides/learning_protocol.md +178 -0
  36. qiskit_noise_learning-0.1.0/docs/guides/workflow.md +281 -0
  37. qiskit_noise_learning-0.1.0/docs/index.rst +64 -0
  38. qiskit_noise_learning-0.1.0/docs/install.rst +17 -0
  39. qiskit_noise_learning-0.1.0/docs/make.bat +35 -0
  40. qiskit_noise_learning-0.1.0/docs/refs.bib +83 -0
  41. qiskit_noise_learning-0.1.0/docs/release-notes.rst +1 -0
  42. qiskit_noise_learning-0.1.0/pyproject.toml +110 -0
  43. qiskit_noise_learning-0.1.0/qiskit_noise_learning/__init__.py +14 -0
  44. qiskit_noise_learning-0.1.0/qiskit_noise_learning/_version.py +24 -0
  45. qiskit_noise_learning-0.1.0/qiskit_noise_learning/analysis/__init__.py +23 -0
  46. qiskit_noise_learning-0.1.0/qiskit_noise_learning/analysis/analysis_pipeline.py +136 -0
  47. qiskit_noise_learning-0.1.0/qiskit_noise_learning/analysis/average_observables.py +163 -0
  48. qiskit_noise_learning-0.1.0/qiskit_noise_learning/analysis/compute_observables.py +309 -0
  49. qiskit_noise_learning-0.1.0/qiskit_noise_learning/analysis/curve_fit_observables.py +221 -0
  50. qiskit_noise_learning-0.1.0/qiskit_noise_learning/analysis/fit.py +332 -0
  51. qiskit_noise_learning-0.1.0/qiskit_noise_learning/analysis/flip_post_select.py +192 -0
  52. qiskit_noise_learning-0.1.0/qiskit_noise_learning/analysis/legacy.py +581 -0
  53. qiskit_noise_learning-0.1.0/qiskit_noise_learning/analysis/model_solve.py +686 -0
  54. qiskit_noise_learning-0.1.0/qiskit_noise_learning/analysis/symmetrize.py +164 -0
  55. qiskit_noise_learning-0.1.0/qiskit_noise_learning/analysis/utils.py +76 -0
  56. qiskit_noise_learning-0.1.0/qiskit_noise_learning/circuit_generator/__init__.py +15 -0
  57. qiskit_noise_learning-0.1.0/qiskit_noise_learning/circuit_generator/circuit_generator.py +62 -0
  58. qiskit_noise_learning-0.1.0/qiskit_noise_learning/circuit_generator/executor/__init__.py +16 -0
  59. qiskit_noise_learning-0.1.0/qiskit_noise_learning/circuit_generator/executor/data_mapper_serialization/__init__.py +67 -0
  60. qiskit_noise_learning-0.1.0/qiskit_noise_learning/circuit_generator/executor/data_mapper_serialization/arrays.py +119 -0
  61. qiskit_noise_learning-0.1.0/qiskit_noise_learning/circuit_generator/executor/data_mapper_serialization/payload.py +107 -0
  62. qiskit_noise_learning-0.1.0/qiskit_noise_learning/circuit_generator/executor/data_mapper_serialization/v1.py +927 -0
  63. qiskit_noise_learning-0.1.0/qiskit_noise_learning/circuit_generator/executor/executor_circuit_generator.py +466 -0
  64. qiskit_noise_learning-0.1.0/qiskit_noise_learning/circuit_generator/executor/executor_data_mapper.py +135 -0
  65. qiskit_noise_learning-0.1.0/qiskit_noise_learning/data/__init__.py +19 -0
  66. qiskit_noise_learning-0.1.0/qiskit_noise_learning/data/aggregated_observable_data.py +124 -0
  67. qiskit_noise_learning-0.1.0/qiskit_noise_learning/data/leveled_data.py +15 -0
  68. qiskit_noise_learning-0.1.0/qiskit_noise_learning/data/model_data.py +87 -0
  69. qiskit_noise_learning-0.1.0/qiskit_noise_learning/data/observable_data.py +123 -0
  70. qiskit_noise_learning-0.1.0/qiskit_noise_learning/data/raw_data.py +206 -0
  71. qiskit_noise_learning-0.1.0/qiskit_noise_learning/data/xarray_utils.py +104 -0
  72. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/__init__.py +31 -0
  73. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/experiment.py +359 -0
  74. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/experiment_builder_stage.py +139 -0
  75. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/__init__.py +31 -0
  76. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/bind_fragment_depths.py +72 -0
  77. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/complete_sequences.py +32 -0
  78. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/identify_relations.py +83 -0
  79. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/merge_instruction_sequences.py +93 -0
  80. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/path_generators/__init__.py +19 -0
  81. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/path_generators/add_paths.py +60 -0
  82. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/path_generators/depth1_paths.py +106 -0
  83. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/path_generators/even_depth_paths.py +142 -0
  84. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/path_generators/even_depth_vanilla_paths.py +117 -0
  85. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/path_generators/spam_paths.py +80 -0
  86. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/rank_reduce_paths.py +84 -0
  87. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/sequence_generators/__init__.py +17 -0
  88. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/sequence_generators/add_instruction_sequences.py +70 -0
  89. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/sequence_generators/generate_instruction_sequences.py +80 -0
  90. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/sequence_generators/vanilla_instruction_sequences.py +169 -0
  91. qiskit_noise_learning-0.1.0/qiskit_noise_learning/experiment_builder/stages/utils.py +66 -0
  92. qiskit_noise_learning-0.1.0/qiskit_noise_learning/gate_sets/__init__.py +20 -0
  93. qiskit_noise_learning-0.1.0/qiskit_noise_learning/gate_sets/gate.py +142 -0
  94. qiskit_noise_learning-0.1.0/qiskit_noise_learning/gate_sets/gate_set.py +191 -0
  95. qiskit_noise_learning-0.1.0/qiskit_noise_learning/gate_sets/model_gate.py +198 -0
  96. qiskit_noise_learning-0.1.0/qiskit_noise_learning/gate_sets/model_gate_set.py +57 -0
  97. qiskit_noise_learning-0.1.0/qiskit_noise_learning/gate_sets/qiskit_gate.py +332 -0
  98. qiskit_noise_learning-0.1.0/qiskit_noise_learning/gate_sets/qiskit_gate_set.py +408 -0
  99. qiskit_noise_learning-0.1.0/qiskit_noise_learning/math/__init__.py +18 -0
  100. qiskit_noise_learning-0.1.0/qiskit_noise_learning/math/indexed_matrix.py +403 -0
  101. qiskit_noise_learning-0.1.0/qiskit_noise_learning/math/indexed_space.py +59 -0
  102. qiskit_noise_learning-0.1.0/qiskit_noise_learning/math/indexed_vector.py +45 -0
  103. qiskit_noise_learning-0.1.0/qiskit_noise_learning/math/linear_map.py +168 -0
  104. qiskit_noise_learning-0.1.0/qiskit_noise_learning/models/__init__.py +34 -0
  105. qiskit_noise_learning-0.1.0/qiskit_noise_learning/models/identity_fidelity_model.py +62 -0
  106. qiskit_noise_learning-0.1.0/qiskit_noise_learning/models/log_fidelity_space.py +69 -0
  107. qiskit_noise_learning-0.1.0/qiskit_noise_learning/models/pauli_lindblad_model.py +842 -0
  108. qiskit_noise_learning-0.1.0/qiskit_noise_learning/models/utils.py +118 -0
  109. qiskit_noise_learning-0.1.0/qiskit_noise_learning/optionals.py +18 -0
  110. qiskit_noise_learning-0.1.0/qiskit_noise_learning/protocols/__init__.py +15 -0
  111. qiskit_noise_learning-0.1.0/qiskit_noise_learning/protocols/vanilla.py +463 -0
  112. qiskit_noise_learning-0.1.0/qiskit_noise_learning/sequences/__init__.py +21 -0
  113. qiskit_noise_learning-0.1.0/qiskit_noise_learning/sequences/apply_gate.py +75 -0
  114. qiskit_noise_learning-0.1.0/qiskit_noise_learning/sequences/base_sequence.py +168 -0
  115. qiskit_noise_learning-0.1.0/qiskit_noise_learning/sequences/fidelity_index.py +371 -0
  116. qiskit_noise_learning-0.1.0/qiskit_noise_learning/sequences/group_mergeable_instruction_sequences.py +335 -0
  117. qiskit_noise_learning-0.1.0/qiskit_noise_learning/sequences/instruction.py +77 -0
  118. qiskit_noise_learning-0.1.0/qiskit_noise_learning/sequences/instruction_sequence.py +200 -0
  119. qiskit_noise_learning-0.1.0/qiskit_noise_learning/sequences/log_path_map.py +98 -0
  120. qiskit_noise_learning-0.1.0/qiskit_noise_learning/sequences/partial_pauli_permutation.py +727 -0
  121. qiskit_noise_learning-0.1.0/qiskit_noise_learning/sequences/path.py +531 -0
  122. qiskit_noise_learning-0.1.0/qiskit_noise_learning/utils/__init__.py +11 -0
  123. qiskit_noise_learning-0.1.0/qiskit_noise_learning/utils/html_repr.py +147 -0
  124. qiskit_noise_learning-0.1.0/qiskit_noise_learning/visualizations/__init__.py +16 -0
  125. qiskit_noise_learning-0.1.0/qiskit_noise_learning/visualizations/_qubit_coordinates.py +225 -0
  126. qiskit_noise_learning-0.1.0/qiskit_noise_learning/visualizations/_static/qnl_interactive.js +529 -0
  127. qiskit_noise_learning-0.1.0/qiskit_noise_learning/visualizations/fidelity_math_labels.py +216 -0
  128. qiskit_noise_learning-0.1.0/qiskit_noise_learning/visualizations/gate_set_topology.py +432 -0
  129. qiskit_noise_learning-0.1.0/qiskit_noise_learning/visualizations/interactive_figure.py +501 -0
  130. qiskit_noise_learning-0.1.0/qiskit_noise_learning/visualizations/path_data/__init__.py +13 -0
  131. qiskit_noise_learning-0.1.0/qiskit_noise_learning/visualizations/path_data/data_adapters.py +150 -0
  132. qiskit_noise_learning-0.1.0/qiskit_noise_learning/visualizations/path_data/layers.py +356 -0
  133. qiskit_noise_learning-0.1.0/qiskit_noise_learning/visualizations/path_data/orchestrators.py +722 -0
  134. qiskit_noise_learning-0.1.0/qiskit_noise_learning/visualizations/path_data/primitives.py +248 -0
  135. qiskit_noise_learning-0.1.0/qiskit_noise_learning.egg-info/PKG-INFO +114 -0
  136. qiskit_noise_learning-0.1.0/qiskit_noise_learning.egg-info/SOURCES.txt +240 -0
  137. qiskit_noise_learning-0.1.0/qiskit_noise_learning.egg-info/dependency_links.txt +1 -0
  138. qiskit_noise_learning-0.1.0/qiskit_noise_learning.egg-info/requires.txt +34 -0
  139. qiskit_noise_learning-0.1.0/qiskit_noise_learning.egg-info/scm_file_list.json +236 -0
  140. qiskit_noise_learning-0.1.0/qiskit_noise_learning.egg-info/scm_version.json +8 -0
  141. qiskit_noise_learning-0.1.0/qiskit_noise_learning.egg-info/top_level.txt +1 -0
  142. qiskit_noise_learning-0.1.0/releasenotes/config.yaml +7 -0
  143. qiskit_noise_learning-0.1.0/releasenotes/notes/0.1/first-release-7bcc24e265c9b66a.yaml +4 -0
  144. qiskit_noise_learning-0.1.0/setup.cfg +4 -0
  145. qiskit_noise_learning-0.1.0/test/__init__.py +11 -0
  146. qiskit_noise_learning-0.1.0/test/conftest.py +251 -0
  147. qiskit_noise_learning-0.1.0/test/docs/__init__.py +11 -0
  148. qiskit_noise_learning-0.1.0/test/docs/test_apidocs_coverage.py +168 -0
  149. qiskit_noise_learning-0.1.0/test/docs/test_tex_macros.py +105 -0
  150. qiskit_noise_learning-0.1.0/test/integration/__init__.py +11 -0
  151. qiskit_noise_learning-0.1.0/test/integration/test_creg_ordering.py +77 -0
  152. qiskit_noise_learning-0.1.0/test/integration/test_learning_protocol_recovery.py +145 -0
  153. qiskit_noise_learning-0.1.0/test/integration/test_partial_width_gates.py +60 -0
  154. qiskit_noise_learning-0.1.0/test/unit/__init__.py +11 -0
  155. qiskit_noise_learning-0.1.0/test/unit/analysis/__init__.py +0 -0
  156. qiskit_noise_learning-0.1.0/test/unit/analysis/conftest.py +66 -0
  157. qiskit_noise_learning-0.1.0/test/unit/analysis/test_analysis_pipeline.py +281 -0
  158. qiskit_noise_learning-0.1.0/test/unit/analysis/test_average_observables.py +111 -0
  159. qiskit_noise_learning-0.1.0/test/unit/analysis/test_compute_observables.py +926 -0
  160. qiskit_noise_learning-0.1.0/test/unit/analysis/test_curve_fit_observables.py +178 -0
  161. qiskit_noise_learning-0.1.0/test/unit/analysis/test_fit.py +125 -0
  162. qiskit_noise_learning-0.1.0/test/unit/analysis/test_flip_post_select.py +623 -0
  163. qiskit_noise_learning-0.1.0/test/unit/analysis/test_integration.py +83 -0
  164. qiskit_noise_learning-0.1.0/test/unit/analysis/test_legacy.py +597 -0
  165. qiskit_noise_learning-0.1.0/test/unit/analysis/test_model_solve.py +918 -0
  166. qiskit_noise_learning-0.1.0/test/unit/analysis/test_symmetrize.py +284 -0
  167. qiskit_noise_learning-0.1.0/test/unit/analysis/test_utils.py +57 -0
  168. qiskit_noise_learning-0.1.0/test/unit/circuit_generator/__init__.py +11 -0
  169. qiskit_noise_learning-0.1.0/test/unit/circuit_generator/executor/__init__.py +11 -0
  170. qiskit_noise_learning-0.1.0/test/unit/circuit_generator/executor/data_mapper_serialization/__init__.py +22 -0
  171. qiskit_noise_learning-0.1.0/test/unit/circuit_generator/executor/data_mapper_serialization/conftest.py +291 -0
  172. qiskit_noise_learning-0.1.0/test/unit/circuit_generator/executor/data_mapper_serialization/test_current_version.py +110 -0
  173. qiskit_noise_learning-0.1.0/test/unit/circuit_generator/executor/data_mapper_serialization/test_payload.py +108 -0
  174. qiskit_noise_learning-0.1.0/test/unit/circuit_generator/executor/data_mapper_serialization/test_read_v1.py +479 -0
  175. qiskit_noise_learning-0.1.0/test/unit/circuit_generator/test_executor_circuit_generator.py +1149 -0
  176. qiskit_noise_learning-0.1.0/test/unit/data/__init__.py +11 -0
  177. qiskit_noise_learning-0.1.0/test/unit/data/test_aggregated_observable_data.py +34 -0
  178. qiskit_noise_learning-0.1.0/test/unit/data/test_model_data.py +30 -0
  179. qiskit_noise_learning-0.1.0/test/unit/data/test_observable_data.py +31 -0
  180. qiskit_noise_learning-0.1.0/test/unit/data/test_raw_data.py +40 -0
  181. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/__init__.py +11 -0
  182. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/conftest.py +40 -0
  183. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/stages/__init__.py +11 -0
  184. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/stages/path_generators/__init__.py +11 -0
  185. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/stages/path_generators/test_add_paths.py +38 -0
  186. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/stages/path_generators/test_depth1_paths.py +37 -0
  187. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/stages/path_generators/test_even_depth_paths.py +41 -0
  188. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/stages/path_generators/test_even_depth_vanilla_paths.py +37 -0
  189. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/stages/path_generators/test_spam_paths.py +88 -0
  190. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/stages/sequence_generators/__init__.py +11 -0
  191. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/stages/sequence_generators/test_add_instruction_sequences.py +33 -0
  192. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/stages/sequence_generators/test_generate_instruction_sequences.py +61 -0
  193. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/stages/sequence_generators/test_vanilla_instruction_sequences.py +169 -0
  194. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/stages/test_bind_fragment_depths.py +90 -0
  195. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/stages/test_complete_sequences.py +39 -0
  196. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/stages/test_identify_relations.py +127 -0
  197. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/stages/test_merge_instruction_sequences.py +223 -0
  198. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/stages/test_rank_reduce_paths.py +100 -0
  199. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/test_experiment.py +322 -0
  200. qiskit_noise_learning-0.1.0/test/unit/experiment_builder/test_experiment_builder_stage.py +176 -0
  201. qiskit_noise_learning-0.1.0/test/unit/gate_sets/__init__.py +11 -0
  202. qiskit_noise_learning-0.1.0/test/unit/gate_sets/test_model_gate.py +135 -0
  203. qiskit_noise_learning-0.1.0/test/unit/gate_sets/test_model_gate_set.py +78 -0
  204. qiskit_noise_learning-0.1.0/test/unit/gate_sets/test_qiskit_gate.py +364 -0
  205. qiskit_noise_learning-0.1.0/test/unit/gate_sets/test_qiskit_gate_set.py +365 -0
  206. qiskit_noise_learning-0.1.0/test/unit/math/__init__.py +11 -0
  207. qiskit_noise_learning-0.1.0/test/unit/math/test_indexed_matrix.py +750 -0
  208. qiskit_noise_learning-0.1.0/test/unit/math/test_indexed_space.py +53 -0
  209. qiskit_noise_learning-0.1.0/test/unit/math/test_indexed_vector.py +75 -0
  210. qiskit_noise_learning-0.1.0/test/unit/math/test_linear_map.py +158 -0
  211. qiskit_noise_learning-0.1.0/test/unit/models/__init__.py +11 -0
  212. qiskit_noise_learning-0.1.0/test/unit/models/test_identity_fidelity_model.py +39 -0
  213. qiskit_noise_learning-0.1.0/test/unit/models/test_log_fidelity_space.py +59 -0
  214. qiskit_noise_learning-0.1.0/test/unit/models/test_pauli_lindblad_model.py +1121 -0
  215. qiskit_noise_learning-0.1.0/test/unit/models/test_utils.py +181 -0
  216. qiskit_noise_learning-0.1.0/test/unit/protocols/__init__.py +12 -0
  217. qiskit_noise_learning-0.1.0/test/unit/protocols/test_prepare_vanilla_program.py +277 -0
  218. qiskit_noise_learning-0.1.0/test/unit/protocols/test_process_vanilla_result.py +233 -0
  219. qiskit_noise_learning-0.1.0/test/unit/protocols/test_vanilla_helpers.py +225 -0
  220. qiskit_noise_learning-0.1.0/test/unit/sequences/__init__.py +11 -0
  221. qiskit_noise_learning-0.1.0/test/unit/sequences/test_apply_gate.py +24 -0
  222. qiskit_noise_learning-0.1.0/test/unit/sequences/test_fidelity_index.py +379 -0
  223. qiskit_noise_learning-0.1.0/test/unit/sequences/test_group_mergeable_instruction_sequences.py +397 -0
  224. qiskit_noise_learning-0.1.0/test/unit/sequences/test_group_mergeable_regressions.py +563 -0
  225. qiskit_noise_learning-0.1.0/test/unit/sequences/test_instruction_sequence.py +471 -0
  226. qiskit_noise_learning-0.1.0/test/unit/sequences/test_log_path_map.py +95 -0
  227. qiskit_noise_learning-0.1.0/test/unit/sequences/test_partial_pauli_permutation.py +353 -0
  228. qiskit_noise_learning-0.1.0/test/unit/sequences/test_path.py +1211 -0
  229. qiskit_noise_learning-0.1.0/test/unit/utils/__init__.py +11 -0
  230. qiskit_noise_learning-0.1.0/test/unit/utils/test_html_repr.py +128 -0
  231. qiskit_noise_learning-0.1.0/test/unit/visualizations/__init__.py +11 -0
  232. qiskit_noise_learning-0.1.0/test/unit/visualizations/conftest.py +94 -0
  233. qiskit_noise_learning-0.1.0/test/unit/visualizations/path_data/__init__.py +11 -0
  234. qiskit_noise_learning-0.1.0/test/unit/visualizations/path_data/test_data_adapters.py +108 -0
  235. qiskit_noise_learning-0.1.0/test/unit/visualizations/path_data/test_layers.py +181 -0
  236. qiskit_noise_learning-0.1.0/test/unit/visualizations/path_data/test_orchestrators.py +442 -0
  237. qiskit_noise_learning-0.1.0/test/unit/visualizations/path_data/test_primitives.py +157 -0
  238. qiskit_noise_learning-0.1.0/test/unit/visualizations/test_fidelity_math_labels.py +252 -0
  239. qiskit_noise_learning-0.1.0/test/unit/visualizations/test_gate_set_topology.py +214 -0
  240. qiskit_noise_learning-0.1.0/test/unit/visualizations/test_interactive_figure.py +434 -0
  241. qiskit_noise_learning-0.1.0/test/unit/visualizations/test_qubit_coordinates.py +173 -0
  242. qiskit_noise_learning-0.1.0/tools/verify_headers.py +182 -0
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: correctness-reviewer
3
+ description: >-
4
+ Independent-context correctness review of a diff: bugs, logic errors, and test coverage of the
5
+ change itself. Invoked by the tiered-review skill's `correctness` tier (Tier 3) so the review is
6
+ performed by a reader who did not write the code and has not been told what it is supposed to do.
7
+ Not a general-purpose reviewer — it deliberately ignores design, architecture, and style, which
8
+ other tiers own. Give it a diff range and a depth; it reports findings and never edits files.
9
+ tools: Bash, Read, Grep, Glob
10
+ ---
11
+
12
+ You are reviewing a diff for **correctness only**. You are a cold reader: you did not write this
13
+ code and nobody has told you what it is meant to do. Build your own model of what it does from the
14
+ code as written, and report where the code diverges from it.
15
+
16
+ ## What you are given
17
+
18
+ A **diff range** (e.g. `main...HEAD`) and a **depth**. Nothing else is authoritative. Fetch the
19
+ change yourself:
20
+
21
+ ```bash
22
+ git diff --stat <range>
23
+ git diff <range>
24
+ git log <range> --oneline
25
+ ```
26
+
27
+ Read surrounding files with Read/Grep whenever the diff alone cannot tell you whether something is
28
+ correct — a function's callers, the class it subclasses, the test that covers it. `git blame` and
29
+ history on the modified lines are fair game and often decisive.
30
+
31
+ ## Reviewing cold
32
+
33
+ - **Derive intent from the code, not from a summary.** If your prompt describes what the change is
34
+ trying to accomplish, treat it as a claim to check, not as ground truth — code that plausibly
35
+ accomplishes a stated goal reads as correct.
36
+ - **Ignore auto-recalled memory.** If persistent memory, prior design notes, or "agreed directions"
37
+ are surfaced to you in `<system-reminder>` blocks, do not use them. The only permitted context is
38
+ the diff, the current tree, git history, and `CLAUDE.md`.
39
+ - Read the root `CLAUDE.md` for project conventions that bear on correctness (test layout, error
40
+ conventions, optional-dependency gating). Do not report style violations from it — that is
41
+ another tier's job.
42
+
43
+ ## Scope
44
+
45
+ **In scope:**
46
+
47
+ - Bugs and logic errors: wrong conditions, off-by-one, inverted comparisons, wrong variable,
48
+ mishandled empty/singleton collections, incorrect broadcasting or axis order, mutable default or
49
+ shared-state aliasing, silent precision loss.
50
+ - Contract violations: a function that no longer satisfies what its callers or docstring promise; a
51
+ subclass that breaks its base class's invariants; a changed return shape that a caller indexes.
52
+ - Numerical and physics correctness: basis-label mismatches, sign conventions, normalization,
53
+ fidelity/log-fidelity conversions, unvalidated qubit indices or Pauli labels.
54
+ - Error paths: exceptions that cannot be reached, guards that admit the case they mean to reject,
55
+ swallowed failures.
56
+ - **Test coverage of this change.** New or changed behavior, new branches, and edge cases must be
57
+ exercised. An untested new code path is a correctness gap, not a style nit — report it as a
58
+ finding and name the specific behavior that is unexercised. (Whether the *existing* tests follow
59
+ project conventions is out of scope.)
60
+
61
+ **Out of scope** — do not report these, even if you believe them:
62
+
63
+ - Design and architecture: whether the approach is right, whether an abstraction belongs here,
64
+ API shape, naming of public surfaces, placement of responsibility.
65
+ - Style, conventions, docstring formatting, nits.
66
+ - Anything `ruff` or pre-commit already fails CI on: formatting, line length, import order,
67
+ `Optional`/`Union` vs PEP 604, private-member access, copyright headers, trailing whitespace.
68
+ - Pre-existing issues on lines this diff did not touch. If a real bug is adjacent but untouched,
69
+ you may note it in a single closing line, outside the ranked list.
70
+
71
+ If you conclude the change's whole *approach* is wrong — a correctness review that keeps bottoming
72
+ out in "this cannot be made correct as structured" — say so in two sentences at the end rather than
73
+ dressing it up as a bug. It is more useful as a signal to re-run the architecture tier.
74
+
75
+ ## Confidence discipline
76
+
77
+ Every finding must come with a **concrete failure scenario**: specific inputs or state, and the
78
+ wrong output, exception, or corrupted value that results. If you cannot construct one, you have a
79
+ suspicion, not a finding — either verify it by reading more, or drop it.
80
+
81
+ Before reporting, try to refute each finding. Common false positives:
82
+
83
+ - A guard you missed elsewhere in the call chain already excludes the input.
84
+ - The "wrong" behavior is the intended behavior, evidenced by a test or docstring.
85
+ - The case cannot arise given the types or validation upstream.
86
+ - A pedantic edge case a senior engineer would not raise.
87
+
88
+ Prefer four findings you have verified to twelve you have not. Reporting nothing is a valid and
89
+ useful outcome — say so plainly rather than padding.
90
+
91
+ ## Depth
92
+
93
+ Your prompt specifies a depth. Scale how far you trace, not how much you speculate:
94
+
95
+ - **low** — the diff itself and its immediate callers.
96
+ - **medium** — plus the tests covering the touched code, and each modified function's call sites.
97
+ - **high** — plus git history/blame on the modified lines, the full call graph into and out of the
98
+ change, and a deliberate hunt for the edge cases the tests do not cover.
99
+ - **xhigh / max** — plus adversarial construction: for each changed function, actively try to build
100
+ an input that breaks it, and check the numerical/physics conventions against their definitions
101
+ elsewhere in the package.
102
+
103
+ ## Output
104
+
105
+ Your final message is the review. It is read by another Claude that will relay it to a user, so
106
+ return findings, not conversation. **Do not edit files** — you have no write tools; report only.
107
+
108
+ Produce a **ranked** list, most important first, ranked by impact on whether the code works:
109
+
110
+ ```
111
+ 1. <one-line summary> — `path/to/file.py:123`
112
+ Failure: <specific inputs/state → wrong output, exception, or corrupted value>
113
+ Why: <the mechanism, in one or two sentences>
114
+ Fix: <concrete change, or "unclear — needs a decision about X">
115
+ ```
116
+
117
+ Then, if applicable, a single **Coverage** section listing new or changed behavior that no test
118
+ exercises, and a single closing line for any adjacent-but-untouched issue.
119
+
120
+ If you found nothing, say: `No correctness findings.` followed by one line on what you checked and
121
+ how deeply, so the reader can judge whether the pass was thorough enough to trust.
@@ -0,0 +1,210 @@
1
+ ---
2
+ name: tiered-review
3
+ description: >-
4
+ Perform a tiered review of the current branch as a PR, analyzing changes against main.
5
+ Runs ONE review tier per invocation — design → architecture → correctness → polish —
6
+ each assuming the previous tiers are already settled. Invoke as
7
+ `/tiered-review <tier> [scope] [effort]` (e.g. `/tiered-review design`,
8
+ `/tiered-review correctness new-models high`).
9
+ disable-model-invocation: false
10
+ ---
11
+
12
+ # Tiered review
13
+
14
+ A review workflow proceeding in four tiers, one per invocation. Each tier is a fresh run (it
15
+ re-diffs the current tree), and each tier **assumes the tiers above it are already settled**
16
+ and refuses to drift downward.
17
+
18
+ ```
19
+ Tier 1 design — approach & intent (chat only)
20
+ Tier 2 architecture — structure & API (chat only)
21
+ Tier 3 correctness — bugs (delegated to a cold-context agent)
22
+ Tier 4 polish — conventions (inline, may offer --fix)
23
+ ```
24
+
25
+ The user controls the transitions between tiers: they invoke a tier, resolve what
26
+ it surfaces on their own time, then invoke the next tier. Do **not** run multiple
27
+ tiers in one invocation — do exactly the one requested and recommend the next.
28
+
29
+ ## What this package is
30
+
31
+ Toolkit for randomization-based quantum noise characterization within the Qiskit ecosystem:
32
+ building and running learning experiments, analyzing the data, and solving for model parameters.
33
+
34
+ Two public API tiers:
35
+ - **Low-level**: User composes core objects directly, useful for research applications.
36
+ - **High-level**: Preset configurations of low-level workflows accessible through the
37
+ `protocols` subpackage.
38
+
39
+ ## Arguments
40
+
41
+ `/tiered-review <tier> [scope] [effort]`
42
+
43
+ - **tier** (required): one of `design`, `architecture`, `correctness`, `polish`.
44
+ Accept obvious synonyms (`arch`→architecture, `bugs`→correctness,
45
+ `nits`/`style`→polish). If no tier is given, default to `design` and say so.
46
+ - **scope** (optional): a git ref or diff range. Default `main...HEAD` (merge-base
47
+ diff of the current branch against `main` — only what this branch changed). A
48
+ bare branch name `X` means `main...X`. Accept an explicit range verbatim.
49
+ - **effort** (optional): `low` | `medium` | `high` | `xhigh` | `max`. Default
50
+ `high`. Scales how deep you trace. On Tier 3 it is passed to the reviewing agent
51
+ as its depth; on the other tiers it scales your own tracing.
52
+
53
+ ## Step 0 — set up (every tier)
54
+
55
+ Do this first, regardless of tier:
56
+
57
+ 1. **Resolve scope.** Compute the diff range (default `main...HEAD`). Run
58
+ `git diff --stat <range>` and `git diff <range>` to get the change. If the diff
59
+ is empty, say so and stop. **On Tier 3, run `--stat` only** — do **not** run the
60
+ full `git diff <range>` until after the agent returns; reading the diff first imports
61
+ the bias the delegation removes.
62
+ 2. **Frame intent.** In 2–4 sentences, state what the change is *trying to
63
+ accomplish*, inferred from the diff, commit messages (`git log main..HEAD
64
+ --oneline`), and any touched docstrings. Every tier judges the change against
65
+ this intent.
66
+
67
+ **On Tier 3**, keep this brief, derive it from `--stat` and commit messages rather
68
+ than a close read, and state it for the user only — never pass it to the agent. Read
69
+ the diff closely only afterwards, to relay and judge the agent's findings.
70
+ 3. **Load context.** Read the root `CLAUDE.md`, then work through the section for the
71
+ requested tier under [Tier logic](#tier-logic) below.
72
+ 4. **Review cold.** Judge the diff on its own merits. Do not make assumptions based on other
73
+ branches or external context unless the diff, CLAUDE.md, or the user says so. In particular,
74
+ do **not** consult persistent/auto-recalled memory (prior design notes, "agreed directions",
75
+ branch history) — even the editorial framing of findings must not lean on it. If memory is
76
+ surfaced automatically, ignore it for this review. The only permitted context is the diff,
77
+ the current tree, git history, CLAUDE.md, and what the user says in-session.
78
+
79
+ ## The escalation contract
80
+
81
+ Each tier stays in its lane. This is what keeps the phases from collapsing into
82
+ one undifferentiated review:
83
+
84
+ - **A tier assumes every higher tier is settled.** `correctness` does not
85
+ relitigate the API shape; `polish` does not raise design concerns.
86
+ - **A tier refuses to drift downward.** If while doing `design` you notice a bug,
87
+ do **not** report it as a design finding — note in one line that lower tiers
88
+ exist for it and move on. The `design` tier explicitly does **not** flag bugs,
89
+ style, or nitpicks.
90
+ - If you believe a *higher* tier was mis-resolved (e.g. during `correctness` you
91
+ realize the whole approach is wrong), that IS worth raising — surface it briefly
92
+ and suggest re-running the higher tier, rather than reviewing downward on a
93
+ foundation you doubt.
94
+
95
+ ## Tier logic
96
+
97
+ For **all** tiers: produce a **ranked** list (most important first). Each finding
98
+ gets a one-line summary, a `file:line` anchor, a short rationale, and — where
99
+ useful — a concrete alternative or fix. Rank by impact on the change's goal, not
100
+ by how easy it is to describe. If a tier finds nothing, say so plainly.
101
+
102
+ ### Tier 1 — `design` (chat only)
103
+ Judge strategy and design choices harshly, but do not comment on code details.
104
+
105
+ - **Do the changes make conceptual sense?** Do they fit the package's design without adding
106
+ unnecessary complexity or duplicating existing abstractions? Is there a simpler approach?
107
+ - **Does it belong here?** Distinguish work that belongs upstream in Qiskit
108
+ (`quantum_info`, transpiler) or in `samplomatic` (twirling/injection) from work
109
+ that belongs in this package. Prefer reusing upstream primitives.
110
+
111
+ Report to chat. Do not edit files.
112
+
113
+ Anchors: `protocols/prepare_vanilla_program.py`, `models/fidelity_model.py`,
114
+ `gate_sets/gate_set.py`, `sequences/path.py`, `README`.
115
+
116
+ ### Tier 2 — `architecture` (chat only)
117
+ Concrete structure and public surface, **assuming design is settled**. Judge
118
+ structure, interfaces, and placement: ABC/Generic contracts, hashing correctness
119
+ for label/key objects, serialization convention, Qiskit-mirroring API shape,
120
+ placement of responsibility, naming of public surfaces, backward-compat. Report to
121
+ chat. Do not edit files.
122
+
123
+ ### Tier 3 — `correctness` (delegated to a cold-context agent)
124
+ Bugs, logic errors, and test coverage of the change itself — **assuming design and
125
+ architecture are settled**. The full mandate (scope in/out, cold-reading rules, depth
126
+ ladder, output format) lives in the `correctness-reviewer` agent and is the single
127
+ source of truth — do not restate or pre-empt it here. Your job is to delegate and relay:
128
+
129
+ ```
130
+ Agent(subagent_type: "correctness-reviewer", run_in_background: false,
131
+ prompt: "Diff range: <range>\nDepth: <effort>")
132
+ ```
133
+
134
+ 1. **Pass the range and depth, nothing else** — not the Step 0 intent summary, your
135
+ reading of the change, a focus-file list, or findings you suspect. Each one reimports
136
+ the bias the fresh context removes. The agent fetches the diff itself.
137
+ 2. **Wait for it** (`run_in_background: false`), and do not review the diff yourself
138
+ meanwhile — your model of the code is what is being checked.
139
+ 3. **Relay its ranked list**, preserving order and `file:line` anchors; the user never
140
+ sees the agent's report. Drop nothing. If you doubt a finding, keep it and say so.
141
+ 4. If the agent is unavailable or returns nothing usable, review inline following
142
+ the `correctness-reviewer` agent's mandate (read
143
+ `.claude/agents/correctness-reviewer.md` for scope, cold-reading rules, and depth),
144
+ but **say plainly that Tier 3 ran as a self-review**.
145
+
146
+ You may append a short **Additionally** section for anything a cold start could not
147
+ have seen; the agent's pass is the deliverable.
148
+
149
+ ### Tier 4 — `polish` (inline)
150
+ Conventions, nits, docs, and micro-cleanups, **assuming everything above is settled**
151
+ (CLAUDE.md rules made executable, plus de-facto conventions). Work through the
152
+ checklist below against the diff **inline, in this context** — do not delegate; walking
153
+ a finite checklist is what makes a fresh context unnecessary here. Present ranked
154
+ findings, then offer to apply them (`--fix`). No design, architecture, or bug findings —
155
+ those are other tiers.
156
+
157
+ Do **not** spend findings on anything `ruff` + pre-commit already enforce — they
158
+ fail CI on their own: copyright headers (`verify_headers.py`), formatting and
159
+ line-length, import order (isort), `Optional`/`Union` → PEP 604, private-member
160
+ access (SLF), and trailing-whitespace/EOF. The checklist below is deliberately the
161
+ *residue* those tools cannot catch.
162
+
163
+ - **Docstrings:** `__init__` args documented in the **class** docstring; classes/
164
+ functions referenced as prose or Sphinx cross-refs (`:class:`~.X``), not bare
165
+ backticks in Sphinx-rendered docstrings.
166
+ - **`from __future__ import annotations`:** CLAUDE.md says avoid it. There is legacy
167
+ drift (several `experiment_builder/` files) — new code must **not** add more; flag
168
+ it if introduced.
169
+ - **Errors:** prefer `ValueError` with an f-string naming the offending value/stage;
170
+ `TypeError` for wrong-type guards; `NotImplementedError` for unsupported physics;
171
+ `ImportError` via `optionals.py`. Validation centralized in `_validate_*` free
172
+ helpers.
173
+ - **Optional deps** gated through `optionals.py` (`HAS_CVXPY`, `HAS_MATPLOTLIB`):
174
+ `HAS_X.require_now("...")` then a local import inside the method; heavy/optional
175
+ imports behind `TYPE_CHECKING`.
176
+ - **Typing:** `Self`, `Generic`/`TypeVar` (`bound=Hashable` for label types),
177
+ `Literal` for enum-like options, `@overload` for dispatch.
178
+ - **Naming:** `PascalCase` classes; `snake_case` module named after its primary
179
+ class; `_leading_underscore` privates; `UPPER_SNAKE` constants; stage classes are
180
+ verb/noun phrases (`ComputeObservables`, `MergeInstructionSequences`).
181
+ - **Test-writing conventions** (`test/unit/`, mirrors the package tree) — *how* the
182
+ tests that exist are written, not *whether* the change is covered (that is Tier 3):
183
+ public-API imports only; `conftest.py` fixture hierarchy; `@pytest.mark.parametrize`;
184
+ `np.isclose`/`allclose` with explicit `atol`; test docstrings describe the
185
+ scenario/expected math.
186
+ - **Rich repr:** `_repr_html_` via `utils/html_repr.HTMLTable`; `draw()` returning the
187
+ figure wrapper the rest of `visualizations/` returns; concise `__repr__`.
188
+
189
+ ## Closing every run
190
+
191
+ End with a **next-tier recommendation**: name the next tier and the exact command
192
+ (e.g. "Design looks settled — when ready, run `/tiered-review architecture`").
193
+ If the current tier surfaced blocking concerns, recommend resolving them and
194
+ re-running the *current* tier rather than advancing.
195
+
196
+ ## Reference: subpackage roles
197
+
198
+ | Subpackage | Role |
199
+ |---|---|
200
+ | `gate_sets/` | Gate/GateSet abstractions; Bridge between qiskit instructions and this package. |
201
+ | `sequences/` | Domain primitives: representation of fidelities, sequences of fidelities, and sequences of instructions. |
202
+ | `math/` | Basis-labelled representations of linear algebra objects. |
203
+ | `models/` | Fidelity "models": specific linear mappings from arbitrary model parameters into log fidelity space. |
204
+ | `experiment_builder/` | Stage-based pipeline for building a description of an experiment: both sequences of instructions as well as what can be learned about a model from their data. |
205
+ | `circuit_generator/` | Management of internal experiment representation to job submission inputs, and job result data into internal data representations (another bridge between this package and qiskit). |
206
+ | `analysis/` | Stage-based data analysis tools, ultimately generating estimates of model parameters. |
207
+ | `data/` | Data containers the analysis tools act on. |
208
+ | `protocols/` | High-level interface providing curated configurations of the other subpackages. |
209
+ | `visualizations/` | Visualization tools. |
210
+ | `utils/` | Miscellaneous helpers that don't belong to a specific subpackage. |
@@ -0,0 +1,44 @@
1
+ name: Docs
2
+
3
+ on:
4
+ # Lets the docs be rebuilt against any ref on demand
5
+ workflow_dispatch:
6
+ push:
7
+ branches: [ "main" ]
8
+ tags: [ "[0-9]+.[0-9]+.[0-9]+*" ]
9
+ pull_request:
10
+ branches: [ "main" ]
11
+
12
+ jobs:
13
+ docs:
14
+
15
+ runs-on: ubuntu-latest
16
+ # Enlarge the loader's surplus static TLS so that qiskit-aer's bundled libgomp can be loaded
17
+ env:
18
+ GLIBC_TUNABLES: glibc.rtld.optional_static_tls=4096
19
+
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ with:
23
+ # reno derives the release notes from git history and tags, and fails on a shallow clone.
24
+ fetch-depth: 0
25
+ - name: Set up Python
26
+ uses: actions/setup-python@v5
27
+ with:
28
+ python-version: "3.15"
29
+ - name: Install dependencies
30
+ run: |
31
+ python -m pip install --upgrade pip
32
+ python -m pip install ".[docs]"
33
+ - name: Install qiskit-ibm-runtime main
34
+ # For Executor.run()'s conversion of a samplomatic QuantumProgram
35
+ # (qiskit-ibm-runtime#3403), unreleased as of 0.50.0. Remove once the floor is >=0.51.
36
+ run: python -m pip install --no-cache-dir "git+https://github.com/Qiskit/qiskit-ibm-runtime@main"
37
+ - name: Build docs
38
+ run: sphinx-build -b html -W docs docs/_build/html
39
+ - name: Upload docs artifact
40
+ uses: actions/upload-artifact@v4
41
+ with:
42
+ name: docs-html
43
+ path: docs/_build/html
44
+ if-no-files-found: error
@@ -0,0 +1,62 @@
1
+ name: Nightly Dev Tests
2
+
3
+ on:
4
+ schedule:
5
+ - cron: '0 1 * * *'
6
+
7
+ jobs:
8
+ tests:
9
+
10
+ runs-on: ubuntu-latest
11
+ # Enlarge the loader's surplus static TLS so that qiskit-aer's bundled libgomp can be loaded
12
+ env:
13
+ GLIBC_TUNABLES: glibc.rtld.optional_static_tls=4096
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ python-version: ["3.11"]
18
+ extras: ["dev,vis,cvxpy"]
19
+ include:
20
+ # cvxpy requires sparsediffpy<0.7.0, but 0.7.0 is the first release with a 3.15
21
+ # wheel, and building the 0.6.1 sdist needs a BLAS the runners do not have. Drop
22
+ # this entry, and the `extras` variable, once cvxpy's pin admits a 3.15 wheel.
23
+ - python-version: "3.15"
24
+ extras: "dev,vis"
25
+
26
+ steps:
27
+ - uses: actions/checkout@v4
28
+ with:
29
+ # Full history needed for copyright year verification in pre-commit
30
+ fetch-depth: 0
31
+ - name: Set up Python ${{ matrix.python-version }}
32
+ uses: actions/setup-python@v5
33
+ with:
34
+ python-version: ${{ matrix.python-version }}
35
+ - name: Install dependencies
36
+ run: |
37
+ python -m pip install --upgrade pip
38
+ python -m pip install ".[${{ matrix.extras }}]"
39
+ python -m pip install build extremal-python-dependencies==0.1.0
40
+ - name: Install qiskit-ibm-runtime main
41
+ # For Executor.run()'s conversion of a samplomatic QuantumProgram
42
+ # (qiskit-ibm-runtime#3403), unreleased as of 0.50.0. Remove once the floor is >=0.51.
43
+ run: python -m pip install --no-cache-dir "git+https://github.com/Qiskit/qiskit-ibm-runtime@main"
44
+ - name: Build Qiskit SDK development wheel
45
+ run: |
46
+ cd ..
47
+ git clone --filter=tree:0 https://github.com/Qiskit/qiskit
48
+ cd qiskit
49
+ git rev-parse HEAD
50
+ python -m build --wheel
51
+ - name: Pin development versions
52
+ shell: bash
53
+ run: >-
54
+ extremal-python-dependencies pin-dependencies --inplace
55
+ "qiskit @ file:$(echo qiskit/dist/*.whl)"
56
+ - name: Pre-commit checks (linting)
57
+ if: matrix.python-version == '3.15'
58
+ run: |
59
+ pre-commit run --all-files
60
+ - name: Test with pytest
61
+ run: |
62
+ python -m pytest
@@ -0,0 +1,55 @@
1
+ # This workflow will upload a Python Package to PyPI when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ name: Upload Python Package
5
+
6
+ on:
7
+ release:
8
+ types: [published]
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ release-build:
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: "3.x"
23
+
24
+ - name: Build release distributions
25
+ run: |
26
+ python -m pip install build
27
+ python -m build
28
+
29
+ - name: Upload distributions
30
+ uses: actions/upload-artifact@v4
31
+ with:
32
+ name: release-dists
33
+ path: dist/
34
+
35
+ pypi-publish:
36
+ runs-on: ubuntu-latest
37
+ needs:
38
+ - release-build
39
+ permissions:
40
+ # IMPORTANT: this permission is mandatory for trusted publishing
41
+ id-token: write
42
+
43
+ steps:
44
+ - name: Retrieve release distributions
45
+ uses: actions/download-artifact@v4
46
+ with:
47
+ name: release-dists
48
+ path: dist/
49
+
50
+ - name: Publish release distributions to PyPI
51
+ # This is an alternative to twine, it uses OIDC publishing utilizing PyPi's trusted publising implementation.
52
+ # With this we do not need API keys stored in the repository.
53
+ uses: pypa/gh-action-pypi-publish@release/v1
54
+ with:
55
+ packages-dir: dist/
@@ -0,0 +1,55 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ pull_request:
7
+ branches: [ "main" ]
8
+
9
+ jobs:
10
+ tests:
11
+
12
+ runs-on: ubuntu-latest
13
+ # Enlarge the loader's surplus static TLS so that qiskit-aer's bundled libgomp can be loaded
14
+ env:
15
+ GLIBC_TUNABLES: glibc.rtld.optional_static_tls=4096
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ python-version: ["3.11", "3.12", "3.13", "3.14"]
20
+ extras: ["dev,vis,cvxpy"]
21
+ include:
22
+ # cvxpy requires sparsediffpy<0.7.0, but 0.7.0 is the first release with a 3.15
23
+ # wheel, and building the 0.6.1 sdist needs a BLAS the runners do not have. Drop
24
+ # this entry, and the `extras` variable, once cvxpy's pin admits a 3.15 wheel.
25
+ - python-version: "3.15"
26
+ extras: "dev,vis"
27
+
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ with:
31
+ # reno derives the release notes from git history and tags, and fails on a shallow clone.
32
+ fetch-depth: 0
33
+ - name: Set up Python ${{ matrix.python-version }}
34
+ uses: actions/setup-python@v5
35
+ with:
36
+ python-version: ${{ matrix.python-version }}
37
+ - name: Install dependencies
38
+ run: |
39
+ python -m pip install --upgrade pip
40
+ python -m pip install ".[${{ matrix.extras }}]"
41
+ - name: Install qiskit-ibm-runtime main
42
+ # For Executor.run()'s conversion of a samplomatic QuantumProgram
43
+ # (qiskit-ibm-runtime#3403), unreleased as of 0.50.0. Remove once the floor is >=0.51.
44
+ run: python -m pip install --no-cache-dir "git+https://github.com/Qiskit/qiskit-ibm-runtime@main"
45
+ - name: Pre-commit checks (linting)
46
+ if: matrix.python-version == '3.12'
47
+ run: |
48
+ pre-commit run --all-files
49
+ - name: Check the release notes parse
50
+ if: matrix.python-version == '3.12'
51
+ run: |
52
+ reno lint
53
+ - name: Test with pytest
54
+ run: |
55
+ python -m pytest