squlearn 0.2.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. squlearn-0.3.0/.github/CODE_OF_CONDUCT.md +134 -0
  2. {squlearn-0.2.0 → squlearn-0.3.0}/.github/CONTRIBUTING.md +2 -0
  3. squlearn-0.3.0/.github/workflows/doc_checks.yml +18 -0
  4. {squlearn-0.2.0 → squlearn-0.3.0}/.github/workflows/format.yml +1 -0
  5. {squlearn-0.2.0 → squlearn-0.3.0}/.github/workflows/publish.yml +1 -1
  6. squlearn-0.3.0/.github/workflows/publish_docs.yml +37 -0
  7. {squlearn-0.2.0 → squlearn-0.3.0}/.gitignore +1 -0
  8. {squlearn-0.2.0 → squlearn-0.3.0}/PKG-INFO +26 -9
  9. squlearn-0.3.0/README.md +57 -0
  10. {squlearn-0.2.0 → squlearn-0.3.0}/docs/README.md +6 -1
  11. squlearn-0.3.0/docs/_static/util/executor.png +0 -0
  12. squlearn-0.3.0/docs/_templates/class.rst +6 -0
  13. {squlearn-0.2.0/docs/templates → squlearn-0.3.0/docs/_templates}/class_with_call.rst +2 -4
  14. squlearn-0.3.0/docs/_templates/function.rst +7 -0
  15. {squlearn-0.2.0 → squlearn-0.3.0}/docs/conf.py +47 -22
  16. squlearn-0.3.0/docs/examples/example_kernel_grid_search.nblink +3 -0
  17. squlearn-0.3.0/docs/examples/example_kernel_mnist.nblink +6 -0
  18. squlearn-0.3.0/docs/examples/examples_index.rst +11 -0
  19. {squlearn-0.2.0 → squlearn-0.3.0}/docs/index.rst +5 -13
  20. {squlearn-0.2.0/docs/tutorials → squlearn-0.3.0/docs/install}/install.rst +4 -4
  21. {squlearn-0.2.0 → squlearn-0.3.0}/docs/make.bat +10 -0
  22. {squlearn-0.2.0 → squlearn-0.3.0}/docs/modules/classes.rst +94 -19
  23. squlearn-0.3.0/docs/requirements.txt +9 -0
  24. squlearn-0.3.0/docs/spelling_wordlist.txt +55 -0
  25. squlearn-0.3.0/docs/user_guide/executor.rst +240 -0
  26. squlearn-0.3.0/docs/user_guide/feature_maps.rst +269 -0
  27. squlearn-0.3.0/docs/user_guide/kernel_methods.rst +306 -0
  28. squlearn-0.3.0/docs/user_guide/operators.rst +122 -0
  29. squlearn-0.3.0/docs/user_guide/user_guide_index.rst +12 -0
  30. {squlearn-0.2.0 → squlearn-0.3.0}/examples/executor/example_executor.ipynb +1 -1
  31. squlearn-0.3.0/examples/feature_maps/layered_feature_map.ipynb +146 -0
  32. squlearn-0.3.0/examples/feature_maps/pruning_example.ipynb +210 -0
  33. squlearn-0.3.0/examples/feature_maps/various_feature_maps.ipynb +293 -0
  34. squlearn-0.3.0/examples/kernel/example_fidelity_kernel.ipynb +151 -0
  35. {squlearn-0.2.0 → squlearn-0.3.0}/examples/kernel/example_projected_kernel.ipynb +3 -3
  36. squlearn-0.3.0/examples/kernel/example_regularization_mitigation.ipynb +447 -0
  37. squlearn-0.3.0/examples/kernel/qgpc_workflow.ipynb +161 -0
  38. squlearn-0.3.0/examples/kernel/qgpr_optimization_workflow.ipynb +198 -0
  39. squlearn-0.3.0/examples/kernel/qgpr_workflow.ipynb +219 -0
  40. squlearn-0.3.0/examples/tutorials/images/feature_map.png +0 -0
  41. squlearn-0.3.0/examples/tutorials/images/pipeline.png +0 -0
  42. squlearn-0.3.0/examples/tutorials/images/projected_quantum_kernel.png +0 -0
  43. squlearn-0.3.0/examples/tutorials/kernel_classification_mnist.ipynb +656 -0
  44. squlearn-0.3.0/examples/tutorials/kernel_grid_search.ipynb +509 -0
  45. {squlearn-0.2.0 → squlearn-0.3.0}/pyproject.toml +18 -1
  46. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/__init__.py +2 -2
  47. squlearn-0.3.0/src/squlearn/expectation_operator/expectation_operator_base.py +494 -0
  48. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/expectation_operator/expectation_operator_derivatives.py +182 -51
  49. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/expectation_operator/expectation_operator_implemented/custom_expectation_operator.py +34 -2
  50. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/expectation_operator/expectation_operator_implemented/ising_hamiltonian.py +46 -6
  51. squlearn-0.3.0/src/squlearn/expectation_operator/expectation_operator_implemented/single_pauli.py +104 -0
  52. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/expectation_operator/expectation_operator_implemented/single_probability.py +41 -7
  53. squlearn-0.3.0/src/squlearn/expectation_operator/expectation_operator_implemented/summed_paulis.py +135 -0
  54. squlearn-0.3.0/src/squlearn/expectation_operator/expectation_operator_implemented/summed_probabilities.py +128 -0
  55. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/feature_map/__init__.py +8 -2
  56. squlearn-0.3.0/src/squlearn/feature_map/feature_map_base.py +344 -0
  57. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/feature_map/feature_map_derivatives.py +216 -89
  58. squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/cheb_pqc.py +252 -0
  59. squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/cheb_rx.py +181 -0
  60. squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/chebyshev_tower.py +186 -0
  61. squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/highdim_feature_map.py +247 -0
  62. squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/hz_crxcrycrz.py +146 -0
  63. squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/param_z_feature_map.py +103 -0
  64. squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/qek_feature_map.py +168 -0
  65. squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/qiskit_feature_map.py +210 -0
  66. squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/qiskit_z_feature_map.py +101 -0
  67. squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/yz_cx_feature_map.py +112 -0
  68. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/feature_map/layered_feature_map.py +497 -140
  69. squlearn-0.3.0/src/squlearn/feature_map/pruned_feature_map.py +327 -0
  70. squlearn-0.3.0/src/squlearn/feature_map/transpiled_feature_map.py +202 -0
  71. squlearn-0.3.0/src/squlearn/kernel/__init__.py +17 -0
  72. squlearn-0.3.0/src/squlearn/kernel/matrix/fidelity_kernel.py +253 -0
  73. squlearn-0.3.0/src/squlearn/kernel/matrix/kernel_matrix_base.py +409 -0
  74. squlearn-0.3.0/src/squlearn/kernel/matrix/kernel_util.py +42 -0
  75. squlearn-0.3.0/src/squlearn/kernel/matrix/projected_quantum_kernel.py +656 -0
  76. squlearn-0.3.0/src/squlearn/kernel/matrix/regularization.py +70 -0
  77. squlearn-0.3.0/src/squlearn/kernel/ml/qgpc.py +147 -0
  78. squlearn-0.3.0/src/squlearn/kernel/ml/qgpr.py +252 -0
  79. squlearn-0.3.0/src/squlearn/kernel/ml/qkrr.py +192 -0
  80. squlearn-0.3.0/src/squlearn/kernel/ml/qsvc.py +156 -0
  81. squlearn-0.3.0/src/squlearn/kernel/ml/qsvr.py +155 -0
  82. squlearn-0.3.0/src/squlearn/kernel/optimization/kernel_loss_base.py +24 -0
  83. squlearn-0.3.0/src/squlearn/kernel/optimization/kernel_optimization_base.py +41 -0
  84. squlearn-0.3.0/src/squlearn/kernel/optimization/kernel_optimizer.py +95 -0
  85. squlearn-0.3.0/src/squlearn/kernel/optimization/negative_log_likelihood.py +79 -0
  86. squlearn-0.3.0/src/squlearn/kernel/optimization/target_alignment.py +78 -0
  87. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/optimizers/__init__.py +2 -1
  88. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/optimizers/adam.py +11 -1
  89. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/optimizers/approximated_gradients.py +3 -0
  90. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/optimizers/optimizer_base.py +11 -0
  91. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/optimizers/optimizers_wrapper.py +2 -2
  92. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/qnn/__init__.py +2 -1
  93. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/qnn/barren_plateau_analysis.py +1 -1
  94. squlearn-0.3.0/src/squlearn/qnn/base_qnn.py +203 -0
  95. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/qnn/loss.py +183 -13
  96. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/qnn/qnn.py +213 -131
  97. squlearn-0.3.0/src/squlearn/qnn/qnnc.py +239 -0
  98. squlearn-0.3.0/src/squlearn/qnn/qnnr.py +213 -0
  99. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/qnn/training.py +8 -7
  100. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/util/executor.py +190 -70
  101. squlearn-0.2.0/src/squlearn/util/quantum_fisher.py → squlearn-0.3.0/src/squlearn/util/qfi.py +84 -24
  102. squlearn-0.3.0/tests/kernel/ml/test_qkrr.py +156 -0
  103. squlearn-0.3.0/tests/kernel/ml/test_qsvc.py +175 -0
  104. squlearn-0.3.0/tests/kernel/ml/test_qsvr.py +176 -0
  105. squlearn-0.3.0/tests/qnn/test_base_qnn.py +149 -0
  106. squlearn-0.3.0/tests/qnn/test_qnnc.py +140 -0
  107. squlearn-0.3.0/tests/qnn/test_qnnr.py +144 -0
  108. {squlearn-0.2.0 → squlearn-0.3.0}/tests/qnn/test_training.py +13 -13
  109. squlearn-0.2.0/README.md +0 -45
  110. squlearn-0.2.0/docs/templates/class.rst +0 -8
  111. squlearn-0.2.0/docs/templates/function.rst +0 -9
  112. squlearn-0.2.0/docs/tutorials/operators.rst +0 -50
  113. squlearn-0.2.0/docs/tutorials/pqk.rst +0 -10
  114. squlearn-0.2.0/docs/tutorials/use_executor.rst +0 -10
  115. squlearn-0.2.0/examples/feature_maps/layered_feature_map.ipynb +0 -142
  116. squlearn-0.2.0/examples/feature_maps/pruning_example.ipynb +0 -262
  117. squlearn-0.2.0/examples/feature_maps/various_feature_maps.ipynb +0 -269
  118. squlearn-0.2.0/examples/kernel/example_fidelity_kernel.ipynb +0 -134
  119. squlearn-0.2.0/examples/kernel/example_regularization_mitigation.ipynb +0 -460
  120. squlearn-0.2.0/examples/kernel/qgpc_workflow.ipynb +0 -176
  121. squlearn-0.2.0/examples/kernel/qgpr_optimization_workflow.ipynb +0 -181
  122. squlearn-0.2.0/examples/kernel/qgpr_workflow.ipynb +0 -220
  123. squlearn-0.2.0/examples/tutorials/pipeline_example.ipynb +0 -123
  124. squlearn-0.2.0/examples/tutorials/qml_sklearn_interaction.ipynb +0 -188
  125. squlearn-0.2.0/src/squlearn/expectation_operator/expectation_operator_base.py +0 -209
  126. squlearn-0.2.0/src/squlearn/expectation_operator/expectation_operator_implemented/single_pauli.py +0 -69
  127. squlearn-0.2.0/src/squlearn/expectation_operator/expectation_operator_implemented/summed_paulis.py +0 -87
  128. squlearn-0.2.0/src/squlearn/expectation_operator/expectation_operator_implemented/summed_probabilities.py +0 -81
  129. squlearn-0.2.0/src/squlearn/feature_map/feature_map_base.py +0 -159
  130. squlearn-0.2.0/src/squlearn/feature_map/feature_map_implemented/cheb_pqc.py +0 -140
  131. squlearn-0.2.0/src/squlearn/feature_map/feature_map_implemented/cheb_rx.py +0 -82
  132. squlearn-0.2.0/src/squlearn/feature_map/feature_map_implemented/chebyshev_tower.py +0 -117
  133. squlearn-0.2.0/src/squlearn/feature_map/feature_map_implemented/highdim_feature_map.py +0 -189
  134. squlearn-0.2.0/src/squlearn/feature_map/feature_map_implemented/hz_crxcrycrz.py +0 -97
  135. squlearn-0.2.0/src/squlearn/feature_map/feature_map_implemented/qek_feature_map.py +0 -99
  136. squlearn-0.2.0/src/squlearn/feature_map/feature_map_implemented/qiskit_z_feature_map.py +0 -67
  137. squlearn-0.2.0/src/squlearn/feature_map/feature_map_implemented/yz_cx_feature_map.py +0 -90
  138. squlearn-0.2.0/src/squlearn/feature_map/feature_map_implemented/zfeaturemap_cx.py +0 -55
  139. squlearn-0.2.0/src/squlearn/feature_map/pruned_feature_map.py +0 -244
  140. squlearn-0.2.0/src/squlearn/feature_map/transpiled_feature_map.py +0 -131
  141. squlearn-0.2.0/src/squlearn/kernel/__init__.py +0 -3
  142. squlearn-0.2.0/src/squlearn/kernel/matrix/fidelity_kernel.py +0 -138
  143. squlearn-0.2.0/src/squlearn/kernel/matrix/kernel_matrix_base.py +0 -128
  144. squlearn-0.2.0/src/squlearn/kernel/matrix/projected_quantum_kernel.py +0 -382
  145. squlearn-0.2.0/src/squlearn/kernel/ml/kernel_util.py +0 -59
  146. squlearn-0.2.0/src/squlearn/kernel/ml/qgpc.py +0 -31
  147. squlearn-0.2.0/src/squlearn/kernel/ml/qgpr.py +0 -112
  148. squlearn-0.2.0/src/squlearn/kernel/ml/qkrr.py +0 -88
  149. squlearn-0.2.0/src/squlearn/kernel/ml/qsvc.py +0 -33
  150. squlearn-0.2.0/src/squlearn/kernel/ml/qsvr.py +0 -32
  151. squlearn-0.2.0/src/squlearn/kernel/optimization/kernel_loss_base.py +0 -9
  152. squlearn-0.2.0/src/squlearn/kernel/optimization/kernel_optimization_base.py +0 -19
  153. squlearn-0.2.0/src/squlearn/kernel/optimization/kernel_optimizer.py +0 -38
  154. squlearn-0.2.0/src/squlearn/kernel/optimization/negative_log_likelihood.py +0 -38
  155. squlearn-0.2.0/src/squlearn/kernel/optimization/target_alignment.py +0 -36
  156. squlearn-0.2.0/src/squlearn/qnn/base_qnn.py +0 -112
  157. squlearn-0.2.0/src/squlearn/qnn/qnnc.py +0 -185
  158. squlearn-0.2.0/src/squlearn/qnn/qnnr.py +0 -159
  159. {squlearn-0.2.0 → squlearn-0.3.0}/LICENSE.txt +0 -0
  160. {squlearn-0.2.0 → squlearn-0.3.0}/docs/Makefile +0 -0
  161. {squlearn-0.2.0 → squlearn-0.3.0}/examples/executor/.gitignore +0 -0
  162. {squlearn-0.2.0 → squlearn-0.3.0}/examples/qnn/classification_example.ipynb +0 -0
  163. {squlearn-0.2.0 → squlearn-0.3.0}/examples/qnn/example_adam.ipynb +0 -0
  164. {squlearn-0.2.0 → squlearn-0.3.0}/examples/qnn/example_minibatch.ipynb +0 -0
  165. {squlearn-0.2.0 → squlearn-0.3.0}/examples/qnn/example_shot_adjusting.ipynb +0 -0
  166. {squlearn-0.2.0 → squlearn-0.3.0}/examples/qnn/expectation_operator.ipynb +0 -0
  167. {squlearn-0.2.0 → squlearn-0.3.0}/examples/qnn/regression_example.ipynb +0 -0
  168. {squlearn-0.2.0 → squlearn-0.3.0}/examples/qnn/regression_example_layered_fm.ipynb +0 -0
  169. {squlearn-0.2.0 → squlearn-0.3.0}/examples/qnn/regression_with_variance.ipynb +0 -0
  170. {squlearn-0.2.0 → squlearn-0.3.0}/examples/tutorials/kernel_regression.ipynb +0 -0
  171. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/expectation_operator/__init__.py +0 -0
  172. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/expectation_operator/expectation_operator_implemented/__init__.py +0 -0
  173. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/feature_map/feature_map_implemented/__init__.py +0 -0
  174. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/kernel/matrix/__init__.py +0 -0
  175. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/kernel/ml/__init__.py +0 -0
  176. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/kernel/optimization/__init__.py +0 -0
  177. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/util/__init__.py +0 -0
  178. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/util/data_preprocessing.py +0 -0
  179. {squlearn-0.2.0 → squlearn-0.3.0}/src/squlearn/util/evaluate_opflow.py +0 -0
