squlearn 0.7.2__tar.gz → 0.7.3__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 (161) hide show
  1. {squlearn-0.7.2 → squlearn-0.7.3}/CITATION.cff +3 -0
  2. {squlearn-0.7.2 → squlearn-0.7.3}/PKG-INFO +3 -3
  3. {squlearn-0.7.2 → squlearn-0.7.3}/README.md +1 -1
  4. {squlearn-0.7.2 → squlearn-0.7.3}/pyproject.toml +3 -2
  5. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/__init__.py +1 -1
  6. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/layered_encoding_circuit.py +31 -14
  7. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/qnn/loss.py +1 -1
  8. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/qnn/qnnc.py +9 -4
  9. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/util/data_preprocessing.py +4 -4
  10. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/util/executor.py +15 -10
  11. {squlearn-0.7.2 → squlearn-0.7.3}/.github/CODE_OF_CONDUCT.md +0 -0
  12. {squlearn-0.7.2 → squlearn-0.7.3}/.github/CONTRIBUTING.md +0 -0
  13. {squlearn-0.7.2 → squlearn-0.7.3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  14. {squlearn-0.7.2 → squlearn-0.7.3}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  15. {squlearn-0.7.2 → squlearn-0.7.3}/.github/workflows/doc_checks.yml +0 -0
  16. {squlearn-0.7.2 → squlearn-0.7.3}/.github/workflows/format.yml +0 -0
  17. {squlearn-0.7.2 → squlearn-0.7.3}/.github/workflows/publish.yml +0 -0
  18. {squlearn-0.7.2 → squlearn-0.7.3}/.github/workflows/publish_docs.yml +0 -0
  19. {squlearn-0.7.2 → squlearn-0.7.3}/.github/workflows/tests.yaml +0 -0
  20. {squlearn-0.7.2 → squlearn-0.7.3}/.gitignore +0 -0
  21. {squlearn-0.7.2 → squlearn-0.7.3}/LICENSE.txt +0 -0
  22. {squlearn-0.7.2 → squlearn-0.7.3}/docs/Makefile +0 -0
  23. {squlearn-0.7.2 → squlearn-0.7.3}/docs/README.md +0 -0
  24. {squlearn-0.7.2 → squlearn-0.7.3}/docs/_static/css/custom.css +0 -0
  25. {squlearn-0.7.2 → squlearn-0.7.3}/docs/_static/favicon.png +0 -0
  26. {squlearn-0.7.2 → squlearn-0.7.3}/docs/_static/logo.png +0 -0
  27. {squlearn-0.7.2 → squlearn-0.7.3}/docs/_static/qnn/qnn.svg +0 -0
  28. {squlearn-0.7.2 → squlearn-0.7.3}/docs/_static/schematic.png +0 -0
  29. {squlearn-0.7.2 → squlearn-0.7.3}/docs/_static/util/executor.png +0 -0
  30. {squlearn-0.7.2 → squlearn-0.7.3}/docs/_templates/class.rst +0 -0
  31. {squlearn-0.7.2 → squlearn-0.7.3}/docs/_templates/class_with_call.rst +0 -0
  32. {squlearn-0.7.2 → squlearn-0.7.3}/docs/_templates/function.rst +0 -0
  33. {squlearn-0.7.2 → squlearn-0.7.3}/docs/conf.py +0 -0
  34. {squlearn-0.7.2 → squlearn-0.7.3}/docs/examples/example_kernel_digit_classification.nblink +0 -0
  35. {squlearn-0.7.2 → squlearn-0.7.3}/docs/examples/example_kernel_grid_search.nblink +0 -0
  36. {squlearn-0.7.2 → squlearn-0.7.3}/docs/examples/example_qnn_backend_mitigation.nblink +0 -0
  37. {squlearn-0.7.2 → squlearn-0.7.3}/docs/examples/example_quantum_bayesian_optimization.nblink +0 -0
  38. {squlearn-0.7.2 → squlearn-0.7.3}/docs/examples/examples_index.rst +0 -0
  39. {squlearn-0.7.2 → squlearn-0.7.3}/docs/index.rst +0 -0
  40. {squlearn-0.7.2 → squlearn-0.7.3}/docs/install/install.rst +0 -0
  41. {squlearn-0.7.2 → squlearn-0.7.3}/docs/make.bat +0 -0
  42. {squlearn-0.7.2 → squlearn-0.7.3}/docs/modules/classes.rst +0 -0
  43. {squlearn-0.7.2 → squlearn-0.7.3}/docs/qiskit_settings.conf +0 -0
  44. {squlearn-0.7.2 → squlearn-0.7.3}/docs/requirements.txt +0 -0
  45. {squlearn-0.7.2 → squlearn-0.7.3}/docs/spelling_wordlist.txt +0 -0
  46. {squlearn-0.7.2 → squlearn-0.7.3}/docs/user_guide/encoding_circuits.rst +0 -0
  47. {squlearn-0.7.2 → squlearn-0.7.3}/docs/user_guide/executor.rst +0 -0
  48. {squlearn-0.7.2 → squlearn-0.7.3}/docs/user_guide/kernel_methods.rst +0 -0
  49. {squlearn-0.7.2 → squlearn-0.7.3}/docs/user_guide/observables.rst +0 -0
  50. {squlearn-0.7.2 → squlearn-0.7.3}/docs/user_guide/quantum_neural_networks.rst +0 -0
  51. {squlearn-0.7.2 → squlearn-0.7.3}/docs/user_guide/user_guide_index.rst +0 -0
  52. {squlearn-0.7.2 → squlearn-0.7.3}/examples/encoding_circuits/layered_encoding_circuit.ipynb +0 -0
  53. {squlearn-0.7.2 → squlearn-0.7.3}/examples/encoding_circuits/pruning_example.ipynb +0 -0
  54. {squlearn-0.7.2 → squlearn-0.7.3}/examples/encoding_circuits/various_encoding_circuit.ipynb +0 -0
  55. {squlearn-0.7.2 → squlearn-0.7.3}/examples/executor/example_executor_qiskit.ipynb +0 -0
  56. {squlearn-0.7.2 → squlearn-0.7.3}/examples/integration/mlflow.ipynb +0 -0
  57. {squlearn-0.7.2 → squlearn-0.7.3}/examples/kernel/example_fidelity_kernel.ipynb +0 -0
  58. {squlearn-0.7.2 → squlearn-0.7.3}/examples/kernel/example_projected_kernel.ipynb +0 -0
  59. {squlearn-0.7.2 → squlearn-0.7.3}/examples/kernel/example_regularization_mitigation.ipynb +0 -0
  60. {squlearn-0.7.2 → squlearn-0.7.3}/examples/kernel/qgpc_workflow.ipynb +0 -0
  61. {squlearn-0.7.2 → squlearn-0.7.3}/examples/kernel/qgpr_optimization_workflow.ipynb +0 -0
  62. {squlearn-0.7.2 → squlearn-0.7.3}/examples/kernel/qgpr_workflow.ipynb +0 -0
  63. {squlearn-0.7.2 → squlearn-0.7.3}/examples/qnn/classification_example.ipynb +0 -0
  64. {squlearn-0.7.2 → squlearn-0.7.3}/examples/qnn/example_adam.ipynb +0 -0
  65. {squlearn-0.7.2 → squlearn-0.7.3}/examples/qnn/example_minibatch.ipynb +0 -0
  66. {squlearn-0.7.2 → squlearn-0.7.3}/examples/qnn/example_qcnn_encoding_circuit.ipynb +0 -0
  67. {squlearn-0.7.2 → squlearn-0.7.3}/examples/qnn/regression_example.ipynb +0 -0
  68. {squlearn-0.7.2 → squlearn-0.7.3}/examples/qnn/regression_with_variance.ipynb +0 -0
  69. {squlearn-0.7.2 → squlearn-0.7.3}/examples/tutorials/images/encoding_circuit.png +0 -0
  70. {squlearn-0.7.2 → squlearn-0.7.3}/examples/tutorials/images/pipeline.png +0 -0
  71. {squlearn-0.7.2 → squlearn-0.7.3}/examples/tutorials/images/projected_quantum_kernel.png +0 -0
  72. {squlearn-0.7.2 → squlearn-0.7.3}/examples/tutorials/images/quantum_bo.png +0 -0
  73. {squlearn-0.7.2 → squlearn-0.7.3}/examples/tutorials/kernel_digit_classification.ipynb +0 -0
  74. {squlearn-0.7.2 → squlearn-0.7.3}/examples/tutorials/kernel_grid_search.ipynb +0 -0
  75. {squlearn-0.7.2 → squlearn-0.7.3}/examples/tutorials/kernel_regression.ipynb +0 -0
  76. {squlearn-0.7.2 → squlearn-0.7.3}/examples/tutorials/qnn_backend_mitigation.ipynb +0 -0
  77. {squlearn-0.7.2 → squlearn-0.7.3}/examples/tutorials/quantum_bayesian_optimization.ipynb +0 -0
  78. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/__init__.py +0 -0
  79. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/circuit_library/__init__.py +0 -0
  80. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/circuit_library/chebyshev_pqc.py +0 -0
  81. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/circuit_library/chebyshev_rx.py +0 -0
  82. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/circuit_library/chebyshev_tower.py +0 -0
  83. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/circuit_library/highdim_encoding_circuit.py +0 -0
  84. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/circuit_library/hubregtsen_encoding_circuit.py +0 -0
  85. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/circuit_library/multi_control_encoding_circuit.py +0 -0
  86. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/circuit_library/param_z_feature_map.py +0 -0
  87. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/circuit_library/qcnn_encoding_circuit.py +0 -0
  88. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/circuit_library/qiskit_encoding_circuit.py +0 -0
  89. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/circuit_library/yz_cx_encoding_circuit.py +0 -0
  90. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/encoding_circuit_base.py +0 -0
  91. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/encoding_circuit_derivatives.py +0 -0
  92. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/pruned_encoding_circuit.py +0 -0
  93. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/encoding_circuit/transpiled_encoding_circuit.py +0 -0
  94. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/__init__.py +0 -0
  95. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/matrix/__init__.py +0 -0
  96. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/matrix/fidelity_kernel.py +0 -0
  97. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/matrix/fidelity_kernel_pennylane.py +0 -0
  98. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/matrix/kernel_matrix_base.py +0 -0
  99. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/matrix/kernel_util.py +0 -0
  100. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/matrix/projected_quantum_kernel.py +0 -0
  101. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/matrix/regularization.py +0 -0
  102. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/ml/__init__.py +0 -0
  103. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/ml/qgpc.py +0 -0
  104. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/ml/qgpr.py +0 -0
  105. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/ml/qkrr.py +0 -0
  106. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/ml/qsvc.py +0 -0
  107. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/ml/qsvr.py +0 -0
  108. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/optimization/__init__.py +0 -0
  109. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/optimization/kernel_loss_base.py +0 -0
  110. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/optimization/kernel_optimization_base.py +0 -0
  111. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/optimization/kernel_optimizer.py +0 -0
  112. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/optimization/negative_log_likelihood.py +0 -0
  113. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/kernel/optimization/target_alignment.py +0 -0
  114. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/observables/__init__.py +0 -0
  115. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/observables/observable_base.py +0 -0
  116. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/observables/observable_derivatives.py +0 -0
  117. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/observables/observable_implemented/__init__.py +0 -0
  118. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/observables/observable_implemented/custom_observable.py +0 -0
  119. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/observables/observable_implemented/ising_hamiltonian.py +0 -0
  120. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/observables/observable_implemented/single_pauli.py +0 -0
  121. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/observables/observable_implemented/single_probability.py +0 -0
  122. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/observables/observable_implemented/summed_paulis.py +0 -0
  123. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/observables/observable_implemented/summed_probabilities.py +0 -0
  124. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/optimizers/__init__.py +0 -0
  125. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/optimizers/adam.py +0 -0
  126. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/optimizers/approximated_gradients.py +0 -0
  127. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/optimizers/optimizer_base.py +0 -0
  128. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/optimizers/optimizers_wrapper.py +0 -0
  129. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/optimizers/sglbo.py +0 -0
  130. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/qnn/__init__.py +0 -0
  131. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/qnn/barren_plateau_analysis.py +0 -0
  132. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/qnn/base_qnn.py +0 -0
  133. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/qnn/lowlevel_qnn.py +0 -0
  134. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/qnn/lowlevel_qnn_base.py +0 -0
  135. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/qnn/lowlevel_qnn_pennylane.py +0 -0
  136. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/qnn/lowlevel_qnn_qiskit.py +0 -0
  137. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/qnn/qnnr.py +0 -0
  138. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/qnn/training.py +0 -0
  139. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/util/__init__.py +0 -0
  140. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/util/optree/__init__.py +0 -0
  141. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/util/optree/optree.py +0 -0
  142. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/util/optree/optree_derivative.py +0 -0
  143. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/util/optree/optree_evaluate.py +0 -0
  144. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/util/pennylane/__init__.py +0 -0
  145. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/util/pennylane/pennylane_circuit.py +0 -0
  146. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/util/pennylane/pennylane_gates.py +0 -0
  147. {squlearn-0.7.2 → squlearn-0.7.3}/src/squlearn/util/qfi.py +0 -0
  148. {squlearn-0.7.2 → squlearn-0.7.3}/tests/encoding_circuit/test_layered_encoding_circuit.py +0 -0
  149. {squlearn-0.7.2 → squlearn-0.7.3}/tests/kernel/ml/test_qgpc.py +0 -0
  150. {squlearn-0.7.2 → squlearn-0.7.3}/tests/kernel/ml/test_qgpr.py +0 -0
  151. {squlearn-0.7.2 → squlearn-0.7.3}/tests/kernel/ml/test_qkrr.py +0 -0
  152. {squlearn-0.7.2 → squlearn-0.7.3}/tests/kernel/ml/test_qsvc.py +0 -0
  153. {squlearn-0.7.2 → squlearn-0.7.3}/tests/kernel/ml/test_qsvr.py +0 -0
  154. {squlearn-0.7.2 → squlearn-0.7.3}/tests/optimizers/test_sglbo.py +0 -0
  155. {squlearn-0.7.2 → squlearn-0.7.3}/tests/qnn/test_base_qnn.py +0 -0
  156. {squlearn-0.7.2 → squlearn-0.7.3}/tests/qnn/test_qnnc.py +0 -0
  157. {squlearn-0.7.2 → squlearn-0.7.3}/tests/qnn/test_qnnr.py +0 -0
  158. {squlearn-0.7.2 → squlearn-0.7.3}/tests/qnn/test_training.py +0 -0
  159. {squlearn-0.7.2 → squlearn-0.7.3}/tests/util/optree/test_optree_derivative.py +0 -0
  160. {squlearn-0.7.2 → squlearn-0.7.3}/tests/util/optree/test_optree_evaluate.py +0 -0
  161. {squlearn-0.7.2 → squlearn-0.7.3}/tests/util/test_executor.py +0 -0
@@ -27,6 +27,9 @@ preferred-citation:
27
27
  given-names: Frederic
28
28
  orcid: https://orcid.org/0009-0008-6240-8390
29
29
  affiliation: Fraunhofer Institute for Manufacturing Engineering and Automation IPA
30
+ - family-names: Hagelüken
31
+ given-names: Manuel
32
+ affilliation: Fraunhofer Institute for Manufacturing Engineering and Automation IPA
30
33
  - family-names: Roth
31
34
  given-names: Marco
32
35
  orcid: https://orcid.org/0000-0002-1276-5655
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: squlearn
3
- Version: 0.7.2
3
+ Version: 0.7.3
4
4
  Summary: A library for quantum machine learning following the scikit-learnstandard.
5
5
  Keywords: quantum,machine learning,qml
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>
6
+ Author-email: David Kreplin <david.kreplin@ipa.fraunhofer.de>, Moritz Willmann <moritz.willmann@ipa.fraunhofer.de>, Jan Schnabel <jan.schnabel@ipa.fraunhofer.de>, Frederic Rapp <frederic.rapp@ipa.fraunhofer.de>, Manuel Hagelüken <manuel.hagelueken@ipa.fraunhofer.de>, Marco Roth <marco.roth@ipa.fraunhofer.de>
7
7
  Maintainer-email: David Kreplin <david.kreplin@ipa.fraunhofer.de>, Moritz Willmann <moritz.willmann@ipa.fraunhofer.de>
8
8
  Requires-Python: >=3.9
9
9
  Description-Content-Type: text/markdown
@@ -97,7 +97,7 @@ sQUlearn is released under the [Apache License 2.0](https://github.com/sQUlearn/
97
97
  ## Cite sQUlearn
98
98
  If you use sQUlearn in your work, please cite our paper:
99
99
 
100
- > Kreplin, D. A., Willmann, M., Schnabel, J., Rapp, F., & Roth, M. (2023). sQUlearn - A Python Library for Quantum Machine Learning. [https://doi.org/10.48550/arXiv.2311.08990](https://doi.org/10.48550/arXiv.2311.08990)
100
+ > Kreplin, D. A., Willmann, M., Schnabel, J., Rapp, F., Hagelüken, M., & Roth, M. (2023). sQUlearn - A Python Library for Quantum Machine Learning. [https://doi.org/10.48550/arXiv.2311.08990](https://doi.org/10.48550/arXiv.2311.08990)
101
101
 
102
102
  ## Contact
103
103
  This project is maintained by the quantum computing group at the Fraunhofer Institute for Manufacturing Engineering and Automation IPA.
@@ -49,7 +49,7 @@ sQUlearn is released under the [Apache License 2.0](https://github.com/sQUlearn/
49
49
  ## Cite sQUlearn
50
50
  If you use sQUlearn in your work, please cite our paper:
51
51
 
52
- > Kreplin, D. A., Willmann, M., Schnabel, J., Rapp, F., & Roth, M. (2023). sQUlearn - A Python Library for Quantum Machine Learning. [https://doi.org/10.48550/arXiv.2311.08990](https://doi.org/10.48550/arXiv.2311.08990)
52
+ > Kreplin, D. A., Willmann, M., Schnabel, J., Rapp, F., Hagelüken, M., & Roth, M. (2023). sQUlearn - A Python Library for Quantum Machine Learning. [https://doi.org/10.48550/arXiv.2311.08990](https://doi.org/10.48550/arXiv.2311.08990)
53
53
 
54
54
  ## Contact
55
55
  This project is maintained by the quantum computing group at the Fraunhofer Institute for Manufacturing Engineering and Automation IPA.
@@ -7,10 +7,11 @@ name = "squlearn"
7
7
  readme = "README.md"
8
8
  authors = [
9
9
  {name = "David Kreplin", email = "david.kreplin@ipa.fraunhofer.de"},
10
+ {name = "Moritz Willmann", email = "moritz.willmann@ipa.fraunhofer.de"},
11
+ {name = "Jan Schnabel", email = "jan.schnabel@ipa.fraunhofer.de"},
10
12
  {name = "Frederic Rapp", email = "frederic.rapp@ipa.fraunhofer.de"},
13
+ {name = "Manuel Hagelüken", email = "manuel.hagelueken@ipa.fraunhofer.de"},
11
14
  {name = "Marco Roth", email = "marco.roth@ipa.fraunhofer.de"},
12
- {name = "Jan Schnabel", email = "jan.schnabel@ipa.fraunhofer.de"},
13
- {name = "Moritz Willmann", email = "moritz.willmann@ipa.fraunhofer.de"},
14
15
  ]
15
16
  maintainers = [
16
17
  {name = "David Kreplin", email = "david.kreplin@ipa.fraunhofer.de"},
@@ -3,7 +3,7 @@
3
3
  from .util import Executor
4
4
  from . import observables, encoding_circuit, kernel, optimizers, qnn, util
5
5
 
6
- __version__ = "0.7.2"
6
+ __version__ = "0.7.3"
7
7
 
8
8
  __all__ = [
9
9
  "Executor",
@@ -1,14 +1,15 @@
1
+ import numpy as np
2
+ from typing import Union, Callable
3
+ import copy
4
+
5
+ import sympy as sp
6
+
1
7
  from qiskit import QuantumCircuit
2
8
  from qiskit.circuit import ParameterVector
3
9
  from qiskit.circuit.library import RXGate, RYGate, RZGate, PhaseGate, UGate
4
10
  from qiskit.circuit.library import CPhaseGate, CHGate, CXGate, CYGate, CZGate
5
11
  from qiskit.circuit.library import SwapGate, CRXGate, CRYGate, CRZGate, RXXGate
6
12
  from qiskit.circuit.library import RYYGate, RZXGate, RZZGate, CUGate
7
- from typing import Union, Callable
8
- import copy
9
-
10
- # is needed for making encoding circuits with numpy functions using strings:
11
- import numpy as np
12
13
 
13
14
  from .encoding_circuit_base import EncodingCircuitBase
14
15
 
@@ -1268,15 +1269,31 @@ class LayeredPQC:
1268
1269
  """initializes a encoding circuit through a given string of gates"""
1269
1270
 
1270
1271
  def generate_function(map_string, args):
1271
- """Translates a string into a function"""
1272
- function_string = """\
1273
- def math_function({var}):
1274
- return {func}
1275
- """.format(
1276
- func=map_string, var=args
1277
- )
1278
- exec(function_string, globals())
1279
- return math_function # pylint: disable=undefined-variable
1272
+ """Function for creating a callable function from a string
1273
+
1274
+ Args:
1275
+ map_string (str): The string representation of the function
1276
+ args (str): The string representation of the arguments of the function
1277
+
1278
+ Returns:
1279
+ callable_function (function): The function that can be called with the arguments
1280
+ """
1281
+ # Split the argument string into individual variable names
1282
+ arg_names = args.split(",")
1283
+
1284
+ # Remove "np." prefix
1285
+ map_string = map_string.replace("np.", "")
1286
+
1287
+ # Create symbols for each variable
1288
+ symbols = [sp.Symbol(arg) for arg in arg_names]
1289
+
1290
+ # Parse the map_string into a SymPy expression
1291
+ expr = sp.sympify(map_string, evaluate=False)
1292
+
1293
+ # Create the function
1294
+ callable_function = sp.lambdify(symbols, expr, modules=np)
1295
+
1296
+ return callable_function
1280
1297
 
1281
1298
  def get_closing_bracket_index(word, index):
1282
1299
  """gives to an open round bracket '(' the location of the closing bracket. This works especially, if there are more than one open brackets."""
@@ -450,7 +450,7 @@ class SquaredLoss(LossBase):
450
450
  and ground_truth as
451
451
 
452
452
  .. math::
453
- \sum_j \sum_i w_i \left(f\left(x_i\right)-f_ref\left(x_i\right)\right) \frac{\partial f(x_i)}{\partial p_j}
453
+ 2\sum_j \sum_i w_i \left(f\left(x_i\right)-f_ref\left(x_i\right)\right) \frac{\partial f(x_i)}{\partial p_j}
454
454
 
455
455
  Args:
456
456
  value_dict (dict): Contains calculated values of the model
@@ -138,6 +138,7 @@ class QNNClassifier(BaseQNN, ClassifierMixin):
138
138
  **kwargs,
139
139
  )
140
140
  self._label_binarizer = None
141
+ self.classes_ = None
141
142
 
142
143
  def predict(self, X: np.ndarray) -> np.ndarray:
143
144
  """Predict using the QNN.
@@ -189,13 +190,17 @@ class QNNClassifier(BaseQNN, ClassifierMixin):
189
190
  """
190
191
  if not self._is_fitted:
191
192
  self._label_binarizer = LabelBinarizer()
192
- self._label_binarizer.fit(y)
193
-
194
- if len(y.shape) == 1:
195
- y = self._label_binarizer.transform(y).ravel()
193
+ y = self._label_binarizer.fit_transform(y)
194
+ self.classes_ = self._label_binarizer.classes_
196
195
  else:
197
196
  y = self._label_binarizer.transform(y)
198
197
 
198
+ if isinstance(self.operator, list) and len(self.operator) == 2 and y.shape[1] == 1:
199
+ y = np.hstack([1 - y, y])
200
+
201
+ if y.shape[1] == 1:
202
+ y = self._label_binarizer.transform(y).ravel()
203
+
199
204
  loss = self.loss
200
205
  if self.variance is not None:
201
206
  loss = loss + VarianceLoss(alpha=self.variance)
@@ -53,12 +53,12 @@ def _adjust_input(
53
53
  error = False
54
54
  shape = np.shape(x)
55
55
 
56
- if sum(shape) == 0 and x_length > 0:
57
- # Empty array although x_length not zero
58
- error = True
59
- elif shape == () and x_length == 1:
56
+ if shape == () and x_length == 1:
60
57
  # Single floating point number
61
58
  xx = np.array([[x]])
59
+ elif sum(shape) == 0 and x_length > 0:
60
+ # Empty array although x_length not zero
61
+ error = True
62
62
  elif len(shape) == 1:
63
63
  if x_length == 1:
64
64
  xx = np.array([np.array([xx]) for xx in x])
@@ -554,7 +554,7 @@ class Executor:
554
554
  if self._caching:
555
555
 
556
556
  # Generate hash value for caching
557
- hash_value = self._cache.hash_variable(
557
+ hash_value_adjusted = self._cache.hash_variable(
558
558
  [
559
559
  "pennylane_execute",
560
560
  hash_value,
@@ -563,22 +563,27 @@ class Executor:
563
563
  ]
564
564
  )
565
565
 
566
- result = self._cache.get_file(hash_value)
566
+ result = self._cache.get_file(hash_value_adjusted)
567
567
  cached = True
568
+ else:
569
+ hash_value_adjusted = None
568
570
 
569
571
  if result is None:
570
572
  cached = False
571
- # Execute the circuit todo: implement restart
572
- self._logger.info(
573
- f"Executor start execution of pennylane circuit with hash value: {{}}".format(
574
- hash_value
573
+ if self._caching:
574
+ self._logger.info(
575
+ f"Execution of pennylane circuit function with hash value: {{}}".format(
576
+ hash_value_adjusted
577
+ )
575
578
  )
576
- )
579
+ else:
580
+ self._logger.info(f"Execution of pennylane circuit function")
581
+ # Execution of pennylane circuit function
577
582
  result = function()
578
583
  self._logger.info(f"Execution of pennylane circuit successful")
579
- else:
584
+ elif self._caching:
580
585
  self._logger.info(
581
- f"Cached result found with hash value: {{}}".format(hash_value)
586
+ f"Cached result found with hash value: {{}}".format(hash_value_adjusted)
582
587
  )
583
588
 
584
589
  success = True
@@ -621,7 +626,7 @@ class Executor:
621
626
  )
622
627
 
623
628
  if self._caching and not cached:
624
- self._cache.store_file(hash_value, copy.copy(result))
629
+ self._cache.store_file(hash_value_adjusted, copy.copy(result))
625
630
 
626
631
  return result
627
632
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes