From d8b48c15d2c3a557a16693a445da8ec6f33a8b27 Mon Sep 17 00:00:00 2001 From: GroenteLepel Date: Mon, 9 Nov 2020 12:31:29 +0100 Subject: [PATCH 01/10] updated version number --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 2756196..1935be4 100644 --- a/setup.py +++ b/setup.py @@ -5,8 +5,8 @@ setuptools.setup( name="qiskit_quantum_knn", - version="1.0.0a1", - author="Daniƫl J. Kok", + version="1.0.1-alpha.1", + author="Daniel J. Kok", author_email="djkok.github@icloud.com", long_description=long_description, long_description_content_type="text/markdown", From 8072bd1af477ed4a77bea9d0381e3926465e0f85 Mon Sep 17 00:00:00 2001 From: GroenteLepel Date: Tue, 1 Dec 2020 11:55:12 +0100 Subject: [PATCH 02/10] Fixed documentation in state_transformation(). --- qiskit_quantum_knn/qknn/qknn_construction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_quantum_knn/qknn/qknn_construction.py b/qiskit_quantum_knn/qknn/qknn_construction.py index 246347c..6a7963e 100644 --- a/qiskit_quantum_knn/qknn/qknn_construction.py +++ b/qiskit_quantum_knn/qknn/qknn_construction.py @@ -379,7 +379,7 @@ def initialise_qknn(log2_dim: int, def state_transformation(qknn_circ: qk.QuantumCircuit, oracle: qinst.Instruction) -> qk.QuantumCircuit: - """applies :math:`H`-gates and the Oracle :math:`\mathcal{W}` to the + r"""applies :math:`H`-gates and the Oracle :math:`\mathcal{W}` to the circuit, and applies the :math:`SWAP`-test. Coincides with Step 2: the "state transformation" section from From 816c50370eda45905cf54e923b5b0dbdb028193d Mon Sep 17 00:00:00 2001 From: GroenteLepel Date: Tue, 1 Dec 2020 11:55:32 +0100 Subject: [PATCH 03/10] Renamed to fit the actual file qknn_construction.py. --- .../{test__qknn_construction.py => test_qknn_construction.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/test_qknn/{test__qknn_construction.py => test_qknn_construction.py} (100%) diff --git a/tests/test_qknn/test__qknn_construction.py b/tests/test_qknn/test_qknn_construction.py similarity index 100% rename from tests/test_qknn/test__qknn_construction.py rename to tests/test_qknn/test_qknn_construction.py From fc46a171a81dfcdeaac6f59193d23d1206ca3637 Mon Sep 17 00:00:00 2001 From: GroenteLepel Date: Tue, 1 Dec 2020 11:55:49 +0100 Subject: [PATCH 04/10] Updated pandas to see if this fixed the deprecation warning (it did not). --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f3b144e..7693145 100644 --- a/requirements.txt +++ b/requirements.txt @@ -53,7 +53,7 @@ notebook==6.1.4 ntlm-auth==1.5.0 numpy==1.19.2 packaging==20.4 -pandas==1.1.2 +pandas==1.1.4 pandocfilters==1.4.3 parso==0.7.1 pexpect==4.8.0 @@ -81,6 +81,7 @@ qiskit-aer==0.6.1 qiskit-aqua==0.7.5 qiskit-ibmq-provider==0.9.0 qiskit-ignis==0.4.0 +-e git+https://github.com/GroenteLepel/qiskit-quantum-knn.git@d8b48c15d2c3a557a16693a445da8ec6f33a8b27#egg=qiskit_quantum_knn qiskit-terra==0.15.2 Quandl==3.5.2 readme-renderer==26.0 From 8994adeb953ade67e777dc54556b552dbdfb9ad0 Mon Sep 17 00:00:00 2001 From: GroenteLepel Date: Tue, 1 Dec 2020 12:16:52 +0100 Subject: [PATCH 05/10] Fixed the QkNN not working when ancilla qubit only counted one occurence (removed the counts length check in setup_control_counts()). --- qiskit_quantum_knn/qknn/qkneighborsclassifier.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/qiskit_quantum_knn/qknn/qkneighborsclassifier.py b/qiskit_quantum_knn/qknn/qkneighborsclassifier.py index dbe9087..4c1b777 100644 --- a/qiskit_quantum_knn/qknn/qkneighborsclassifier.py +++ b/qiskit_quantum_knn/qknn/qkneighborsclassifier.py @@ -384,10 +384,6 @@ def setup_control_counts(control_counts: Dict[str, int]) -> Dict[str, int]: ValueError: if the provided dictionary does not coincide with the :py:class:`Result` from the QkNN. """ - if len(control_counts) != 2: - raise ValueError("Provided dict not correct length. Should be 2," - "but is {0:d}".format(len(control_counts))) - # constant describing the states possible in control_counts control_states = np.array(['0', '1']) # check if substition of 0 count value must be done From dee2848e430eaa301e786631abe0dcccba671e41 Mon Sep 17 00:00:00 2001 From: GroenteLepel Date: Tue, 1 Dec 2020 12:57:02 +0100 Subject: [PATCH 06/10] Fixed requirements.txt to contain the wheel package. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 7693145..8348d23 100644 --- a/requirements.txt +++ b/requirements.txt @@ -81,7 +81,7 @@ qiskit-aer==0.6.1 qiskit-aqua==0.7.5 qiskit-ibmq-provider==0.9.0 qiskit-ignis==0.4.0 --e git+https://github.com/GroenteLepel/qiskit-quantum-knn.git@d8b48c15d2c3a557a16693a445da8ec6f33a8b27#egg=qiskit_quantum_knn +-e git+https://github.com/GroenteLepel/qiskit-quantum-knn.git@8994adeb953ade67e777dc54556b552dbdfb9ad0#egg=qiskit_quantum_knn qiskit-terra==0.15.2 Quandl==3.5.2 readme-renderer==26.0 From 0134ea33f918f1e73e7dcf1ed0d701c1c2919390 Mon Sep 17 00:00:00 2001 From: GroenteLepel Date: Tue, 1 Dec 2020 12:57:07 +0100 Subject: [PATCH 07/10] Updated version. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1935be4..a599e64 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="qiskit_quantum_knn", - version="1.0.1-alpha.1", + version="1.0.1", author="Daniel J. Kok", author_email="djkok.github@icloud.com", long_description=long_description, From 8aef67ce2312e25c979466acf5038e47b838e638 Mon Sep 17 00:00:00 2001 From: GroenteLepel Date: Tue, 1 Dec 2020 13:18:08 +0100 Subject: [PATCH 08/10] Update test-project.yml Changed a bit to see if this will fix the sudden problems of not being able to find my test files. --- .github/workflows/test-project.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-project.yml b/.github/workflows/test-project.yml index 5e86ed6..00fed50 100644 --- a/.github/workflows/test-project.yml +++ b/.github/workflows/test-project.yml @@ -1,4 +1,4 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: Test project @@ -13,21 +13,18 @@ jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.8] steps: - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: ${{ matrix.python-version }} + python-version: 3.8 - name: Install dependencies run: | python -m pip install --upgrade pip pip install flake8 pytest - pip install -e . + pip install -e ./ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | From 2f39ca21cb6bf49e78453439cbf7dd41d90246fd Mon Sep 17 00:00:00 2001 From: Thijs Miedema Date: Tue, 1 Dec 2020 14:39:51 +0100 Subject: [PATCH 09/10] Find minimal change to fix problems --- pytest.ini | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 pytest.ini diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..7e217ac --- /dev/null +++ b/pytest.ini @@ -0,0 +1,6 @@ +# pytest.ini +[pytest] +testpaths = + tests +python_files = test_*.py +addopts = -rf --import-mode=importlib From ed629738acd6af5eca1d2d2ee4a967244b0009a8 Mon Sep 17 00:00:00 2001 From: Thijs Miedema Date: Tue, 1 Dec 2020 14:41:45 +0100 Subject: [PATCH 10/10] Run on my branch --- .github/workflows/test-project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-project.yml b/.github/workflows/test-project.yml index 00fed50..4a78a16 100644 --- a/.github/workflows/test-project.yml +++ b/.github/workflows/test-project.yml @@ -5,7 +5,7 @@ name: Test project on: push: - branches: [ master ] + branches: [ master, fix-pytest-action ] pull_request: branches: [ master ]