class_docstr: Test tensor sample values.
class_docstr_tok: ["Test","tensor","sample","values","."]
docstr: Test that a tensor product involving PauliX and PauliY works correctly
code: def test_paulix_pauliy(self, device, tol, skip_if):
      """Test that a tensor product involving PauliX and PauliY works correctly"""
      n_wires = 3
      dev = device(n_wires)
  
      if dev.shots is None:
          pytest.skip(
              "Device is in analytic mode, cannot test sampling."
          )
  
      skip_if(dev, {"supports_tensor_observables": False})
  
      theta = 0.432
      phi = 0.123
      varphi = -0.543
  
      @qml.qnode(dev)
      def circuit():
          qml.RX(theta, wires=[0])
          qml.RX(phi, wires=[1])
          qml.RX(varphi, wires=[2])
          qml.CNOT(wires=[0, 1])
          qml.CNOT(wires=[1, 2])
          return qml.sample(
              qml.PauliX(wires=[0]) @ qml.PauliY(wires=[2])
          )
  
      res = circuit()
  
      # res should only contain 1 and -1
      assert np.allclose(res**2, 1, atol=tol(False))
  
      mean = np.mean(res)
      expected = np.sin(theta) * np.sin(phi) * np.sin(varphi)
      assert np.allclose(mean, expected, atol=tol(False))
  
      var = np.var(res)
      expected = (
          8 * np.sin(theta) ** 2 * np.cos(2 * varphi) * np.sin(phi) ** 2
          - np.cos(2 * (theta - phi))
          - np.cos(2 * (theta + phi))
          + 2 * np.cos(2 * theta)
          + 2 * np.cos(2 * phi)
          + 14
      ) / 16
      assert np.allclose(var, expected, atol=tol(False))
  
imports: import pytest
  from flaky import flaky
  from scipy.sparse import csr_matrix
  import pennylane
  from pennylane import numpy
  from pennylane.measurements import ClassicalShadowMP, MeasurementTransform, SampleMeasurement, SampleMP, StateMeasurement, StateMP
label_desc: Use image node_id 1 for calling the TestTensorSample obj's underlying member method code with example usage: obj.test_paulix_pauliy(device, tol, skip_if) and returns: qml