class_docstr: Test the Hermitian observable
class_docstr_tok: ["Test","the","Hermitian","observable"]
docstr: Test that the hermitian matrix method produces the correct output.
docstr_tok: ["Test","that","the","hermitian","matrix","method","produces","the","correct","output","."]
code: def test_hermitian_matrix(self, tol):
      """Test that the hermitian matrix method produces the correct output."""
      ham = np.array([[1, 1], [1, -1]]) / np.sqrt(2)
      out = qml.Hermitian(ham, wires=0).matrix()
  
      # verify output type
      assert isinstance(out, np.ndarray)
  
      # verify equivalent to input state
      assert np.allclose(out, ham, atol=tol, rtol=0)
  
imports: import functools
  import pickle
  import pytest
  import numpy
  from gate_data import I, X, Y, Z, H
  import pennylane
  from pennylane.ops.qubit.observables import BasisStateProjector, StateVectorProjector
label_desc: Use image node_id 13 for calling the TestHermitian obj's underlying member method code with example usage: obj.test_hermitian_matrix(tol) without return types