Skip to content

Commit

Permalink
Align dependencies (qiskit, sphinx) (#21)
Browse files Browse the repository at this point in the history
* chore(deps): bump qiskit and pandoc

* remove qridge

* chore(docs): align docs
  • Loading branch information
mspronesti authored Apr 18, 2023
1 parent 134d65b commit 9604b85
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 417 deletions.
21 changes: 0 additions & 21 deletions docs/apidoc/qlearnkit.algorithms.qridge.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/apidoc/qlearnkit.algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Subpackages

qlearnkit.algorithms.qkmeans
qlearnkit.algorithms.qknn
qlearnkit.algorithms.qridge
qlearnkit.algorithms.qsvm

Submodules
Expand Down
24 changes: 24 additions & 0 deletions docs/apidoc/qlearnkit.nn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ qlearnkit.nn package
Submodules
----------

qlearnkit.nn.qae module
-----------------------

.. automodule:: qlearnkit.nn.qae
:members:
:undoc-members:
:show-inheritance:

qlearnkit.nn.qml\_mixin module
------------------------------

.. automodule:: qlearnkit.nn.qml_mixin
:members:
:undoc-members:
:show-inheritance:

qlearnkit.nn.qrnn module
------------------------

Expand All @@ -12,6 +28,14 @@ qlearnkit.nn.qrnn module
:undoc-members:
:show-inheritance:

qlearnkit.nn.quanv module
-------------------------

.. automodule:: qlearnkit.nn.quanv
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

Expand Down
2 changes: 0 additions & 2 deletions qlearnkit/algorithms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from .qknn import QKNeighborsClassifier, QKNeighborsRegressor
from .qsvm import QSVClassifier
from .qkmeans import QKMeans
from .qridge import QRidgeRegressor

__all__ = [
"QuantumEstimator",
Expand All @@ -12,5 +11,4 @@
"QKNeighborsRegressor",
"QSVClassifier",
"QKMeans",
"QRidgeRegressor"
]
4 changes: 2 additions & 2 deletions qlearnkit/algorithms/qknn/qknn_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ def _majority_voting(self,
n_queries = self.X_train.shape[0]
if n_queries == 1:
# case of 1D array
labels, _ = stats.mode(k_nearest)
labels, _ = stats.mode(k_nearest, keepdims=True)
else:
labels, _ = stats.mode(k_nearest, axis=1)
labels, _ = stats.mode(k_nearest, keepdims=True, axis=1)

# eventually flatten the np.ndarray
# returned by stats.mode
Expand Down
6 changes: 0 additions & 6 deletions qlearnkit/algorithms/qridge/__init__.py

This file was deleted.

202 changes: 0 additions & 202 deletions qlearnkit/algorithms/qridge/qridge.py

This file was deleted.

2 changes: 1 addition & 1 deletion qlearnkit/nn/quanv.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Quanv2DLayer(Module, QmlMixin):
**References:**
[1] Henderson et al.,
`Quantum Long Short-Term Memory <https://arxiv.org/pdf/1904.04767.pdf>`_
`Quanvolutional Neural Networks: Powering Image Recognition with Quantum Circuits <https://arxiv.org/pdf/1904.04767.pdf>`_
Args:
n_qubits:
Expand Down
13 changes: 5 additions & 8 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
qiskit-aer>=0.10.3
qiskit-terra>=0.20.0
qiskit-machine-learning>=0.3.1
scikit-learn==1.0.2
scipy==1.7.3
numpy==1.22.0
-r requirements.txt
qiskit-aer
pytest==6.2.5
pytest-cov==3.0.0
pytest-xdist==2.5.0
Expand All @@ -16,11 +12,12 @@ sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
sphinx-autodoc-typehints==1.14.0
sphinx-gallery
sphinx-gallery==0.10.1
pandoc>=1.1.0
sphinx-rtd-theme
nbsphinx
nbsphinx-link
nbformat==5.4.0
matplotlib>=3.3
flake8==4.0.1
jupyter
Expand All @@ -29,4 +26,4 @@ pre-commit
# However, for the developement of the nn package,
# they are needed, here's why they are included here.
pennylane
torch
torch
11 changes: 5 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
qiskit-terra>=0.20.0
qiskit-aer>=0.10.3
qiskit-machine-learning>=0.3.1
scikit-learn==1.0.2
scipy==1.7.3
numpy==1.22.0
qiskit-terra==0.22.0
qiskit-machine-learning==0.4.0
scikit-learn>=1.0.2
scipy>=1.10
numpy<1.24

2 changes: 1 addition & 1 deletion test/qknn/test_knn_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from qlearnkit.algorithms import QKNeighborsClassifier
from qlearnkit.encodings import AmplitudeEncoding

from qiskit import Aer
from qiskit_aer import Aer
from qiskit.utils import QuantumInstance, algorithm_globals

seed = 42
Expand Down
2 changes: 1 addition & 1 deletion test/qknn/test_knn_regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from qlearnkit.algorithms import QKNeighborsRegressor
from qlearnkit.encodings import AmplitudeEncoding

from qiskit import Aer
from qiskit_aer import Aer
from qiskit.utils import QuantumInstance, algorithm_globals

seed = 42
Expand Down
2 changes: 1 addition & 1 deletion test/test_kmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from qlearnkit.algorithms import QKMeans
import pytest

from qiskit import Aer
from qiskit_aer import Aer
from qiskit.utils import QuantumInstance, algorithm_globals

seed = 42
Expand Down
Loading

0 comments on commit 9604b85

Please sign in to comment.