-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating capabilities dictionary, requirements.txt and black CI check #45
Changes from all commits
cc0c0a1
b6f3e10
9b1df9c
68d5f8e
cf3fa48
4c4a3da
16c60f7
28dfa84
33a7ab1
4acee96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,10 @@ jobs: | |
|
||
- name: Get required Python packages | ||
run: | | ||
pip install numpy pybind11 pytest pytest-cov pytest-mock flaky | ||
cd main | ||
python -m pip install --upgrade pip | ||
pip install git+https://github.com/PennyLaneAI/pennylane.git | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is temporary. Need the latest PennyLane with the update of |
||
pip install -r requirements.txt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was discovered by Maria, that we were not depending on |
||
|
||
- name: Install lightning.qubit device | ||
run: | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,22 @@ 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the black update that was needed for each PennyLane plugin |
||
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: | ||
python -m pip install --upgrade pip | ||
pip install black | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Run Black | ||
run: black -l 100 pennylane_lightning/ --check |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,8 @@ jobs: | |
|
||
- name: Install cibuildwheel | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install git+https://github.com/PennyLaneAI/pennylane.git | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will be removed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's not forget all the places we'll need to shortly change back! |
||
python -m pip install cibuildwheel==1.5.5 | ||
|
||
- name: Install Eigen on Windows | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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", | ||
|
@@ -94,9 +93,22 @@ 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, | ||
Comment on lines
+96
to
+97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
) | ||
|
||
@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: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
flaky | ||
numpy | ||
pennylane>=0.11 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When should we pin this, I guess in a follow up PR we'd pin this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, in the version bump PR. Note, that that PR should pass checks only when PL v0.12 has been released. |
||
pybind11 | ||
pytest | ||
pytest-cov | ||
pytest-mock |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,7 +168,8 @@ def build_extensions(self): | |
|
||
requirements = [ | ||
"numpy", | ||
"pennylane>=0.11.0", | ||
"pennylane @ git+https://github.com/PennyLaneAI/pennylane.git", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will be reverted |
||
"pybind11", | ||
] | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
pip
upgrades just for making sure all is good...