squlearn 0.1.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.
- squlearn-0.3.0/.github/CODE_OF_CONDUCT.md +134 -0
- squlearn-0.1.0/README.md → squlearn-0.3.0/.github/CONTRIBUTING.md +48 -83
- squlearn-0.3.0/.github/workflows/doc_checks.yml +18 -0
- squlearn-0.3.0/.github/workflows/format.yml +27 -0
- squlearn-0.3.0/.github/workflows/publish.yml +30 -0
- squlearn-0.3.0/.github/workflows/publish_docs.yml +37 -0
- squlearn-0.3.0/.gitignore +168 -0
- {squlearn-0.1.0 → squlearn-0.3.0}/LICENSE.txt +201 -201
- squlearn-0.3.0/PKG-INFO +95 -0
- squlearn-0.3.0/README.md +57 -0
- squlearn-0.3.0/docs/Makefile +20 -0
- squlearn-0.3.0/docs/README.md +23 -0
- squlearn-0.3.0/docs/_static/util/executor.png +0 -0
- squlearn-0.3.0/docs/_templates/class.rst +6 -0
- squlearn-0.3.0/docs/_templates/class_with_call.rst +19 -0
- squlearn-0.3.0/docs/_templates/function.rst +7 -0
- squlearn-0.3.0/docs/conf.py +94 -0
- squlearn-0.3.0/docs/examples/example_kernel_grid_search.nblink +3 -0
- squlearn-0.3.0/docs/examples/example_kernel_mnist.nblink +6 -0
- squlearn-0.3.0/docs/examples/examples_index.rst +11 -0
- squlearn-0.3.0/docs/index.rst +19 -0
- squlearn-0.3.0/docs/install/install.rst +50 -0
- squlearn-0.3.0/docs/make.bat +45 -0
- squlearn-0.3.0/docs/modules/classes.rst +224 -0
- squlearn-0.3.0/docs/requirements.txt +9 -0
- squlearn-0.3.0/docs/spelling_wordlist.txt +55 -0
- squlearn-0.3.0/docs/user_guide/executor.rst +240 -0
- squlearn-0.3.0/docs/user_guide/feature_maps.rst +269 -0
- squlearn-0.3.0/docs/user_guide/kernel_methods.rst +306 -0
- squlearn-0.3.0/docs/user_guide/operators.rst +122 -0
- squlearn-0.3.0/docs/user_guide/user_guide_index.rst +12 -0
- squlearn-0.3.0/examples/executor/.gitignore +3 -0
- squlearn-0.3.0/examples/executor/example_executor.ipynb +316 -0
- squlearn-0.3.0/examples/feature_maps/layered_feature_map.ipynb +146 -0
- squlearn-0.3.0/examples/feature_maps/pruning_example.ipynb +210 -0
- squlearn-0.3.0/examples/feature_maps/various_feature_maps.ipynb +293 -0
- squlearn-0.3.0/examples/kernel/example_fidelity_kernel.ipynb +151 -0
- squlearn-0.3.0/examples/kernel/example_projected_kernel.ipynb +250 -0
- squlearn-0.3.0/examples/kernel/example_regularization_mitigation.ipynb +447 -0
- squlearn-0.3.0/examples/kernel/qgpc_workflow.ipynb +161 -0
- squlearn-0.3.0/examples/kernel/qgpr_optimization_workflow.ipynb +198 -0
- squlearn-0.3.0/examples/kernel/qgpr_workflow.ipynb +219 -0
- squlearn-0.3.0/examples/qnn/classification_example.ipynb +1901 -0
- squlearn-0.3.0/examples/qnn/example_adam.ipynb +2370 -0
- squlearn-0.3.0/examples/qnn/example_minibatch.ipynb +282 -0
- squlearn-0.3.0/examples/qnn/example_shot_adjusting.ipynb +340 -0
- squlearn-0.3.0/examples/qnn/expectation_operator.ipynb +594 -0
- squlearn-0.3.0/examples/qnn/regression_example.ipynb +1949 -0
- squlearn-0.3.0/examples/qnn/regression_example_layered_fm.ipynb +2895 -0
- squlearn-0.3.0/examples/qnn/regression_with_variance.ipynb +1915 -0
- squlearn-0.3.0/examples/tutorials/images/feature_map.png +0 -0
- squlearn-0.3.0/examples/tutorials/images/pipeline.png +0 -0
- squlearn-0.3.0/examples/tutorials/images/projected_quantum_kernel.png +0 -0
- squlearn-0.3.0/examples/tutorials/kernel_classification_mnist.ipynb +656 -0
- squlearn-0.3.0/examples/tutorials/kernel_grid_search.ipynb +509 -0
- squlearn-0.3.0/examples/tutorials/kernel_regression.ipynb +201 -0
- {squlearn-0.1.0 → squlearn-0.3.0}/pyproject.toml +72 -50
- squlearn-0.3.0/src/squlearn/__init__.py +15 -0
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/expectation_operator/__init__.py +17 -22
- squlearn-0.3.0/src/squlearn/expectation_operator/expectation_operator_base.py +494 -0
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/expectation_operator/expectation_operator_derivatives.py +475 -344
- squlearn-0.3.0/src/squlearn/expectation_operator/expectation_operator_implemented/custom_expectation_operator.py +111 -0
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/expectation_operator/expectation_operator_implemented/ising_hamiltonian.py +192 -115
- squlearn-0.3.0/src/squlearn/expectation_operator/expectation_operator_implemented/single_pauli.py +104 -0
- squlearn-0.3.0/src/squlearn/expectation_operator/expectation_operator_implemented/single_probability.py +107 -0
- squlearn-0.3.0/src/squlearn/expectation_operator/expectation_operator_implemented/summed_paulis.py +135 -0
- squlearn-0.3.0/src/squlearn/expectation_operator/expectation_operator_implemented/summed_probabilities.py +128 -0
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/feature_map/__init__.py +33 -37
- squlearn-0.3.0/src/squlearn/feature_map/feature_map_base.py +344 -0
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/feature_map/feature_map_derivatives.py +584 -457
- squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/cheb_pqc.py +252 -0
- squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/cheb_rx.py +181 -0
- squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/chebyshev_tower.py +186 -0
- squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/highdim_feature_map.py +247 -0
- squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/hz_crxcrycrz.py +146 -0
- squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/param_z_feature_map.py +103 -0
- squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/qek_feature_map.py +168 -0
- squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/qiskit_feature_map.py +210 -0
- squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/qiskit_z_feature_map.py +101 -0
- squlearn-0.3.0/src/squlearn/feature_map/feature_map_implemented/yz_cx_feature_map.py +112 -0
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/feature_map/layered_feature_map.py +2506 -2149
- squlearn-0.3.0/src/squlearn/feature_map/pruned_feature_map.py +327 -0
- squlearn-0.3.0/src/squlearn/feature_map/transpiled_feature_map.py +202 -0
- squlearn-0.3.0/src/squlearn/kernel/__init__.py +17 -0
- squlearn-0.3.0/src/squlearn/kernel/matrix/__init__.py +4 -0
- squlearn-0.3.0/src/squlearn/kernel/matrix/fidelity_kernel.py +253 -0
- squlearn-0.3.0/src/squlearn/kernel/matrix/kernel_matrix_base.py +409 -0
- squlearn-0.3.0/src/squlearn/kernel/matrix/kernel_util.py +42 -0
- squlearn-0.3.0/src/squlearn/kernel/matrix/projected_quantum_kernel.py +656 -0
- squlearn-0.3.0/src/squlearn/kernel/matrix/regularization.py +70 -0
- squlearn-0.3.0/src/squlearn/kernel/ml/__init__.py +8 -0
- squlearn-0.3.0/src/squlearn/kernel/ml/qgpc.py +147 -0
- squlearn-0.3.0/src/squlearn/kernel/ml/qgpr.py +252 -0
- squlearn-0.3.0/src/squlearn/kernel/ml/qkrr.py +192 -0
- squlearn-0.3.0/src/squlearn/kernel/ml/qsvc.py +156 -0
- squlearn-0.3.0/src/squlearn/kernel/ml/qsvr.py +155 -0
- squlearn-0.3.0/src/squlearn/kernel/optimization/__init__.py +5 -0
- squlearn-0.3.0/src/squlearn/kernel/optimization/kernel_loss_base.py +24 -0
- squlearn-0.3.0/src/squlearn/kernel/optimization/kernel_optimization_base.py +41 -0
- squlearn-0.3.0/src/squlearn/kernel/optimization/kernel_optimizer.py +95 -0
- squlearn-0.3.0/src/squlearn/kernel/optimization/negative_log_likelihood.py +79 -0
- squlearn-0.3.0/src/squlearn/kernel/optimization/target_alignment.py +78 -0
- squlearn-0.3.0/src/squlearn/optimizers/__init__.py +13 -0
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/optimizers/adam.py +166 -133
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/optimizers/approximated_gradients.py +141 -135
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/optimizers/optimizer_base.py +86 -75
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/optimizers/optimizers_wrapper.py +108 -108
- squlearn-0.3.0/src/squlearn/qnn/__init__.py +15 -0
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/qnn/barren_plateau_analysis.py +242 -242
- squlearn-0.3.0/src/squlearn/qnn/base_qnn.py +203 -0
- squlearn-0.3.0/src/squlearn/qnn/loss.py +641 -0
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/qnn/qnn.py +1138 -1057
- squlearn-0.3.0/src/squlearn/qnn/qnnc.py +239 -0
- squlearn-0.3.0/src/squlearn/qnn/qnnr.py +213 -0
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/qnn/training.py +567 -649
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/util/__init__.py +3 -3
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/util/data_preprocessing.py +93 -93
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/util/evaluate_opflow.py +320 -262
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/util/executor.py +1236 -1092
- squlearn-0.1.0/src/squlearn/util/quantum_fisher.py → squlearn-0.3.0/src/squlearn/util/qfi.py +211 -151
- squlearn-0.3.0/tests/kernel/ml/test_qkrr.py +156 -0
- squlearn-0.3.0/tests/kernel/ml/test_qsvc.py +175 -0
- squlearn-0.3.0/tests/kernel/ml/test_qsvr.py +176 -0
- squlearn-0.3.0/tests/qnn/test_base_qnn.py +149 -0
- squlearn-0.3.0/tests/qnn/test_qnnc.py +140 -0
- squlearn-0.3.0/tests/qnn/test_qnnr.py +144 -0
- squlearn-0.3.0/tests/qnn/test_training.py +42 -0
- squlearn-0.1.0/PKG-INFO +0 -300
- squlearn-0.1.0/setup.cfg +0 -4
- squlearn-0.1.0/src/squlearn/__init__.py +0 -1
- squlearn-0.1.0/src/squlearn/expectation_operator/expectation_operator_base.py +0 -173
- squlearn-0.1.0/src/squlearn/expectation_operator/expectation_operator_implemented/custom_expectation_operator.py +0 -55
- squlearn-0.1.0/src/squlearn/expectation_operator/expectation_operator_implemented/single_amplitude.py +0 -49
- squlearn-0.1.0/src/squlearn/expectation_operator/expectation_operator_implemented/single_pauli.py +0 -61
- squlearn-0.1.0/src/squlearn/expectation_operator/expectation_operator_implemented/summed_amplitudes.py +0 -63
- squlearn-0.1.0/src/squlearn/expectation_operator/expectation_operator_implemented/summed_paulis.py +0 -49
- squlearn-0.1.0/src/squlearn/feature_map/feature_map_base.py +0 -159
- squlearn-0.1.0/src/squlearn/feature_map/feature_map_implemented/cheb_pqc.py +0 -140
- squlearn-0.1.0/src/squlearn/feature_map/feature_map_implemented/cheb_rx.py +0 -82
- squlearn-0.1.0/src/squlearn/feature_map/feature_map_implemented/chebyshev_tower.py +0 -117
- squlearn-0.1.0/src/squlearn/feature_map/feature_map_implemented/highdim_feature_map.py +0 -189
- squlearn-0.1.0/src/squlearn/feature_map/feature_map_implemented/hz_crxcrycrz.py +0 -97
- squlearn-0.1.0/src/squlearn/feature_map/feature_map_implemented/qek_feature_map.py +0 -99
- squlearn-0.1.0/src/squlearn/feature_map/feature_map_implemented/qiskit_z_feature_map.py +0 -67
- squlearn-0.1.0/src/squlearn/feature_map/feature_map_implemented/yz_cx_feature_map.py +0 -90
- squlearn-0.1.0/src/squlearn/feature_map/feature_map_implemented/zfeaturemap_cx.py +0 -55
- squlearn-0.1.0/src/squlearn/feature_map/pruned_feature_map.py +0 -244
- squlearn-0.1.0/src/squlearn/feature_map/transpiled_feature_map.py +0 -131
- squlearn-0.1.0/src/squlearn/kernel/__init__.py +0 -0
- squlearn-0.1.0/src/squlearn/kernel/matrix/__init__.py +0 -9
- squlearn-0.1.0/src/squlearn/kernel/matrix/fidelity_kernel.py +0 -127
- squlearn-0.1.0/src/squlearn/kernel/matrix/kernel_matrix_base.py +0 -128
- squlearn-0.1.0/src/squlearn/kernel/matrix/projected_quantum_kernel.py +0 -370
- squlearn-0.1.0/src/squlearn/kernel/ml/__init__.py +0 -10
- squlearn-0.1.0/src/squlearn/kernel/ml/helper_functions.py +0 -8
- squlearn-0.1.0/src/squlearn/kernel/ml/kernel_ml_base.py +0 -14
- squlearn-0.1.0/src/squlearn/kernel/ml/kernel_util.py +0 -55
- squlearn-0.1.0/src/squlearn/kernel/ml/qgpc.py +0 -34
- squlearn-0.1.0/src/squlearn/kernel/ml/qgpr.py +0 -125
- squlearn-0.1.0/src/squlearn/kernel/ml/qkrr.py +0 -96
- squlearn-0.1.0/src/squlearn/kernel/ml/qsvc.py +0 -33
- squlearn-0.1.0/src/squlearn/kernel/ml/qsvr.py +0 -32
- squlearn-0.1.0/src/squlearn/kernel/optimization/__init__.py +0 -13
- squlearn-0.1.0/src/squlearn/kernel/optimization/kernel_loss_base.py +0 -9
- squlearn-0.1.0/src/squlearn/kernel/optimization/kernel_optimization_base.py +0 -19
- squlearn-0.1.0/src/squlearn/kernel/optimization/kernel_optimizer.py +0 -41
- squlearn-0.1.0/src/squlearn/kernel/optimization/negative_log_likelihood.py +0 -38
- squlearn-0.1.0/src/squlearn/kernel/optimization/target_alignment.py +0 -34
- squlearn-0.1.0/src/squlearn/optimizers/__init__.py +0 -17
- squlearn-0.1.0/src/squlearn/qnn/__init__.py +0 -3
- squlearn-0.1.0/src/squlearn/qnn/base_qnn.py +0 -119
- squlearn-0.1.0/src/squlearn/qnn/loss.py +0 -209
- squlearn-0.1.0/src/squlearn/qnn/qnnc.py +0 -186
- squlearn-0.1.0/src/squlearn/qnn/qnnr.py +0 -162
- squlearn-0.1.0/src/squlearn.egg-info/PKG-INFO +0 -300
- squlearn-0.1.0/src/squlearn.egg-info/SOURCES.txt +0 -73
- squlearn-0.1.0/src/squlearn.egg-info/dependency_links.txt +0 -1
- squlearn-0.1.0/src/squlearn.egg-info/requires.txt +0 -13
- squlearn-0.1.0/src/squlearn.egg-info/top_level.txt +0 -1
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/expectation_operator/expectation_operator_implemented/__init__.py +0 -0
- {squlearn-0.1.0 → squlearn-0.3.0}/src/squlearn/feature_map/feature_map_implemented/__init__.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
|
+
|
|
@@ -1,83 +1,48 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
from the top level directory to ensure the use of the `pyproject.toml` configuration file.
|
|
50
|
-
|
|
51
|
-
We don't enforce but highly encourage the use of the [pylint linter](https://docs.pylint.org/) to check newly written code and adapt accordingly. To run the linter with the desired configuration run
|
|
52
|
-
```bash
|
|
53
|
-
pylint path/to/folder/or/file.py
|
|
54
|
-
```
|
|
55
|
-
from the top level directory to again ensure the use of the `pyproject.toml` configuration file. Running pylint before and after the contribution shouldn't add violations and/or lower the overall code score.
|
|
56
|
-
|
|
57
|
-
#### Docstrings
|
|
58
|
-
We furthermore desire to use the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) for our Docstrings. Generally we at least expect
|
|
59
|
-
- A one-line summary, terminated by a period, and
|
|
60
|
-
- a description of the class/method.
|
|
61
|
-
|
|
62
|
-
For classes we furthermore expect
|
|
63
|
-
- A list of attributes.
|
|
64
|
-
|
|
65
|
-
For methods we furthermore expect
|
|
66
|
-
- A list of arguments, and
|
|
67
|
-
- A list of return values.
|
|
68
|
-
|
|
69
|
-
### Git Flow
|
|
70
|
-
We use the Git Flow branch structure specified [here](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) except for release branches.
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## License
|
|
75
|
-
|
|
76
|
-
[Apache License 2.0](https://github.com/sQUlearn/squlearn/blob/main/LICENSE.txt)
|
|
77
|
-
|
|
78
|
-
## Imprint
|
|
79
|
-
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.
|
|
80
|
-
|
|
81
|
-
https://www.ipa.fraunhofer.de/en/expertise/cyber-cognitive-intelligence-cci/quantencomputing.html
|
|
82
|
-
|
|
83
|
-
---
|
|
1
|
+
# Contributing
|
|
2
|
+
If you plan to contribute to this project, please read this section carefully and check that your contribution fits the desired process and style.
|
|
3
|
+
|
|
4
|
+
## Install development version
|
|
5
|
+
To contribute to sQUlearn install the package from the source code:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/sQUlearn/squlearn.git && cd squlearn
|
|
9
|
+
git checkout develop
|
|
10
|
+
pip install -e .
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
> Note that editable installing as above might require an updated version of pip `pip install pip --upgrade`
|
|
14
|
+
|
|
15
|
+
## Devtools
|
|
16
|
+
Install the recommended tools with
|
|
17
|
+
```bash
|
|
18
|
+
pip install -e .[dev]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Style Guide
|
|
22
|
+
### Code Style
|
|
23
|
+
We try to match all of our python code closely to the [PEP8 style guide](https://pep8.org/) with the exception of using a line length of `99`. To ensure this we use the [Black formater](https://black.readthedocs.io/en/stable/index.html) with the configuration specified in [pyproject.toml](https://github.com/sQUlearn/squlearn/blob/main/pyproject.toml). To format your code, run
|
|
24
|
+
```bash
|
|
25
|
+
black path/to/folder/or/file.py
|
|
26
|
+
```
|
|
27
|
+
from the top level directory to ensure the use of the `pyproject.toml` configuration file.
|
|
28
|
+
|
|
29
|
+
We don't enforce but highly encourage the use of the [pylint linter](https://docs.pylint.org/) to check newly written code and adapt accordingly. To run the linter with the desired configuration run
|
|
30
|
+
```bash
|
|
31
|
+
pylint path/to/folder/or/file.py
|
|
32
|
+
```
|
|
33
|
+
from the top level directory to again ensure the use of the `pyproject.toml` configuration file. Running pylint before and after the contribution shouldn't add violations and/or lower the overall code score.
|
|
34
|
+
|
|
35
|
+
### Docstrings
|
|
36
|
+
We furthermore desire to use the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) for our Docstrings. Generally we at least expect
|
|
37
|
+
- A one-line summary, terminated by a period, and
|
|
38
|
+
- a description of the class/method.
|
|
39
|
+
|
|
40
|
+
For classes we furthermore expect
|
|
41
|
+
- A list of attributes.
|
|
42
|
+
|
|
43
|
+
For methods we furthermore expect
|
|
44
|
+
- A list of arguments, and
|
|
45
|
+
- A list of return values.
|
|
46
|
+
|
|
47
|
+
## Git Flow
|
|
48
|
+
We use the Git Flow branch structure specified [here](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) except for release branches.
|
|
@@ -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"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: Formatting check
|
|
2
|
+
on:
|
|
3
|
+
- pull_request
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
black:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
|
|
9
|
+
steps:
|
|
10
|
+
- name: Cancel Workflow Action
|
|
11
|
+
uses: styfle/cancel-workflow-action@0.11.0
|
|
12
|
+
|
|
13
|
+
- name: Set up Python
|
|
14
|
+
uses: actions/setup-python@v2
|
|
15
|
+
with:
|
|
16
|
+
python-version: 3.9
|
|
17
|
+
|
|
18
|
+
- name: Install dependencies
|
|
19
|
+
run: pip install black[jupyter]
|
|
20
|
+
|
|
21
|
+
- uses: actions/checkout@v2
|
|
22
|
+
|
|
23
|
+
- name: Run Black
|
|
24
|
+
run: |
|
|
25
|
+
black -l 99 src --check
|
|
26
|
+
black -l 99 tests --check
|
|
27
|
+
black -l 99 --ipynb examples --check
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
on:
|
|
3
|
+
release:
|
|
4
|
+
types: [published]
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
pypi-publish:
|
|
8
|
+
name: Upload release to PyPI
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
environment:
|
|
11
|
+
name: release
|
|
12
|
+
url: https://pypi.org/p/squlearn
|
|
13
|
+
permissions:
|
|
14
|
+
id-token: write
|
|
15
|
+
steps:
|
|
16
|
+
- name: Set up Python
|
|
17
|
+
uses: actions/setup-python@v2
|
|
18
|
+
with:
|
|
19
|
+
python-version: 3.9
|
|
20
|
+
|
|
21
|
+
- name: Install dependencies
|
|
22
|
+
run: pip install flit
|
|
23
|
+
|
|
24
|
+
- uses: actions/checkout@v2
|
|
25
|
+
|
|
26
|
+
- name: Build
|
|
27
|
+
run: flit build
|
|
28
|
+
|
|
29
|
+
- name: Publish package distributions to PyPI
|
|
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
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
docs/modules/generated/*
|
|
74
|
+
docs/examples/images
|
|
75
|
+
|
|
76
|
+
# PyBuilder
|
|
77
|
+
.pybuilder/
|
|
78
|
+
target/
|
|
79
|
+
|
|
80
|
+
# Jupyter Notebook
|
|
81
|
+
.ipynb_checkpoints
|
|
82
|
+
|
|
83
|
+
# IPython
|
|
84
|
+
profile_default/
|
|
85
|
+
ipython_config.py
|
|
86
|
+
|
|
87
|
+
# pyenv
|
|
88
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
89
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
90
|
+
# .python-version
|
|
91
|
+
|
|
92
|
+
# pipenv
|
|
93
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
94
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
95
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
96
|
+
# install all needed dependencies.
|
|
97
|
+
#Pipfile.lock
|
|
98
|
+
|
|
99
|
+
# poetry
|
|
100
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
101
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
102
|
+
# commonly ignored for libraries.
|
|
103
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
104
|
+
#poetry.lock
|
|
105
|
+
|
|
106
|
+
# pdm
|
|
107
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
108
|
+
#pdm.lock
|
|
109
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
110
|
+
# in version control.
|
|
111
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
112
|
+
.pdm.toml
|
|
113
|
+
|
|
114
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
115
|
+
__pypackages__/
|
|
116
|
+
|
|
117
|
+
# Celery stuff
|
|
118
|
+
celerybeat-schedule
|
|
119
|
+
celerybeat.pid
|
|
120
|
+
|
|
121
|
+
# SageMath parsed files
|
|
122
|
+
*.sage.py
|
|
123
|
+
|
|
124
|
+
# Environments
|
|
125
|
+
.env
|
|
126
|
+
.venv
|
|
127
|
+
env/
|
|
128
|
+
venv/
|
|
129
|
+
ENV/
|
|
130
|
+
env.bak/
|
|
131
|
+
venv.bak/
|
|
132
|
+
|
|
133
|
+
# Spyder project settings
|
|
134
|
+
.spyderproject
|
|
135
|
+
.spyproject
|
|
136
|
+
|
|
137
|
+
# Rope project settings
|
|
138
|
+
.ropeproject
|
|
139
|
+
|
|
140
|
+
# mkdocs documentation
|
|
141
|
+
/site
|
|
142
|
+
|
|
143
|
+
# mypy
|
|
144
|
+
.mypy_cache/
|
|
145
|
+
.dmypy.json
|
|
146
|
+
dmypy.json
|
|
147
|
+
|
|
148
|
+
# Pyre type checker
|
|
149
|
+
.pyre/
|
|
150
|
+
|
|
151
|
+
# pytype static type analyzer
|
|
152
|
+
.pytype/
|
|
153
|
+
|
|
154
|
+
# Cython debug symbols
|
|
155
|
+
cython_debug/
|
|
156
|
+
|
|
157
|
+
# PyCharm
|
|
158
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
159
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
160
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
161
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
162
|
+
#.idea/
|
|
163
|
+
|
|
164
|
+
# VSCode
|
|
165
|
+
.vscode/
|
|
166
|
+
|
|
167
|
+
#Example logs
|
|
168
|
+
examples/qnn/*_log.csv
|