diff --git a/mpitests/test_adjoint_jacobian.py b/mpitests/test_adjoint_jacobian.py index 862ad4c4ef..570f1106b8 100644 --- a/mpitests/test_adjoint_jacobian.py +++ b/mpitests/test_adjoint_jacobian.py @@ -39,9 +39,6 @@ if not ld._CPP_BINARY_AVAILABLE: pytest.skip("No binary module found. Skipping.", allow_module_level=True) -if device_name == "lightning.gpu": - pytest.skip("LGPU new API in WIP. Skipping.", allow_module_level=True) - I, X, Y, Z = ( np.eye(2), qml.PauliX.compute_matrix(), diff --git a/mpitests/test_apply.py b/mpitests/test_apply.py index 0b0abf51a0..f1f2e30158 100644 --- a/mpitests/test_apply.py +++ b/mpitests/test_apply.py @@ -384,7 +384,7 @@ def circuit(): class TestSparseHamExpval: # pylint: disable=too-few-public-methods,missing-function-docstring """Tests sparse hamiltonian expectation values.""" - @pytest.mark.parametrize("C_DTYPE", [np.complex128]) + @pytest.mark.parametrize("C_DTYPE", [np.complex128, np.complex64]) def test_sparse_hamiltonian_expectation(self, C_DTYPE): comm = MPI.COMM_WORLD commSize = comm.Get_size() @@ -429,13 +429,11 @@ def circuit(): mpi_qnode = qml.QNode(circuit, dev_mpi) expected_output_mpi = mpi_qnode() + comm.Barrier() + assert np.allclose(expected_output_mpi, expected_output_gpu) -@pytest.mark.skipif( - device_name == "lightning.gpu", - reason="LGPU new API in WIP. Skipping.", -) class TestExpval: """Tests that expectation values are properly calculated or that the proper errors are raised.""" diff --git a/mpitests/test_probs.py b/mpitests/test_probs.py index 0649d1c8c7..8edc52700c 100644 --- a/mpitests/test_probs.py +++ b/mpitests/test_probs.py @@ -20,9 +20,6 @@ # pylint: disable=missing-function-docstring,unnecessary-comprehension,too-many-arguments,wrong-import-order,unused-variable,c-extension-no-member from mpi4py import MPI -if device_name == "lightning.gpu": - pytest.skip("LGPU new API in WIP. Skipping.", allow_module_level=True) - numQubits = 8 diff --git a/pennylane_lightning/lightning_gpu/_measurements.py b/pennylane_lightning/lightning_gpu/_measurements.py index 90f4ceb287..74c7f0e3a5 100644 --- a/pennylane_lightning/lightning_gpu/_measurements.py +++ b/pennylane_lightning/lightning_gpu/_measurements.py @@ -157,14 +157,6 @@ def expval(self, measurementprocess: MeasurementProcess): if isinstance(measurementprocess.obs, qml.SparseHamiltonian): # ensuring CSR sparse representation. - # CSR_SparseHamiltonian = measurementprocess.obs.sparse_matrix( - # wire_order=list(range(self._qubit_state.num_wires)) - # ).tocsr(copy=False) - # return self._measurement_lightning.expval( - # CSR_SparseHamiltonian.indptr, - # CSR_SparseHamiltonian.indices, - # CSR_SparseHamiltonian.data, - # ) if self._use_mpi: # Identity for CSR_SparseHamiltonian to pass to processes with rank != 0 to reduce @@ -195,16 +187,6 @@ def expval(self, measurementprocess: MeasurementProcess): matrix = measurementprocess.obs.matrix() return self._measurement_lightning.expval(matrix, observable_wires) - # if ( - # isinstance(measurementprocess.obs, (qml.ops.Hamiltonian, qml.Hermitian)) - # or (measurementprocess.obs.arithmetic_depth > 0) - # or isinstance(measurementprocess.obs.name, List) - # ): - # ob_serialized = QuantumScriptSerializer( - # self._qubit_state.device_name, self.dtype == np.complex64 - # )._ob(measurementprocess.obs) - # return self._measurement_lightning.expval(ob_serialized) - if ( isinstance(measurementprocess.obs, qml.ops.Hamiltonian) or (measurementprocess.obs.arithmetic_depth > 0)