class_docstr: Testing the tracking capabilities of DefaultQubit.
class_docstr_tok: ["Testing","the","tracking","capabilities","of","DefaultQubit","."]
docstr: Test that resources are tracked for the new default qubit device.
docstr_tok: ["Test","that","resources","are","tracked","for","the","new","default","qubit","device","."]
code: def test_tracking_resources(self):
      """Test that resources are tracked for the new default qubit device."""
      qs = qml.tape.QuantumScript(
          [
              qml.Hadamard(0),
              qml.Hadamard(1),
              qml.CNOT(wires=[0, 2]),
              qml.RZ(1.23, 1),
              qml.CNOT(wires=[1, 2]),
              qml.Hadamard(0),
          ],
          [qml.expval(qml.PauliZ(1)), qml.expval(qml.PauliY(2))],
      )
  
      expected_resources = Resources(
          num_wires=3,
          num_gates=6,
          gate_types={"Hadamard": 3, "CNOT": 2, "RZ": 1},
          gate_sizes={1: 4, 2: 2},
          depth=3,
      )
  
      dev = qml.device("default.qubit")
      with qml.Tracker(dev) as tracker:
          dev.execute(qs)
  
      assert len(tracker.history["resources"]) == 1
      assert tracker.history["resources"][0] == expected_resources
  
file_path: pennylane/tests/devices/test_default_qubit_tracking.py
imports: import pytest
  import numpy
  import pennylane
  from pennylane.resource import Resources
  from pennylane.devices import ExecutionConfig
label_desc: Use image node_id 5 for calling the TestTracking obj's underlying member method code with example usage: obj.test_tracking_resources() without return types