Skip to content

Commit 20019d8

Browse files
maliasadiringo-but-quantum
authored andcommitted
Remove CPhase + Tidy up src (#717)
* Remove CPhase; Tidy up NDPermuter, gh scripts, and doc * Add release_notes to docs * Auto update version from '0.37.0-dev0' to '0.37.0-dev2' * Update changelog * Auto update version from '0.37.0-dev2' to '0.37.0-dev3' * trigger ci * Revert change in config.h * Update * Update * Update * Auto update version from '0.37.0-dev3' to '0.37.0-dev4' * Fix _version * Auto update version from '0.37.0-dev6' to '0.37.0-dev7' * Update format * trigger ci --------- Co-authored-by: ringo-but-quantum <[email protected]>
1 parent 5507f89 commit 20019d8

File tree

198 files changed

+5971
-5407
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+5971
-5407
lines changed

.github/CHANGELOG.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@
1212

1313
### Improvements
1414

15+
* Update C++ and Python GitHub actions names to include the matrix info.
16+
[(#717)](https://github.com/PennyLaneAI/pennylane-lightning/pull/717)
17+
18+
* Remove `CPhase` in favour of `CPhaseShift` in Lightning devices.
19+
[(#717)](https://github.com/PennyLaneAI/pennylane-lightning/pull/717)
20+
1521
* The various OpenMP configurations of Lightning-Qubit are tested in parallel on different Github Actions runners.
1622
[(#712)](https://github.com/PennyLaneAI/pennylane-lightning/pull/712)
1723

18-
* Update Linux wheels to use manylinux_2_28 images.
24+
* Update Linux wheels to use `manylinux_2_28` images.
1925
[(#667)](https://github.com/PennyLaneAI/pennylane-lightning/pull/667)
2026

2127
* Add support for `qml.expval` and `qml.var` in the `lightning.tensor` device for the `quimb` interface and the MPS method.
@@ -32,7 +38,7 @@
3238

3339
This release contains contributions from (in alphabetical order):
3440

35-
Amintor Dusko, Pietropaolo Frisoni, Vincent Michaud-Rioux, Mudit Pandey, Shuli Shu
41+
Ali Asadi, Amintor Dusko, Pietropaolo Frisoni, Vincent Michaud-Rioux, Mudit Pandey, Shuli Shu
3642

3743
---
3844

.github/workflows/dev_version_script.py

+23-11
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import re
1615
import argparse
16+
import re
1717
from pathlib import Path
1818

1919
try:
2020
from semver import Version
2121
except ImportError as exc:
22-
raise ImportError("Unable to import semver. Install semver by running `pip install semver`") from exc
22+
raise ImportError(
23+
"Unable to import semver. Install semver by running `pip install semver`"
24+
) from exc
2325

2426
DEV_PRERELEASE_TAG_PREFIX = "dev"
2527
DEV_PRERELEASE_TAG_START = "dev0"
@@ -45,10 +47,14 @@ def extract_version(repo_root_path: Path) -> Version:
4547
if line.startswith("__version__"):
4648
if (m := rgx_ver.match(line.strip())) is not None:
4749
if not m.groups():
48-
raise ValueError(f"Unable to find valid semver for __version__. Got: '{line}'")
50+
raise ValueError(
51+
f"Unable to find valid semver for __version__. Got: '{line}'"
52+
)
4953
parsed_semver = m.group(1)
5054
if not Version.is_valid(parsed_semver):
51-
raise ValueError(f"Invalid semver for __version__. Got: '{parsed_semver}' from line '{line}'")
55+
raise ValueError(
56+
f"Invalid semver for __version__. Got: '{parsed_semver}' from line '{line}'"
57+
)
5258
return Version.parse(parsed_semver)
5359
raise ValueError(f"Unable to find valid semver for __version__. Got: '{line}'")
5460
raise ValueError("Cannot parse version")
@@ -67,10 +73,7 @@ def update_prerelease_version(repo_root_path: Path, version: Version):
6773
raise FileNotFoundError(f"Unable to find version file at location {version_file_path}")
6874

6975
with version_file_path.open() as f:
70-
lines = [
71-
rgx_ver.sub(f"__version__ = \"{str(version)}\"", line)
72-
for line in f
73-
]
76+
lines = [rgx_ver.sub(f'__version__ = "{str(version)}"', line) for line in f]
7477

7578
with version_file_path.open("w") as f:
7679
f.write("".join(lines))
@@ -98,8 +101,14 @@ def update_prerelease_version(repo_root_path: Path, version: Version):
98101
# If a PR is of a higher version AND the prerelease tag is reset, then do nothing
99102
# This captures the case during release where we might bump the release version
100103
# within a PR and reset tag back to dev0
101-
if pr_version > master_version and pr_version.prerelease and pr_version.prerelease == DEV_PRERELEASE_TAG_START:
102-
print("This Pull Request is upgrading the package version to next release ... skipping bumping!")
104+
if (
105+
pr_version > master_version
106+
and pr_version.prerelease
107+
and pr_version.prerelease == DEV_PRERELEASE_TAG_START
108+
):
109+
print(
110+
"This Pull Request is upgrading the package version to next release ... skipping bumping!"
111+
)
103112
print("If this is happening in error, please report it to the PennyLane team!")
104113
elif pr_version.prerelease and pr_version.prerelease.startswith(DEV_PRERELEASE_TAG_PREFIX):
105114
# If master branch does not have a prerelease (for any reason) OR does not have an ending number
@@ -109,7 +118,10 @@ def update_prerelease_version(repo_root_path: Path, version: Version):
109118
else:
110119
# If master branch does not have a prerelease (for any reason) OR does not have an ending number
111120
# Then default to the starting tag
112-
if not master_version.prerelease or master_version.prerelease == DEV_PRERELEASE_TAG_PREFIX:
121+
if (
122+
not master_version.prerelease
123+
or master_version.prerelease == DEV_PRERELEASE_TAG_PREFIX
124+
):
113125
next_prerelease_version = DEV_PRERELEASE_TAG_START
114126
else:
115127
# Generate the next prerelease version (eg: dev1 -> dev2). Sourcing from master version.

.github/workflows/tests_lgpu_cpp.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
pl_backend: ["lightning_gpu"]
6464
cuda_version: ["12"]
6565

66-
name: C++ tests (Lightning-GPU)
66+
name: C++ Tests (${{ matrix.pl_backend }}, cuda-${{ matrix.cuda_version }})
6767
runs-on:
6868
- ubuntu-22.04
6969
- self-hosted

.github/workflows/tests_lgpu_python.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
default_backend: ["lightning_qubit"]
6767
cuda_version: ["12"]
6868

69-
name: Python tests with LGPU
69+
name: Python Tests (${{ matrix.pl_backend }}, cuda-${{ matrix.cuda_version }})
7070
runs-on:
7171
- ubuntu-22.04
7272
- self-hosted
@@ -133,7 +133,7 @@ jobs:
133133
py_path=$(which python)
134134
echo "Python Interpreter Path => $py_path"
135135
echo "python=$py_path" >> $GITHUB_OUTPUT
136-
136+
137137
pip_path=$(which python)
138138
echo "PIP Path => $pip_path"
139139
echo "pip=$pip_path" >> $GITHUB_OUTPUT
@@ -166,7 +166,7 @@ jobs:
166166
python -m pip uninstall -y pennylane && python -m pip install -U pennylane
167167
168168
- name: Build and install package
169-
env:
169+
env:
170170
CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum')")
171171
run: |
172172
cd main
@@ -181,34 +181,34 @@ jobs:
181181
182182
- name: Run PennyLane-Lightning-GPU unit tests
183183
if: ${{ matrix.pl_backend != 'all'}}
184-
env:
184+
env:
185185
OMP_NUM_THREADS: 1
186186
OMP_PROC_BIND: false
187187
run: |
188188
cd main/
189189
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
190-
pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
190+
pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
191191
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
192-
PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS
192+
PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS
193193
mv coverage.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
194194
195195
- name: Install all backend devices
196196
if: ${{ matrix.pl_backend == 'all' }}
197-
env:
197+
env:
198198
CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum')")
199199
run: |
200200
cd main
201201
rm -rf build
202202
CMAKE_ARGS="-DPL_BACKEND=${{matrix.default_backend}} -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
203203
python -m pip install . -vv
204204
rm -rf build
205-
205+
206206
CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
207207
python -m pip install . -vv
208208
209209
- name: Run PennyLane-Lightning unit tests for lightning.qubit with all devices installed
210210
if: ${{ matrix.pl_backend == 'all' }}
211-
env:
211+
env:
212212
OMP_NUM_THREADS: 1
213213
OMP_PROC_BIND: false
214214
run: |

.github/workflows/tests_lgpumpi_cpp.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ jobs:
184184
fail_ci_if_error: true
185185
verbose: true
186186
token: ${{ secrets.CODECOV_TOKEN }}
187-
187+
188188
- name: Cleanup
189189
if: always()
190190
run: |

.github/workflows/tests_linux_cpp.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- enable_kernel_omp: OFF
5252
enable_kernel_avx_stream: ON
5353
timeout-minutes: 60
54-
name: C++ tests
54+
name: C++ Tests (${{ matrix.pl_backend }}, ENABLE_KERNEL_OMP=${{ matrix.enable_kernel_omp }}, ENABLE_KERNEL_AVX_STREAM=${{ matrix.enable_kernel_avx_stream }})
5555
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
5656

5757
steps:
@@ -113,7 +113,7 @@ jobs:
113113
matrix:
114114
pl_backend: ["lightning_qubit"]
115115
timeout-minutes: 60
116-
name: C++ tests (OpenBLAS)
116+
name: C++ Tests (${{ matrix.pl_backend }}, blas-ON)
117117
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
118118

119119
steps:
@@ -181,7 +181,7 @@ jobs:
181181
exec_model: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.exec_model) }}
182182
kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }}
183183
timeout-minutes: 60
184-
name: C++ tests (Kokkos)
184+
name: C++ Tests (${{ matrix.pl_backend }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }})
185185
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
186186

187187
steps:
@@ -275,7 +275,7 @@ jobs:
275275
exec_model: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.exec_model) }}
276276
kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }}
277277
timeout-minutes: 60
278-
name: C++ tests (multiple backends)
278+
name: C++ Tests (multiple-backends, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }})
279279
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
280280

