From 219262b0884a08a17dac61255b9f63b42a878fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Alfredo=20Nu=C3=B1ez=20Meneses?= Date: Wed, 11 Sep 2024 10:19:11 -0400 Subject: [PATCH] delete usuless variables --- pennylane_lightning/lightning_gpu/_state_vector.py | 2 +- pennylane_lightning/lightning_gpu/lightning_gpu.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/pennylane_lightning/lightning_gpu/_state_vector.py b/pennylane_lightning/lightning_gpu/_state_vector.py index 126f0d973d..17c61e60f6 100644 --- a/pennylane_lightning/lightning_gpu/_state_vector.py +++ b/pennylane_lightning/lightning_gpu/_state_vector.py @@ -232,7 +232,7 @@ def _apply_state_vector(self, state, device_wires, use_async=False): basis_states = np.array(list(product([0, 1], repeat=len(device_wires)))) # get basis states to alter on full set of qubits - unravelled_indices = np.zeros((2 ** len(device_wires), self.num_wires), dtype=int) + unravelled_indices = np.zeros((1 << len(device_wires), self.num_wires), dtype=int) unravelled_indices[:, device_wires] = basis_states # get indices for which the state is changed to input state vector elements diff --git a/pennylane_lightning/lightning_gpu/lightning_gpu.py b/pennylane_lightning/lightning_gpu/lightning_gpu.py index ad20da9e78..e330568f48 100644 --- a/pennylane_lightning/lightning_gpu/lightning_gpu.py +++ b/pennylane_lightning/lightning_gpu/lightning_gpu.py @@ -298,13 +298,10 @@ def __init__( # pylint: disable=too-many-arguments self._sync = sync # Creating the state vector - self._mpi_handler = LightningGPU_MPIHandler( mpi, mpi_buf_size, self._dp, self.num_wires, c_dtype ) - self._num_local_wires = self._mpi_handler.num_local_wires - self._statevector = self.LightningStateVector( self.num_wires, dtype=c_dtype, mpi_handler=self._mpi_handler, sync=self._sync )