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 multiple wires.
docstr_tok: ["Tests","that","the","eigendecomposition","property","of","the","Hermitian","class","returns","the","correct","results","for","multiple","wires","."]
code: def test_hermitian_eigendecomposition_multiple_wires(
      self, observable, tol
  ):
      """Tests that the eigendecomposition property of the Hermitian class returns the correct results
      for multiple wires."""
  
      num_wires = int(np.log2(len(observable)))
      eigendecomp = qml.Hermitian(
          observable, wires=list(range(num_wires))
      ).eigendecomposition
  
      eigvals, eigvecs = np.linalg.eigh(observable)
  
      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
      )
      assert len(qml.Hermitian._eigs) == 1
  
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 5 for calling the TestHermitian obj's underlying member method code with example usage: obj.test_hermitian_eigendecomposition_multiple_wires(observable, tol) without return types