281281
steps:

.github/workflows/tests_lkcpu_python.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
exec_model: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.exec_model) }}
5959
kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }}
6060
timeout-minutes: 60
61-
name: Python tests with Kokkos
61+
name: Build (${{ matrix.pl_backend }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }})
6262
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
6363

6464
steps:
@@ -153,7 +153,7 @@ jobs:
153153
exec_model: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.exec_model) }}
154154
kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }}
155155
timeout-minutes: 60
156-
name: Python tests with Kokkos
156+
name: Python Tests (${{ matrix.pl_backend }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }}, test-group-${{ matrix.group }})
157157
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
158158

159159
steps:

.github/workflows/tests_lkcuda_cpp.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
exec_model: ["CUDA"]
112112
kokkos_version: ["4.2.00"]
113113

114-
name: C++ tests (Kokkos)
114+
name: C++ Tests (${{ matrix.pl_backend }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }})
115115
runs-on:
116116
- ${{ matrix.os }}
117117
- self-hosted

.github/workflows/tests_lkcuda_python.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
exec_model: ["CUDA"]
113113
kokkos_version: ["4.2.00"]
114114

115-
name: Python tests with Kokkos
115+
name: Python Tests (${{ matrix.pl_backend }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }})
116116
runs-on:
117117
- ${{ matrix.os }}
118118
- self-hosted

