class_docstr: Unit tests for the hadamard_grad function
class_docstr_tok: ["Unit","tests","for","the","hadamard_grad","function"]
docstr: Tests correct output shape and evaluation for a tape
  with a single expval output
code: def test_single_expectation_value(self, tol):
      """Tests correct output shape and evaluation for a tape
      with a single expval output"""
      dev = qml.device("default.qubit", wires=3)
      x = 0.543
      y = -0.654
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.RX(x, wires=[0])
          qml.RY(y, wires=[1])
          qml.CNOT(wires=[0, 1])
          qml.expval(qml.PauliZ(0) @ qml.PauliX(1))
  
      tape = qml.tape.QuantumScript.from_queue(q)
  
      res_hadamard, tapes = grad_fn(tape, dev)
  
      assert len(tapes) == 2
  
      assert len(res_hadamard) == 2
      assert not isinstance(res_hadamard[0], tuple)
      assert not isinstance(res_hadamard[1], tuple)
  
      expected = np.array(
          [-np.sin(y) * np.sin(x), np.cos(y) * np.cos(x)]
      )
      assert np.allclose(res_hadamard[0], expected[0], atol=tol, rtol=0)
      assert np.allclose(res_hadamard[1], expected[1], atol=tol, rtol=0)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 12 for calling the TestHadamardGrad obj's underlying member method code with example usage: obj.test_single_expectation_value(tol) without return types