class_docstr: Test expectation values
class_docstr_tok: ["Test","expectation","values"]
docstr: Test that PauliX expectation value is correct
code: def test_paulix_expectation(self, device, tol):
      """Test that PauliX expectation value is correct"""
      n_wires = 2
      dev = device(n_wires)
  
      theta = 0.432
      phi = 0.123
  
      @qml.qnode(dev)
      def circuit():
          qml.RY(theta, wires=[0])
          qml.RY(phi, wires=[1])
          qml.CNOT(wires=[0, 1])
          return qml.expval(qml.PauliX(wires=0)), qml.expval(
              qml.PauliX(wires=1)
          )
  
      res = circuit()
      expected = np.array([np.sin(theta) * np.sin(phi), np.sin(phi)])
      assert np.allclose(res, expected, atol=tol(dev.shots))
  
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 3 for calling the TestExpval obj's underlying member method code with example usage: obj.test_paulix_expectation(device, tol) and returns: qml,  qml