.github/workflows/tests_lqcpu_python.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
pl_backend: ["lightning_qubit"]
5050
blas: ["OFF", "ON"]
5151
timeout-minutes: 60
52-
name: Python tests
52+
name: Build (${{ matrix.pl_backend }}, blas-${{ matrix.blas }})
5353
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
5454

5555
steps:
@@ -126,7 +126,7 @@ jobs:
126126
blas: ["OFF", "ON"]
127127
group: [1, 2, 3, 4]
128128
timeout-minutes: 60
129-
name: Python tests
129+
name: Python Tests (${{ matrix.pl_backend }}, blas-${{ matrix.blas }}, test-group-${{ matrix.group }})
130130
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
131131

132132
steps:

.github/workflows/tests_windows_cpp.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
exec_model: ${{ fromJson(needs.win-set-matrix-x86.outputs.exec_model) }}
5454
kokkos_version: ${{ fromJson(needs.win-set-matrix-x86.outputs.kokkos_version) }}
5555
timeout-minutes: 30
56-
name: Kokkos core (${{ matrix.exec_model }})
56+
name: Build Kokkos core (kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }})
5757
runs-on: ${{ matrix.os }}
5858

5959
steps:
@@ -100,12 +100,13 @@ jobs:
100100
cpptests:
101101
if: ${{ !contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }}
102102
timeout-minutes: 30
103-
name: C++ tests (Windows)
104103
runs-on: ${{ matrix.os }}
105104
strategy:
106105
matrix:
107106
os: [windows-latest]
108107
pl_backend: ["lightning_qubit"]
108+
name: C++ Tests (${{ matrix.pl_backend }}, on-${{ matrix.os }})
109+
109110
steps:
110111
- uses: actions/setup-python@v4
111112
name: Install Python
@@ -114,7 +115,7 @@ jobs:
114115

