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