diff --git a/pennylane_ionq/device.py b/pennylane_ionq/device.py index 1aeea82..c747775 100644 --- a/pennylane_ionq/device.py +++ b/pennylane_ionq/device.py @@ -31,10 +31,6 @@ from pennylane.ops import Identity, PauliX, PauliY, PauliZ from pennylane.ops.op_math.prod import Prod -from pennylane.measurements import ( - Shots, -) -from pennylane.resource import Resources from pennylane.ops.op_math.linear_combination import LinearCombination from .api_client import Job, JobExecutionError @@ -253,22 +249,13 @@ def batch_execute(self, circuits): if self.tracker.active: for circuit in circuits: - shots_from_dev = self._shots if not self.shot_vector else self._raw_shot_sequence tape_resources = circuit.specs["resources"] - resources = Resources( # temporary until shots get updated on tape ! - tape_resources.num_wires, - tape_resources.num_gates, - tape_resources.gate_types, - tape_resources.gate_sizes, - tape_resources.depth, - Shots(shots_from_dev), - ) self.tracker.update( executions=1, shots=self._shots, results=results, - resources=resources, + resources=tape_resources, ) self.tracker.update(batches=1, batch_len=len(circuits)) diff --git a/tests/test_device.py b/tests/test_device.py index 55add25..83a82bf 100755 --- a/tests/test_device.py +++ b/tests/test_device.py @@ -265,12 +265,11 @@ def test_recording_when_pennylane_tracker_active(self, requires_api): assert dev.tracker.history["batches"] == [1] assert dev.tracker.history["batch_len"] == [2] assert len(dev.tracker.history["resources"]) == 2 - assert dev.tracker.history["resources"][0].num_wires == 1 + assert dev.tracker.history["resources"][0].num_allocs == 1 assert dev.tracker.history["resources"][0].num_gates == 1 assert dev.tracker.history["resources"][0].depth == 1 assert dev.tracker.history["resources"][0].gate_types == {"GPI": 1} assert dev.tracker.history["resources"][0].gate_sizes == {1: 1} - assert dev.tracker.history["resources"][0].shots.total_shots == 1024 assert len(dev.tracker.history["results"]) == 2 def test_not_recording_when_pennylane_tracker_not_active(self, requires_api):