Skip to content

Commit

Permalink
quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
multiphaseCFD committed Oct 22, 2024
1 parent 4e69bb3 commit 454e4e0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pennylane_lightning/lightning_gpu/_state_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,6 @@ def _apply_lightning_controlled(self, operation):
Returns:
None
"""
if self._mpi_handler.use_mpi:
raise DeviceError("Lightning-GPU-MPI does not support Controlled GlobalPhase gates.")

state = self.state_vector

basename = operation.base.name
Expand Down Expand Up @@ -336,6 +333,14 @@ def _apply_lightning(
isinstance(operation, qml.ops.Controlled) and not self._mpi_handler.use_mpi
): # MPI backend does not have native controlled gates support
self._apply_lightning_controlled(operation)
elif (
self._mpi_handler.use_mpi
and isinstance(operation, qml.ops.Controlled)
and isinstance(operation.base, qml.GlobalPhase)
):
raise DeviceError(
"Lightning-GPU-MPI does not support Controlled GlobalPhase gates."
)
else: # apply gate as a matrix
try:
mat = qml.matrix(operation)
Expand Down

0 comments on commit 454e4e0

Please sign in to comment.