Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
josephleekl committed Oct 18, 2024
1 parent 38c48b9 commit 968b86e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions pennylane_lightning/lightning_kokkos/_state_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ def _apply_lightning_controlled(self, operation):
param = operation.parameters
method(control_wires, control_values, target_wires, inv, param)
else:
raise qml.DeviceError("No gate operation supplied and controlled matrix not yet supported")
raise qml.DeviceError(
"No gate operation supplied and controlled matrix not yet supported"
)

def _apply_lightning_midmeasure(
self, operation: MidMeasureMP, mid_measurements: dict, postselect_mode: str
Expand Down Expand Up @@ -292,4 +294,4 @@ def _apply_lightning(
method(qml.matrix(operation), wires, False)
except AttributeError: # pragma: no cover
# To support older versions of PL
method(operation.matrix, wires, False)
method(operation.matrix, wires, False)
2 changes: 1 addition & 1 deletion pennylane_lightning/lightning_kokkos/lightning_kokkos.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,4 +551,4 @@ def get_c_interface():
lib_location = (Path(path) / lib_name).as_posix()
return "LightningKokkosSimulator", lib_location

raise RuntimeError("'LightningKokkosSimulator' shared library not found")
raise RuntimeError("'LightningKokkosSimulator' shared library not found")
4 changes: 2 additions & 2 deletions tests/test_gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def circuit():
qml.RX,
qml.RY,
qml.RZ,
qml.Rot
qml.Rot,
],
)
@pytest.mark.parametrize("control_value", [False, True])
Expand Down Expand Up @@ -482,6 +482,7 @@ def circuit():
circ_def = qml.QNode(circuit, dev_def)
assert np.allclose(circ(), circ_def(), tol)


@pytest.mark.skipif(
device_name not in ("lightning.qubit", "lightning.tensor"),
reason="N-controlled operations only implemented in lightning.qubit and lightning.tensor.",
Expand Down Expand Up @@ -695,4 +696,3 @@ def circuit():
circ = qml.QNode(circuit, dev)
circ_def = qml.QNode(circuit, dev_def)
assert np.allclose(circ(), circ_def(), tol)

0 comments on commit 968b86e

Please sign in to comment.