115116
- name: Checkout PennyLane-Lightning
116117
uses: actions/checkout@v3
117-
118+
118119
- name: Install dependencies
119120
run: |
120121
python -m pip install cmake build ninja scipy pybind11
@@ -154,7 +155,7 @@ jobs:
154155
name: windows-test-report-${{ github.job }}-${{ matrix.pl_backend }}
155156
path: .\Build\tests\results\
156157
if-no-files-found: error
157-
158+
158159
- name: Upload coverage results
159160
uses: actions/upload-artifact@v3
160161
with:
@@ -173,7 +174,7 @@ jobs:
173174
kokkos_version: ${{ fromJson(needs.win-set-matrix-x86.outputs.kokkos_version) }}
174175

175176
timeout-minutes: 30
176-
name: C++ tests (Windows, Kokkos)
177+
name: C++ Tests (${{matrix.pl_backend}}, on-${{ matrix.os }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }})
177178
runs-on: ${{ matrix.os }}
178179

179180
steps:

.github/workflows/tests_without_binary.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ jobs:
3434
pythontests:
3535
needs: [determine_runner]
3636
timeout-minutes: 30
37-
name: Python tests
3837
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
3938
strategy:
4039
matrix:
4140
pl_backend: ["lightning_qubit", "lightning_kokkos", "lightning_gpu"]
4241

42+
name: Python Tests without Binary (${{ matrix.pl_backend }})
43+
4344
steps:
4445
- name: Checkout PennyLane-Lightning
4546
uses: actions/checkout@v4

.github/workflows/vb_script.py

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
import argparse
15+
1516
import pennylane as qml
1617

1718
pl_version = '"' + qml.version() + '"'

doc/docker.rst doc/dev/docker.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
.. include:: ../README.rst
1+
.. include:: ../../README.rst
22
:start-after: docker-start-inclusion-marker-do-not-remove
33
:end-before: docker-end-inclusion-marker-do-not-remove

doc/installation.rst doc/dev/installation.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ Each device in the Lightning ecosystem is a separate Python package. Select the
66
.. title-card::
77
:name: Lightning Qubit
88
:description: Guidelines to installing and testing the Lightning Qubit device.
9-
:link: ./lightning_qubit/installation.html
9+
:link: ../lightning_qubit/installation.html
1010

1111
.. title-card::
1212
:name: Lightning GPU
1313
:description: Guidelines to installing and testing the Lightning GPU device
14-
:link: ./lightning_gpu/installation.html
14+
:link: ../lightning_gpu/installation.html
1515

1616
.. title-card::
1717
:name: Lightning Kokkos
1818
:description: Guidelines to installing and testing the Lightning Kokkos device
19-
:link: ./lightning_kokkos/installation.html
19+
:link: ../lightning_kokkos/installation.html
2020

2121
.. raw:: html
2222

@@ -26,6 +26,6 @@ Each device in the Lightning ecosystem is a separate Python package. Select the
2626
.. toctree::
2727
:hidden:
2828

29-
lightning_qubit/installation
30-
lightning_gpu/installation
31-
lightning_kokkos/installation
29+
../lightning_qubit/installation
30+
../lightning_gpu/installation
31+
../lightning_kokkos/installation
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
.. include:: ../README.rst
1+
.. include:: ../../README.rst
22
:start-after: support-start-inclusion-marker-do-not-remove
33
:end-before: support-end-inclusion-marker-do-not-remove

0 commit comments

Comments
 (0)