From cc0c0a1c4c8e19f8a9f5c030a52dcea6b4764d94 Mon Sep 17 00:00:00 2001 From: antalszava Date: Mon, 28 Sep 2020 10:08:10 -0400 Subject: [PATCH 01/10] Redefining capabilities --- pennylane_lightning/lightning_qubit.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pennylane_lightning/lightning_qubit.py b/pennylane_lightning/lightning_qubit.py index d2a661add6..d056c49c82 100644 --- a/pennylane_lightning/lightning_qubit.py +++ b/pennylane_lightning/lightning_qubit.py @@ -56,7 +56,6 @@ class LightningQubit(DefaultQubit): pennylane_requires = ">=0.11" version = __version__ author = "Xanadu Inc." - _capabilities = {"inverse_operations": False} # we should look at supporting operations = { "BasisState", @@ -97,6 +96,18 @@ def __init__(self, wires, *, shots=1000, analytic=True): "The number of wires exceeds 16, reverting to NumPy-based evaluation.", UserWarning, ) + @classmethod + def capabilities(cls): + capabilities = super().capabilities().copy() + capabilities.update( + model="qubit", + supports_reversible_diff=False, + supports_inverse_operations=False, + supports_analytic_computation=True, + returns_state=True, + ) + return capabilities + def apply(self, operations, rotations=None, **kwargs): if self.num_wires > self._MAX_WIRES: From b6f3e101cf670572c92e2b46ee947deb5f8448bf Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 13 Oct 2020 10:06:05 -0400 Subject: [PATCH 02/10] Black CI check update --- .github/workflows/format.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 94a4615817..e0dcfc1a64 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -6,8 +6,20 @@ jobs: black: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Black Code Formatter - uses: lgeiger/black-action@v1.0.1 - with: - args: "-l 100 pennylane_lightning/ --check" + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.4.1 + with: + access_token: ${{ github.token }} + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install dependencies + run: pip install black + + - uses: actions/checkout@v2 + + - name: Run Black + run: black -l 100 pennylane_lightning/ --check From 9b1df9c7b1561d5222a37fb369cac7ad172e842b Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 13 Oct 2020 10:15:38 -0400 Subject: [PATCH 03/10] Upgrade pip --- .github/workflows/build.yml | 1 + .github/workflows/format.yml | 4 +++- .github/workflows/wheels.yml | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2984e793e..264006f09b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,6 +54,7 @@ jobs: - name: Get required Python packages run: | + python -m pip install --upgrade pip pip install numpy pybind11 pytest pytest-cov pytest-mock flaky - name: Install lightning.qubit device diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index e0dcfc1a64..e19d3a57e4 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -17,7 +17,9 @@ jobs: python-version: 3.8 - name: Install dependencies - run: pip install black + run: + python -m pip install --upgrade pip + pip install black - uses: actions/checkout@v2 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0878c21b77..881100dd3e 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -70,6 +70,7 @@ jobs: - name: Install cibuildwheel run: | + python -m pip install --upgrade pip python -m pip install cibuildwheel==1.5.5 - name: Install Eigen on Windows From 68d5f8e9a1d11cf1d4ffbb54b12460e8cbed2e48 Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 13 Oct 2020 10:18:00 -0400 Subject: [PATCH 04/10] Temporarily PL master as requirement --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 71d6daf726..94a3ae66cc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ numpy -pennylane>=0.11 +git+https://github.com/PennyLaneAI/pennylane.git pytest pytest-cov pytest-mock From cf3fa484f859232c36ad2072f144ec5e49b19c42 Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 13 Oct 2020 10:19:37 -0400 Subject: [PATCH 05/10] Update requirements.txt --- .github/workflows/build.yml | 3 ++- requirements.txt | 2 ++ setup.py | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 264006f09b..3def121d17 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,8 +54,9 @@ jobs: - name: Get required Python packages run: | + cd main python -m pip install --upgrade pip - pip install numpy pybind11 pytest pytest-cov pytest-mock flaky + pip install -r requirements.txt - name: Install lightning.qubit device run: | diff --git a/requirements.txt b/requirements.txt index 94a3ae66cc..b2653e72c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,7 @@ +flaky numpy git+https://github.com/PennyLaneAI/pennylane.git +pybind11 pytest pytest-cov pytest-mock diff --git a/setup.py b/setup.py index e5ecda539c..026d3691c3 100644 --- a/setup.py +++ b/setup.py @@ -169,6 +169,7 @@ def build_extensions(self): requirements = [ "numpy", "pennylane>=0.11.0", + "pybind11", ] From 4c4a3da12bf69137fc2cf7fe57d9c21a3b69984f Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 13 Oct 2020 10:24:38 -0400 Subject: [PATCH 06/10] Formatting --- pennylane_lightning/lightning_qubit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pennylane_lightning/lightning_qubit.py b/pennylane_lightning/lightning_qubit.py index d056c49c82..0489fdc0c7 100644 --- a/pennylane_lightning/lightning_qubit.py +++ b/pennylane_lightning/lightning_qubit.py @@ -93,7 +93,8 @@ def __init__(self, wires, *, shots=1000, analytic=True): if self.num_wires > self._MAX_WIRES: warnings.warn( - "The number of wires exceeds 16, reverting to NumPy-based evaluation.", UserWarning, + "The number of wires exceeds 16, reverting to NumPy-based evaluation.", + UserWarning, ) @classmethod From 16c60f75d7484c9ca70ea48377f9ac95df5df044 Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 13 Oct 2020 10:36:02 -0400 Subject: [PATCH 07/10] PL master in setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 026d3691c3..492ee16768 100644 --- a/setup.py +++ b/setup.py @@ -168,7 +168,7 @@ def build_extensions(self): requirements = [ "numpy", - "pennylane>=0.11.0", + "git+https://github.com/PennyLaneAI/pennylane.git", "pybind11", ] From 28dfa84ef53917319b0c93c05cb690e26b9d31b9 Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 13 Oct 2020 11:48:25 -0400 Subject: [PATCH 08/10] Temp PennyLane install --- .github/workflows/build.yml | 1 + .github/workflows/wheels.yml | 1 + requirements.txt | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3def121d17..f6769e0993 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,6 +56,7 @@ jobs: run: | cd main python -m pip install --upgrade pip + pip install git+https://github.com/PennyLaneAI/pennylane.git pip install -r requirements.txt - name: Install lightning.qubit device diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 881100dd3e..c8749f0ed2 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -71,6 +71,7 @@ jobs: - name: Install cibuildwheel run: | python -m pip install --upgrade pip + pip install git+https://github.com/PennyLaneAI/pennylane.git python -m pip install cibuildwheel==1.5.5 - name: Install Eigen on Windows diff --git a/requirements.txt b/requirements.txt index b2653e72c8..e36813e0fa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ flaky numpy -git+https://github.com/PennyLaneAI/pennylane.git +pennylane>=0.11 pybind11 pytest pytest-cov diff --git a/setup.py b/setup.py index 492ee16768..026d3691c3 100644 --- a/setup.py +++ b/setup.py @@ -168,7 +168,7 @@ def build_extensions(self): requirements = [ "numpy", - "git+https://github.com/PennyLaneAI/pennylane.git", + "pennylane>=0.11.0", "pybind11", ] From 33a7ab148aa4af7ec95f3de29bbf3545e0697975 Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 13 Oct 2020 12:00:26 -0400 Subject: [PATCH 09/10] Temp PennyLane install --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 026d3691c3..896056357e 100644 --- a/setup.py +++ b/setup.py @@ -168,7 +168,7 @@ def build_extensions(self): requirements = [ "numpy", - "pennylane>=0.11.0", + "pennylane @ git+https://github.com/PennyLaneAI/pennylane.git, "pybind11", ] From 4acee96709c02e8dbe69fd552ef2746b6da14bad Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 13 Oct 2020 12:03:55 -0400 Subject: [PATCH 10/10] Correct typo --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 896056357e..e49baaa77b 100644 --- a/setup.py +++ b/setup.py @@ -168,7 +168,7 @@ def build_extensions(self): requirements = [ "numpy", - "pennylane @ git+https://github.com/PennyLaneAI/pennylane.git, + "pennylane @ git+https://github.com/PennyLaneAI/pennylane.git", "pybind11", ]