@@ -0,0 +1,134 @@
1
+
2
+ # Contributor Covenant Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We as members, contributors, and leaders pledge to make participation in our
7
+ community a harassment-free experience for everyone, regardless of age, body
8
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
9
+ identity and expression, level of experience, education, socio-economic status,
10
+ nationality, personal appearance, race, caste, color, religion, or sexual
11
+ identity and orientation.
12
+
13
+ We pledge to act and interact in ways that contribute to an open, welcoming,
14
+ diverse, inclusive, and healthy community.
15
+
16
+ ## Our Standards
17
+
18
+ Examples of behavior that contributes to a positive environment for our
19
+ community include:
20
+
21
+ * Demonstrating empathy and kindness toward other people
22
+ * Being respectful of differing opinions, viewpoints, and experiences
23
+ * Giving and gracefully accepting constructive feedback
24
+ * Accepting responsibility and apologizing to those affected by our mistakes,
25
+ and learning from the experience
26
+ * Focusing on what is best not just for us as individuals, but for the overall
27
+ community
28
+
29
+ Examples of unacceptable behavior include:
30
+
31
+ * The use of sexualized language or imagery, and sexual attention or advances of
32
+ any kind
33
+ * Trolling, insulting or derogatory comments, and personal or political attacks
34
+ * Public or private harassment
35
+ * Publishing others' private information, such as a physical or email address,
36
+ without their explicit permission
37
+ * Other conduct which could reasonably be considered inappropriate in a
38
+ professional setting
39
+
40
+ ## Enforcement Responsibilities
41
+
42
+ Community leaders are responsible for clarifying and enforcing our standards of
43
+ acceptable behavior and will take appropriate and fair corrective action in
44
+ response to any behavior that they deem inappropriate, threatening, offensive,
45
+ or harmful.
46
+
47
+ Community leaders have the right and responsibility to remove, edit, or reject
48
+ comments, commits, code, wiki edits, issues, and other contributions that are
49
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
50
+ decisions when appropriate.
51
+
52
+ ## Scope
53
+
54
+ This Code of Conduct applies within all community spaces, and also applies when
55
+ an individual is officially representing the community in public spaces.
56
+ Examples of representing our community include using an official e-mail address,
57
+ posting via an official social media account, or acting as an appointed
58
+ representative at an online or offline event.
59
+
60
+ ## Enforcement
61
+
62
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
63
+ reported to the community leaders responsible for enforcement at
64
+ [squlearn@gmail.com](mailto:squlearn@gmail.com).
65
+ All complaints will be reviewed and investigated promptly and fairly.
66
+
67
+ All community leaders are obligated to respect the privacy and security of the
68
+ reporter of any incident.
69
+
70
+ ## Enforcement Guidelines
71
+
72
+ Community leaders will follow these Community Impact Guidelines in determining
73
+ the consequences for any action they deem in violation of this Code of Conduct:
74
+
75
+ ### 1. Correction
76
+
77
+ **Community Impact**: Use of inappropriate language or other behavior deemed
78
+ unprofessional or unwelcome in the community.
79
+
80
+ **Consequence**: A private, written warning from community leaders, providing
81
+ clarity around the nature of the violation and an explanation of why the
82
+ behavior was inappropriate. A public apology may be requested.
83
+
84
+ ### 2. Warning
85
+
86
+ **Community Impact**: A violation through a single incident or series of
87
+ actions.
88
+
89
+ **Consequence**: A warning with consequences for continued behavior. No
90
+ interaction with the people involved, including unsolicited interaction with
91
+ those enforcing the Code of Conduct, for a specified period of time. This
92
+ includes avoiding interactions in community spaces as well as external channels
93
+ like social media. Violating these terms may lead to a temporary or permanent
94
+ ban.
95
+
96
+ ### 3. Temporary Ban
97
+
98
+ **Community Impact**: A serious violation of community standards, including
99
+ sustained inappropriate behavior.
100
+
101
+ **Consequence**: A temporary ban from any sort of interaction or public
102
+ communication with the community for a specified period of time. No public or
103
+ private interaction with the people involved, including unsolicited interaction
104
+ with those enforcing the Code of Conduct, is allowed during this period.
105
+ Violating these terms may lead to a permanent ban.
106
+
107
+ ### 4. Permanent Ban
108
+
109
+ **Community Impact**: Demonstrating a pattern of violation of community
110
+ standards, including sustained inappropriate behavior, harassment of an
111
+ individual, or aggression toward or disparagement of classes of individuals.
112
+
113
+ **Consequence**: A permanent ban from any sort of public interaction within the
114
+ community.
115
+
116
+ ## Attribution
117
+
118
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119
+ version 2.1, available at
120
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121
+
122
+ Community Impact Guidelines were inspired by
123
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124
+
125
+ For answers to common questions about this code of conduct, see the FAQ at
126
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127
+ [https://www.contributor-covenant.org/translations][translations].
128
+
129
+ [homepage]: https://www.contributor-covenant.org
130
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131
+ [Mozilla CoC]: https://github.com/mozilla/diversity
132
+ [FAQ]: https://www.contributor-covenant.org/faq
133
+ [translations]: https://www.contributor-covenant.org/translations
134
+
@@ -10,6 +10,8 @@ git checkout develop
10
10
  pip install -e .
11
11
  ```
12
12
 
13
+ > Note that editable installing as above might require an updated version of pip `pip install pip --upgrade`
14
+
13
15
  ## Devtools
14
16
  Install the recommended tools with
15
17
  ```bash
@@ -0,0 +1,18 @@
1
+ name: Documentation check
2
+ on:
3
+ - pull_request
4
+
5
+ jobs:
6
+ doc_checks:
7
+ runs-on: ubuntu-latest
8
+
9
+ steps:
10
+ - name: Cancel Workflow Action
11
+ uses: styfle/cancel-workflow-action@0.11.0
12
+
13
+ - uses: actions/checkout@v2
14
+ - uses: sQUlearn/sphinx-action@master
15
+ with:
16
+ docs-folder: "docs/"
17
+ pre-build-command: "pip3 install ."
18
+ build-command: "sphinx-build -b html . _build -W --keep-going"
@@ -23,4 +23,5 @@ jobs:
23
23
  - name: Run Black
24
24
  run: |
25
25
  black -l 99 src --check
26
+ black -l 99 tests --check
26
27
  black -l 99 --ipynb examples --check
@@ -27,4 +27,4 @@ jobs:
27
27
  run: flit build
28
28
 
29
29
  - name: Publish package distributions to PyPI
30
- uses: pypa/gh-action-pypi-publish@release/v1
30
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,37 @@
1
+ name: Publish to GH Pages
2
+ on:
3
+ release:
4
+ types: [published]
5
+
6
+ jobs:
7
+ publish-pages:
8
+ name: Publish to GH Pages
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - name: Checkout Source Code
12
+ uses: actions/checkout@v2
13
+ - name: Checkout GH Pages
14
+ uses: actions/checkout@v2
15
+ with:
16
+ repository: sQUlearn/squlearn.github.io
17
+ path: "docs/_build"
18
+ token: ${{ secrets.GITHUB_TOKEN }}
19
+ - name: Build Docs
20
+ uses: sQUlearn/sphinx-action@master
21
+ with:
22
+ docs-folder: "docs/"
23
+ pre-build-command: "pip3 install ."
24
+ build-command: "sphinx-build -b html . _build -W"
25
+ - name: Commit Files
26
+ run: |
27
+ cd docs/_build
28
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
29
+ git config --global user.name "github-actions[bot]"
30
+ git add .
31
+ git commit -m "update documentation ${{ github.event.release.tag_name }}"
32
+ git tag -a "${{ github.event.release.tag_name }}" -m "${{ github.event.release.name}}"
33
+ - name: Push Changes
34
+ uses: ad-m/github-push-action@master
35
+ with:
36
+ directory: docs/_build
37
+ repository: sQUlearn/squlearn.github.io
@@ -71,6 +71,7 @@ instance/
71
71
  # Sphinx documentation
72
72
  docs/_build/
73
73
  docs/modules/generated/*
74
+ docs/examples/images
74
75
 
75
76
  # PyBuilder
76
77
  .pybuilder/
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: squlearn
3
- Version: 0.2.0
4
- Summary: A library for quantum machine learning following the sklearn standard.
3
+ Version: 0.3.0
4
+ Summary: A library for quantum machine learning following the scikit-learnstandard.
5
5
  Keywords: quantum,machine learning,qml
6
6
  Author-email: David Kreplin <david.kreplin@ipa.fraunhofer.de>, Frederic Rapp <frederic.rapp@ipa.fraunhofer.de>, Marco Roth <marco.roth@ipa.fraunhofer.de>, Jan Schnabel <jan.schnabel@ipa.fraunhofer.de>, Moritz Willmann <moritz.willmann@ipa.fraunhofer.de>
7
7
  Maintainer-email: David Kreplin <david.kreplin@ipa.fraunhofer.de>, Moritz Willmann <moritz.willmann@ipa.fraunhofer.de>
@@ -14,15 +14,20 @@ Requires-Dist: numpy>=1.17
14
14
  Requires-Dist: scipy>=1.5
15
15
  Requires-Dist: scikit-learn>=1.0
16
16
  Requires-Dist: qiskit>=0.42.1
17
+ Requires-Dist: qiskit-aer>=0.12.0
17
18
  Requires-Dist: qiskit-machine-learning>=0.6.0
18
19
  Requires-Dist: qiskit-ibm-runtime>=0.9
19
20
  Requires-Dist: dill>=0.3
20
- Requires-Dist: pylint ; extra == "dev"
21
21
  Requires-Dist: black ; extra == "dev"
22
+ Requires-Dist: flit ; extra == "dev"
23
+ Requires-Dist: myst-parser ; extra == "dev"
24
+ Requires-Dist: nbsphinx ; extra == "dev"
25
+ Requires-Dist: nbsphinx_link ; extra == "dev"
26
+ Requires-Dist: pylint ; extra == "dev"
22
27
  Requires-Dist: pytest ; extra == "dev"
23
28
  Requires-Dist: sphinx ; extra == "dev"
29
+ Requires-Dist: sphinxcontrib-spelling ; extra == "dev"
24
30
  Requires-Dist: sphinx-rtd-theme ; extra == "dev"
25
- Requires-Dist: flit ; extra == "dev"
26
31
  Requires-Dist: jupyter ; extra == "examples"
27
32
  Requires-Dist: matplotlib>=3.5 ; extra == "examples"
28
33
  Requires-Dist: pylatexenc>=2.10 ; extra == "examples"
@@ -30,9 +35,21 @@ Project-URL: Homepage, https://github.com/sQUlearn/squlearn
30
35
  Provides-Extra: dev
31
36
  Provides-Extra: examples
32
37
 
33
- # sQUlearn 0.2.0
34
-
35
- **_Note:_** This is an early access version! Not everything that is described is already working 100%.
38
+ # sQUlearn 0.3.0
39
+
40
+ sQUlearn is a novel Python package introducing Quantum Machine Learning (QML) capabilities to
41
+ traditional machine learning pipelines via a *high-level / low-level* design approach. The package
42
+ features an array of algorithms including Quantum Support Vector Machines, Quantum Gaussian Processes,
43
+ Quantum Kernel Ridge Regression and Quantum Neural Networks (QNN), all designed to
44
+ seamlessly integrate with scikit-learn. The QNN engine facilitates efficient gradient computation and
45
+ automated training with non-linear parametrized circuits. Users can further customize their QNN
46
+ models, enhancing flexibility and potential outcomes. sQUlearn's kernel engines are designed to
47
+ meet various needs, with fidelity kernels and projected quantum kernels, the latter leveraging
48
+ the QNN engine for optimization. A feature map tool allows for efficient layer-wise design
49
+ based on strings, encouraging innovation beyond standard implementations. Lastly, backend integration
50
+ with IBM quantum computers is handled with a custom execution engine that optimizes session management
51
+ on quantum backends and simulators, ensuring optimal use
52
+ of quantum resources and creating an accessible environment for QML experimentation.
36
53
 
37
54
  ## Prerequisites
38
55
 
@@ -61,7 +78,7 @@ pip install .[examples]
61
78
  ```
62
79
 
63
80
  ## Contribution
64
- Thanks for considering to contribute to sQUlearn! Please read our [contribution guidelines](./.github/CONTRIBUTING.md) before you submit a pull request.
81
+ Thanks for considering to contribute to sQUlearn! Please read our [contribution guidelines](https://github.com/sQUlearn/squlearn/blob/main/.github/CONTRIBUTING.md) before you submit a pull request.
65
82
 
66
83
  ---
67
84
 
@@ -72,7 +89,7 @@ Thanks for considering to contribute to sQUlearn! Please read our [contribution
72
89
  ## Imprint
73
90
  This project is maintained by the quantum computing group at the Fraunhofer Institute for Manufacturing Engineering and Automation IPA. It started as a collection of implementations of quantum machine learning methods.
74
91
 
75
- http://www.ipa.fraunhofer.de/quantum
92
+ [http://www.ipa.fraunhofer.de/quantum](http://www.ipa.fraunhofer.de/quantum)
76
93
 
77
94
  ---
78
95
 
@@ -0,0 +1,57 @@
1
+ # sQUlearn 0.3.0
2
+
3
+ sQUlearn is a novel Python package introducing Quantum Machine Learning (QML) capabilities to
4
+ traditional machine learning pipelines via a *high-level / low-level* design approach. The package
5
+ features an array of algorithms including Quantum Support Vector Machines, Quantum Gaussian Processes,
6
+ Quantum Kernel Ridge Regression and Quantum Neural Networks (QNN), all designed to
7
+ seamlessly integrate with scikit-learn. The QNN engine facilitates efficient gradient computation and
8
+ automated training with non-linear parametrized circuits. Users can further customize their QNN
9
+ models, enhancing flexibility and potential outcomes. sQUlearn's kernel engines are designed to
10
+ meet various needs, with fidelity kernels and projected quantum kernels, the latter leveraging
11
+ the QNN engine for optimization. A feature map tool allows for efficient layer-wise design
12
+ based on strings, encouraging innovation beyond standard implementations. Lastly, backend integration
13
+ with IBM quantum computers is handled with a custom execution engine that optimizes session management
14
+ on quantum backends and simulators, ensuring optimal use
15
+ of quantum resources and creating an accessible environment for QML experimentation.
16
+
17
+ ## Prerequisites
18
+
19
+ The package requires **at least Python 3.9**.
20
+ ## Installation
21
+
22
+ ### Stable Release
23
+
24
+ To install the stable release version of sQUlearn, run the following command:
25
+ ```bash
26
+ pip install squlearn
27
+ ```
28
+
29
+ Alternatively, you can install sQUlearn directly from GitHub via
30
+ ```bash
31
+ pip install git+ssh://git@github.com:sQUlearn/squlearn.git
32
+ ```
33
+
34
+ ## Examples
35
+ There are several more elaborate examples available in the folder ``./examples`` which display the features of this package.
36
+ Tutorials for beginners can be found at ``./examples/tutorials``.
37
+
38
+ To install the required packages, run
39
+ ```bash
40
+ pip install .[examples]
41
+ ```
42
+
43
+ ## Contribution
44
+ Thanks for considering to contribute to sQUlearn! Please read our [contribution guidelines](https://github.com/sQUlearn/squlearn/blob/main/.github/CONTRIBUTING.md) before you submit a pull request.
45
+
46
+ ---
47
+
48
+ ## License
49
+
50
+ [Apache License 2.0](https://github.com/sQUlearn/squlearn/blob/main/LICENSE.txt)
51
+
52
+ ## Imprint
53
+ This project is maintained by the quantum computing group at the Fraunhofer Institute for Manufacturing Engineering and Automation IPA. It started as a collection of implementations of quantum machine learning methods.
54
+
55
+ [http://www.ipa.fraunhofer.de/quantum](http://www.ipa.fraunhofer.de/quantum)
56
+
57
+ ---
@@ -15,4 +15,9 @@ Or execute in the windows shell:
15
15
 
16
16
  ```bash
17
17
  make.bat html
18
- ```
18
+ ```
19
+
20
+ Spell checking with
21
+ ```bash
22
+ make.bat spelling
23
+ ```
@@ -0,0 +1,6 @@
1
+ :mod:`{{module}}`.\ :spelling:word:`{{objname}}`
2
+ {{ underline }}=================================
3
+
4
+ .. currentmodule:: {{ module }}
5
+
6
+ .. autoclass:: {{ objname }}
@@ -3,8 +3,8 @@
3
3
  is added before the :mod: directive. Otherwise, the rendering will show as a
4
4
  paragraph instead of a header.
5
5
 
6
- :mod:`{{module}}`.{{objname}}
7
- {{ underline }}===============
6
+ :mod:`{{module}}`.\ :spelling:word:`{{objname}}`
7
+ {{ underline }}=================================
8
8
 
9
9
  .. currentmodule:: {{ module }}
10
10
 
@@ -14,8 +14,6 @@
14
14
  .. automethod:: __call__
15
15
  {% endblock %}
16
16
 
17
- .. include:: {{module}}.{{objname}}.examples
18
-
19
17
  .. raw:: html
20
18
 
21
19
  <div class="clearer"></div>
@@ -0,0 +1,7 @@
1
+ :mod:`{{module}}`.\ :spelling:word:`{{objname}}`
2
+ {{ underline }}=================================
3
+
4
+ .. currentmodule:: {{ module }}
5
+
6
+ .. autofunction:: {{ objname }}
7
+
@@ -12,39 +12,61 @@
12
12
  #
13
13
  # import os
14
14
  # import sys
15
- # sys.path.insert(0, os.path.abspath('.'))
16
-
15
+ # sys.path.insert(0, os.path.abspath("."))
17
16
 
18
17
  # -- Project information -----------------------------------------------------
19
18
 
20
- project = 'sQUlearn'
21
- copyright = '2023, Fraunhofer IPA'
22
- author = 'Fraunhofer IPA'
19
+ project = "sQUlearn"
20
+ copyright = "2023, Fraunhofer IPA"
21
+ author = "Fraunhofer IPA"
23
22
 
24
23
  # The full version, including alpha/beta/rc tags
25
- release = '0.2.0'
26
-
24
+ release = "0.3.0"
27
25
 
28
26
  # -- General configuration ---------------------------------------------------
29
27
 
30
28
  # Add any Sphinx extension module names here, as strings. They can be
31
- # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
29
+ # extensions coming with Sphinx (named "sphinx.ext.*") or your custom
32
30
  # ones.
33
31
 
34
- extensions = [ "sphinx.ext.autodoc",
35
- "sphinx.ext.autosummary",
36
- "sphinx.ext.napoleon",
37
- ]
38
-
39
- autodoc_default_options = {"members": True, "inherited-members": True}
32
+ extensions = [
33
+ "sphinx.ext.autodoc",
34
+ "sphinx.ext.autosummary",
35
+ "sphinx.ext.napoleon",
36
+ "sphinxcontrib.spelling",
37
+ "matplotlib.sphinxext.plot_directive",
38
+ "myst_parser",
39
+ "nbsphinx",
40
+ "nbsphinx_link",
41
+ ]
42
+
43
+ source_suffix = {
44
+ ".rst": "restructuredtext",
45
+ ".md": "markdown",
46
+ }
47
+
48
+ autodoc_default_options = {
49
+ "members": True,
50
+ "inherited-members": True,
51
+ "member-order": "groupwise",
52
+ }
53
+ autodoc_mock_imports = ["sklearn"]
54
+
55
+ # Skip property members --> They should be defined in Attributes
56
+ def skip_property_member(app, what, name, obj, skip, options):
57
+ if isinstance(obj, property):
58
+ return True
59
+
60
+ def setup(app):
61
+ app.connect("autodoc-skip-member", skip_property_member)
40
62
 
41
63
  # Add any paths that contain templates here, relative to this directory.
42
- templates_path = ['_templates']
64
+ templates_path = ["_templates"]
43
65
 
44
66
  # List of patterns, relative to source directory, that match files and
45
67
  # directories to ignore when looking for source files.
46
68
  # This pattern also affects html_static_path and html_extra_path.
47
- exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
69
+ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "README.md", "**.ipynb_checkpoints"]
48
70
 
49
71
  # generate autosummary even if no references
50
72
  autosummary_generate = True
@@ -54,16 +76,19 @@ autosummary_generate = True
54
76
  # The theme to use for HTML and HTML Help pages. See the documentation for
55
77
  # a list of builtin themes.
56
78
  #
57
- html_theme = 'sphinx_rtd_theme'
79
+ html_theme = "sphinx_rtd_theme"
58
80
 
59
81
  # Add any paths that contain custom static files (such as style sheets) here,
60
82
  # relative to this directory. They are copied after the builtin static files,
61
83
  # so a file named "default.css" will overwrite the builtin "default.css".
62
- html_static_path = ['_static']
84
+ html_static_path = ["_static"]
63
85
 
64
- latex_engine = 'xelatex'
86
+ latex_engine = "xelatex"
65
87
  latex_elements = {
66
- 'preamble': r'''
88
+ "preamble": r"""
67
89
  \usepackage{braket}
68
- ''',
69
- }
90
+ """,
91
+ }
92
+
93
+ # Allow numbering for figures
94
+ numfig = True
@@ -0,0 +1,3 @@
1
+ {
2
+ "path": "../../examples/tutorials/kernel_grid_search.ipynb"
3
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "path": "../../examples/tutorials/kernel_classification_mnist.ipynb",
3
+ "extra-media": [
4
+ "../../examples/tutorials/images"
5
+ ]
6
+ }
@@ -0,0 +1,11 @@
1
+ .. _examples:
2
+
3
+ Examples
4
+ ========
5
+
6
+ .. toctree::
7
+ :maxdepth: 3
8
+ :glob:
9
+
10
+ example_kernel_mnist
11
+ example_kernel_grid_search
@@ -6,22 +6,14 @@
6
6
  Welcome to sQUlearn's documentation!
7
7
  ====================================
8
8
 
9
- Here comes some description of the sQUlearn package and the documentation.
9
+ .. include:: ../README.md
10
+ :parser: myst_parser.sphinx_
10
11
 
11
12
  .. toctree::
12
13
  :maxdepth: 2
13
14
  :caption: Contents:
14
15
 
15
- tutorials/install
16
+ install/install
17
+ user_guide/user_guide_index
16
18
  modules/classes
17
- tutorials/use_executor
18
- tutorials/pqk
19
- tutorials/operators
20
-
21
-
22
- Indices and tables
23
- ==================
24
- * :ref:`api_reference`
25
- * :ref:`genindex`
26
- * :ref:`modindex`
27
- * :ref:`search`
19
+ examples/examples_index
@@ -6,13 +6,14 @@ Installation
6
6
  Prerequisites
7
7
  -------------
8
8
 
9
- sQUlearn requires a recent python3 (>=3.8) installation.
9
+ sQUlearn requires a recent python3 (>=3.9) installation.
10
10
  Additionally the following python packages are necessary: ::
11
11
 
12
12
  numpy>=1.17
13
13
  scipy>=1.5
14
14
  scikit-learn>=1.0
15
15
  qiskit>=0.42.1
16
+ qiskit-aer>=0.12.0
16
17
  qiskit-machine-learning>=0.6.0
17
18
  qiskit-ibm-runtime>=0.9
18
19
  dill>=0.3
@@ -42,9 +43,8 @@ To install the latest master version:
42
43
  Development version
43
44
  -------------------
44
45
 
45
- To contribute to sQUlearn with full access to code and running tests install the package from the source code:
46
+ To install the latest development version:
46
47
 
47
48
  .. code-block:: bash
48
49
 
49
- git clone https://github.com/sQUlearn/squlearn.git && cd squlearn
50
- pip install -e .
50
+ pip install git+https://github.com/sQUlearn/squlearn.git@develop
@@ -8,6 +8,7 @@ if "%SPHINXBUILD%" == "" (
8
8
  set SPHINXBUILD=sphinx-build
9
9
  )
10
10
  set SOURCEDIR=.
11
+ set MODDIR=.\modules\generated
11
12
  set BUILDDIR=_build
12
13
 
13
14
  %SPHINXBUILD% >NUL 2>NUL
@@ -24,12 +25,21 @@ if errorlevel 9009 (
24
25
  )
25
26
 
26
27
  if "%1" == "" goto help
28
+ if "%1" == "clean" goto clean
27
29
 
28
30
  %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29
31
  goto end
30
32
 
31
33
  :help
32
34
  %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
35
+ goto end
36
+
37
+ :clean
38
+ %SPHINXBUILD% -M clean %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
39
+ if exist %MODDIR% (
40
+ echo Removing %MODDIR%
41
+ @RD /S /Q %MODDIR%
42
+ )
33
43
 
34
44
  :end
35
45
  popd