class_docstr: Tests for samples of tensor observables
class_docstr_tok: ["Tests","for","samples","of","tensor","observables"]
docstr: Test that a tensor product involving PauliZ and hadamard works correctly
docstr_tok: ["Test","that","a","tensor","product","involving","PauliZ","and","hadamard","works","correctly"]
code: def test_pauliz_tensor_hadamard(
      self, theta, phi, varphi, tol_stochastic
  ):
      """Test that a tensor product involving PauliZ and hadamard works correctly"""
      dev = qml.device("default.qubit", wires=3, shots=int(1e6))
  
      @qml.qnode(dev, diff_method="parameter-shift")
      def circuit(a, b, c):
          ansatz(a, b, c)
          return sample(qml.PauliZ(0) @ qml.Hadamard(1) @ qml.PauliY(2))
  
      s1 = circuit(theta, phi, varphi)
  
      # s1 should only contain 1 and -1
      assert np.allclose(s1**2, 1, atol=tol_stochastic, rtol=0)
  
imports: import functools
  import pytest
  import numpy
  import pennylane
  from pennylane import expval, var, sample
label_desc: Use image node_id 3 for calling the TestTensorSample obj's underlying member method code with example usage: obj.test_pauliz_tensor_hadamard(theta, phi, varphi, tol_stochastic) and returns: sample