Skip to content
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

Fix clobbering with multi-backend packaging #504

Merged
merged 5 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

### Breaking changes

* Cast integral-valued arrays to the device's complex type on entry in `_preprocess_state_vector` to ensure the state is correctly represented with floating-point numbers.
* Cast integral-valued arrays to the device's complex type on entry in `_preprocess_state_vector` to ensure the state is correctly represented with floating-point numbers.
[(#501)](https://github.com/PennyLaneAI/pennylane-lightning/pull/501)

* Update DefaultQubit to DefaultQubitLegacy on Lightning fallback.
Expand All @@ -21,6 +21,9 @@

### Improvements

* Update setup.py to allow for multi-package co-existence. The PennyLane_Lightning package now is the responsible for the core functionality, and will be depended upon by all other extensions.
[(#504)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/504)

* Refactor LKokkos `StateVectorKokkos` class to use Kokkos `RangePolicy` together with special functors in `applyMultiQubitOp` to apply 1- to 4-wire generic unitary gates. For more than 4 wires, the general implementation using Kokkos `TeamPolicy` is employed to yield the best all-around performance.
[(#490)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/490)

Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/tests_without_binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ jobs:
cd main
python -m pip install -r requirements-dev.txt

- name: Install lightning.qubit device
- name: Install the pennylane_lightning package
if: ${{ matrix.pl_backend == 'lightning_kokkos'}}
run: |
cd main
SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv

- name: Install backend device
env:
SKIP_COMPILATION: True
PL_BACKEND: ${{ matrix.pl_backend }}
run: |
cd main
python -m pip install -e . -vv

- name: Install the new pennylane_lightning package
if: ${{ matrix.pl_backend == 'lightning_kokkos'}}
run: |
cd main
SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv

- name: Run PennyLane-Lightning unit tests
run: |
cd main/
Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.33.0-dev11"
__version__ = "0.33.0-dev12"
25 changes: 17 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ def build_extension(self, ext: CMakeExtension):
"pennylane>=0.32",
]

packages_list = ['pennylane_lightning.'+backend]

if backend == "lightning_qubit":
packages_list += ['pennylane_lightning.core']
else:
requirements += ["pennylane_lightning=="+version]

suffix = backend.replace("lightning_", "")
suffix = suffix[0].upper() + suffix[1:]

Expand All @@ -185,14 +192,7 @@ def build_extension(self, ext: CMakeExtension):
"maintainer_email": "[email protected]",
"url": "https://github.com/XanaduAI/pennylane-lightning",
"license": "Apache License 2.0",
"packages": find_namespace_packages(include=['pennylane_lightning.core',
'pennylane_lightning.'+backend]),
"package_data": {
'pennylane_lightning.core': [
os.path.join("src", "*"),
os.path.join("src", "**", "*"),
]
},
"packages": find_namespace_packages(include=packages_list),
"include_package_data": True,
"entry_points": {"pennylane.plugins": pennylane_plugins},
"description": "PennyLane-Lightning plugin",
Expand All @@ -206,6 +206,15 @@ def build_extension(self, ext: CMakeExtension):
"ext_package": "pennylane_lightning",
}

if backend == "lightning_qubit":
info = info | {
"package_data": {
'pennylane_lightning.core': [
os.path.join("src", "*"),
os.path.join("src", "**", "*"),
]
},}

classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
Expand Down