Skip to content

Commit

Permalink
Add support for BlockEncode gate to lightning devices (#599)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Jan 24, 2024
1 parent ff34173 commit 2716864
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

### Improvements

* The `BlockEncode` operation from PennyLane is now supported on all Lightning devices.
[(#599)](https://github.com/PennyLaneAI/pennylane-lightning/pull/599)

* OpenMP acceleration can now be enabled at compile time for all `lightning.qubit` gate kernels using the "-DLQ_ENABLE_KERNEL_OMP=1" CMake argument.
[(#510)](https://github.com/PennyLaneAI/pennylane-lightning/pull/510)

Expand All @@ -35,7 +38,7 @@

This release contains contributions from (in alphabetical order):

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

---

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.35.0-dev6"
__version__ = "0.35.0-dev7"
1 change: 1 addition & 0 deletions pennylane_lightning/lightning_gpu/lightning_gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def _mebibytesToBytes(mebibytes):
"OrbitalRotation",
"QFT",
"ECR",
"BlockEncode",
}

allowed_observables = {
Expand Down
3 changes: 2 additions & 1 deletion pennylane_lightning/lightning_gpu/lightning_gpu.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ matrix = [
"QubitCarry",
"QubitSum",
"DiagonalQubitUnitary",
"BlockEncode",
]

[measurement_processes]
Expand Down Expand Up @@ -119,4 +120,4 @@ mid_circuit_measurement = false

# This field is currently unchecked but it is reserved for the purpose of
# determining if the device supports dynamic qubit allocation/deallocation.
dynamic_qubit_management = false
dynamic_qubit_management = false
1 change: 1 addition & 0 deletions pennylane_lightning/lightning_kokkos/lightning_kokkos.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def _kokkos_configuration():
"OrbitalRotation",
"QFT",
"ECR",
"BlockEncode",
}

allowed_observables = {
Expand Down
3 changes: 2 additions & 1 deletion pennylane_lightning/lightning_kokkos/lightning_kokkos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ matrix = [
"QubitCarry",
"QubitSum",
"DiagonalQubitUnitary",
"BlockEncode",
]

[measurement_processes]
Expand Down Expand Up @@ -119,4 +120,4 @@ mid_circuit_measurement = true

# This field is currently unchecked but it is reserved for the purpose of
# determining if the device supports dynamic qubit allocation/deallocation.
dynamic_qubit_management = false
dynamic_qubit_management = false
1 change: 1 addition & 0 deletions pennylane_lightning/lightning_qubit/lightning_qubit.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
"OrbitalRotation",
"QFT",
"ECR",
"BlockEncode",
}

allowed_observables = {
Expand Down
1 change: 1 addition & 0 deletions pennylane_lightning/lightning_qubit/lightning_qubit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ matrix = [
"QubitCarry",
"QubitSum",
"DiagonalQubitUnitary",
"BlockEncode",
]

[measurement_processes]
Expand Down
1 change: 1 addition & 0 deletions tests/test_gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def op(op_name):
"QubitSum": [qml.QubitSum, [], {"wires": [0, 1, 2]}],
"QubitCarry": [qml.QubitCarry, [], {"wires": [0, 1, 2, 3]}],
"QubitUnitary": [qml.QubitUnitary, [], {"U": np.eye(16) * 1j, "wires": [0, 1, 2, 3]}],
"BlockEncode": [qml.BlockEncode, [[[0.2, 0, 0.2], [-0.2, 0.2, 0]]], {"wires": [0, 1, 2]}],
}
return ops_list.get(op_name)

Expand Down

0 comments on commit 2716864

Please sign in to comment.