Skip to content

Commit 2716864

Browse files
dime10AmintorDuskogithub-actions[bot]
authored
Add support for BlockEncode gate to lightning devices (#599)
* Add support for BlockEncode operation A recent operation added to PennyLane, only supports application via matrix. * Add test * Add changelog * Bump version * trigger CI * Auto update version * Trigger CI --------- Co-authored-by: AmintorDusko <[email protected]> Co-authored-by: Dev version update bot <github-actions[bot]@users.noreply.github.com>
1 parent ff34173 commit 2716864

File tree

9 files changed

+14
-4
lines changed

9 files changed

+14
-4
lines changed

.github/CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
### Improvements
1111

12+
* The `BlockEncode` operation from PennyLane is now supported on all Lightning devices.
13+
[(#599)](https://github.com/PennyLaneAI/pennylane-lightning/pull/599)
14+
1215
* OpenMP acceleration can now be enabled at compile time for all `lightning.qubit` gate kernels using the "-DLQ_ENABLE_KERNEL_OMP=1" CMake argument.
1316
[(#510)](https://github.com/PennyLaneAI/pennylane-lightning/pull/510)
1417

@@ -35,7 +38,7 @@
3538

3639
This release contains contributions from (in alphabetical order):
3740

38-
Amintor Dusko, Vincent Michaud-Rioux, Lee J. O'Riordan, Shuli Shu
41+
Amintor Dusko, David Ittah, Vincent Michaud-Rioux, Lee J. O'Riordan, Shuli Shu
3942

4043
---
4144

pennylane_lightning/core/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
Version number (major.minor.patch[-label])
1717
"""
1818

19-
__version__ = "0.35.0-dev6"
19+
__version__ = "0.35.0-dev7"

pennylane_lightning/lightning_gpu/lightning_gpu.py

+1
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ def _mebibytesToBytes(mebibytes):
185185
"OrbitalRotation",
186186
"QFT",
187187
"ECR",
188+
"BlockEncode",
188189
}
189190

190191
allowed_observables = {

pennylane_lightning/lightning_gpu/lightning_gpu.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ matrix = [
8888
"QubitCarry",
8989
"QubitSum",
9090
"DiagonalQubitUnitary",
91+
"BlockEncode",
9192
]
9293

9394
[measurement_processes]
@@ -119,4 +120,4 @@ mid_circuit_measurement = false
119120

120121
# This field is currently unchecked but it is reserved for the purpose of
121122
# determining if the device supports dynamic qubit allocation/deallocation.
122-
dynamic_qubit_management = false
123+
dynamic_qubit_management = false

pennylane_lightning/lightning_kokkos/lightning_kokkos.py

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ def _kokkos_configuration():
140140
"OrbitalRotation",
141141
"QFT",
142142
"ECR",
143+
"BlockEncode",
143144
}
144145

145146
allowed_observables = {

pennylane_lightning/lightning_kokkos/lightning_kokkos.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ matrix = [
8888
"QubitCarry",
8989
"QubitSum",
9090
"DiagonalQubitUnitary",
91+
"BlockEncode",
9192
]
9293

9394
[measurement_processes]
@@ -119,4 +120,4 @@ mid_circuit_measurement = true
119120

120121
# This field is currently unchecked but it is reserved for the purpose of
121122
# determining if the device supports dynamic qubit allocation/deallocation.
122-
dynamic_qubit_management = false
123+
dynamic_qubit_management = false

pennylane_lightning/lightning_qubit/lightning_qubit.py

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
"OrbitalRotation",
155155
"QFT",
156156
"ECR",
157+
"BlockEncode",
157158
}
158159

159160
allowed_observables = {

pennylane_lightning/lightning_qubit/lightning_qubit.toml

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ matrix = [
9090
"QubitCarry",
9191
"QubitSum",
9292
"DiagonalQubitUnitary",
93+
"BlockEncode",
9394
]
9495

9596
[measurement_processes]

tests/test_gates.py

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def op(op_name):
7676
"QubitSum": [qml.QubitSum, [], {"wires": [0, 1, 2]}],
7777
"QubitCarry": [qml.QubitCarry, [], {"wires": [0, 1, 2, 3]}],
7878
"QubitUnitary": [qml.QubitUnitary, [], {"U": np.eye(16) * 1j, "wires": [0, 1, 2, 3]}],
79+
"BlockEncode": [qml.BlockEncode, [[[0.2, 0, 0.2], [-0.2, 0.2, 0]]], {"wires": [0, 1, 2]}],
7980
}
8081
return ops_list.get(op_name)
8182

0 commit comments

Comments
 (0)