class_docstr: Test the Hermitian observable
class_docstr_tok: ["Test","the","Hermitian","observable"]
docstr: Tests that the eigendecomposition property of the Hermitian class returns the correct results
  for a single wire.
docstr_tok: ["Tests","that","the","eigendecomposition","property","of","the","Hermitian","class","returns","the","correct","results","for","a","single","wire","."]
code: def test_hermitian_eigegendecomposition_single_wire(
      self, observable, eigvals, eigvecs, tol
  ):
      """Tests that the eigendecomposition property of the Hermitian class returns the correct results
      for a single wire."""
  
      eigendecomp = qml.Hermitian(
          observable, wires=0
      ).eigendecomposition
      assert np.allclose(
          eigendecomp["eigval"], eigvals, atol=tol, rtol=0
      )
      assert np.allclose(
          eigendecomp["eigvec"], eigvecs, atol=tol, rtol=0
      )
  
      key = tuple(observable.flatten().tolist())
      assert np.allclose(
          qml.Hermitian._eigs[key]["eigval"], eigvals, atol=tol, rtol=0
      )
      assert np.allclose(
          qml.Hermitian._eigs[key]["eigvec"], eigvecs, 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 4 for calling the TestHermitian obj's underlying member method code with example usage: obj.test_hermitian_eigegendecomposition_single_wire(observable, eigvals, eigvecs, tol) without return types