Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions pennylane_ionq/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down
3 changes: 1 addition & 2 deletions tests/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading