class_docstr: Test the methods and attributes of the Resource class
docstr: Test that the equality dunder method is correct for Resources.
docstr_tok: ["Test","that","the","equality","dunder","method","is","correct","for","Resources","."]
code: def test_eq(self):
      """Test that the equality dunder method is correct for Resources."""
      r1 = Resources(
          4, 2, {"Hadamard": 1, "CNOT": 1}, {1: 1, 2: 1}, 2, Shots(100)
      )
      r2 = Resources(
          4, 2, {"Hadamard": 1, "CNOT": 1}, {1: 1, 2: 1}, 2, Shots(100)
      )
      r3 = Resources(
          4, 2, {"CNOT": 1, "Hadamard": 1}, {2: 1, 1: 1}, 2, Shots(100)
      )  # all equal
  
      r4 = Resources(
          1, 2, {"Hadamard": 1, "CNOT": 1}, {1: 1, 2: 1}, 2, Shots(100)
      )  # diff wires
      r5 = Resources(
          4, 1, {"Hadamard": 1, "CNOT": 1}, {1: 1, 2: 1}, 2, Shots(100)
      )  # diff num_gates
      r6 = Resources(
          4, 2, {"CNOT": 1}, {1: 1, 2: 1}, 2, Shots(100)
      )  # diff gate_types
      r7 = Resources(
          4, 2, {"Hadamard": 1, "CNOT": 1}, {1: 3, 2: 2}, 2, Shots(100)
      )  # diff gate_sizes
      r8 = Resources(
          4, 2, {"Hadamard": 1, "CNOT": 1}, {1: 1, 2: 1}, 1, Shots(100)
      )  # diff depth
      r9 = Resources(
          4,
          2,
          {"Hadamard": 1, "CNOT": 1},
          {1: 1, 2: 1},
          2,
          Shots((10, 10)),
      )  # diff shots
  
      assert r1.__eq__(r1)
      assert r1.__eq__(r2)
      assert r1.__eq__(r3)
  
      assert not r1.__eq__(r4)
      assert not r1.__eq__(r5)
      assert not r1.__eq__(r6)
      assert not r1.__eq__(r7)
      assert not r1.__eq__(r8)
      assert not r1.__eq__(r9)
  
imports: from dataclasses import FrozenInstanceError
  from collections import defaultdict
  import pytest
  import pennylane
  from pennylane.operation import Operation
  from pennylane.tape import QuantumScript
  from pennylane.resource.resource import Resources, ResourcesOperation, _count_resources
  from pennylane.measurements import Shots
label_desc: Use image node_id 5 for calling the TestResources obj's underlying member method code with example usage: obj.test_eq() without return types