class_docstr: Tests for the expval function
class_docstr_tok: ["Tests","for","the","expval","function"]
docstr: Test that the eigvals property controls the hash property.
docstr_tok: ["Test","that","the","eigvals","property","controls","the","hash","property","."]
code: def test_eigvals(self):
      """Test that the eigvals property controls the hash property."""
      m1 = ExpectationMP(eigvals=[-0.5, 0.5], wires=qml.wires.Wires(0))
      m2 = ExpectationMP(
          eigvals=[-0.5, 0.5], wires=qml.wires.Wires(0), id="something"
      )
  
      assert m1.hash == m2.hash
  
      m3 = ExpectationMP(eigvals=[-0.5, 0.5], wires=qml.wires.Wires(1))
      assert m1.hash != m3.hash
  
      m4 = ExpectationMP(eigvals=[-1, 1], wires=qml.wires.Wires(1))
      assert m1.hash != m4.hash
      assert m3.hash != m4.hash
  
imports: import copy
  import numpy
  import pytest
  import pennylane
  from pennylane.measurements import Expectation, Shots
  from pennylane.measurements.expval import ExpectationMP
label_desc: Use image node_id 15 for calling the TestExpval obj's underlying member method code with example usage: obj.test_eigvals() without return types