Skip to content

Commit 2635692

Browse files
Merge pull request #338 from sQUlearn/develop
release 0.8.4
2 parents f21f3ca + 1e05f80 commit 2635692

9 files changed

Lines changed: 29 additions & 9 deletions

File tree

.github/workflows/doc_checks.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ jobs:
1212
- name: Cancel Workflow Action
1313
uses: styfle/cancel-workflow-action@0.11.0
1414

15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
16+
1617
- uses: sQUlearn/sphinx-action@master
1718
with:
1819
docs-folder: "docs/"

.github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Install dependencies
1919
run: pip install black[jupyter]
2020

21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
2222

2323
- name: Run Black
2424
run: |

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install dependencies
2222
run: pip install flit
2323

24-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v4
2525

2626
- name: Build
2727
run: flit build

.github/workflows/publish_docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
QISKIT_SETTINGS: ${{github.workspace}}/docs/qiskit_settings.conf
1313
steps:
1414
- name: Checkout Source Code
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v4
1616
- name: Checkout GH Pages
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
1818
with:
1919
repository: sQUlearn/squlearn.github.io
2020
fetch-depth: 0

docs/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,12 @@ def setup(app):
111111
"qiskit-aer": ("https://qiskit.github.io/qiskit-aer/", None),
112112
"qiskit-ibm-runtime": ("https://docs.quantum.ibm.com/api/qiskit-ibm-runtime/", None),
113113
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
114-
"sklearn": ("https://scikit-learn.org/1.4/", None),
114+
"sklearn": ("https://scikit-learn.org/stable/", None),
115115
}
116116

117117
suppress_warnings = ["myst.header", "config.cache"]
118118

119119
# base URL for sphinx_sitemap
120120
html_baseurl = "https://squlearn.github.io/"
121121
sitemap_url_scheme = "{link}"
122+
sitemap_show_lastmod = False

src/squlearn/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from .util import Executor
44
from . import observables, encoding_circuit, kernel, optimizers, qnn, util
55

6-
__version__ = "0.8.3"
6+
__version__ = "0.8.4"
77

88
__all__ = [
99
"Executor",

src/squlearn/kernel/qgpc.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ class QGPC(GaussianProcessClassifier):
3434
--------
3535
squlearn.kernel.QSVC : Quantum Support Vector classification.
3636
37+
References
38+
----------
39+
.. [RW2006] `Carl E. Rasmussen and Christopher K.I. Williams,
40+
"Gaussian Processes for Machine Learning",
41+
MIT Press 2006 <https://www.gaussianprocess.org/gpml/chapters/RW.pdf>`_
42+
3743
**Example**
3844
3945
.. code-block::

src/squlearn/qnn/base_qnn.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,6 @@ def _validate_input(self, X, y, incremental, reset):
355355
y,
356356
accept_sparse=["csr", "csc"],
357357
multi_output=True,
358-
y_numeric=True,
359358
reset=reset,
360359
)
361360
if y.ndim == 2 and y.shape[1] == 1:

tests/qnn/test_training.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import numpy as np
44
import pytest
5+
from packaging import version
6+
from scipy import __version__ as scipy_version
57

68
from squlearn import Executor
79
from squlearn.observables import SummedPaulis, SinglePauli
@@ -147,8 +149,19 @@ def _build_qnn_setup(self, pqc, ob, test_case: str):
147149
def test_zero_param_ob(self, test_case):
148150
"""Test for zero number of parameters in observable."""
149151

152+
# scipy changed their slsqp implementation in 1.16.0 and we don't want to limit the user to
153+
# a specific scipy
154+
if version.parse(scipy_version) < version.parse("1.16.0"):
155+
regressor_result = np.array(
156+
[0.11503425, 0.10989764, 0.11377155, 0.12618358, 0.14544058]
157+
)
158+
else:
159+
regressor_result = np.array(
160+
[0.11080395, 0.10440662, 0.10877287, 0.12350483, 0.14668292]
161+
)
162+
150163
assert_dict = {
151-
"QNNRegressor": np.array([0.11503425, 0.10989764, 0.11377155, 0.12618358, 0.14544058]),
164+
"QNNRegressor": regressor_result,
152165
"QNNClassifier": np.array([0, 0, 0, 0, 0]),
153166
}
154167
pqc = ChebyshevPQC(2, 1, 1)

0 commit comments

Comments
 (0)