class_docstr: Tests for samples of tensor observables
class_docstr_tok: ["Tests","for","samples","of","tensor","observables"]
docstr: Test that a tensor product involving qml.Hermitian works correctly
docstr_tok: ["Test","that","a","tensor","product","involving","qml.Hermitian","works","correctly"]
code: def test_tensor_hermitian(self, theta, phi, varphi, tol_stochastic):
      """Test that a tensor product involving qml.Hermitian works correctly"""
      dev = qml.device("default.qubit", wires=3, shots=int(1e6))
  
      A = np.array(
          [
              [-6, 2 + 1j, -3, -5 + 2j],
              [2 - 1j, 0, 2 - 1j, -5 + 4j],
              [-3, 2 + 1j, 0, -4 + 3j],
              [-5 - 2j, -5 - 4j, -4 - 3j, -6],
          ]
      )
  
      @qml.qnode(dev, diff_method=None)
      def circuit(a, b, c):
          ansatz(a, b, c)
          return sample(qml.PauliZ(0) @ qml.Hermitian(A, [1, 2]))
  
      s1 = circuit(theta, phi, varphi)
  
      # s1 should only contain the eigenvalues of
      # the hermitian matrix tensor product Z
      eigvals = np.linalg.eigvalsh(np.kron(Z, A))
      assert set(np.round(s1, 8)).issubset(set(np.round(eigvals, 8)))
  
imports: import functools
  import pytest
  import numpy
  import pennylane
  from pennylane import expval, var, sample
label_desc: Use image node_id 4 for calling the TestTensorSample obj's underlying member method code with example usage: obj.test_tensor_hermitian(theta, phi, varphi, tol_stochastic) and returns: sample