Skip to content

[Fix] Update resource tracker with new names - #192

Open
antalszava wants to merge 1 commit into
PennyLaneAI:masterfrom
antalszava:fix_specs_resources_bug
Open

[Fix] Update resource tracker with new names#192
antalszava wants to merge 1 commit into
PennyLaneAI:masterfrom
antalszava:fix_specs_resources_bug

Conversation

@antalszava

@antalszava antalszava commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Fixes the following local test failure:

def test_recording_when_pennylane_tracker_active(self, requires_api):
          """Test recording device execution history via pennnylane tracker class."""
          dev = SimulatorDevice(wires=(0,), gateset="native", shots=1024)
          dev.tracker = qp.Tracker()
          dev.tracker.active = True
          dev.tracker.reset()
          with qp.tape.QuantumTape(shots=1024) as tape1:
              GPI(0, wires=[0])
              qp.probs(wires=[0])
          dev.batch_execute([tape1, tape1])
          assert dev.tracker.history["executions"] == [1, 1]
          assert dev.tracker.history["shots"] == [1024, 1024]
          assert dev.tracker.history["batches"] == [1]
          assert dev.tracker.history["batch_len"] == [2]
          assert len(dev.tracker.history["resources"]) == 2
          resources = dev.tracker.history["resources"][0]
          assert resources.num_allocs == 1
  >       assert resources.total_quantum_operations == 1
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  E       AttributeError: 'SpecsResources' object has no attribute 'total_quantum_operations'

pennylane==0.45.1 and GH master branch of PennyLane-IonQ.

@antalszava antalszava changed the title fix: update resource tracker with new names [Fix] Update resource tracker with new names Jul 30, 2026
@antalszava
antalszava marked this pull request as ready for review July 30, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant